mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 10:49:48 +02:00
- changed music change-over during game start so that background music continues to play while waiting for network clients
This commit is contained in:
@@ -610,26 +610,6 @@ void Game::init(bool initForPreviewOnly)
|
|||||||
SDL_PumpEvents();
|
SDL_PumpEvents();
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
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__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Waiting for network\n",__FILE__,__FUNCTION__);
|
||||||
logger.add("Waiting for network players", true);
|
logger.add("Waiting for network players", true);
|
||||||
@@ -650,6 +630,26 @@ void Game::init(bool initForPreviewOnly)
|
|||||||
// throw runtime_error("world.getThisFaction()->getType()->getMusic() == NULL");
|
// 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();
|
StrSound *gameMusic= world.getThisFaction()->getType()->getMusic();
|
||||||
soundRenderer.playMusic(gameMusic);
|
soundRenderer.playMusic(gameMusic);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user