mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Now performs unsigned portion of calculation including modulo, THEN multiplied by FRACUNIT Variable names have been adjusted a little to make this clearer
This commit is contained in:
parent
93de95d8f8
commit
32ce2b4744
1 changed files with 18 additions and 6 deletions
|
|
@ -2764,9 +2764,12 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *baselevelsearch)
|
||||||
|
|
||||||
UINT8 i = 0;
|
UINT8 i = 0;
|
||||||
INT16 maxlevels = M_CountLevelsToShowInList(&locklesslevelsearch);
|
INT16 maxlevels = M_CountLevelsToShowInList(&locklesslevelsearch);
|
||||||
const fixed_t step = (82 * FRACUNIT);
|
const UINT32 ustep = 82;
|
||||||
fixed_t previewanimwork = (cupgrid.previewanim * FRACUNIT) + rendertimefrac_unpaused;
|
const fixed_t fracstep = (ustep * FRACUNIT);
|
||||||
fixed_t x = -(previewanimwork % step);
|
|
||||||
|
UINT32 unsignedportion = 0;
|
||||||
|
fixed_t x = 0;
|
||||||
|
|
||||||
INT16 map, start = M_GetFirstLevelInList(&i, &locklesslevelsearch);
|
INT16 map, start = M_GetFirstLevelInList(&i, &locklesslevelsearch);
|
||||||
UINT8 starti = i;
|
UINT8 starti = i;
|
||||||
|
|
||||||
|
|
@ -2774,7 +2777,10 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *baselevelsearch)
|
||||||
|
|
||||||
if (baselevelsearch->cup && maxlevels > 0)
|
if (baselevelsearch->cup && maxlevels > 0)
|
||||||
{
|
{
|
||||||
INT16 add = (previewanimwork / step) % maxlevels;
|
unsignedportion = (cupgrid.previewanim % (maxlevels * ustep));
|
||||||
|
x = (unsignedportion * FRACUNIT) + rendertimefrac_unpaused;
|
||||||
|
|
||||||
|
INT16 add = (x / fracstep) % maxlevels;
|
||||||
map = start;
|
map = start;
|
||||||
while (add > 0)
|
while (add > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -2787,6 +2793,8 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *baselevelsearch)
|
||||||
|
|
||||||
add--;
|
add--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x = -(x % fracstep);
|
||||||
while (x < BASEVIDWIDTH * FRACUNIT)
|
while (x < BASEVIDWIDTH * FRACUNIT)
|
||||||
{
|
{
|
||||||
if (map >= nummapheaders)
|
if (map >= nummapheaders)
|
||||||
|
|
@ -2814,17 +2822,21 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *baselevelsearch)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
x += step;
|
x += fracstep;
|
||||||
|
|
||||||
map = M_GetNextLevelInList(map, &i, &locklesslevelsearch);
|
map = M_GetNextLevelInList(map, &i, &locklesslevelsearch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
unsignedportion = (cupgrid.previewanim % ustep);
|
||||||
|
x = (unsignedportion * FRACUNIT) + rendertimefrac_unpaused;
|
||||||
|
|
||||||
|
x = -(x % fracstep);
|
||||||
while (x < BASEVIDWIDTH * FRACUNIT)
|
while (x < BASEVIDWIDTH * FRACUNIT)
|
||||||
{
|
{
|
||||||
V_DrawFixedPatch(x + FRACUNIT, (y+2) * FRACUNIT, FRACUNIT, 0, staticpat, NULL);
|
V_DrawFixedPatch(x + FRACUNIT, (y+2) * FRACUNIT, FRACUNIT, 0, staticpat, NULL);
|
||||||
x += step;
|
x += fracstep;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue