when introducing a constant used throughout multiple files, best assign a *name* to it, else you're digging your own grave on the long run :-)

svn-id: r11941
This commit is contained in:
Max Horn 2003-12-26 13:13:56 +00:00
parent ffbfe8922a
commit aa26fa0681
5 changed files with 20 additions and 15 deletions

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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);

View File

@ -32,6 +32,10 @@ class ScummEngine;
struct MP3OffsetTable;
enum {
kTalkSoundID = 10000
};
class Sound {
protected:
int16 _soundQuePos, _soundQue[0x100];

View File

@ -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;
}