mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Pixel perfect progression bar filling
- Final line now ALSO uses ClipRect - Reduce existing overreliance on ClipRect. A little overdraw is fine to prevent gaps
This commit is contained in:
parent
d0daa09637
commit
174b58c043
1 changed files with 75 additions and 28 deletions
|
|
@ -956,15 +956,6 @@ skiptallydrawer:
|
|||
}
|
||||
else
|
||||
{
|
||||
const fixed_t lineborder = playerx + FRACUNIT;
|
||||
V_SetClipRect(
|
||||
0,
|
||||
0,
|
||||
lineborder,
|
||||
BASEVIDHEIGHT << FRACBITS,
|
||||
0
|
||||
);
|
||||
|
||||
V_DrawMappedPatch(
|
||||
x - 1, 179,
|
||||
0,
|
||||
|
|
@ -972,10 +963,8 @@ skiptallydrawer:
|
|||
colormap
|
||||
);
|
||||
|
||||
V_ClearClipRect();
|
||||
|
||||
V_SetClipRect(
|
||||
lineborder,
|
||||
playerx + FRACUNIT,
|
||||
0,
|
||||
BASEVIDWIDTH << FRACBITS,
|
||||
BASEVIDHEIGHT << FRACBITS,
|
||||
|
|
@ -1067,9 +1056,28 @@ skiptallydrawer:
|
|||
V_DrawMappedPatch(x2 - 13, 167, 0, queuebg_prize, greymap);
|
||||
|
||||
// Draw the final line
|
||||
xiter = x + 6;
|
||||
const fixed_t fillend = (playerx / FRACUNIT);
|
||||
while (xiter < x2 - 6)
|
||||
const fixed_t barstart = x + 6;
|
||||
const fixed_t barend = x2 - 6;
|
||||
|
||||
if (barend - 2 >= barstart)
|
||||
{
|
||||
boolean lineisfull = false, recttoclear = false;
|
||||
|
||||
xiter = barstart;
|
||||
|
||||
if (playerx >= (barend + 1) * FRACUNIT)
|
||||
{
|
||||
lineisfull = true;
|
||||
}
|
||||
else if (playerx <= (barstart - 1) * FRACUNIT)
|
||||
{
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
const fixed_t fillend = min((playerx / FRACUNIT) + 2, barend);
|
||||
|
||||
while (xiter < fillend)
|
||||
{
|
||||
V_DrawMappedPatch(
|
||||
xiter - 1, 177,
|
||||
|
|
@ -1081,13 +1089,52 @@ skiptallydrawer:
|
|||
V_DrawMappedPatch(
|
||||
xiter - 1, 179,
|
||||
0,
|
||||
line_flat[(xiter < fillend) ? BPP_DONE : BPP_AHEAD],
|
||||
(xiter < fillend) ? colormap : NULL
|
||||
line_flat[BPP_DONE],
|
||||
colormap
|
||||
);
|
||||
|
||||
xiter += 2;
|
||||
}
|
||||
|
||||
// Undo the last step so we can draw the unfilled area of the patch.
|
||||
xiter -= 2;
|
||||
|
||||
V_SetClipRect(
|
||||
playerx,
|
||||
0,
|
||||
BASEVIDWIDTH << FRACBITS,
|
||||
BASEVIDHEIGHT << FRACBITS,
|
||||
0
|
||||
);
|
||||
|
||||
recttoclear = true;
|
||||
}
|
||||
|
||||
while (xiter < barend)
|
||||
{
|
||||
V_DrawMappedPatch(
|
||||
xiter - 1, 177,
|
||||
0,
|
||||
line_flat[BPP_SHADOW],
|
||||
NULL
|
||||
);
|
||||
|
||||
V_DrawMappedPatch(
|
||||
xiter - 1, 179,
|
||||
0,
|
||||
line_flat[lineisfull ? BPP_DONE : BPP_AHEAD],
|
||||
lineisfull ? colormap : NULL
|
||||
);
|
||||
|
||||
xiter += 2;
|
||||
}
|
||||
|
||||
if (recttoclear == true)
|
||||
{
|
||||
V_ClearClipRect();
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the final dot
|
||||
V_DrawMappedPatch(
|
||||
x2 - 8, y,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue