void Camera::wield(const InventoryItem* item, IGameDef *gamedef)
{
- ITextureSource *tsrc = gamedef->tsrc();
+ //ITextureSource *tsrc = gamedef->tsrc();
INodeDefManager *ndef = gamedef->ndef();
if (item != NULL)
// If that failed, make an extruded sprite.
if (!isCube)
{
- m_wieldnode->setSprite(item->getImageRaw(tsrc));
+ m_wieldnode->setSprite(item->getImageRaw());
m_wieldnode->setScale(v3f(40));
}
<<std::endl;
if(item)
{
- texture = item->getImage(tsrc);
+ texture = item->getImage();
delete item;
}
}
return;
video::ITexture *texture = NULL;
- texture = item->getImage(tsrc);
+ texture = item->getImage();
if(texture != NULL)
{
}
#ifndef SERVER
-video::ITexture * MaterialItem::getImage(ITextureSource *tsrc) const
+video::ITexture * MaterialItem::getImage() const
{
return m_gamedef->getNodeDefManager()->get(m_nodename).inventory_texture;
}
}
#ifndef SERVER
-video::ITexture * ToolItem::getImage(ITextureSource *tsrc) const
+video::ITexture * ToolItem::getImage() const
{
- if(tsrc == NULL)
- return NULL;
-
+ ITextureSource *tsrc = m_gamedef->tsrc();
+
std::string basename = getImageBasename();
/*
return tsrc->getTextureRaw(os.str());
}
-video::ITexture * ToolItem::getImageRaw(ITextureSource *tsrc) const
+video::ITexture * ToolItem::getImageRaw() const
{
- if(tsrc == NULL)
- return NULL;
+ ITextureSource *tsrc = m_gamedef->tsrc();
return tsrc->getTextureRaw(getImageBasename());
}
*/
#ifndef SERVER
-video::ITexture * CraftItem::getImage(ITextureSource *tsrc) const
+video::ITexture * CraftItem::getImage() const
{
- if(tsrc == NULL)
- return NULL;
-
+ ITextureSource *tsrc = m_gamedef->tsrc();
+
std::string name = item_craft_get_image_name(m_subname, m_gamedef);
// Get such a texture
virtual std::string getImageBasename() const { return ""; }
#ifndef SERVER
// Shall return an image of the item (or NULL)
- virtual video::ITexture * getImage(ITextureSource *tsrc) const
+ virtual video::ITexture * getImage() const
{ return NULL; }
// Shall return an image of the item without embellishments (or NULL)
- virtual video::ITexture * getImageRaw(ITextureSource *tsrc) const
- { return getImage(tsrc); }
+ virtual video::ITexture * getImageRaw() const
+ { return getImage(); }
#endif
// Shall return a text to show in the GUI
virtual std::string getText() { return ""; }
return new MaterialItem(m_gamedef, m_nodename, m_count);
}
#ifndef SERVER
- video::ITexture * getImage(ITextureSource *tsrc) const;
+ video::ITexture * getImage() const;
#endif
std::string getText()
{
return new CraftItem(m_gamedef, m_subname, m_count);
}
#ifndef SERVER
- video::ITexture * getImage(ITextureSource *tsrc) const;
+ video::ITexture * getImage() const;
#endif
std::string getText()
{
std::string getImageBasename() const;
#ifndef SERVER
- video::ITexture * getImage(ITextureSource *tsrc) const;
- video::ITexture * getImageRaw(ITextureSource *tsrc) const;
+ video::ITexture * getImage() const;
+ video::ITexture * getImageRaw() const;
#endif
std::string getText()