Add cv_uncappedhud toggle and R_GetHudUncap
Turns out I need to AND with FRACMASK everywhere to avoid discrepencies, so might as well make a function for it (no, it's NOT interpolation, I swear...!)
This commit is contained in:
1 parent
4ed335422c
commit
c51cfcd817
7 files changed
+32
-20
No files matched your search
+5
-5
@@ -169,8 +169,8 @@ static void F_SkyScroll(INT32 scrollspeed)
|
||||
w = (vid.width / vid.dupx)<<FRACBITS;
|
||||
|
||||
// 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;
|
||||
animtimer = ((((finalecount * scrollspeed) % (SHORT(pat->width)*16))<<FRACBITS) + (R_GetHudUncap() * scrollspeed))/16;
|
||||
anim2 = (SHORT(pat2->width)<<FRACBITS) - ((((finalecount * scrollspeed) % (SHORT(pat2->width)*16))<<FRACBITS) + (R_GetHudUncap() * scrollspeed))/16;
|
||||
|
||||
// SRB2Kart: F_DrawPatchCol is over-engineered; recoded to be less shitty and error-prone
|
||||
if (rendermode != render_none)
|
||||
@@ -993,7 +993,7 @@ void F_TitleScreenDrawer(void)
|
||||
if (finalecount >= 20)
|
||||
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
|
||||
else if (finalecount >= 10)
|
||||
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - rendertimefrac), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
|
||||
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - R_GetHudUncap()), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
|
||||
}
|
||||
else if (finalecount < 52)
|
||||
{
|
||||
@@ -1009,8 +1009,8 @@ void F_TitleScreenDrawer(void)
|
||||
|
||||
F_SkyScroll(titlescrollspeed);
|
||||
|
||||
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);
|
||||
V_DrawSciencePatch(0, -40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetHudUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
|
||||
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + 40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetHudUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
|
||||
|
||||
if (transval)
|
||||
V_DrawFadeScreen(120, 10 - transval);
|
||||
|
||||
+9
-10
@@ -9636,7 +9636,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
|
||||
yscale = FixedDiv(AutomapPic->height, mapheight);
|
||||
zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20);
|
||||
|
||||
#define lerp(from, to) from + FixedMul(rendertimefrac, to - from)
|
||||
#define lerp(from, to) cv_uncappedhud.value ? from + FixedMul(rendertimefrac, to - from) : to
|
||||
amnumxpos = (FixedMul(lerp(mo->old_x, mo->x), zoom) - FixedMul(xoffset, zoom));
|
||||
amnumypos = -(FixedMul(lerp(mo->old_y, mo->y), zoom) - FixedMul(yoffset, zoom));
|
||||
#undef lerp
|
||||
@@ -9854,7 +9854,7 @@ static void K_drawKartFinish(void)
|
||||
|
||||
x = ((vid.width<<FRACBITS)/vid.dupx);
|
||||
xval = (SHORT(kp_racefinish[pnum]->width)<<FRACBITS);
|
||||
x = (FixedMul(((TICRATE - stplyr->kartstuff[k_cardanimation])<<FRACBITS) - rendertimefrac, xval > x ? xval : x))/TICRATE;
|
||||
x = (FixedMul(((TICRATE - stplyr->kartstuff[k_cardanimation])<<FRACBITS) - R_GetHudUncap(), xval > x ? xval : x))/TICRATE;
|
||||
|
||||
if (splitscreen && stplyr == &players[displayplayers[1]])
|
||||
x = -x;
|
||||
@@ -9873,7 +9873,7 @@ static void K_drawBattleFullscreen(void)
|
||||
// fill in the fractional bits
|
||||
if (cardanim && cardanim != 164*FRACUNIT)
|
||||
{
|
||||
INT32 frac = (rendertimefrac & FRACMASK) * ((164 - stplyr->kartstuff[k_cardanimation])/8 + 1);
|
||||
INT32 frac = R_GetHudUncap() * ((164 - stplyr->kartstuff[k_cardanimation])/8 + 1);
|
||||
if (stplyr->exiting)
|
||||
cardanim += frac;
|
||||
else
|
||||
@@ -10171,12 +10171,12 @@ static void K_drawInput(void)
|
||||
if (timeinmap < 113)
|
||||
{
|
||||
INT32 count = ((INT32)(timeinmap) - 105);
|
||||
INT32 frac = count > 0 && count < 6 ? rendertimefrac << (FRACBITS - count - 11) : 0;
|
||||
INT32 frac = count > 0 && count < 6 ? R_GetHudUncap() << (FRACBITS - count - 11) : 0;
|
||||
|
||||
offs = 64*FRACUNIT;
|
||||
while (count-- > 0)
|
||||
offs >>= 1;
|
||||
x += offs - frac;
|
||||
x += (offs < FRACUNIT ? 0 : offs) - frac;
|
||||
}
|
||||
|
||||
#define BUTTW 8
|
||||
@@ -10273,9 +10273,8 @@ static void K_drawLapStartAnim(void)
|
||||
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
|
||||
INT32 vflags = V_SNAPTOTOP|V_HUDTRANS;
|
||||
|
||||
fixed_t frac = rendertimefrac & FRACMASK;
|
||||
fixed_t slideout = max(0, 32*(((progress - 76)*FRACUNIT) + frac));
|
||||
fixed_t slidein = max(0, 32*(((stplyr->kartstuff[k_lapanimation] - 76)*FRACUNIT) - frac));
|
||||
fixed_t slideout = max(0, 32*(((progress - 76)*FRACUNIT) + R_GetHudUncap()));
|
||||
fixed_t slidein = max(0, 32*(((stplyr->kartstuff[k_lapanimation] - 76)*FRACUNIT) - R_GetHudUncap()));
|
||||
|
||||
// First, draw the emblem and hand
|
||||
INT32 emblemx = (BASEVIDWIDTH << (FRACBITS - 1)) + slidein;
|
||||
@@ -10286,7 +10285,7 @@ static void K_drawLapStartAnim(void)
|
||||
INT32 hand = stplyr->kartstuff[k_laphand];
|
||||
if (hand >= 1 && hand <= 3)
|
||||
{
|
||||
y += 4*FRACUNIT - abs((int)(leveltime % 8)*FRACUNIT + rendertimefrac - 4*FRACUNIT);
|
||||
y += 4*FRACUNIT - abs((int)(leveltime % 8)*FRACUNIT + R_GetHudUncap() - 4*FRACUNIT);
|
||||
V_DrawFixedPatch(emblemx, y, FRACUNIT, vflags, kp_lapanim_hand[hand - 1], NULL);
|
||||
}
|
||||
|
||||
@@ -10564,7 +10563,7 @@ void K_drawKartHUD(void)
|
||||
if (timeinmap < 113)
|
||||
{
|
||||
INT32 count = ((INT32)(timeinmap) - 104);
|
||||
INT32 frac = count > 0 ? rendertimefrac << max(0, FRACBITS - count - 9) : 0;
|
||||
INT32 frac = count > 0 ? R_GetHudUncap() << max(0, FRACBITS - count - 9) : 0;
|
||||
|
||||
offs = 256*FRACUNIT;
|
||||
while (count-- > 0)
|
||||
|
||||
@@ -2013,6 +2013,8 @@ static menuitem_t OP_SaturnMenu[] =
|
||||
{IT_STRING | IT_SUBMENU, NULL, "Nametags...", &OP_NametagDef, 90},
|
||||
{IT_STRING | IT_SUBMENU, NULL, "Driftgauge...", &OP_DriftGaugeDef, 95},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Uncapped HUD", &cv_uncappedhud, 105},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 115},
|
||||
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Sprite Distortion...", &OP_PlayerDistortDef, 125},
|
||||
@@ -2040,6 +2042,7 @@ static const char* OP_SaturnTooltips[] =
|
||||
"Show Localskin Menus.",
|
||||
"Nametag Options.",
|
||||
"Driftgauge Options.",
|
||||
"Uncaps the HUD framerate, making it appear smoother.",
|
||||
"Disables the flicker effect on Midnight Channel.",
|
||||
"Options for sprite distortion effects.",
|
||||
"Move position of HUD elements.",
|
||||
@@ -2065,6 +2068,7 @@ enum
|
||||
sm_showlocalskin,
|
||||
sm_nametagmen,
|
||||
sm_driftgaugemen,
|
||||
sm_uncappedhud,
|
||||
sm_pisschannel,
|
||||
sm_distortionmenu,
|
||||
sm_hudoffsets,
|
||||
|
||||
@@ -196,6 +196,7 @@ consvar_t cv_soniccd = {"soniccd", "Off", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NUL
|
||||
consvar_t cv_allowmlook = {"allowmlook", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_showhud = {"showhud", "Yes", CV_CALL, CV_YesNo, R_SetViewSize, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_translucenthud = {"translucenthud", "10", CV_SAVE, translucenthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_uncappedhud = {"uncappedhud", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_translucency = {"translucency", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_drawdist = {"drawdist", "Infinite", CV_SAVE, drawdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -512,6 +513,11 @@ fixed_t R_PointToDist(fixed_t x, fixed_t y)
|
||||
return R_PointToDist2(viewx, viewy, x, y);
|
||||
}
|
||||
|
||||
INT32 R_GetHudUncap(void)
|
||||
{
|
||||
return cv_uncappedhud.value ? rendertimefrac & FRACMASK : 0;
|
||||
}
|
||||
|
||||
//
|
||||
// R_ScaleFromGlobalAngle
|
||||
// Returns the texture mapping scale for the current line (horizontal span)
|
||||
@@ -1862,6 +1868,7 @@ void R_RegisterEngineStuff(void)
|
||||
|
||||
CV_RegisterVar(&cv_showhud);
|
||||
CV_RegisterVar(&cv_translucenthud);
|
||||
CV_RegisterVar(&cv_uncappedhud);
|
||||
|
||||
CV_RegisterVar(&cv_maxportals);
|
||||
|
||||
|
||||
+4
-1
@@ -106,7 +106,7 @@ extern ps_metric_t ps_numpolyobjects;
|
||||
// REFRESH - the actual rendering functions.
|
||||
//
|
||||
|
||||
extern consvar_t cv_showhud, cv_translucenthud;
|
||||
extern consvar_t cv_showhud, cv_translucenthud, cv_uncappedhud;
|
||||
extern consvar_t cv_homremoval;
|
||||
extern consvar_t cv_chasecam, cv_chasecam2, cv_chasecam3, cv_chasecam4;
|
||||
extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4;
|
||||
@@ -140,4 +140,7 @@ void R_RenderPlayerView(player_t *player);
|
||||
|
||||
// add commands related to engine, at game startup
|
||||
void R_RegisterEngineStuff(void);
|
||||
|
||||
// return multiplier for HUD uncap
|
||||
INT32 R_GetHudUncap(void);
|
||||
#endif
|
||||
+1
-1
@@ -741,7 +741,7 @@ static void ST_drawLevelTitle(void)
|
||||
|
||||
// uh... "fill in the bits" of sub, or something... no idea what I came up with
|
||||
// VERY janky, but doesn't require m_easing
|
||||
INT32 frac = (FixedMul(rendertimefrac, FixedDiv(dupcalc, BASEVIDWIDTH)) >> (count + 4))/13; // these two magic numbers seem to do the trick
|
||||
INT32 frac = (FixedMul(R_GetHudUncap(), FixedDiv(dupcalc, BASEVIDWIDTH)) >> (count + 4))/13; // these two magic numbers seem to do the trick
|
||||
|
||||
sub = dupcalc;
|
||||
while (count-- > 0)
|
||||
|
||||
+2
-3
@@ -432,12 +432,11 @@ void Y_IntermissionDrawer(void)
|
||||
if (sorttic != -1 && intertic >= sorttic && !demo.playback)
|
||||
{
|
||||
INT32 count = (intertic - sorttic);
|
||||
INT32 frac = rendertimefrac & FRACMASK;
|
||||
|
||||
if (count < 8)
|
||||
x -= ((((count<<FRACBITS) + frac) * vid.width)>>FRACBITS) / (8 * vid.dupx);
|
||||
x -= ((((count<<FRACBITS) + R_GetHudUncap()) * vid.width)>>FRACBITS) / (8 * vid.dupx);
|
||||
else if (count < 16)
|
||||
x += (((((16 - count)<<FRACBITS) - frac) * vid.width)>>FRACBITS) / (8 * vid.dupx);
|
||||
x += (((((16 - count)<<FRACBITS) - R_GetHudUncap()) * vid.width)>>FRACBITS) / (8 * vid.dupx);
|
||||
}
|
||||
|
||||
// SRB2kart 290117 - compeltely replaced this block.
|
||||
|
||||
Reference in new issue
Block a user