aboutsummaryrefslogtreecommitdiff
path: root/src/tile.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-18 13:10:37 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-18 13:10:37 +0200
commit15a43c5ed02130f1b1e07a0385530da197b0c846 (patch)
tree94851572e9e711dd5c5f5d6ef2e84680166de35b /src/tile.h
parent385dd9917fd4ced23a704f0566779d58f5a6b727 (diff)
downloadhax-minetest-server-15a43c5ed02130f1b1e07a0385530da197b0c846.tar.gz
hax-minetest-server-15a43c5ed02130f1b1e07a0385530da197b0c846.zip
before adding day/night lighting
--HG-- rename : data/light.png => data/cloud.png
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];