diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index f667108f7..9bfa72bbf 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -82,7 +82,7 @@ extern int nomusic; extern bool nosound; inline bool MusicEnabled() { - return !nomusic; + return mus_enabled && !nomusic; } inline bool SoundEnabled() diff --git a/source/core/movie/playmve.cpp b/source/core/movie/playmve.cpp index e79545d06..97a311f15 100644 --- a/source/core/movie/playmve.cpp +++ b/source/core/movie/playmve.cpp @@ -110,10 +110,10 @@ static bool StreamCallbackFunc(SoundStream* stream, void* buff, int len, void* u return true; } -InterplayDecoder::InterplayDecoder() +InterplayDecoder::InterplayDecoder(bool soundenabled) { bIsPlaying = false; - bAudioStarted = false; + bAudioStarted = !soundenabled; // This prevents the stream from getting created nWidth = 0; nHeight = 0; diff --git a/source/core/movie/playmve.h b/source/core/movie/playmve.h index 8bac67dc9..77e89a10b 100644 --- a/source/core/movie/playmve.h +++ b/source/core/movie/playmve.h @@ -98,7 +98,7 @@ public: kAudioBlocks = 20 // alloc a lot of blocks - need to store lots of audio data before video frames start. }; - InterplayDecoder(); + InterplayDecoder(bool soundenabled); ~InterplayDecoder(); bool Open(FileReader &fr); diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index a12489d1c..4a5bda4f5 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -194,7 +194,7 @@ class DMvePlayer : public DScreenJob public: bool isvalid() { return !failed; } - DMvePlayer(FileReader& fr) + DMvePlayer(FileReader& fr) : decoder(SoundEnabled()) { failed = !decoder.Open(fr); } @@ -302,7 +302,7 @@ public: int sound = animSnd[i].soundnum; if (sound == -1) soundEngine->StopAllChannels(); - else + else if (SoundEnabled()) soundEngine->StartSound(SOURCE_None, nullptr, nullptr, CHAN_AUTO, CHANF_UI, sound, 1.f, ATTN_NONE); } }