summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-03-02 16:05:39 +0100
committermadmaxoft <github@xoft.cz>2014-03-02 16:14:00 +0100
commit274d2bcb17791c292a2095af649b1a4c51246d23 (patch)
tree08346c777ea4f4459b114c88a7814690f2d21366
parentMerge pull request #738 from xdot/master (diff)
downloadcuberite-274d2bcb17791c292a2095af649b1a4c51246d23.tar
cuberite-274d2bcb17791c292a2095af649b1a4c51246d23.tar.gz
cuberite-274d2bcb17791c292a2095af649b1a4c51246d23.tar.bz2
cuberite-274d2bcb17791c292a2095af649b1a4c51246d23.tar.lz
cuberite-274d2bcb17791c292a2095af649b1a4c51246d23.tar.xz
cuberite-274d2bcb17791c292a2095af649b1a4c51246d23.tar.zst
cuberite-274d2bcb17791c292a2095af649b1a4c51246d23.zip
-rw-r--r--src/Defines.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/Defines.h b/src/Defines.h
index 6d3d28c80..018ecb1d3 100644
--- a/src/Defines.h
+++ b/src/Defines.h
@@ -226,6 +226,56 @@ inline const char * ClickActionToString(eClickAction a_ClickAction)
+/** Returns a blockface mirrored around the Y axis (doesn't change up/down). */
+inline eBlockFace MirrorBlockFaceY(eBlockFace a_BlockFace)
+{
+ switch (a_BlockFace)
+ {
+ case BLOCK_FACE_XM: return BLOCK_FACE_XP;
+ case BLOCK_FACE_XP: return BLOCK_FACE_XM;
+ case BLOCK_FACE_ZM: return BLOCK_FACE_ZP;
+ case BLOCK_FACE_ZP: return BLOCK_FACE_ZM;
+ }
+ return a_BlockFace;
+}
+
+
+
+
+
+/** Returns a blockface rotated around the Y axis counter-clockwise. */
+inline eBlockFace RotateBlockFaceCCW(eBlockFace a_BlockFace)
+{
+ switch (a_BlockFace)
+ {
+ case BLOCK_FACE_XM: return BLOCK_FACE_ZP;
+ case BLOCK_FACE_XP: return BLOCK_FACE_ZM;
+ case BLOCK_FACE_ZM: return BLOCK_FACE_XM;
+ case BLOCK_FACE_ZP: return BLOCK_FACE_XP;
+ }
+ return a_BlockFace;
+}
+
+
+
+
+
+inline eBlockFace RotateBlockFaceCW(eBlockFace a_BlockFace)
+{
+ switch (a_BlockFace)
+ {
+ case BLOCK_FACE_XM: return BLOCK_FACE_ZM;
+ case BLOCK_FACE_XP: return BLOCK_FACE_ZP;
+ case BLOCK_FACE_ZM: return BLOCK_FACE_XP;
+ case BLOCK_FACE_ZP: return BLOCK_FACE_XM;
+ }
+ return a_BlockFace;
+}
+
+
+
+
+
inline bool IsValidBlock(int a_BlockType)
{
if (