mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
- 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
|
@ -138,7 +138,7 @@ FTexture::FTexture (const char *name, int lumpnum)
|
||||||
:
|
:
|
||||||
Scale(1,1), SourceLump(lumpnum),
|
Scale(1,1), SourceLump(lumpnum),
|
||||||
UseType(ETextureType::Any), bNoDecals(false), bNoRemap0(false), bWorldPanning(false),
|
UseType(ETextureType::Any), bNoDecals(false), bNoRemap0(false), bWorldPanning(false),
|
||||||
bMasked(true), bAlphaTexture(false), bHasCanvas(false), bWarped(0), bComplex(false), bMultiPatch(false), bKeepAround(false), bFullNameTexture(false),
|
bMasked(true), bAlphaTexture(false), bHasCanvas(false), bWarped(0), bComplex(false), bMultiPatch(false), bFullNameTexture(false),
|
||||||
Rotations(0xFFFF), SkyOffset(0), Width(0), Height(0)
|
Rotations(0xFFFF), SkyOffset(0), Width(0), Height(0)
|
||||||
{
|
{
|
||||||
bBrightmapChecked = false;
|
bBrightmapChecked = false;
|
||||||
|
|
|
@ -468,17 +468,10 @@ void FTextureManager::ReplaceTexture (FTextureID picnum, FTexture *newtexture, b
|
||||||
|
|
||||||
newtexture->Name = oldtexture->Name;
|
newtexture->Name = oldtexture->Name;
|
||||||
newtexture->UseType = oldtexture->UseType;
|
newtexture->UseType = oldtexture->UseType;
|
||||||
Textures[index].Texture = newtexture;
|
// 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.
|
||||||
newtexture->id = oldtexture->id;
|
oldtexture->Name = "";
|
||||||
if (free && !oldtexture->bKeepAround)
|
AddTexture(newtexture);
|
||||||
{
|
|
||||||
delete oldtexture;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
oldtexture->id.SetInvalid();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -407,7 +407,6 @@ protected:
|
||||||
// fully composited before subjected to any kind of postprocessing instead of
|
// fully composited before subjected to any kind of postprocessing instead of
|
||||||
// doing it per patch.
|
// doing it per patch.
|
||||||
uint8_t bMultiPatch:2; // This is a multipatch texture (we really could use real type info for textures...)
|
uint8_t bMultiPatch:2; // This is a multipatch texture (we really could use real type info for textures...)
|
||||||
uint8_t bKeepAround:1; // This texture was used as part of a multi-patch texture. Do not free it.
|
|
||||||
uint8_t bFullNameTexture : 1;
|
uint8_t bFullNameTexture : 1;
|
||||||
uint8_t bBrightmapChecked : 1; // Set to 1 if brightmap has been checked
|
uint8_t bBrightmapChecked : 1; // Set to 1 if brightmap has been checked
|
||||||
uint8_t bGlowing : 1; // Texture glow color
|
uint8_t bGlowing : 1; // Texture glow color
|
||||||
|
|
Loading…
Reference in a new issue