M_DrawCupPreview: Fix interpolation flicker (resolves #832)

This commit is contained in:
toaster 2024-01-05 22:37:50 +00:00
parent b5c1e89645
commit 5c2a4ae68f

View file

@ -2679,14 +2679,16 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *levelsearch)
{ {
UINT8 i = 0; UINT8 i = 0;
INT16 maxlevels = M_CountLevelsToShowInList(levelsearch); INT16 maxlevels = M_CountLevelsToShowInList(levelsearch);
fixed_t x = -((cupgrid.previewanim % 82 * FRACUNIT + rendertimefrac) % (82 * FRACUNIT)); const fixed_t step = (82 * FRACUNIT);
fixed_t previewanimwork = (cupgrid.previewanim * FRACUNIT) + rendertimefrac_unpaused;
fixed_t x = -(previewanimwork % step);
INT16 add; INT16 add;
INT16 map, start = M_GetFirstLevelInList(&i, levelsearch); INT16 map, start = M_GetFirstLevelInList(&i, levelsearch);
UINT8 starti = i; UINT8 starti = i;
if (levelsearch->cup && maxlevels > 0) if (levelsearch->cup && maxlevels > 0)
{ {
add = (cupgrid.previewanim / 82) % maxlevels; add = (previewanimwork / step) % maxlevels;
map = start; map = start;
while (add > 0) while (add > 0)
{ {
@ -2714,7 +2716,7 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *levelsearch)
map, map,
NULL); NULL);
x += 82 * FRACUNIT; x += step;
map = M_GetNextLevelInList(map, &i, levelsearch); map = M_GetNextLevelInList(map, &i, levelsearch);
} }
@ -2725,7 +2727,7 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *levelsearch)
while (x < BASEVIDWIDTH * FRACUNIT) while (x < BASEVIDWIDTH * FRACUNIT)
{ {
V_DrawFixedPatch(x + FRACUNIT, (y+2) * FRACUNIT, FRACUNIT, 0, st, NULL); V_DrawFixedPatch(x + FRACUNIT, (y+2) * FRACUNIT, FRACUNIT, 0, st, NULL);
x += 82 * FRACUNIT; x += step;
} }
} }
} }