video backend selection
[oweals/minetest.git] / src / inventory.h
index e7c7adaee3b3d194d2b6572d52a7f7f1606f69e9..9155eb025f5868d34acecfaf4e7fc43cfa33925a 100644 (file)
@@ -122,12 +122,8 @@ public:
 #ifndef SERVER
        video::ITexture * getImage()
        {
-               /*if(m_content >= USEFUL_CONTENT_COUNT)
-                       return NULL;
-                       
-               return g_irrlicht->getTexture(g_content_inventory_texture_paths[m_content]);*/
-
-               return g_irrlicht->getTexture(content_features(m_content).inventory_texture);
+               return content_features(m_content).inventory_texture;
+               return NULL;
        }
 #endif
        std::string getText()
@@ -252,6 +248,9 @@ public:
 #ifndef SERVER
        video::ITexture * getImage()
        {
+               if(g_texturesource == NULL)
+                       return NULL;
+               
                std::string name;
 
                if(m_subname == "Stick")
@@ -264,7 +263,8 @@ public:
                        name = "cloud.png";
                
                // Get such a texture
-               return g_irrlicht->getTexture(name);
+               //return g_irrlicht->getTexture(name);
+               return g_texturesource->getTextureRaw(name);
        }
 #endif
        std::string getText()
@@ -330,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";
@@ -349,29 +352,14 @@ public:
                
                float value_f = (float)toolprogress / (float)maxprogress;
                std::ostringstream os;
-               os<<"[progressbar"<<value_f;
+               os<<basename<<"^[progressbar"<<value_f;
 
-               TextureSpec spec;
+               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);
-
-               /*// 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));*/
+               return g_irrlicht->getTexture(spec);*/
        }
 #endif
        std::string getText()