aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2014-07-22 18:54:48 +0200
committeruruk2014-07-22 18:54:48 +0200
commitdef6b4fc3e38392c8345af9945cb3a1d208a7726 (patch)
tree968ba7773e271195c0dbcf1b5e33f5bdd24c4309 /engines
parent2f19de9ebe1d62d3bb6f93a121c68e52337a179f (diff)
downloadscummvm-rg350-def6b4fc3e38392c8345af9945cb3a1d208a7726.tar.gz
scummvm-rg350-def6b4fc3e38392c8345af9945cb3a1d208a7726.tar.bz2
scummvm-rg350-def6b4fc3e38392c8345af9945cb3a1d208a7726.zip
CGE2: Add and use Sound::checkSoundHandle().
Diffstat (limited to 'engines')
-rw-r--r--engines/cge2/cge2_main.cpp2
-rw-r--r--engines/cge2/snail.cpp5
-rw-r--r--engines/cge2/sound.cpp5
-rw-r--r--engines/cge2/sound.h1
4 files changed, 9 insertions, 4 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp
index f887bdc2fe..f8fa274bc8 100644
--- a/engines/cge2/cge2_main.cpp
+++ b/engines/cge2/cge2_main.cpp
@@ -551,6 +551,8 @@ void CGE2Engine::mainLoop() {
// Check shouldQuit()
_quitFlag = shouldQuit();
+
+ _sound->checkSoundHandle();
}
void CGE2Engine::handleFrame() {
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index 8cb8d19b24..9dce4dbbc8 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -742,10 +742,7 @@ void CGE2Engine::snSay(Sprite *spr, int val) {
_sound->setRepeat(1);
snSound(spr, i);
_sound->setRepeat(oldRepeat);
- //_commandStat._wait = &_sound->_smpinf._counter;
- // This line is commented out for now since I wasn't able to find where this flag is reset
- // and it's prevented the main loop from doing anything.
- // TODO: Recheck this later! At the moment it seems working fine.
+ _soundStat._wait = &_sound->_smpinf._counter;
}
}
}
diff --git a/engines/cge2/sound.cpp b/engines/cge2/sound.cpp
index b7b39d2722..7e886e5639 100644
--- a/engines/cge2/sound.cpp
+++ b/engines/cge2/sound.cpp
@@ -106,6 +106,11 @@ void Sound::stop() {
sndDigiStop(&_smpinf);
}
+void Sound::checkSoundHandle() {
+ if (!_vm->_mixer->isSoundHandleActive(_soundHandle))
+ _smpinf._counter = 0;
+}
+
void Sound::sndDigiStop(SmpInfo *PSmpInfo) {
if (_vm->_mixer->isSoundHandleActive(_soundHandle))
_vm->_mixer->stopHandle(_soundHandle);
diff --git a/engines/cge2/sound.h b/engines/cge2/sound.h
index 6fa2b2a553..e2e9482799 100644
--- a/engines/cge2/sound.h
+++ b/engines/cge2/sound.h
@@ -76,6 +76,7 @@ public:
int16 getRepeat();
void setRepeat(int16 count);
void stop();
+ void checkSoundHandle();
private:
int _soundRepeatCount;
CGE2Engine *_vm;