summaryrefslogtreecommitdiff
path: root/src/nodedef.h
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2012-01-12 06:10:39 +0100
committerKahrl <kahrl@gmx.net>2012-01-12 06:10:39 +0100
commit6a76c226e10e92c3e3339096f07f8ab065e2098b (patch)
tree396d9083f5f76ebb5ba96df113ba68046c2487df /src/nodedef.h
parent569156b01302ea4ba45d11ff5524b62dbc6a9aa0 (diff)
downloadminetest-6a76c226e10e92c3e3339096f07f8ab065e2098b.tar.gz
minetest-6a76c226e10e92c3e3339096f07f8ab065e2098b.tar.bz2
minetest-6a76c226e10e92c3e3339096f07f8ab065e2098b.zip
The huge item definition and item namespace unification patch (itemdef), see http://c55.me/minetest/wiki/doku.php?id=changes:itemdef
Diffstat (limited to 'src/nodedef.h')
-rw-r--r--src/nodedef.h49
1 files changed, 11 insertions, 38 deletions
diff --git a/src/nodedef.h b/src/nodedef.h
index fdf2f8c45..598ad7fb3 100644
--- a/src/nodedef.h
+++ b/src/nodedef.h
@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "tile.h"
#endif
#include "materials.h" // MaterialProperties
+class IItemDefManager;
class ITextureSource;
class IGameDef;
@@ -124,7 +125,6 @@ struct ContentFeatures
// 0 1 2 3 4 5
// up down right left back front
TileSpec tiles[6];
- video::ITexture *inventory_texture;
// Special material/texture
// - Currently used for flowing liquids
video::SMaterial *special_materials[CF_SPECIAL_COUNT];
@@ -133,11 +133,7 @@ struct ContentFeatures
u8 visual_solidness; // When solidness=0, this tells how it looks like
bool backface_culling;
#endif
-
- // List of textures that are used and are wanted to be included in
- // the texture atlas
- std::set<std::string> used_texturenames;
-
+
/*
Actual data
*/
@@ -148,7 +144,6 @@ struct ContentFeatures
enum NodeDrawType drawtype;
float visual_scale; // Misc. scale parameter
std::string tname_tiles[6];
- std::string tname_inventory;
MaterialSpec mspec_special[CF_SPECIAL_COUNT]; // Use setter methods
u8 alpha;
@@ -174,10 +169,6 @@ struct ContentFeatures
// If true, param2 is set to direction when placed. Used for torches.
// NOTE: the direction format is quite inefficient and should be changed
bool wall_mounted;
- // Whether this content type often contains mineral.
- // Used for texture atlas creation.
- // Currently only enabled for CONTENT_STONE.
- bool often_contains_mineral;
// Inventory item string as which the node appears in inventory when dug.
// Mineral overrides this.
std::string dug_item;
@@ -202,9 +193,6 @@ struct ContentFeatures
u32 damage_per_second;
NodeBox selection_box;
MaterialProperties material;
- std::string cookresult_item;
- float furnace_cooktime;
- float furnace_burntime;
/*
Methods
@@ -214,23 +202,9 @@ struct ContentFeatures
~ContentFeatures();
void reset();
void serialize(std::ostream &os);
- void deSerialize(std::istream &is, IGameDef *gamedef);
+ void deSerialize(std::istream &is);
/*
- Texture setters.
-
- */
-
- // Texture setters. They also add stuff to used_texturenames.
- void setTexture(u16 i, std::string name);
- void setAllTextures(std::string name);
- void setSpecialMaterial(u16 i, const MaterialSpec &mspec);
-
- void setInventoryTexture(std::string imgname);
- void setInventoryTextureCube(std::string top,
- std::string left, std::string right);
-
- /*
Some handy methods
*/
bool isLiquid() const{
@@ -253,7 +227,6 @@ public:
virtual bool getId(const std::string &name, content_t &result) const=0;
virtual content_t getId(const std::string &name) const=0;
virtual const ContentFeatures& get(const std::string &name) const=0;
- virtual std::string getAlias(const std::string &name) const =0;
virtual void serialize(std::ostream &os)=0;
};
@@ -271,8 +244,7 @@ public:
virtual content_t getId(const std::string &name) const=0;
// If not found, returns the features of CONTENT_IGNORE
virtual const ContentFeatures& get(const std::string &name) const=0;
- virtual std::string getAlias(const std::string &name) const =0;
-
+
// Register node definition
virtual void set(content_t c, const ContentFeatures &def)=0;
// Register node definition by name (allocate an id)
@@ -281,11 +253,12 @@ public:
const ContentFeatures &def)=0;
// If returns CONTENT_IGNORE, could not allocate id
virtual content_t allocateDummy(const std::string &name)=0;
- // Set an alias so that nodes named <name> will load as <convert_to>.
- // Alias is not set if <name> has already been defined.
- // Alias will be removed if <name> is defined at a later point of time.
- virtual void setAlias(const std::string &name,
- const std::string &convert_to)=0;
+
+ /*
+ Update item alias mapping.
+ Call after updating item definitions.
+ */
+ virtual void updateAliases(IItemDefManager *idef)=0;
/*
Update tile textures to latest return values of TextueSource.
@@ -294,7 +267,7 @@ public:
virtual void updateTextures(ITextureSource *tsrc)=0;
virtual void serialize(std::ostream &os)=0;
- virtual void deSerialize(std::istream &is, IGameDef *gamedef)=0;
+ virtual void deSerialize(std::istream &is)=0;
};
IWritableNodeDefManager* createNodeDefManager();