From 64a96e1b946ca4f5d4e93f964bda331782a6ea34 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 1 Oct 2022 09:16:47 +0200 Subject: [PATCH] - fixed: RR: save the current track for the "8-track player" This way a saved game can properly resume the loop. --- source/games/duke/src/global.h | 1 + source/games/duke/src/savegame.cpp | 1 + source/games/duke/src/sounds.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/global.h b/source/games/duke/src/global.h index 1c8b96ee6..95623c3ee 100644 --- a/source/games/duke/src/global.h +++ b/source/games/duke/src/global.h @@ -130,6 +130,7 @@ extern short BellTime; extern uint8_t enemysizecheat /*raat607*/, ufospawnsminion, pistonsound, chickenphase /* raat605*/, RRRA_ExitedLevel, fogactive; extern uint32_t everyothertime; extern player_orig po[MAXPLAYERS]; +extern int32_t g_cdTrack; END_DUKE_NS diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index 17e84c8ac..047397e06 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -444,6 +444,7 @@ void GameInterface::SerializeGameState(FSerializer& arc) ("fogactive", fogactive) ("thunder_brightness", thunder_brightness) .Array("po", po, ud.multimode) + ("rrcdtrack", g_cdTrack) .EndObject(); lava_serialize(arc); diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index 2b518cdf9..2f987e68b 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -54,6 +54,8 @@ CVAR(Bool, wt_commentary, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) BEGIN_DUKE_NS +int32_t g_cdTrack = -1; + static FSoundID currentCommentarySound; void UnmuteSounds() @@ -693,8 +695,6 @@ void S_PlaySpecialMusic(unsigned int m) void S_PlayRRMusic(int newTrack) { - static int32_t g_cdTrack = -1; - if (!isRR() || !mus_redbook || cd_disabled || currentLevel->music.IsNotEmpty()) return; Mus_Stop();