Files
cuberite-2a/source/Sign.h
T

45 lines
567 B
C++
Raw Normal View History

2013-03-09 14:35:43 +00:00
#pragma once
2013-03-09 14:35:43 +00:00
// tolua_begin
class cSign
{
public:
2013-03-09 14:35:43 +00:00
static char RotationToMetaData(double a_Rotation)
{
a_Rotation += 180 + (180 / 16); // So it's not aligned with axis
if (a_Rotation > 360)
{
a_Rotation -= 360;
}
2013-03-09 14:35:43 +00:00
a_Rotation = (a_Rotation / 360) * 16;
return ((char)a_Rotation) % 16;
2013-03-09 14:35:43 +00:00
}
static char DirectionToMetaData(char a_Direction)
{
switch (a_Direction)
{
2013-03-09 14:35:43 +00:00
case 0x2: return 0x2;
case 0x3: return 0x3;
case 0x4: return 0x4;
case 0x5: return 0x5;
default:
break;
};
return 0x2;
}
2013-03-09 14:35:43 +00:00
} ;
// tolua_end