- changed FTextureManager::ReplaceTexture to only append the new texture instead of replacing the old one.
This should ensure that other references to the original will remain valid.
This commit is contained in:
parent
e05cedfc0d
commit
120b950291
3 changed files with 5 additions and 13 deletions
|
|
@ -468,17 +468,10 @@ void FTextureManager::ReplaceTexture (FTextureID picnum, FTexture *newtexture, b
|
|||
|
||||
newtexture->Name = oldtexture->Name;
|
||||
newtexture->UseType = oldtexture->UseType;
|
||||
Textures[index].Texture = newtexture;
|
||||
|
||||
newtexture->id = oldtexture->id;
|
||||
if (free && !oldtexture->bKeepAround)
|
||||
{
|
||||
delete oldtexture;
|
||||
}
|
||||
else
|
||||
{
|
||||
oldtexture->id.SetInvalid();
|
||||
}
|
||||
// Add the new texture at the end of the texture list and clear the old one's name to ensure it won't be found anymore
|
||||
// We cannot actually replace it because it may be referenced by some other texture.
|
||||
oldtexture->Name = "";
|
||||
AddTexture(newtexture);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue