- fixed: The raw texture caching in the texture manager did not work.

This erroneously checked for FrontSkyLayer.
Also including some change here that allows explicit setting of the RawTexture (not used yet.)
This commit is contained in:
Christoph Oelckers 2022-11-25 12:29:36 +01:00
parent 28f8d4570d
commit 4103b282bb
2 changed files with 12 additions and 3 deletions

View file

@ -1300,11 +1300,12 @@ void FTextureManager::InitPalettedVersions()
//
//==========================================================================
FTextureID FTextureManager::GetRawTexture(FTextureID texid)
FTextureID FTextureManager::GetRawTexture(FTextureID texid, bool dontlookup)
{
int texidx = texid.GetIndex();
if ((unsigned)texidx >= Textures.Size()) return texid;
if (Textures[texidx].FrontSkyLayer != -1) return FSetTextureID(Textures[texidx].FrontSkyLayer);
if (Textures[texidx].RawTexture != -1) return FSetTextureID(Textures[texidx].RawTexture);
if (dontlookup) return texid;
// Reject anything that cannot have been a front layer for the sky in original Hexen, i.e. it needs to be an unscaled wall texture only using Doom patches.
auto tex = Textures[texidx].Texture;

View file

@ -77,7 +77,15 @@ public:
void FlushAll();
FTextureID GetFrontSkyLayer(FTextureID);
FTextureID GetRawTexture(FTextureID);
FTextureID GetRawTexture(FTextureID tex, bool dontlookup = false);
void SetRawTexture(FTextureID texid)
{
int texidx = texid.GetIndex();
if ((unsigned)texidx < Textures.Size())
{
Textures[texidx].RawTexture = texidx;
}
}
enum