diff --git a/src/common/textures/multipatchtexturebuilder.cpp b/src/common/textures/multipatchtexturebuilder.cpp index 7def5cb7a..41daa0035 100644 --- a/src/common/textures/multipatchtexturebuilder.cpp +++ b/src/common/textures/multipatchtexturebuilder.cpp @@ -923,7 +923,10 @@ void FMultipatchTextureBuilder::ResolveAllPatches() for (auto &b : BuiltTextures) { Printf("%s\n", b.Name.GetChars()); + // make it hard to find but also ensure that it references valid backing data. b.texture->SetUseType(ETextureType::Null); + b.texture->SetBase(TexMan.GameByIndex(0)->GetTexture()); + b.texture->SetName(""); } break; } diff --git a/src/rendering/hwrenderer/hw_precache.cpp b/src/rendering/hwrenderer/hw_precache.cpp index ca5f37f72..72b977f80 100644 --- a/src/rendering/hwrenderer/hw_precache.cpp +++ b/src/rendering/hwrenderer/hw_precache.cpp @@ -104,7 +104,7 @@ void hw_PrecacheTexture(uint8_t *texhitlist, TMap &actorhitl for (int i = 1; i < TexMan.NumTextures(); i++) { auto gametex = TexMan.GameByIndex(i); - if (gametex && + if (gametex && gametex->isValid() && gametex->GetTexture()->GetImage() && // only image textures are subject to precaching gametex->GetUseType() != ETextureType::FontChar && // We do not want to delete font characters here as they are very likely to be needed constantly. gametex->GetUseType() < ETextureType::Special) // Any texture marked as 'special' is also out.