From 15a43c5ed02130f1b1e07a0385530da197b0c846 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 18 Dec 2010 13:10:37 +0200 Subject: before adding day/night lighting --HG-- rename : data/light.png => data/cloud.png --- src/tile.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'src/tile.h') 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]; -- cgit v1.2.3