Skip to content

Commit

Permalink
Only add ^[forcesingle to get raw texture if atlas is used
Browse files Browse the repository at this point in the history
  • Loading branch information
kahrl committed Jun 4, 2013
1 parent 649dca4 commit 4f6bec1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tile.cpp
Expand Up @@ -364,14 +364,14 @@ class TextureSource : public IWritableTextureSource
// Gets a separate texture
video::ITexture* getTextureRaw(const std::string &name)
{
AtlasPointer ap = getTexture(name + "^[forcesingle");
AtlasPointer ap = getTexture(name + m_forcesingle_suffix);
return ap.atlas;
}

// Gets a separate texture atlas pointer
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
Expand Down Expand Up @@ -437,6 +437,7 @@ class TextureSource : public IWritableTextureSource
// Main texture atlas. This is filled at startup and is then not touched.
video::IImage *m_main_atlas_image;
video::ITexture *m_main_atlas_texture;
std::string m_forcesingle_suffix;

// Queued texture fetches (to be processed by the main thread)
RequestQueue<std::string, u32, u8, u8> m_get_texture_queue;
Expand Down Expand Up @@ -1137,6 +1138,8 @@ void TextureSource::buildMainAtlas(class IGameDef *gamedef)
<<atlaspath<<std::endl;
fs::RecursiveDelete(atlaspath);
driver->writeImageToFile(atlas_img, atlaspath.c_str());*/

m_forcesingle_suffix = "^[forcesingle";
}

video::IImage* generate_image_from_scratch(std::string name,
Expand Down

0 comments on commit 4f6bec1

Please sign in to comment.