Prevent duplicate metatile pastes in the tileset editor

This commit is contained in:
GriffinR
2022-06-29 14:53:14 -04:00
committed by t
parent cd481892ae
commit 73eabc92ca
3 changed files with 26 additions and 1 deletions

View File

@@ -54,4 +54,18 @@ public:
static int getAttributesSize(BaseGameVersion version);
};
inline bool operator==(const Metatile &a, const Metatile &b) {
return a.behavior == b.behavior &&
a.layerType == b.layerType &&
a.encounterType == b.encounterType &&
a.terrainType == b.terrainType &&
a.unusedAttributes == b.unusedAttributes &&
a.label == b.label &&
a.tiles == b.tiles;
}
inline bool operator!=(const Metatile &a, const Metatile &b) {
return !(operator==(a, b));
}
#endif // METATILE_H

View File

@@ -22,4 +22,15 @@ public:
static int getIndexInTileset(int);
};
inline bool operator==(const Tile &a, const Tile &b) {
return a.tileId == b.tileId &&
a.xflip == b.xflip &&
a.yflip == b.yflip &&
a.palette == b.palette;
}
inline bool operator!=(const Tile &a, const Tile &b) {
return !(operator==(a, b));
}
#endif // TILE_H