From: Holger Schemel Date: Sat, 10 Feb 2024 20:16:05 +0000 (+0100) Subject: added separate time counter for tape time frames X-Git-Tag: 4.4.0.0-test-1~414 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=536a326a06ee35572a2717e9b4cb90830cb5c677;p=rocksndiamonds.git added separate time counter for tape time frames --- diff --git a/src/game.c b/src/game.c index 3f02c087..789fb015 100644 --- a/src/game.c +++ b/src/game.c @@ -3843,6 +3843,8 @@ void InitGame(void) TimeFrames = 0; TimePlayed = 0; TimeLeft = level.time; + + TapeTimeFrames = 0; TapeTime = 0; ScreenMovDir = MV_NONE; @@ -11679,7 +11681,6 @@ static void CheckLevelTime(void) if (TimeFrames >= FRAMES_PER_SECOND) { TimeFrames = 0; - TapeTime++; for (i = 0; i < MAX_PLAYERS; i++) { @@ -11726,6 +11727,12 @@ static void CheckLevelTime(void) game_em.lev->time = (game.no_level_time_limit ? TimePlayed : TimeLeft); } + } + + if (TapeTimeFrames >= FRAMES_PER_SECOND) + { + TapeTimeFrames = 0; + TapeTime++; if (tape.recording || tape.playing) DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime); @@ -11741,8 +11748,11 @@ void AdvanceFrameAndPlayerCounters(int player_nr) { int i; - // advance frame counters (global frame counter and time frame counter) + // advance frame counters (global frame counter and tape time frame counter) FrameCounter++; + TapeTimeFrames++; + + // advance time frame counter (used to control available time to solve level) TimeFrames++; // advance player counters (counters for move delay, move animation etc.) @@ -16036,6 +16046,7 @@ static ListNode *SaveEngineSnapshotBuffers(void) SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TimeFrames)); SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TimePlayed)); SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TimeLeft)); + SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TapeTimeFrames)); SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(TapeTime)); SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(ScreenMovDir)); diff --git a/src/main.c b/src/main.c index 168a650b..d3241c11 100644 --- a/src/main.c +++ b/src/main.c @@ -124,7 +124,8 @@ int BX2, BY2; int SBX_Left, SBX_Right; int SBY_Upper, SBY_Lower; -int TimeFrames, TimePlayed, TimeLeft, TapeTime; +int TimeFrames, TimePlayed, TimeLeft; +int TapeTimeFrames, TapeTime; boolean network_player_action_received = FALSE; diff --git a/src/main.h b/src/main.h index e5f50a4e..29069466 100644 --- a/src/main.h +++ b/src/main.h @@ -3916,7 +3916,8 @@ extern int BX2, BY2; extern int SBX_Left, SBX_Right; extern int SBY_Upper, SBY_Lower; -extern int TimeFrames, TimePlayed, TimeLeft, TapeTime; +extern int TimeFrames, TimePlayed, TimeLeft; +extern int TapeTimeFrames, TapeTime; extern boolean network_player_action_received;