#include "tile.h"
#endif
#include "materials.h" // MaterialProperties
+class IItemDefManager;
class ITextureSource;
class IGameDef;
// 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];
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
*/
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;
// 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;
- // If true, node is equivalent to air. Torches are, air is. Water is not.
- // Is used for example to check whether a mud block can have grass on.
- bool air_equivalent;
- // 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;
u32 damage_per_second;
NodeBox selection_box;
MaterialProperties material;
- std::string cookresult_item;
- float furnace_cooktime;
- float furnace_burntime;
/*
Methods
~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
*/
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;
-
+
// Register node definition
virtual void set(content_t c, const ContentFeatures &def)=0;
// Register node definition by name (allocate an id)
// If returns CONTENT_IGNORE, could not allocate id
virtual content_t allocateDummy(const std::string &name)=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.
Call after updating the texture atlas of a TextureSource.
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();