diff --git a/src/gamedata/resourcefiles/resourcefile.h b/src/gamedata/resourcefiles/resourcefile.h index 5ff10c930..d21d52bad 100644 --- a/src/gamedata/resourcefiles/resourcefile.h +++ b/src/gamedata/resourcefiles/resourcefile.h @@ -47,7 +47,6 @@ struct FResourceLump int8_t RefCount; char * Cache; FResourceFile * Owner; - FTexture * LinkedTexture; int Namespace; FResourceLump() @@ -58,7 +57,6 @@ struct FResourceLump RefCount = 0; Namespace = 0; // ns_global *Name = 0; - LinkedTexture = NULL; } virtual ~FResourceLump(); diff --git a/src/gamedata/w_wad.cpp b/src/gamedata/w_wad.cpp index 52221bdf8..e506827ff 100644 --- a/src/gamedata/w_wad.cpp +++ b/src/gamedata/w_wad.cpp @@ -64,6 +64,7 @@ struct FWadCollection::LumpRecord { int wadnum; FResourceLump *lump; + FTexture* linkedTexture; }; // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- @@ -204,6 +205,7 @@ int FWadCollection::AddExternalFile(const char *filename) FWadCollection::LumpRecord *lumprec = &LumpInfo[LumpInfo.Reserve(1)]; lumprec->lump = lump; lumprec->wadnum = -1; + lumprec->linkedTexture = nullptr; return LumpInfo.Size()-1; // later } @@ -620,8 +622,7 @@ void FWadCollection::SetLinkedTexture(int lump, FTexture *tex) { if ((size_t)lump < NumLumps) { - FResourceLump *reslump = LumpInfo[lump].lump; - reslump->LinkedTexture = tex; + LumpInfo[lump].linkedTexture = tex; } } @@ -635,8 +636,7 @@ FTexture *FWadCollection::GetLinkedTexture(int lump) { if ((size_t)lump < NumLumps) { - FResourceLump *reslump = LumpInfo[lump].lump; - return reslump->LinkedTexture; + return LumpInfo[lump].linkedTexture; } return NULL; }