Make DoTitle take the title of an ambient track by reference. Update DoLevel to do the same.

This commit is contained in:
hispidence 2022-01-30 18:05:13 +00:00
parent 14f0b710fb
commit b3443ba328
3 changed files with 6 additions and 6 deletions

View file

@ -74,8 +74,8 @@ extern std::vector<short> OutsideRoomTable[OUTSIDE_SIZE][OUTSIDE_SIZE];
int DrawPhase(); int DrawPhase();
GAME_STATUS DoTitle(int index); GAME_STATUS DoTitle(int index, std::string const & ambient);
GAME_STATUS DoLevel(int index, std::string ambient, bool loadFromSavegame); GAME_STATUS DoLevel(int index, std::string const & ambient, bool loadFromSavegame);
GAME_STATUS ControlPhase(int numFrames, int demoMode); GAME_STATUS ControlPhase(int numFrames, int demoMode);
int GetRandomControl(); int GetRandomControl();

View file

@ -230,7 +230,7 @@ bool GameFlow::DoGameflow()
if (CurrentLevel == 0) if (CurrentLevel == 0)
{ {
status = DoTitle(0); status = DoTitle(0, level->AmbientTrack);
} }
else else
{ {

View file

@ -450,7 +450,7 @@ unsigned CALLBACK GameMain(void *)
return true; return true;
} }
GAME_STATUS DoTitle(int index) GAME_STATUS DoTitle(int index, std::string const & ambient)
{ {
TENLog("DoTitle", LogLevel::Info); TENLog("DoTitle", LogLevel::Info);
@ -499,7 +499,7 @@ GAME_STATUS DoTitle(int index)
UseSpotCam = true; UseSpotCam = true;
// Play background music // Play background music
PlaySoundTrack(83); PlaySoundTrack(ambient);
// Initialize menu // Initialize menu
g_Gui.SetMenuToDisplay(Menu::Title); g_Gui.SetMenuToDisplay(Menu::Title);
@ -560,7 +560,7 @@ GAME_STATUS DoTitle(int index)
return GAME_STATUS::GAME_STATUS_NEW_GAME; 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 not loading a savegame, then clear all the infos
if (!loadFromSavegame) if (!loadFromSavegame)