Add g_fast_forward_clock_stop, means to end g_fast_forward early if too much real world time is taken

This commit is contained in:
James R 2024-03-18 02:19:40 -07:00
parent 4281cd1283
commit 0ce93b2d96
3 changed files with 14 additions and 0 deletions

View file

@ -150,6 +150,7 @@ boolean g_singletics = false; // timedemo
boolean lastdraw = false;
tic_t g_fast_forward = 0;
tic_t g_fast_forward_clock_stop = INFTICS;
postimg_t postimgtype[MAXSPLITSCREENPLAYERS];
INT32 postimgparam[MAXSPLITSCREENPLAYERS];

View file

@ -927,6 +927,7 @@ extern INT16 wipetypepost;
// debug flag to cancel adaptiveness
extern boolean g_singletics;
extern tic_t g_fast_forward;
extern tic_t g_fast_forward_clock_stop;
#define singletics (g_singletics == true || g_fast_forward > 0)

View file

@ -2030,7 +2030,19 @@ void G_Ticker(boolean run)
if (g_fast_forward > 0)
{
if (I_GetTime() > g_fast_forward_clock_stop)
{
// If too much real time has passed, end the fast-forward early.
g_fast_forward = 1;
}
g_fast_forward--;
if (g_fast_forward == 0)
{
// Next fast-forward is unlimited.
g_fast_forward_clock_stop = INFTICS;
}
}
}
}