- allow specifying actor classes whose graphics to precache through MAPINFO.

- some reorganization of texture precaching so that the renderer can decide what to do with actors.

Just marking the sprite textures loses too much info if more is needed than just loading the images into memory.
This commit is contained in:
Christoph Oelckers 2016-05-01 22:47:36 +02:00
commit 65e1589543
10 changed files with 144 additions and 121 deletions

View file

@ -1226,44 +1226,6 @@ int FTextureManager::CountLumpTextures (int lumpnum)
return 0;
}
//===========================================================================
//
// R_PrecacheLevel
//
// Preloads all relevant graphics for the level.
//
//===========================================================================
void FTextureManager::PrecacheLevel (void)
{
BYTE *hitlist;
int cnt = NumTextures();
if (demoplayback)
return;
hitlist = new BYTE[cnt];
memset (hitlist, 0, cnt);
screen->GetHitlist(hitlist);
for (unsigned i = 0; i < level.info->PrecacheTextures.Size(); i++)
{
FTextureID tex = TexMan.CheckForTexture(level.info->PrecacheTextures[i], FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_ReturnFirst);
if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall;
}
for (int i = cnt - 1; i >= 0; i--)
{
Renderer->PrecacheTexture(ByIndex(i), hitlist[i]);
}
delete[] hitlist;
}
//==========================================================================
//