From b3443ba32857de9d14968ad2e7ce0ca1bfecc16c Mon Sep 17 00:00:00 2001 From: hispidence Date: Sun, 30 Jan 2022 18:05:13 +0000 Subject: [PATCH] Make DoTitle take the title of an ambient track by reference. Update DoLevel to do the same. --- Common/Game/control/control.h | 4 ++-- Scripting/src/GameFlowScript.cpp | 2 +- TR5Main/Game/control/control.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Common/Game/control/control.h b/Common/Game/control/control.h index ff914a783..9c92e8562 100644 --- a/Common/Game/control/control.h +++ b/Common/Game/control/control.h @@ -74,8 +74,8 @@ extern std::vector OutsideRoomTable[OUTSIDE_SIZE][OUTSIDE_SIZE]; int DrawPhase(); -GAME_STATUS DoTitle(int index); -GAME_STATUS DoLevel(int index, std::string ambient, bool loadFromSavegame); +GAME_STATUS DoTitle(int index, std::string const & ambient); +GAME_STATUS DoLevel(int index, std::string const & ambient, bool loadFromSavegame); GAME_STATUS ControlPhase(int numFrames, int demoMode); int GetRandomControl(); diff --git a/Scripting/src/GameFlowScript.cpp b/Scripting/src/GameFlowScript.cpp index 61783d0ff..679982bcd 100644 --- a/Scripting/src/GameFlowScript.cpp +++ b/Scripting/src/GameFlowScript.cpp @@ -230,7 +230,7 @@ bool GameFlow::DoGameflow() if (CurrentLevel == 0) { - status = DoTitle(0); + status = DoTitle(0, level->AmbientTrack); } else { diff --git a/TR5Main/Game/control/control.cpp b/TR5Main/Game/control/control.cpp index 0703e9dd7..8711c8cfe 100644 --- a/TR5Main/Game/control/control.cpp +++ b/TR5Main/Game/control/control.cpp @@ -450,7 +450,7 @@ unsigned CALLBACK GameMain(void *) return true; } -GAME_STATUS DoTitle(int index) +GAME_STATUS DoTitle(int index, std::string const & ambient) { TENLog("DoTitle", LogLevel::Info); @@ -499,7 +499,7 @@ GAME_STATUS DoTitle(int index) UseSpotCam = true; // Play background music - PlaySoundTrack(83); + PlaySoundTrack(ambient); // Initialize menu g_Gui.SetMenuToDisplay(Menu::Title); @@ -560,7 +560,7 @@ GAME_STATUS DoTitle(int index) return GAME_STATUS::GAME_STATUS_NEW_GAME; } -GAME_STATUS DoLevel(int index, std::string ambient, bool loadFromSavegame) +GAME_STATUS DoLevel(int index, std::string const & ambient, bool loadFromSavegame) { // If not loading a savegame, then clear all the infos if (!loadFromSavegame)