From 55d213435a47ed99d824c570f2979c37c1011c08 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 18 Jan 2011 04:56:42 +0000 Subject: [PATCH] - changed music change-over during game start so that background music continues to play while waiting for network clients --- source/glest_game/game/game.cpp | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 91918ef06..44480cb96 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -610,26 +610,6 @@ void Game::init(bool initForPreviewOnly) SDL_PumpEvents(); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - //sounds - - SoundRenderer &soundRenderer= SoundRenderer::getInstance(); - soundRenderer.stopAllSounds(); - soundRenderer= SoundRenderer::getInstance(); - - Tileset *tileset= world.getTileset(); - AmbientSounds *ambientSounds= tileset->getAmbientSounds(); - - //rain - if(tileset->getWeather() == wRainy && ambientSounds->isEnabledRain()) { - logger.add("Starting ambient stream", true); - soundRenderer.playAmbient(ambientSounds->getRain()); - } - - //snow - if(tileset->getWeather() == wSnowy && ambientSounds->isEnabledSnow()) { - logger.add("Starting ambient stream", true); - soundRenderer.playAmbient(ambientSounds->getSnow()); - } SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Waiting for network\n",__FILE__,__FUNCTION__); logger.add("Waiting for network players", true); @@ -650,6 +630,26 @@ void Game::init(bool initForPreviewOnly) // throw runtime_error("world.getThisFaction()->getType()->getMusic() == NULL"); //} + //sounds + SoundRenderer &soundRenderer= SoundRenderer::getInstance(); + soundRenderer.stopAllSounds(); + soundRenderer= SoundRenderer::getInstance(); + + Tileset *tileset= world.getTileset(); + AmbientSounds *ambientSounds= tileset->getAmbientSounds(); + + //rain + if(tileset->getWeather() == wRainy && ambientSounds->isEnabledRain()) { + logger.add("Starting ambient stream", true); + soundRenderer.playAmbient(ambientSounds->getRain()); + } + + //snow + if(tileset->getWeather() == wSnowy && ambientSounds->isEnabledSnow()) { + logger.add("Starting ambient stream", true); + soundRenderer.playAmbient(ambientSounds->getSnow()); + } + StrSound *gameMusic= world.getThisFaction()->getType()->getMusic(); soundRenderer.playMusic(gameMusic);