Precache static level graphics

This commit is contained in:
toaster 2024-01-06 23:17:45 +00:00
parent 9e3ca7a59b
commit 601b39378d
3 changed files with 8 additions and 1 deletions

View file

@ -97,6 +97,7 @@ static char hu_tick;
patch_t *missingpat;
patch_t *blanklvl, *nolvl;
patch_t *unvisitedlvl[4];
// song credits
static patch_t *songcreditbg;
@ -196,6 +197,11 @@ void HU_LoadGraphics(void)
HU_UpdatePatch(&blanklvl, "BLANKLVL");
HU_UpdatePatch(&nolvl, "M_NOLVL");
for (i = 0; i < 4; i++)
{
HU_UpdatePatch(&unvisitedlvl[i], "PREVST0%d", i+1);
}
HU_UpdatePatch(&songcreditbg, "K_SONGCR");
// cache ping gfx:

View file

@ -2724,9 +2724,9 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *levelsearch)
}
else
{
patch_t *st = W_CachePatchName(va("PREVST0%d", (cupgrid.previewanim % 4) + 1), PU_CACHE);
while (x < BASEVIDWIDTH * FRACUNIT)
{
patch_t *st = unvisitedlvl[cupgrid.previewanim % 4];
V_DrawFixedPatch(x + FRACUNIT, (y+2) * FRACUNIT, FRACUNIT, 0, st, NULL);
x += step;
}

View file

@ -900,6 +900,7 @@ struct patch_t
extern patch_t *missingpat;
extern patch_t *blanklvl, *nolvl;
extern patch_t *unvisitedlvl[4];
#if defined(_MSC_VER)
#pragma pack(1)