Uncap input display

This commit is contained in:
NepDisk 2025-02-09 11:44:19 -05:00
parent 591c32e97f
commit 78751d9659
2 changed files with 24 additions and 22 deletions

View file

@ -235,30 +235,31 @@ static void F_TitleBGScroll(INT32 scrollspeed)
pat = W_CachePatchName("TITLEBG1", PU_CACHE);
pat2 = W_CachePatchName("TITLEBG2", PU_CACHE);
w = vid.width / vid.dupx;
w = (vid.width / vid.dupx)<<FRACBITS;
animtimer = ((finalecount*scrollspeed)/16) % SHORT(pat->width);
anim2 = SHORT(pat2->width) - (((finalecount*scrollspeed)/16) % SHORT(pat2->width));
// The scroll offset MUST be clamped before shifting by FRACBITS, or else it'll overflow in about 3 minutes
animtimer = ((((finalecount * scrollspeed) % (SHORT(pat->width)*16))<<FRACBITS) + (rendertimefrac * scrollspeed))/16;
anim2 = (SHORT(pat2->width)<<FRACBITS) - ((((finalecount * scrollspeed) % (SHORT(pat2->width)*16))<<FRACBITS) + (rendertimefrac * scrollspeed))/16;
// SRB2Kart: F_DrawPatchCol is over-engineered; recoded to be less shitty and error-prone
if (rendermode != render_none)
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
x = -((INT32)animtimer);
x = -animtimer;
y = 0;
while (x < w)
{
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, V_SNAPTOTOP|V_SNAPTOLEFT, pat, NULL);
x += SHORT(pat->width);
V_DrawFixedPatch(x, y, FRACUNIT, V_SNAPTOTOP|V_SNAPTOLEFT, pat, NULL);
x += SHORT(pat->width)<<FRACBITS;
}
x = -anim2;
y = BASEVIDHEIGHT - SHORT(pat2->height);
y = (BASEVIDHEIGHT - SHORT(pat2->height))<<FRACBITS;
while (x < w)
{
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, pat2, NULL);
x += SHORT(pat2->width);
V_DrawFixedPatch(x, y, FRACUNIT, V_SNAPTOBOTTOM|V_SNAPTOLEFT, pat2, NULL);
x += SHORT(pat2->width)<<FRACBITS;
}
}
@ -1243,7 +1244,7 @@ void F_TitleScreenDrawer(void)
if (finalecount >= 20)
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
else if (finalecount >= 10)
V_DrawSciencePatch((84<<FRACBITS) - FixedDiv(180<<FRACBITS, 10<<FRACBITS)*(20-finalecount), (87<<FRACBITS), 0, ttkart, FRACUNIT/2);
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - rendertimefrac), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
}
else if (finalecount < 52)
{
@ -1259,8 +1260,8 @@ void F_TitleScreenDrawer(void)
F_TitleBGScroll(5);
V_DrawSciencePatch(0, 0 - FixedMul(40<<FRACBITS, FixedDiv(finalecount%70, 70)), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + FixedMul(40<<FRACBITS, FixedDiv(finalecount%70, 70)), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
V_DrawSciencePatch(0, -40*FixedDiv(((finalecount % 70)<<FRACBITS) + rendertimefrac, 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + 40*FixedDiv(((finalecount % 70)<<FRACBITS) + rendertimefrac, 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
if (transval)
V_DrawFadeScreen(0, 10 - transval);

View file

@ -4024,7 +4024,8 @@ static void K_drawInput(void)
{
static INT32 pn = 0;
INT32 target = 0, splitflags = (V_SNAPTOBOTTOM|V_SNAPTORIGHT);
INT32 x = BASEVIDWIDTH - 32, y = BASEVIDHEIGHT-24, offs, col;
INT32 x = (BASEVIDWIDTH - 32)*FRACUNIT, y = (BASEVIDHEIGHT - 24)*FRACUNIT;
INT32 offs, col;
const INT32 accent1 = splitflags | skincolors[stplyr->skincolor].ramp[5];
const INT32 accent2 = splitflags | skincolors[stplyr->skincolor].ramp[9];
ticcmd_t *cmd = &stplyr->cmd;
@ -4035,17 +4036,17 @@ static void K_drawInput(void)
#define drawbutt(xoffs, butt, symb)\
if (!stplyr->exiting && (cmd->buttons & butt))\
{\
offs = 2;\
offs = 2*FRACUNIT;\
col = accent1;\
}\
else\
{\
offs = 0;\
col = accent2;\
V_DrawFill(x+(xoffs), y+BUTTH, BUTTW-1, 2, splitflags|31);\
V_DrawFill((x + xoffs*FRACUNIT)>>FRACBITS, (y + BUTTH*FRACUNIT)>>FRACBITS, BUTTW-1, 2, splitflags|31);\
}\
V_DrawFill(x+(xoffs), y+offs, BUTTW-1, BUTTH, col);\
V_DrawFixedPatch((x+1+(xoffs))<<FRACBITS, (y+offs+1)<<FRACBITS, FRACUNIT, splitflags, fontv[TINY_FONT].font[symb-HU_FONTSTART], NULL)
V_DrawFill((x + xoffs*FRACUNIT)>>FRACBITS, (y+offs)>>FRACBITS, BUTTW-1, BUTTH, col);\
V_DrawFixedPatch(x + FRACUNIT + xoffs*FRACUNIT, y + offs + FRACUNIT, FRACUNIT, splitflags, fontv[TINY_FONT].font[symb-HU_FONTSTART], NULL)
drawbutt(-2*BUTTW, BT_ACCELERATE, 'A');
drawbutt( -BUTTW, BT_BRAKE, 'B');
@ -4057,7 +4058,7 @@ static void K_drawInput(void)
#undef BUTTW
#undef BUTTH
y -= 1;
y -= FRACUNIT;
if (stplyr->exiting || !stplyr->cmd.turning) // no turn
target = 0;
@ -4083,7 +4084,7 @@ static void K_drawInput(void)
if (pn < 0)
{
splitflags |= V_FLIP; // right turn
x--;
x -= FRACUNIT;
}
target = abs(pn);
@ -4091,12 +4092,12 @@ static void K_drawInput(void)
target = 4;
if (!stplyr->skincolor)
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, splitflags, kp_inputwheel[target], NULL);
V_DrawFixedPatch(x, y, FRACUNIT, splitflags, kp_inputwheel[target], NULL);
else
{
UINT8 *colormap;
colormap = R_GetTranslationColormap(0, stplyr->skincolor, GTC_CACHE);
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, splitflags, kp_inputwheel[target], colormap);
V_DrawFixedPatch(x, y, FRACUNIT, splitflags, kp_inputwheel[target], colormap);
}
}
@ -4574,7 +4575,7 @@ void K_drawKartHUD(void)
{
if (demo.title) // Draw title logo instead in demo.titles
{
INT32 x = BASEVIDWIDTH - 32, y = 128, snapflags = V_SNAPTOBOTTOM|V_SNAPTORIGHT;
INT32 x = (BASEVIDWIDTH - 32), y = 128, snapflags = V_SNAPTOBOTTOM|V_SNAPTORIGHT;
if (r_splitscreen == 3)
{