mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- made the texture precaching code a bit more self-descriptive after finding a discrepancy in handling between ZDoom and GZDoom's versions.
This commit is contained in:
parent
34aeb428a1
commit
ad9e4413fa
4 changed files with 17 additions and 7 deletions
|
@ -84,7 +84,7 @@ void FSoftwareRenderer::PrecacheTexture(FTexture *tex, int cache)
|
|||
{
|
||||
if (tex != NULL)
|
||||
{
|
||||
if (cache & 1)
|
||||
if (cache & FTextureManager::HIT_Columnmode)
|
||||
{
|
||||
const FTexture::Span *spanp;
|
||||
tex->GetColumn(0, &spanp);
|
||||
|
|
|
@ -1246,7 +1246,7 @@ void FTextureManager::PrecacheLevel (void)
|
|||
|
||||
for (unsigned i = 0; i < level.info->PrecacheTextures.Size(); i++)
|
||||
{
|
||||
hitlist[level.info->PrecacheTextures[i].GetIndex()] |= 1;
|
||||
hitlist[level.info->PrecacheTextures[i].GetIndex()] |= FTextureManager::HIT_Wall;
|
||||
}
|
||||
|
||||
for (int i = cnt - 1; i >= 0; i--)
|
||||
|
|
|
@ -365,6 +365,16 @@ public:
|
|||
TEXMAN_DontCreate = 32
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HIT_Wall = 1,
|
||||
HIT_Flat = 2,
|
||||
HIT_Sky = 4,
|
||||
HIT_Sprite = 8,
|
||||
|
||||
HIT_Columnmode = HIT_Wall|HIT_Sky|HIT_Sprite
|
||||
};
|
||||
|
||||
FTextureID CheckForTexture (const char *name, int usetype, BITFIELD flags=TEXMAN_TryAny);
|
||||
FTextureID GetTexture (const char *name, int usetype, BITFIELD flags=0);
|
||||
int ListTextures (const char *name, TArray<FTextureID> &list);
|
||||
|
|
|
@ -1245,7 +1245,7 @@ void DFrameBuffer::GetHitlist(BYTE *hitlist)
|
|||
FTextureID pic = frame->Texture[k];
|
||||
if (pic.isValid())
|
||||
{
|
||||
hitlist[pic.GetIndex()] = 1;
|
||||
hitlist[pic.GetIndex()] = HIT_Sprite;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1257,14 +1257,14 @@ void DFrameBuffer::GetHitlist(BYTE *hitlist)
|
|||
for (i = numsectors - 1; i >= 0; i--)
|
||||
{
|
||||
hitlist[sectors[i].GetTexture(sector_t::floor).GetIndex()] =
|
||||
hitlist[sectors[i].GetTexture(sector_t::ceiling).GetIndex()] |= 2;
|
||||
hitlist[sectors[i].GetTexture(sector_t::ceiling).GetIndex()] |= HIT_Flat;
|
||||
}
|
||||
|
||||
for (i = numsides - 1; i >= 0; i--)
|
||||
{
|
||||
hitlist[sides[i].GetTexture(side_t::top).GetIndex()] =
|
||||
hitlist[sides[i].GetTexture(side_t::mid).GetIndex()] =
|
||||
hitlist[sides[i].GetTexture(side_t::bottom).GetIndex()] |= 1;
|
||||
hitlist[sides[i].GetTexture(side_t::bottom).GetIndex()] |= HIT_Wall;
|
||||
}
|
||||
|
||||
// Sky texture is always present.
|
||||
|
@ -1276,11 +1276,11 @@ void DFrameBuffer::GetHitlist(BYTE *hitlist)
|
|||
|
||||
if (sky1texture.isValid())
|
||||
{
|
||||
hitlist[sky1texture.GetIndex()] |= 1;
|
||||
hitlist[sky1texture.GetIndex()] |= HIT_Sky;
|
||||
}
|
||||
if (sky2texture.isValid())
|
||||
{
|
||||
hitlist[sky2texture.GetIndex()] |= 1;
|
||||
hitlist[sky2texture.GetIndex()] |= HIT_Sky;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue