- do not precache unreferenced textures

https://forum.zdoom.org/viewtopic.php?t=72649
This commit is contained in:
alexey.lysiuk 2021-07-12 13:27:49 +03:00
parent e453f97872
commit e02690af58

View file

@ -209,14 +209,16 @@ static void PrecacheLevel(FLevelLocals *Level)
AddToList(hitlist.Data(), Level->skytexture2, FTextureManager::HIT_Sky);
}
static const BITFIELD checkForTextureFlags = FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst | FTextureManager::TEXMAN_DontCreate;
for (auto n : gameinfo.PrecachedTextures)
{
FTextureID tex = TexMan.CheckForTexture(n, ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst);
FTextureID tex = TexMan.CheckForTexture(n, ETextureType::Wall, checkForTextureFlags);
if (tex.Exists()) AddToList(hitlist.Data(), tex, FTextureManager::HIT_Wall);
}
for (unsigned i = 0; i < Level->info->PrecacheTextures.Size(); i++)
{
FTextureID tex = TexMan.CheckForTexture(Level->info->PrecacheTextures[i], ETextureType::Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst);
FTextureID tex = TexMan.CheckForTexture(Level->info->PrecacheTextures[i], ETextureType::Wall, checkForTextureFlags);
if (tex.Exists()) AddToList(hitlist.Data(), tex, FTextureManager::HIT_Wall);
}