Make character cursor framerate-independent

This commit is contained in:
Eidolon 2022-05-19 21:03:58 -05:00
parent a4090db7b9
commit 2fe0555e3f

View file

@ -9141,12 +9141,13 @@ Update the maxplayers label...
if (itemOn == 2 && i == setupm_pselect) if (itemOn == 2 && i == setupm_pselect)
{ {
static UINT8 cursorframe = 0; static fixed_t cursorframe = 0;
if (skullAnimCounter % 4 == 0)
cursorframe++; cursorframe += renderdeltatics / 4;
if (cursorframe > 7) if (cursorframe > 7 * FRACUNIT)
cursorframe = 0; cursorframe -= 7 * FRACUNIT;
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, 0, W_CachePatchName(va("K_BHILI%d", cursorframe+1), PU_CACHE), NULL);
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, 0, W_CachePatchName(va("K_BHILI%d", (cursorframe >> FRACBITS) + 1), PU_CACHE), NULL);
} }
x += incrwidth; x += incrwidth;
@ -9487,16 +9488,15 @@ static void M_DrawSetupMultiPlayerMenu(void)
fixed_t scale = FRACUNIT/2; fixed_t scale = FRACUNIT/2;
INT32 offx = 8, offy = 8; INT32 offx = 8, offy = 8;
patch_t *cursor; patch_t *cursor;
static UINT8 cursorframe = 0; static fixed_t cursorframe = 0;
patch_t *face; patch_t *face;
UINT8 *colmap; UINT8 *colmap;
if (skullAnimCounter % 4 == 0) cursorframe += renderdeltatics / 4;
cursorframe++; if (cursorframe > 7 * FRACUNIT)
if (cursorframe > 7) cursorframe -= 7 * FRACUNIT;
cursorframe = 0;
cursor = W_CachePatchName(va("K_BHILI%d", cursorframe+1), PU_CACHE); cursor = W_CachePatchName(va("K_BHILI%d", (cursorframe >> FRACBITS) + 1), PU_CACHE);
if (col < 0) if (col < 0)
col += numskins; col += numskins;