diff options
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 1 | ||||
-rw-r--r-- | engines/mortevielle/sound.cpp | 7 | ||||
-rw-r--r-- | engines/mortevielle/sound.h | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 104a340317..54bd0301aa 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -78,6 +78,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g _screenSurface.setParent(this); _mouse.setParent(this); _text.setParent(this); + _soundManager.setParent(this); _lastGameFrame = 0; _mouseClick = false; diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp index bb85221d75..478af41c87 100644 --- a/engines/mortevielle/sound.cpp +++ b/engines/mortevielle/sound.cpp @@ -192,10 +192,13 @@ void SoundManager::musyc(tablint &tb, int nbseg, int att) { } // Keep waiting until the song has been finished - while (_speakerStream->isPlaying() && !g_vm->shouldQuit()) { - g_vm->delay(10); + while (_speakerStream->isPlaying() && !_vm->shouldQuit()) { + _vm->delay(10); } #endif } +void SoundManager::setParent(MortevielleEngine *vm) { + _vm = vm; +} } // End of namespace Mortevielle diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h index 675fc78f78..a47e8db32e 100644 --- a/engines/mortevielle/sound.h +++ b/engines/mortevielle/sound.h @@ -34,6 +34,7 @@ #include "common/queue.h" namespace Mortevielle { +class MortevielleEngine; typedef int tablint[256]; @@ -93,6 +94,7 @@ public: class SoundManager { private: + MortevielleEngine *_vm; Audio::Mixer *_mixer; PCSpeaker *_speakerStream; Audio::SoundHandle _speakerHandle; @@ -100,6 +102,7 @@ public: SoundManager(Audio::Mixer *mixer); ~SoundManager(); + void setParent(MortevielleEngine *vm); void playNote(int frequency, int32 length); void decodeMusic(const byte *PSrc, byte *PDest, int NbreSeg); |