tiny d_main cleanup

This commit is contained in:
Alug committed 2025-03-05 10:37:10 +01:00
1 parent 7235f9864e
commit b069c2cb3e
2 files changed
+11 -16

No files matched your search

+1 -1
View File
@@ -6284,8 +6284,8 @@ static void Local_Maketic(INT32 realtics)
// game responder calls HU_Responder, AM_Responder, F_Responder,
// and G_MapEventsToControls
if (!dedicated) rendergametic = gametic;
// translate inputs (keyboard/mouse/joystick) into game controls
// translate inputs (keyboard/mouse/joystick) into game controls
for (i = 0; i <= splitscreen; i++)
{
CreateNewLocalCMD(i, realtics);
+10 -15
View File
@@ -356,6 +356,7 @@ static boolean D_Display(void)
// save the current screen if about to wipe
wipe = (gamestate != wipegamestate);
if (wipe)
{
// set for all later
@@ -745,11 +746,9 @@ void D_SRB2Loop(void)
precise_t enterprecise = I_GetPreciseTime();
precise_t finishprecise = enterprecise;
{
// Casting the return value of a function is bad practice (apparently)
double budget = ((R_GetFramerateCap() == 0) ? 0.0 : round((1.0 / R_GetFramerateCap()) * I_GetPrecisePrecision()));
capbudget = (precise_t) budget;
}
// Casting the return value of a function is bad practice (apparently)
double budget = ((R_GetFramerateCap() == 0) ? 0.0 : round((1.0 / R_GetFramerateCap()) * I_GetPrecisePrecision()));
capbudget = (precise_t) budget;
boolean ranwipe = false;
@@ -795,7 +794,7 @@ void D_SRB2Loop(void)
// process tics (but maybe not if realtic == 0)
TryRunTics(realtics);
if (lastdraw || singletics || gametic > rendergametic)
if (lastdraw || singletics || (gametic > rendergametic))
{
rendergametic = gametic;
rendertimeout = entertic + TICRATE/17;
@@ -809,7 +808,7 @@ void D_SRB2Loop(void)
{
// Evaluate the chase cam once for every local realtic
// This might actually be better suited inside G_Ticker or TryRunTics
for (tic_t chasecamtics = 0; chasecamtics < realtics; chasecamtics++)
for (tic_t chasecamtics = 0; (chasecamtics < realtics); chasecamtics++)
{
P_RunChaseCameras();
}
@@ -840,7 +839,7 @@ void D_SRB2Loop(void)
rendertimefrac = FRACUNIT;
}
if (!hu_stopped)
if ((deltatics < 1.0) && !hu_stopped)
{
rendertimefrac_unpaused = g_time.timefrac;
}
@@ -895,7 +894,7 @@ void D_SRB2Loop(void)
//
// Wipes run an inner loop and artificially increase
// the measured time.
if (!ranwipe && frameskip < 3 && deltatics > 1.0)
if (!ranwipe && (frameskip < 3) && (deltatics > 1.0))
{
frameskip++;
}
@@ -911,7 +910,7 @@ void D_SRB2Loop(void)
// in the case of "match refresh rate" + vsync, don't sleep at all
const boolean vsync_with_match_refresh = cv_vidwait.value && cv_fpscap.value == 0;
if (elapsed > 0 && (INT64)capbudget > elapsed && !vsync_with_match_refresh)
if ((elapsed > 0) && ((INT64)capbudget > elapsed) && !vsync_with_match_refresh)
{
I_SleepDuration(capbudget - (finishprecise - enterprecise));
}
@@ -986,10 +985,6 @@ void D_StartTitle(void)
S_ResetKeepAndSpecialMus(); // just in case
F_StartTitleScreen();
// Reset the palette -- SRB2Kart: actually never mind let's do this in the middle of every fade
/*if (rendermode != render_none)
V_SetPaletteLump("PLAYPAL");*/
}
//
@@ -2087,7 +2082,7 @@ void D_SRB2Main(void)
}
#ifdef HAVE_DISCORDRPC
if (! dedicated)
if (!dedicated)
{
DRPC_Init();
}