diff options
| author | Max Horn | 2003-12-26 13:13:56 +0000 | 
|---|---|---|
| committer | Max Horn | 2003-12-26 13:13:56 +0000 | 
| commit | aa26fa0681ebd871ff976e6aec4d112eb9b21a19 (patch) | |
| tree | 30831b970e42cb2784265cd4086f1f19f7aebf84 | |
| parent | ffbfe8922a3cfa2d2750fca3a2cb2d953fd1e4ca (diff) | |
| download | scummvm-rg350-aa26fa0681ebd871ff976e6aec4d112eb9b21a19.tar.gz scummvm-rg350-aa26fa0681ebd871ff976e6aec4d112eb9b21a19.tar.bz2 scummvm-rg350-aa26fa0681ebd871ff976e6aec4d112eb9b21a19.zip | |
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
| -rw-r--r-- | scumm/imuse_digi.cpp | 17 | ||||
| -rw-r--r-- | scumm/script_v8.cpp | 4 | ||||
| -rw-r--r-- | scumm/sound.cpp | 6 | ||||
| -rw-r--r-- | scumm/sound.h | 4 | ||||
| -rw-r--r-- | scumm/string.cpp | 4 | 
5 files changed, 20 insertions, 15 deletions
| diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp index 53641531a4..c8c734f5cc 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 b4675ce533..1d26983ddf 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 5523635069..b4c601de53 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 f23eeccf9d..8ca405f0df 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 1a15a48255..48a6646fad 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;  	} | 
