31 #ifndef CRAB_TILEINFO_H 32 #define CRAB_TILEINFO_H 34 #include "crab/loaders.h" 39 typedef uint GidFormat;
42 const static GidFormat FlippedHorizontallyFlag = 0x80000000;
43 const static GidFormat FlippedVerticallyFlag = 0x40000000;
44 const static GidFormat FlippedAntiDiagonallyFlag = 0x20000000;
51 TextureFlipType _flip;
58 TileInfo(rapidxml::xml_node<char> *node) {
60 if (!loadNum(_gid,
"gid", node))
63 bool horizontal = (_gid & FlippedHorizontallyFlag) != 0;
64 bool vertical = (_gid & FlippedVerticallyFlag) != 0;
65 bool antidiagonal = (_gid & FlippedAntiDiagonallyFlag) != 0;
74 }
else if (antidiagonal)
78 }
else if (vertical) {
83 }
else if (antidiagonal)
89 _gid &= ~(FlippedHorizontallyFlag | FlippedVerticallyFlag | FlippedAntiDiagonallyFlag);
92 bool operator==(
const TileInfo& other)
const {
93 return (_gid == other._gid) && (_flip == other._flip);
100 #endif // CRAB_TILEINFO_H Definition: moveeffect.h:37
Definition: TileInfo.h:46