Skip to content

Commit

Permalink
MORTEVIELLE: Replace g_vm in SoundManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jun 25, 2013
1 parent 2811607 commit 266c8cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions engines/mortevielle/mortevielle.cpp
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions engines/mortevielle/sound.cpp
Expand Up @@ -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
3 changes: 3 additions & 0 deletions engines/mortevielle/sound.h
Expand Up @@ -34,6 +34,7 @@
#include "common/queue.h"

namespace Mortevielle {
class MortevielleEngine;

typedef int tablint[256];

Expand Down Expand Up @@ -93,13 +94,15 @@ class PCSpeaker : public Audio::AudioStream {

class SoundManager {
private:
MortevielleEngine *_vm;
Audio::Mixer *_mixer;
PCSpeaker *_speakerStream;
Audio::SoundHandle _speakerHandle;
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);
Expand Down

0 comments on commit 266c8cb

Please sign in to comment.