X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FBlock.hpp;h=5f52d173882903af05a8346561842d0f77006f52;hb=d2fa8ca97d291508ce3812fb052a8255d3190d00;hp=0bb5fd8964b0655dae6addb1dd49903cf89d08ff;hpb=a74e9630e55ca47c23f3ba3c9ccffcaccad394ff;p=blank.git diff --git a/src/world/Block.hpp b/src/world/Block.hpp index 0bb5fd8..5f52d17 100644 --- a/src/world/Block.hpp +++ b/src/world/Block.hpp @@ -66,7 +66,7 @@ struct Block { } } - static glm::tvec3 FaceNormal(Face face) noexcept { + static glm::ivec3 FaceNormal(Face face) noexcept { return face2normal[face]; } @@ -125,13 +125,19 @@ struct Block { }; private: - static const glm::tvec3 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 &); +inline bool operator ==(const Block &a, const Block &b) { + return a.type == b.type && a.orient == b.orient; +} + +inline bool operator !=(const Block &a, const Block &b) { + return !(a == b); +} std::ostream &operator <<(std::ostream &, const Block &); std::ostream &operator <<(std::ostream &, const Block::Face &);