From ee80592a6f0f3d2c6ebfb0e3a7c520692a79f391 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sat, 21 Jul 2018 17:37:15 +0200 Subject: [PATCH] Disable properly the mixer fade out only with emscripten It's not supported for an unknown reason. --- src/sound.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sound.cxx b/src/sound.cxx index e5f5ed2..922a010 100644 --- a/src/sound.cxx +++ b/src/sound.cxx @@ -23,6 +23,7 @@ #include "def.h" #include "event.h" #include "misc.h" +#include "platform.h" #include "sound.h" // Stops all sounds. @@ -40,10 +41,11 @@ CSound::StopAllSounds (bool immediat, const std::set * except) if (Mix_Playing (i + 1) == SDL_TRUE) { - //if (immediat) + /* FIXME: add support of fade out with emscripten */ + if (immediat && Platform::getType () == Platform::Type::SDL) Mix_HaltChannel (i + 1); - //else - // Mix_FadeOutChannel (i + 1, 500); + else + Mix_FadeOutChannel (i + 1, 500); } }