diff options
author | Travis Howell | 2004-09-19 12:22:47 +0000 |
---|---|---|
committer | Travis Howell | 2004-09-19 12:22:47 +0000 |
commit | e22230e223b0182086b2565d5db59934391354c9 (patch) | |
tree | 23b0f956c83ed18337d38007f4ae62487aa28f14 | |
parent | 989de0d5dc51c8bec8bca0c6159902b9ecfd9cf8 (diff) | |
download | scummvm-rg350-e22230e223b0182086b2565d5db59934391354c9.tar.gz scummvm-rg350-e22230e223b0182086b2565d5db59934391354c9.tar.bz2 scummvm-rg350-e22230e223b0182086b2565d5db59934391354c9.zip |
Actually check if a sound is active, if the sound is outside music engine.
Add some more HE differences
svn-id: r15188
-rw-r--r-- | scumm/scumm.cpp | 2 | ||||
-rw-r--r-- | scumm/sound.cpp | 3 | ||||
-rw-r--r-- | scumm/string.cpp | 15 | ||||
-rw-r--r-- | sound/mixer.cpp | 7 | ||||
-rw-r--r-- | sound/mixer.h | 3 |
5 files changed, 28 insertions, 2 deletions
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index f525dfa344..244a0bbcd1 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -1159,7 +1159,7 @@ void ScummEngine::launch() { else if (_gameId == GID_MANIAC) _numActors = 25; else if (_heversion >= 80) - _numActors = 62; + _numActors = 63; else _numActors = 13; diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 0a9f264dba..85f5f6d735 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -779,6 +779,9 @@ int Sound::isSoundRunning(int sound) const { if (!_vm->isResourceLoaded(rtSound, sound)) return 0; + if (_vm->_mixer->isSoundIDActive(sound)) + return 1; + if (_vm->_musicEngine) return _vm->_musicEngine->getSoundStatus(sound); diff --git a/scumm/string.cpp b/scumm/string.cpp index 2cdd673c69..cc32a57476 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -386,6 +386,7 @@ void ScummEngine::drawString(int a, const byte *msg) { int i, c; byte fontHeight = 0; uint color; + int code = (_heversion >= 80) ? 127 : 64; addMessageToStack(msg, buf, sizeof(buf)); @@ -433,7 +434,19 @@ void ScummEngine::drawString(int a, const byte *msg) { } for (i = 0; (c = buf[i++]) != 0;) { - if (c == 0xFE || c == 0xFF) { + if (c == code) { + c = buf[i++]; + switch (c) { + case 110: + if (_charset->_center) { + _charset->_left = _charset->_startLeft - _charset->getStringWidth(a, buf + i); + } else { + _charset->_left = _charset->_startLeft; + } + _charset->_top += fontHeight; + break; + } + } else if (c == 0xFE || c == 0xFF) { c = buf[i++]; switch (c) { case 9: diff --git a/sound/mixer.cpp b/sound/mixer.cpp index e3ab968f3f..862967e232 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -463,6 +463,13 @@ void SoundMixer::pauseHandle(PlayingSoundHandle handle, bool paused) { _channels[index]->pause(paused); } +bool SoundMixer::isSoundIDActive(int id) { + for (int i = 0; i != NUM_CHANNELS; i++) + if (_channels[i] && _channels[i]->getId() == id) + return true; + return false; +} + bool SoundMixer::hasActiveSFXChannel() { // FIXME/TODO: We need to distinguish between SFX and music channels Common::StackLock lock(_mutex); diff --git a/sound/mixer.h b/sound/mixer.h index 91b32ae152..d2093ec560 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -145,6 +145,9 @@ public: /** pause/unpause all channels */ void pauseAll(bool paused); + /** check if sound ID is active */ + bool isSoundIDActive(int id); + /** check if mixer is paused */ bool isPaused(); |