]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/nodedef.h
Tool progress bar tweaking
[dragonfireclient.git] / src / nodedef.h
index f69b66c9f46d4eab4485f917aad3108120c9b1db..598ad7fb391555eeac7f122189caf479e0fc89b4 100644 (file)
@@ -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,22 +202,8 @@ 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
        */
@@ -270,7 +244,7 @@ class IWritableNodeDefManager : public INodeDefManager
        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)
@@ -279,11 +253,12 @@ class IWritableNodeDefManager : public INodeDefManager
                        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.
@@ -292,7 +267,7 @@ class IWritableNodeDefManager : public INodeDefManager
        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();