mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-20 23:13:33 +00:00
the whole game
This commit is contained in:
36
src/client/PixelCalc.h
Executable file
36
src/client/PixelCalc.h
Executable file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// PixelCalc.h
|
||||
// minecraftpe
|
||||
//
|
||||
// Created by rhino on 10/24/11.
|
||||
// Copyright (c) 2011 Mojang AB. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef minecraftpe_PixelCalc_h
|
||||
#define minecraftpe_PixelCalc_h
|
||||
|
||||
class PixelCalc
|
||||
{
|
||||
public:
|
||||
PixelCalc(float pixelsPerMillimeter = 1) {
|
||||
setPixelsPerMillimeter(pixelsPerMillimeter);
|
||||
}
|
||||
|
||||
float millimetersToPixels(float mm) const {
|
||||
return mm * _pixelsPerMillimeter;
|
||||
}
|
||||
float pixelsToMillimeters(float pp) const {
|
||||
return pp * _millimetersPerPixel;
|
||||
}
|
||||
|
||||
void setPixelsPerMillimeter(float pixelsPerMillimeter) {
|
||||
_pixelsPerMillimeter = pixelsPerMillimeter;
|
||||
_millimetersPerPixel = 1.0f / _pixelsPerMillimeter;
|
||||
}
|
||||
|
||||
private:
|
||||
float _pixelsPerMillimeter;
|
||||
float _millimetersPerPixel;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user