summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-01-26 00:41:06 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-01-26 00:41:06 +0200
commit9f882bf74d452521cb7fb1806ab453aaa28da343 (patch)
treea5676871bd8f3adf44fade49162ea0342d49ac4d /src/inventory.h
parent035345f13d2da9eced87a426a671d3bc4df392b5 (diff)
downloadminetest-9f882bf74d452521cb7fb1806ab453aaa28da343.tar.gz
minetest-9f882bf74d452521cb7fb1806ab453aaa28da343.tar.bz2
minetest-9f882bf74d452521cb7fb1806ab453aaa28da343.zip
Reworked texture, material, mineral and whatever handling
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/inventory.h b/src/inventory.h
index 84ccd5bd6..797a67509 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -122,12 +122,6 @@ public:
#ifndef SERVER
video::ITexture * getImage()
{
- /*if(m_content == CONTENT_TORCH)
- return g_texturecache.get("torch_on_floor");
-
- u16 tile = content_tile(m_content, v3s16(1,0,0));
- return g_tile_contents[tile].getTexture(0);*/
-
if(m_content >= USEFUL_CONTENT_COUNT)
return NULL;
@@ -257,15 +251,18 @@ public:
video::ITexture * getImage()
{
std::string basename;
+
if(m_subname == "Stick")
- basename = porting::getDataPath("stick.png").c_str();
- // Default to cloud texture
+ basename = porting::getDataPath("stick.png");
+ else if(m_subname == "lump_of_coal")
+ basename = porting::getDataPath("lump_of_coal.png");
+ else if(m_subname == "lump_of_iron")
+ basename = porting::getDataPath("lump_of_iron.png");
else
- basename = tile_texture_path_get(TILE_CLOUD);
+ basename = porting::getDataPath("cloud.png[[mod:crack3");
// Get such a texture
return g_irrlicht->getTexture(basename);
- //return g_irrlicht->getTexture(TextureSpec(finalname, basename, mod));
}
#endif
std::string getText()
@@ -340,7 +337,8 @@ public:
basename = porting::getDataPath("tool_mesepick.png").c_str();
// Default to cloud texture
else
- basename = tile_texture_path_get(TILE_CLOUD);
+ basename = porting::getDataPath("cloud.png").c_str();
+ //basename = tile_texture_path_get(TILE_CLOUD);
/*
Calculate some progress value with sane amount of
@@ -350,6 +348,12 @@ public:
u32 toolprogress = (65535-m_wear)/(65535/maxprogress);
// 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();
@@ -358,7 +362,7 @@ public:
// Get such a texture
TextureMod *mod = new ProgressBarTextureMod(value_f);
- return g_irrlicht->getTexture(TextureSpec(finalname, basename, mod));
+ return g_irrlicht->getTexture(TextureSpec(finalname, basename, mod));*/
}
#endif
std::string getText()