Update inventory texture too
authorPerttu Ahola <celeron55@gmail.com>
Tue, 15 Nov 2011 11:22:29 +0000 (13:22 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:43 +0000 (19:13 +0200)
src/nodedef.cpp
src/nodedef.h

index d589c5ec928aad03deb166437d433a52953f820b..57807449e4247fe2925afd001a19ce7c051fd043 100644 (file)
@@ -64,6 +64,7 @@ void ContentFeatures::setInventoryTexture(std::string imgname,
        
        imgname += "^[forcesingle";
        
+       inventory_texture_name = imgname;
        inventory_texture = tsrc->getTextureRaw(imgname);
 }
 
@@ -84,6 +85,7 @@ void ContentFeatures::setInventoryTextureCube(std::string top,
        imgname_full += left;
        imgname_full += "{";
        imgname_full += right;
+       inventory_texture_name = imgname_full;
        inventory_texture = tsrc->getTextureRaw(imgname_full);
 }
 #endif
@@ -181,6 +183,10 @@ public:
                                if(f->special_material2)
                                        f->special_material2->setTexture(0, f->special_atlas->atlas);
                        }
+                       if(f->inventory_texture_name != ""){
+                               f->inventory_texture =
+                                       tsrc->getTextureRaw(f->inventory_texture_name);
+                       }
                }
 #endif
        }
index 0430621e7da629e363a994f85d10e9cdf6a13a95..a093cb7998527dabe9a34724041311efd75acaf8 100644 (file)
@@ -113,6 +113,7 @@ struct ContentFeatures
        */
        TileSpec tiles[6];
        
+       std::string inventory_texture_name;
        video::ITexture *inventory_texture;
 
        // Used currently for flowing liquids