summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-14 01:56:24 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-14 01:56:24 +0200
commit6129e31b96f31521a79f5dfd7968f0cf0decb200 (patch)
treea8369cc5d835e6fd762f7763a365a68160024e3f /src/inventory.h
parent47f76d8a5122767337f0c7b75c5c44a01c418141 (diff)
downloadminetest-6129e31b96f31521a79f5dfd7968f0cf0decb200.tar.gz
minetest-6129e31b96f31521a79f5dfd7968f0cf0decb200.tar.bz2
minetest-6129e31b96f31521a79f5dfd7968f0cf0decb200.zip
better graphics, zlib to work on vc++
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/inventory.h b/src/inventory.h
index 1fab9d027..50f3247c3 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -59,9 +59,9 @@ private:
class MaterialItem : public InventoryItem
{
public:
- MaterialItem(u8 material, u16 count)
+ MaterialItem(u8 content, u16 count)
{
- m_material = material;
+ m_content = content;
m_count = count;
}
/*
@@ -76,18 +76,26 @@ public:
//os.imbue(std::locale("C"));
os<<getName();
os<<" ";
- os<<(unsigned int)m_material;
+ os<<(unsigned int)m_content;
os<<" ";
os<<m_count;
}
virtual InventoryItem* clone()
{
- return new MaterialItem(m_material, m_count);
+ return new MaterialItem(m_content, m_count);
}
video::ITexture * getImage()
{
- u16 tile = content_tile(m_material, v3s16(1,0,0));
- return g_tile_materials[tile].getTexture(0);
+ /*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;
+
+ return g_texturecache.get(g_content_inventory_textures[m_content]);
}
std::string getText()
{
@@ -100,7 +108,7 @@ public:
*/
u8 getMaterial()
{
- return m_material;
+ return m_content;
}
u16 getCount()
{
@@ -123,7 +131,7 @@ public:
m_count -= count;
}
private:
- u8 m_material;
+ u8 m_content;
u16 m_count;
};