diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp index 53641531a45..c8c734f5cc3 100644 --- a/scumm/imuse_digi.cpp +++ b/scumm/imuse_digi.cpp @@ -773,11 +773,12 @@ void IMuseDigital::startSound(int sound) { for (l = 0; l < MAX_DIGITAL_CHANNELS; l++) { if (!_channel[l].used && !_channel[l].handle.isActive()) { byte *ptr, *s_ptr; - if ((sound == 10000) && (_voiceBundleData)) { + if ((sound == kTalkSoundID) && (_voiceBundleData)) { s_ptr = ptr = _voiceBundleData; - } else if ((sound == 10000) && (_voiceVocData)) { + } else if ((sound == kTalkSoundID) && (_voiceVocData)) { // - } else if (sound != 10000) { + s_ptr = ptr = 0; + } else if (sound != kTalkSoundID) { ptr = _scumm->getResourceAddress(rtSound, sound); s_ptr = ptr; if (ptr == NULL) { @@ -805,7 +806,7 @@ void IMuseDigital::startSound(int sound) { int32 size = 0; int t; - if ((sound == 10000) && (_voiceVocData)) { + if ((sound == kTalkSoundID) && (_voiceVocData)) { _channel[l].mixerSize = _voiceVocRate * 2; _channel[l].size = _voiceVocSize * 2; _channel[l].bits = 8; @@ -897,7 +898,7 @@ void IMuseDigital::startSound(int sound) { break; } - if ((sound == 10000) && (_voiceBundleData)) { + if ((sound == kTalkSoundID) && (_voiceBundleData)) { if (_scumm->_actorToPrintStrFor != 0xFF && _scumm->_actorToPrintStrFor != 0) { Actor *a = _scumm->derefActor(_scumm->_actorToPrintStrFor, "playBundleSound"); _channel[l].freq = (_channel[l].freq * a->talkFrequency) / 256; @@ -1429,7 +1430,7 @@ void IMuseDigital::bundleMusicHandler() { } void IMuseDigital::playBundleSound(const char *sound) { - byte *ptr = 0, *orig_ptr = 0; + byte *ptr = 0; bool result; if (!_scumm->_mixer->isReady()) @@ -1469,9 +1470,9 @@ void IMuseDigital::playBundleSound(const char *sound) { } if (ptr) { - stopSound(10000); + stopSound(kTalkSoundID); setBundleVoice(ptr); - startSound(10000); + startSound(kTalkSoundID); free(ptr); } } diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index b4675ce5338..1d26983ddf0 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1079,8 +1079,8 @@ void ScummEngine_v8::o8_actorOps() { // setChannelPan() won't do anything.) if (_actorToPrintStrFor == a->number) { - if (_sound->isSoundRunning(10000)) - _imuseDigital->parseScriptCmds(12, 0x700, 10000, a->talkPan, 0, 0, 0, 0); + if (_sound->isSoundRunning(kTalkSoundID)) + _imuseDigital->parseScriptCmds(12, 0x700, kTalkSoundID, a->talkPan, 0, 0, 0, 0); } break; diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 5523635069f..b4c601de537 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -407,7 +407,7 @@ void Sound::processSfxQueues() { act = _scumm->VAR(_scumm->VAR_TALK_ACTOR); if (_scumm->_imuseDigital) { - finished = !isSoundRunning(10000); + finished = !isSoundRunning(kTalkSoundID); } else { finished = !_talkChannelHandle.isActive(); } @@ -565,7 +565,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, PlayingSoundHandle void Sound::stopTalkSound() { if (_sfxMode & 2) { if (_scumm->_imuseDigital) { - _scumm->_imuseDigital->stopSound(10000); + _scumm->_imuseDigital->stopSound(kTalkSoundID); } else { _scumm->_mixer->stopHandle(_talkChannelHandle); } @@ -822,7 +822,7 @@ void Sound::startSfxSound(File *file, int file_size, PlayingSoundHandle *handle, if (_scumm->_imuseDigital) { _scumm->_imuseDigital->setVocVoice(data, size, rate); - _scumm->_imuseDigital->startSound(10000); + _scumm->_imuseDigital->startSound(kTalkSoundID); free(data); } else { _scumm->_mixer->playRaw(handle, data, size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED, id); diff --git a/scumm/sound.h b/scumm/sound.h index f23eeccf9d7..8ca405f0df4 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -32,6 +32,10 @@ class ScummEngine; struct MP3OffsetTable; +enum { + kTalkSoundID = 10000 +}; + class Sound { protected: int16 _soundQuePos, _soundQue[0x100]; diff --git a/scumm/string.cpp b/scumm/string.cpp index 1a15a482552..48a6646fad5 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -164,9 +164,9 @@ void ScummEngine::CHARSET_1() { return; if ((_gameId == GID_CMI || _gameId == GID_DIG) && (_imuseDigital) - && _sound->isSoundRunning(10000)) { + && _sound->isSoundRunning(kTalkSoundID)) { // Keep the 'speech' flag in _sound->_sfxMode set as long as the - // sound 10000 is playing. + // sound kTalkSoundID is playing. _sound->_sfxMode |= 2; }