mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 22:33:17 +00:00
Don't free replaced textures that are used as patches.
- Fixed: If a part of a multipatch texture is replaced by a HIRESTEX version, the original patch must not be deleted, since the multipatch texture still needs it for compositing.
This commit is contained in:
parent
5a5fb9b3d1
commit
1d4f4b25d7
4 changed files with 7 additions and 4 deletions
|
@ -244,7 +244,6 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl
|
|||
Height = SAFESHORT(mtexture.d->height);
|
||||
strncpy (Name, (const char *)mtexture.d->name, 8);
|
||||
Name[8] = 0;
|
||||
|
||||
CalcBitSize ();
|
||||
|
||||
xScale = mtexture.d->ScaleX ? mtexture.d->ScaleX*(FRACUNIT/8) : FRACUNIT;
|
||||
|
@ -280,6 +279,10 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl
|
|||
NumParts--;
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
Parts[i].Texture->bKeepAround = true;
|
||||
}
|
||||
if (strife)
|
||||
mpatch.s++;
|
||||
else
|
||||
|
@ -859,7 +862,6 @@ void FTextureManager::AddTexturesLump (const void *lumpdata, int lumpsize, int d
|
|||
{
|
||||
pnames.Read (patchlookup[i].Name, 8);
|
||||
patchlookup[i].Name[8] = 0;
|
||||
|
||||
FTextureID j = CheckForTexture (patchlookup[i].Name, FTexture::TEX_WallPatch);
|
||||
if (j.isValid())
|
||||
{
|
||||
|
|
|
@ -146,7 +146,7 @@ FTexture::FTexture (const char *name, int lumpnum)
|
|||
: LeftOffset(0), TopOffset(0),
|
||||
WidthBits(0), HeightBits(0), xScale(FRACUNIT), yScale(FRACUNIT), SourceLump(lumpnum),
|
||||
UseType(TEX_Any), bNoDecals(false), bNoRemap0(false), bWorldPanning(false),
|
||||
bMasked(true), bAlphaTexture(false), bHasCanvas(false), bWarped(0), bComplex(false), bMultiPatch(false),
|
||||
bMasked(true), bAlphaTexture(false), bHasCanvas(false), bWarped(0), bComplex(false), bMultiPatch(false), bKeepAround(false),
|
||||
Rotations(0xFFFF), SkyOffset(0), Width(0), Height(0), WidthMask(0), Native(NULL)
|
||||
{
|
||||
id.SetInvalid();
|
||||
|
|
|
@ -428,7 +428,7 @@ void FTextureManager::ReplaceTexture (FTextureID picnum, FTexture *newtexture, b
|
|||
Textures[index].Texture = newtexture;
|
||||
|
||||
newtexture->id = oldtexture->id;
|
||||
if (free)
|
||||
if (free && !oldtexture->bKeepAround)
|
||||
{
|
||||
delete oldtexture;
|
||||
}
|
||||
|
|
|
@ -177,6 +177,7 @@ public:
|
|||
// fully composited before subjected to any kind of postprocessing instead of
|
||||
// doing it per patch.
|
||||
BYTE bMultiPatch:1; // This is a multipatch texture (we really could use real type info for textures...)
|
||||
BYTE bKeepAround:1; // This texture was used as part of a multi-patch texture. Do not free it.
|
||||
|
||||
WORD Rotations;
|
||||
SWORD SkyOffset;
|
||||
|
|
Loading…
Reference in a new issue