X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Finventory.h;h=9155eb025f5868d34acecfaf4e7fc43cfa33925a;hb=023fc5b7714859f36f62a3fefda7a2d312d46bdc;hp=ca07bf46dcbbd71ae6b13ba9c721f16f1686d705;hpb=1704badc306fc8c7c6609aff9f809aee3ac00d3a;p=dragonfireclient.git diff --git a/src/inventory.h b/src/inventory.h index ca07bf46d..9155eb025 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -122,8 +122,7 @@ class MaterialItem : public InventoryItem #ifndef SERVER video::ITexture * getImage() { - //TODO - //return g_irrlicht->getTexture(content_features(m_content).inventory_texture); + return content_features(m_content).inventory_texture; return NULL; } #endif @@ -249,6 +248,9 @@ class CraftItem : public InventoryItem #ifndef SERVER video::ITexture * getImage() { + if(g_texturesource == NULL) + return NULL; + std::string name; if(m_subname == "Stick") @@ -262,8 +264,7 @@ class CraftItem : public InventoryItem // Get such a texture //return g_irrlicht->getTexture(name); - //TODO - return NULL; + return g_texturesource->getTextureRaw(name); } #endif std::string getText() @@ -329,6 +330,9 @@ class ToolItem : public InventoryItem #ifndef SERVER video::ITexture * getImage() { + if(g_texturesource == NULL) + return NULL; + std::string basename; if(m_toolname == "WPick") basename = "tool_wpick.png"; @@ -348,31 +352,14 @@ class ToolItem : public InventoryItem float value_f = (float)toolprogress / (float)maxprogress; std::ostringstream os; - os<<"[progressbar"<getTextureRaw(os.str()); /*TextureSpec spec; spec.addTid(g_irrlicht->getTextureId(basename)); spec.addTid(g_irrlicht->getTextureId(os.str())); return g_irrlicht->getTexture(spec);*/ - //TODO - return NULL; - - /*// Make texture name for the new texture with a progress bar - float value_f = (float)toolprogress / (float)maxprogress; - std::ostringstream os; - os<getTexture(os.str());*/ - - /*// Make texture name for the new texture with a progress bar - std::ostringstream os; - os<getTexture(TextureSpec(finalname, basename, mod));*/ } #endif std::string getText()