summaryrefslogtreecommitdiff
path: root/src/tile.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-01-26 00:41:06 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-01-26 00:41:06 +0200
commit9f882bf74d452521cb7fb1806ab453aaa28da343 (patch)
treea5676871bd8f3adf44fade49162ea0342d49ac4d /src/tile.h
parent035345f13d2da9eced87a426a671d3bc4df392b5 (diff)
downloadminetest-9f882bf74d452521cb7fb1806ab453aaa28da343.tar.gz
minetest-9f882bf74d452521cb7fb1806ab453aaa28da343.tar.bz2
minetest-9f882bf74d452521cb7fb1806ab453aaa28da343.zip
Reworked texture, material, mineral and whatever handling
Diffstat (limited to 'src/tile.h')
-rw-r--r--src/tile.h88
1 files changed, 18 insertions, 70 deletions
diff --git a/src/tile.h b/src/tile.h
index 5869c03ee..b903d92a8 100644
--- a/src/tile.h
+++ b/src/tile.h
@@ -21,88 +21,36 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define TILE_HEADER
#include "common_irrlicht.h"
-#include "utility.h"
+//#include "utility.h"
+#include <string>
-// TileID is supposed to be stored in a u16
-
-enum TileID
-{
- TILE_NONE, // Nothing shown
- TILE_STONE,
- TILE_WATER,
- TILE_GRASS,
- TILE_TREE,
- TILE_LEAVES,
- TILE_GRASS_FOOTSTEPS,
- TILE_MESE,
- TILE_MUD,
- TILE_TREE_TOP,
- TILE_MUD_WITH_GRASS,
- TILE_CLOUD,
- TILE_COALSTONE,
- TILE_WOOD,
-
- // Count of tile ids
- TILES_COUNT
-};
-
-enum TileSpecialFeature
-{
- TILEFEAT_NONE,
- TILEFEAT_CRACK,
-};
-
-struct TileCrackParam
+struct TileSpec
{
- bool operator==(TileCrackParam &other)
+ TileSpec():
+ alpha(255)
{
- return progression == other.progression;
}
- u16 progression;
-};
-
-struct TileSpec
-{
- TileSpec()
+ TileSpec(const std::string &a_name):
+ name(a_name),
+ alpha(255)
{
- id = TILE_NONE;
- feature = TILEFEAT_NONE;
}
- bool operator==(TileSpec &other)
+ TileSpec(const char *a_name):
+ name(a_name),
+ alpha(255)
{
- 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
+ bool operator==(TileSpec &other)
{
- TileCrackParam crack;
- } param;
+ return (name == other.name && alpha == other.alpha);
+ }
+
+ // path + mods
+ std::string name;
+ u8 alpha;
};
-/*
- Functions
-*/
-
-void init_tile_textures();
-
-const char * tile_texture_path_get(u32 i);
-
-video::SMaterial & tile_material_get(u32 i);
-
#endif