summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-04-11 21:56:38 +0200
committerAndrei Karas <akaras@inbox.ru>2011-04-28 02:41:43 +0300
commit4cd8cf7f527553abad86c07c8ebbb2ba8b5d3699 (patch)
tree2fce080e3001a53cbabc8468b98c84b4afd84444 /src/game.cpp
parent24662442f04d3c70aef4b0502545e346b6c63f67 (diff)
downloadplus-4cd8cf7f527553abad86c07c8ebbb2ba8b5d3699.tar.gz
plus-4cd8cf7f527553abad86c07c8ebbb2ba8b5d3699.tar.bz2
plus-4cd8cf7f527553abad86c07c8ebbb2ba8b5d3699.tar.xz
plus-4cd8cf7f527553abad86c07c8ebbb2ba8b5d3699.zip
Implemented a simple non-blocking fadeOutAndPlay system.
It's currently used when changing maps. Resolves: TMW-Mantis: #750. Reviewed-by: Thorbjorn. Conflicts: src/game.cpp src/sound.cpp src/sound.h
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index d5ac15ef3..3c3067bbf 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1430,7 +1430,12 @@ void Game::changeMap(const std::string &mapPath)
std::string oldMusic = mCurrentMap ? mCurrentMap->getMusicFile() : "";
std::string newMusic = newMap ? newMap->getMusicFile() : "";
if (newMusic != oldMusic)
- sound.playMusic(newMusic);
+ {
+ if (newMusic.empty())
+ sound.fadeOutMusic();
+ else
+ sound.fadeOutAndPlayMusic(newMusic);
+ }
if (mCurrentMap)
mCurrentMap->saveExtraLayer();