]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Block.hpp
tvec[234]<int> -> ivec[234]
[blank.git] / src / world / Block.hpp
index 74af3e4ab4bbf025e342674e6bc7eff986bf2d7a..274e3d3c3120369eb8915c752db357c8b8b80b23 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef BLANK_WORLD_BLOCK_HPP_
 #define BLANK_WORLD_BLOCK_HPP_
 
+#include <iosfwd>
 #include <glm/glm.hpp>
 
 
@@ -65,7 +66,7 @@ struct Block {
                }
        }
 
-       static glm::tvec3<int> FaceNormal(Face face) noexcept {
+       static glm::ivec3 FaceNormal(Face face) noexcept {
                return face2normal[face];
        }
 
@@ -98,7 +99,7 @@ struct Block {
                        value |= Mask(f);
                }
                void Unset(Face f) {
-                       value |= ~Mask(f);
+                       value &= ~Mask(f);
                }
 
                void Clear() {
@@ -124,12 +125,18 @@ struct Block {
        };
 
 private:
-       static const glm::tvec3<int> face2normal[6];
+       static const glm::ivec3 face2normal[6];
        static const glm::mat4 orient2transform[ORIENT_COUNT];
        static const Face orient2face[ORIENT_COUNT][FACE_COUNT];
 
 };
 
+bool operator ==(const Block &, const Block &);
+
+std::ostream &operator <<(std::ostream &, const Block &);
+std::ostream &operator <<(std::ostream &, const Block::Face &);
+std::ostream &operator <<(std::ostream &, const Block::Turn &);
+
 }
 
 #endif