Skip to content

Commit 4f6bec1

Browse files
committedJun 4, 2013
Only add ^[forcesingle to get raw texture if atlas is used
1 parent 649dca4 commit 4f6bec1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

Diff for: ‎src/tile.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,14 @@ class TextureSource : public IWritableTextureSource
364364
// Gets a separate texture
365365
video::ITexture* getTextureRaw(const std::string &name)
366366
{
367-
AtlasPointer ap = getTexture(name + "^[forcesingle");
367+
AtlasPointer ap = getTexture(name + m_forcesingle_suffix);
368368
return ap.atlas;
369369
}
370370

371371
// Gets a separate texture atlas pointer
372372
AtlasPointer getTextureRawAP(const AtlasPointer &ap)
373373
{
374-
return getTexture(getTextureName(ap.id) + "^[forcesingle");
374+
return getTexture(getTextureName(ap.id) + m_forcesingle_suffix);
375375
}
376376

377377
// Returns a pointer to the irrlicht device
@@ -437,6 +437,7 @@ class TextureSource : public IWritableTextureSource
437437
// Main texture atlas. This is filled at startup and is then not touched.
438438
video::IImage *m_main_atlas_image;
439439
video::ITexture *m_main_atlas_texture;
440+
std::string m_forcesingle_suffix;
440441

441442
// Queued texture fetches (to be processed by the main thread)
442443
RequestQueue<std::string, u32, u8, u8> m_get_texture_queue;
@@ -1137,6 +1138,8 @@ void TextureSource::buildMainAtlas(class IGameDef *gamedef)
11371138
<<atlaspath<<std::endl;
11381139
fs::RecursiveDelete(atlaspath);
11391140
driver->writeImageToFile(atlas_img, atlaspath.c_str());*/
1141+
1142+
m_forcesingle_suffix = "^[forcesingle";
11401143
}
11411144

11421145
video::IImage* generate_image_from_scratch(std::string name,

0 commit comments

Comments
 (0)