summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-02-11 16:43:26 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-02-11 16:43:26 +0200
commit804b2647ced20b8af1e632f1e99d54f905fa8ce0 (patch)
treec60db21bf4394434424993711669253ee9f6aae2 /src/inventory.h
parent841ac10e5c20ad152f375f43bceb992fc3945041 (diff)
downloadminetest-804b2647ced20b8af1e632f1e99d54f905fa8ce0.tar.gz
minetest-804b2647ced20b8af1e632f1e99d54f905fa8ce0.tar.bz2
minetest-804b2647ced20b8af1e632f1e99d54f905fa8ce0.zip
new texture stuff quite working
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h35
1 files changed, 11 insertions, 24 deletions
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 @@ public:
#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 @@ public:
#ifndef SERVER
video::ITexture * getImage()
{
+ if(g_texturesource == NULL)
+ return NULL;
+
std::string name;
if(m_subname == "Stick")
@@ -262,8 +264,7 @@ public:
// 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 @@ public:
#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 @@ public:
float value_f = (float)toolprogress / (float)maxprogress;
std::ostringstream os;
- os<<"[progressbar"<<value_f;
+ os<<basename<<"^[progressbar"<<value_f;
+
+ return g_texturesource->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<<basename<<"[[mod:progressbar"<<value_f;
- return g_irrlicht->getTexture(os.str());*/
-
- /*// Make texture name for the new texture with a progress bar
- std::ostringstream os;
- os<<basename<<"-toolprogress-"<<toolprogress;
- std::string finalname = os.str();
-
- float value_f = (float)toolprogress / (float)maxprogress;
-
- // Get such a texture
- TextureMod *mod = new ProgressBarTextureMod(value_f);
- return g_irrlicht->getTexture(TextureSpec(finalname, basename, mod));*/
}
#endif
std::string getText()