2012-06-14 09:06:06 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class cStairs //tolua_export
|
|
|
|
{ //tolua_export
|
|
|
|
public:
|
2012-10-20 16:16:55 -04:00
|
|
|
static NIBBLETYPE RotationToMetaData( float a_Rotation, char a_BlockFace) //tolua_export
|
2012-06-14 09:06:06 -04:00
|
|
|
{ //tolua_export
|
|
|
|
a_Rotation += 90 + 45; // So its not aligned with axis
|
2012-10-20 16:16:55 -04:00
|
|
|
NIBBLETYPE result = 0x0;
|
|
|
|
if (a_BlockFace == BLOCK_FACE_BOTTOM)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
|
|
|
result = 0x4;
|
|
|
|
}
|
|
|
|
|
2012-10-20 16:16:55 -04:00
|
|
|
if (a_Rotation > 360.f)
|
|
|
|
{
|
|
|
|
a_Rotation -= 360.f;
|
|
|
|
}
|
|
|
|
if ((a_Rotation >= 0.f) && (a_Rotation < 90.f))
|
|
|
|
{
|
2012-06-14 09:06:06 -04:00
|
|
|
return result;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
|
|
|
else if ((a_Rotation >= 180) && (a_Rotation < 270))
|
|
|
|
{
|
2012-06-14 09:06:06 -04:00
|
|
|
result += 0x1;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
|
|
|
else if ((a_Rotation >= 90) && (a_Rotation < 180))
|
|
|
|
{
|
2012-06-14 09:06:06 -04:00
|
|
|
result += 0x2;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
2012-06-14 09:06:06 -04:00
|
|
|
else
|
2012-10-20 16:16:55 -04:00
|
|
|
{
|
2012-06-14 09:06:06 -04:00
|
|
|
result += 0x3;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
return result;
|
|
|
|
} //tolua_export
|
|
|
|
}; //tolua_export
|