From 5ee20018d8adfb6f0b387a68084d4f23feb60eb2 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 21 Oct 2011 22:42:59 +0000 Subject: [PATCH] d new way to manage the sound fade for game start/stop via optional ini: GameStartStopFadeSoundMilliseconds=3500 --- source/glest_game/game/game.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index b456a843..6e2cc642 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -46,7 +46,7 @@ const float PHOTO_MODE_MAXHEIGHT = 500.0; const int CREATE_NEW_TEAM = -100; const int CANCEL_SWITCH_TEAM = -1; -const int fadeMusicMilliseconds = 3500; +int fadeMusicMilliseconds = 3500; Game::Game() : ProgramState(NULL) { if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); @@ -106,6 +106,8 @@ Game::Game() : ProgramState(NULL) { currentUIState=NULL; currentAmbientSound=NULL; //printf("In [%s:%s] Line: %d currentAmbientSound = [%p]\n",__FILE__,__FUNCTION__,__LINE__,currentAmbientSound); + + fadeMusicMilliseconds = Config::getInstance().getInt("GameStartStopFadeSoundMilliseconds",intToStr(fadeMusicMilliseconds).c_str()); } void Game::resetMembers() { @@ -174,6 +176,8 @@ void Game::resetMembers() { currentAmbientSound=NULL; //printf("In [%s:%s] Line: %d currentAmbientSound = [%p]\n",__FILE__,__FUNCTION__,__LINE__,currentAmbientSound); + fadeMusicMilliseconds = Config::getInstance().getInt("GameStartStopFadeSoundMilliseconds",intToStr(fadeMusicMilliseconds).c_str()); + Object::setStateCallback(&gui); Logger &logger= Logger::getInstance();