-
Notifications
You must be signed in to change notification settings - Fork 75
File naming #4
Copy link
Copy link
Open
Description
If you have a TexturePack and want to change its texture the asset filename must not be the same or it won't change the texture.
For example:
I have a texture pack ( myTexturePack ) and I want to change it for different chapters.
myTexturePack = texturepackLoader.loadFromAsset("gfx/chapter1/myGFX.xml", "gfx/chapter1/");
//we load it
myTexturePack.load();
//then we want to change it (*forget unloading stuff)
myTexturePack = texturePackLoader.loadFromAsset("gfx/chapter2/myGFX.xml", "gfx/chapter2/");
myTexturePack.load();At this point we would aspect to have the graphics from chapter 2 loaded, but this doesn't happen because of the check made in the parser.
final String file = SAXUtils.getAttributeOrThrow(pAttributes, TexturePackParser.TAG_TEXTURE_ATTRIBUTE_FILE);
if(this.mTextureManager.hasMappedTexture(file)) {
return this.mTextureManager.getMappedTexture(file);
}The string should contain the whole path not just the filename or there should be a reference somewhere saying that the names of the files must be different.
~korn3l
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels