diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-03-09 19:02:30 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-03-09 19:02:30 +0100 |
commit | b5e33c5424c0b148a7076bb0f3019cfb0ef9c824 (patch) | |
tree | dabb3041abd9b8513570111310903992254d8063 /src/Blocks/BlockStairs.h | |
parent | Fix IsThread destructor (diff) | |
parent | Fixed #778 - stack overflow.com (diff) | |
download | cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.gz cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.bz2 cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.lz cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.xz cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.zst cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockStairs.h | 68 |
1 files changed, 3 insertions, 65 deletions
diff --git a/src/Blocks/BlockStairs.h b/src/Blocks/BlockStairs.h index 93035b3b1..ea8405597 100644 --- a/src/Blocks/BlockStairs.h +++ b/src/Blocks/BlockStairs.h @@ -2,17 +2,17 @@ #pragma once #include "BlockHandler.h" - +#include "MetaRotater.h" class cBlockStairsHandler : - public cBlockHandler + public cMetaRotater<cBlockHandler, 0x03, 0x03, 0x00, 0x02, 0x01, true> { public: cBlockStairsHandler(BLOCKTYPE a_BlockType) : - cBlockHandler(a_BlockType) + cMetaRotater<cBlockHandler, 0x03, 0x03, 0x00, 0x02, 0x01, true>(a_BlockType) { } @@ -104,54 +104,6 @@ public: } - virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override - { - // Bits 3 and 4 stay, the rest is swapped around according to a table: - NIBBLETYPE TopBits = (a_Meta & 0x0c); - switch (a_Meta & 0x03) - { - case 0x00: return TopBits | 0x03; // East -> North - case 0x01: return TopBits | 0x02; // West -> South - case 0x02: return TopBits | 0x00; // South -> East - case 0x03: return TopBits | 0x01; // North -> West - } - // Not reachable, but to avoid a compiler warning: - return 0; - } - - - virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override - { - // Bits 3 and 4 stay, the rest is swapped around according to a table: - NIBBLETYPE TopBits = (a_Meta & 0x0c); - switch (a_Meta & 0x03) - { - case 0x00: return TopBits | 0x02; // East -> South - case 0x01: return TopBits | 0x03; // West -> North - case 0x02: return TopBits | 0x01; // South -> West - case 0x03: return TopBits | 0x00; // North -> East - } - // Not reachable, but to avoid a compiler warning: - return 0; - } - - - virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override - { - // Bits 3 and 4 stay, the rest is swapped around according to a table: - NIBBLETYPE TopBits = (a_Meta & 0x0c); - switch (a_Meta & 0x03) - { - case 0x00: return TopBits | 0x00; // East -> East - case 0x01: return TopBits | 0x01; // West -> West - case 0x02: return TopBits | 0x03; // South -> North - case 0x03: return TopBits | 0x02; // North -> South - } - // Not reachable, but to avoid a compiler warning: - return 0; - } - - virtual NIBBLETYPE MetaMirrorXZ(NIBBLETYPE a_Meta) override { // Toggle bit 3: @@ -159,20 +111,6 @@ public: } - virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override - { - // Bits 3 and 4 stay, the rest is swapped around according to a table: - NIBBLETYPE TopBits = (a_Meta & 0x0c); - switch (a_Meta & 0x03) - { - case 0x00: return TopBits | 0x01; // East -> West - case 0x01: return TopBits | 0x00; // West -> East - case 0x02: return TopBits | 0x02; // South -> South - case 0x03: return TopBits | 0x03; // North -> North - } - // Not reachable, but to avoid a compiler warning: - return 0; - } } ; |