summaryrefslogtreecommitdiff
path: root/src/itemdef.h
diff options
context:
space:
mode:
authorSapier <sapier AT gmx dot net>2015-12-29 19:55:50 +0100
committerSapier <sapier AT gmx dot net>2015-12-29 19:55:50 +0100
commit1735c20549d474a45f1f231ea7d25ff8e3157818 (patch)
tree682ca363ee40cfb59e738b747774c4aa1e6979e0 /src/itemdef.h
parent25d128da36bb5aaa27f0dcd32b86fb5616684426 (diff)
downloadminetest-1735c20549d474a45f1f231ea7d25ff8e3157818.tar.gz
minetest-1735c20549d474a45f1f231ea7d25ff8e3157818.tar.bz2
minetest-1735c20549d474a45f1f231ea7d25ff8e3157818.zip
Revert "Refactoring and code style fixes in preparation of adding mesh typed items"
This reverts commit f14e7bac54af65e3d3d99f89f23f114b17058e49. Reverted due to missinterpretation of agreement, obvious dislike and me not interested in doing fights for feature I don't actually need
Diffstat (limited to 'src/itemdef.h')
-rw-r--r--src/itemdef.h82
1 files changed, 1 insertions, 81 deletions
diff --git a/src/itemdef.h b/src/itemdef.h
index fb157705f..805b4aa5d 100644
--- a/src/itemdef.h
+++ b/src/itemdef.h
@@ -25,18 +25,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <string>
#include <iostream>
#include <set>
-#include <map>
#include "itemgroup.h"
#include "sound.h"
-#include "util/container.h"
-#include "util/thread.h"
-
-#ifndef SERVER
-#include "client/tile.h"
-#endif
-
class IGameDef;
-class INodeDefManager;
struct ToolCapabilities;
/*
@@ -48,7 +39,7 @@ enum ItemType
ITEM_NONE,
ITEM_NODE,
ITEM_CRAFT,
- ITEM_TOOL
+ ITEM_TOOL,
};
struct ItemDefinition
@@ -166,77 +157,6 @@ public:
virtual void processQueue(IGameDef *gamedef)=0;
};
-
-class CItemDefManager: public IWritableItemDefManager
-{
-public:
- CItemDefManager();
- virtual ~CItemDefManager();
- virtual const ItemDefinition& get(const std::string &name_) const;
- virtual std::string getAlias(const std::string &name) const;
- virtual std::set<std::string> getAll() const;
- virtual bool isKnown(const std::string &name_) const;
-
-#ifndef SERVER
- // Get item inventory texture
- virtual video::ITexture* getInventoryTexture(const std::string &name,
- IGameDef *gamedef) const;
-
- // Get item wield mesh
- virtual scene::IMesh* getWieldMesh(const std::string &name,
- IGameDef *gamedef) const;
-#endif
- void clear();
-
- virtual void registerItem(const ItemDefinition &def);
- virtual void registerAlias(const std::string &name,
- const std::string &convert_to);
- void serialize(std::ostream &os, u16 protocol_version);
- void deSerialize(std::istream &is);
-
- void processQueue(IGameDef *gamedef);
-
-private:
-
-#ifndef SERVER
- struct ClientCached
- {
- video::ITexture *inventory_texture;
- scene::IMesh *wield_mesh;
-
- ClientCached();
- };
-
- void createNodeItemTexture(const std::string& name,
- const ItemDefinition& def, INodeDefManager* nodedef,
- ClientCached* cc, IGameDef* gamedef, ITextureSource* tsrc) const;
-
- ClientCached* createClientCachedDirect(const std::string &name,
- IGameDef *gamedef) const;
-
- ClientCached* getClientCached(const std::string &name,
- IGameDef *gamedef) const;
-
- // The id of the thread that is allowed to use irrlicht directly
- threadid_t m_main_thread;
-
- // A reference to this can be returned when nothing is found, to avoid NULLs
- mutable ClientCached m_dummy_clientcached;
-
- // Cached textures and meshes
- mutable MutexedMap<std::string, ClientCached*> m_clientcached;
-
- // Queued clientcached fetches (to be processed by the main thread)
- mutable RequestQueue<std::string, ClientCached*, u8, u8> m_get_clientcached_queue;
-#endif
-
- // Key is name
- std::map<std::string, ItemDefinition*> m_item_definitions;
-
- // Aliases
- std::map<std::string, std::string> m_aliases;
-};
-
IWritableItemDefManager* createItemDefManager();
#endif