aboutsummaryrefslogtreecommitdiff
path: root/src/tile.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tile.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/tile.h b/src/tile.h
index 286c5fb2e..f1aa100fc 100644
--- a/src/tile.h
+++ b/src/tile.h
@@ -38,11 +38,61 @@ enum TileID
TILE_MUD,
TILE_TREE_TOP,
TILE_MUD_WITH_GRASS,
+ TILE_CLOUD,
// Count of tile ids
TILES_COUNT
};
+enum TileSpecialFeature
+{
+ TILEFEAT_NONE,
+ TILEFEAT_CRACK,
+};
+
+struct TileCrackParam
+{
+ bool operator==(TileCrackParam &other)
+ {
+ return progression == other.progression;
+ }
+
+ u16 progression;
+};
+
+struct TileSpec
+{
+ TileSpec()
+ {
+ id = TILE_NONE;
+ feature = TILEFEAT_NONE;
+ }
+
+ bool operator==(TileSpec &other)
+ {
+ if(id != other.id)
+ return false;
+ if(feature != other.feature)
+ return false;
+ if(feature == TILEFEAT_NONE)
+ return true;
+ if(feature == TILEFEAT_CRACK)
+ {
+ return param.crack == other.param.crack;
+ }
+ // Invalid feature
+ assert(0);
+ return false;
+ }
+
+ u16 id; // Id in g_tile_materials, TILE_NONE=none
+ enum TileSpecialFeature feature;
+ union
+ {
+ TileCrackParam crack;
+ } param;
+};
+
// A mapping from tiles to names of cached textures
extern const char * g_tile_texture_names[TILES_COUNT];