Move tool stuff to tool.{h,cpp}
[oweals/minetest.git] / src / inventory.cpp
index c9ba9b4e58901512740c66a977f9c80ad0b52f46..ea5b696366ee1daac9bdb0bfedefdec2d8bdcb56 100644 (file)
@@ -33,6 +33,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "content_sao.h"
 #include "player.h"
 #include "log.h"
+#include "mapnode_contentfeatures.h"
+#include "tool.h"
 
 /*
        InventoryItem
@@ -148,6 +150,13 @@ ServerActiveObject* InventoryItem::createSAO(ServerEnvironment *env, u16 id, v3f
        MaterialItem
 */
 
+#ifndef SERVER
+video::ITexture * MaterialItem::getImage() const
+{
+       return content_features(m_content).inventory_texture;
+}
+#endif
+
 bool MaterialItem::isCookable() const
 {
        return item_material_is_cookable(m_content);
@@ -158,6 +167,15 @@ InventoryItem *MaterialItem::createCookResult() const
        return item_material_create_cook_result(m_content);
 }
 
+/*
+       ToolItem
+*/
+
+std::string ToolItem::getImageBasename() const
+{
+       return tool_get_imagename(m_toolname);
+}
+
 /*
        CraftItem
 */