From 03b04095847efffc2d9242b3ec08b3becaa0ce7a Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Mon, 29 Nov 2021 02:24:01 +0700 Subject: [PATCH] bring implementation of -timedemo in line with Chocolate Doom (#362) --- Source/d_loop.c | 12 +++++++++++- Source/d_main.c | 20 +------------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Source/d_loop.c b/Source/d_loop.c index 6fa0bf11..b57b68a8 100644 --- a/Source/d_loop.c +++ b/Source/d_loop.c @@ -754,7 +754,17 @@ void TryRunTics (void) realtics = entertic - oldentertics; oldentertics = entertic; - NetUpdate (); + // in singletics mode, run a single tic every time this function + // is called. + + if (singletics) + { + BuildNewTic(); + } + else + { + NetUpdate (); + } lowtic = GetLowTic(); diff --git a/Source/d_main.c b/Source/d_main.c index 903edf2b..2927bd1f 100644 --- a/Source/d_main.c +++ b/Source/d_main.c @@ -1856,10 +1856,6 @@ void D_DoomMain(void) { int p, slot; - ticcmd_t emptycmd; - - netcmds = &emptycmd; - setbuf(stdout,NULL); dsdh_InitTables(); @@ -2355,21 +2351,7 @@ void D_DoomMain(void) // frame syncronous IO operations I_StartFrame (); - // process one or more tics - if (singletics) - { - I_StartTic (); - D_ProcessEvents (); - G_BuildTiccmd (netcmds); - if (advancedemo) - D_DoAdvanceDemo (); - M_Ticker (); - G_Ticker (); - gametic++; - maketic++; - } - else - TryRunTics (); // will run at least one tic + TryRunTics (); // will run at least one tic // killough 3/16/98: change consoleplayer to displayplayer S_UpdateSounds(players[displayplayer].mo);// move positional sounds