also precache animated flats

i have no clue how tf animated textures work
This commit is contained in:
Alug committed 2025-02-15 16:22:42 +01:00
1 parent c1a187084d
commit a403d96204
2 files changed
+31 -5

No files matched your search

+29 -5
View File
@@ -550,14 +550,14 @@ void HWR_FreeTextureCache(void)
static void HWR_PrecacheLevelFlats(void)
{
levelflat_t levelflat;
lumpnum_t lump;
size_t i, j;
INT32 k;
// special case for encore remapping
if (encoremode)
{
// this does not account for fofs and polyobjects
// TODO: handle atleast fofs
for (i = 0; i < numsectors; i++)
{
for (j = 0; j < 2; j++)
@@ -565,8 +565,20 @@ static void HWR_PrecacheLevelFlats(void)
boolean ceiling = (j == 1);
INT32 pic = ceiling ? sectors[i].ceilingpic : sectors[i].floorpic;
lump = levelflats[pic].lumpnum;
levelflat = levelflats[pic];
lump = levelflat.lumpnum;
HWR_GetFlat(lump, R_NoEncore(&sectors[i], ceiling));
if (levelflat.speed) // it is an animated flat
{
for (k = 0; k < levelflat.numpics; k++)
{
levelflat.lumpnum = levelflat.baselumpnum + k;
lump = levelflat.lumpnum;
HWR_GetFlat(lump, R_NoEncore(&sectors[i], ceiling));
}
}
}
}
}
@@ -576,8 +588,20 @@ static void HWR_PrecacheLevelFlats(void)
// just load every flat
for (i = 0; i < numlevelflats; i++)
{
lump = levelflats[i].lumpnum;
levelflat = levelflats[i];
lump = levelflat.lumpnum;
HWR_GetFlat(lump, false);
if (levelflat.speed) // it is an animated flat
{
for (k = 0; k < levelflat.numpics; k++)
{
levelflat.lumpnum = levelflat.baselumpnum + k;
lump = levelflat.lumpnum;
HWR_GetFlat(lump, false);
}
}
}
}
}
@@ -661,7 +685,7 @@ static void HWR_PrecacheLevelSprites(void)
mo = (mobj_t *)th;
//FIXME: cant really precache colorized sprites without a colormap
// ogl is weird
if (mo->color || mo->colorized)
continue;
+2
View File
@@ -624,6 +624,7 @@ INT32 P_AddLevelFlat(const char *flatname, levelflat_t *levelflat)
// store the flat lump number
levelflat->lumpnum = R_GetFlatNumForName(flatname);
levelflat->baselumpnum = LUMPERROR;
#ifndef ZDEBUG
CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name);
@@ -668,6 +669,7 @@ INT32 P_AddLevelFlatRuntime(const char *flatname)
// store the flat lump number
levelflat->lumpnum = R_GetFlatNumForName(flatname);
levelflat->baselumpnum = LUMPERROR;
#ifndef ZDEBUG
CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name);