X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fblock.hpp;h=3ccd74f71937f523473536910d1a28d4cfaf964b;hb=1b022dd17364c9e3344afd86572f2ead14973cde;hp=3777e6d77b6169d345ca73592d4f7b54182c765c;hpb=6933bedd9a46d69d9ad3cbdee4f17cd78103e336;p=blank.git diff --git a/src/block.hpp b/src/block.hpp index 3777e6d..3ccd74f 100644 --- a/src/block.hpp +++ b/src/block.hpp @@ -42,6 +42,11 @@ struct Block { const glm::mat4 &Transform() const; + Face GetFace() const { return Face(orient / 4); } + void SetFace(Face face) { orient = face * TURN_COUNT + GetTurn(); } + Turn GetTurn() const { return Turn(orient % 4); } + void SetTurn(Turn turn) { orient = GetFace() * TURN_COUNT + turn; } + }; @@ -56,11 +61,12 @@ struct BlockType { bool visible; + // FIXME: fill faces don't respect block orientation struct Faces { + bool up; + bool down; bool right; bool left; - bool top; - bool bottom; bool front; bool back; } fill;