]> git.localhorst.tv Git - blank.git/blobdiff - src/block.hpp
fix error in border block calculation
[blank.git] / src / block.hpp
index 23c3979feba4ecd36d9867512901b81229a10fef..3ccd74f71937f523473536910d1a28d4cfaf964b 100644 (file)
@@ -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,6 +61,7 @@ struct BlockType {
 
        bool visible;
 
+       // FIXME: fill faces don't respect block orientation
        struct Faces {
                bool up;
                bool down;