1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-22 23:58:48 -05:00

Only add ^[forcesingle to get raw texture if atlas is used

This commit is contained in:
Kahrl 2013-06-04 07:44:19 +02:00
parent 649dca4d16
commit 4f6bec19bc

View File

@ -364,14 +364,14 @@ public:
// Gets a separate texture // Gets a separate texture
video::ITexture* getTextureRaw(const std::string &name) video::ITexture* getTextureRaw(const std::string &name)
{ {
AtlasPointer ap = getTexture(name + "^[forcesingle"); AtlasPointer ap = getTexture(name + m_forcesingle_suffix);
return ap.atlas; return ap.atlas;
} }
// Gets a separate texture atlas pointer // Gets a separate texture atlas pointer
AtlasPointer getTextureRawAP(const AtlasPointer &ap) AtlasPointer getTextureRawAP(const AtlasPointer &ap)
{ {
return getTexture(getTextureName(ap.id) + "^[forcesingle"); return getTexture(getTextureName(ap.id) + m_forcesingle_suffix);
} }
// Returns a pointer to the irrlicht device // Returns a pointer to the irrlicht device
@ -437,6 +437,7 @@ private:
// Main texture atlas. This is filled at startup and is then not touched. // Main texture atlas. This is filled at startup and is then not touched.
video::IImage *m_main_atlas_image; video::IImage *m_main_atlas_image;
video::ITexture *m_main_atlas_texture; video::ITexture *m_main_atlas_texture;
std::string m_forcesingle_suffix;
// Queued texture fetches (to be processed by the main thread) // Queued texture fetches (to be processed by the main thread)
RequestQueue<std::string, u32, u8, u8> m_get_texture_queue; RequestQueue<std::string, u32, u8, u8> m_get_texture_queue;
@ -1137,6 +1138,8 @@ void TextureSource::buildMainAtlas(class IGameDef *gamedef)
<<atlaspath<<std::endl; <<atlaspath<<std::endl;
fs::RecursiveDelete(atlaspath); fs::RecursiveDelete(atlaspath);
driver->writeImageToFile(atlas_img, atlaspath.c_str());*/ driver->writeImageToFile(atlas_img, atlaspath.c_str());*/
m_forcesingle_suffix = "^[forcesingle";
} }
video::IImage* generate_image_from_scratch(std::string name, video::IImage* generate_image_from_scratch(std::string name,