diff options
author | Max Horn | 2003-03-23 13:14:54 +0000 |
---|---|---|
committer | Max Horn | 2003-03-23 13:14:54 +0000 |
commit | be47bc121e5c411b5e6c4cc39471be746113a1ce (patch) | |
tree | 14060643d5bf306f4e98bc3938489e5ab568eee7 /scumm | |
parent | 2c579c25cef63cd9152d3e89a57feb9ef20190f1 (diff) | |
download | scummvm-rg350-be47bc121e5c411b5e6c4cc39471be746113a1ce.tar.gz scummvm-rg350-be47bc121e5c411b5e6c4cc39471be746113a1ce.tar.bz2 scummvm-rg350-be47bc121e5c411b5e6c4cc39471be746113a1ce.zip |
cleanup
svn-id: r6847
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse.cpp | 13 | ||||
-rw-r--r-- | scumm/imuse.h | 2 | ||||
-rw-r--r-- | scumm/sound.cpp | 21 | ||||
-rw-r--r-- | scumm/string.cpp | 2 |
4 files changed, 17 insertions, 21 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index cec93be063..0b2d5ab75b 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -458,7 +458,7 @@ public: bool startSound(int sound); int stopSound(int sound); int stop_all_sounds(); - int get_sound_status(int sound); + int getSoundStatus(int sound); bool get_sound_active(int sound); int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h); int clear_queue(); @@ -720,6 +720,7 @@ bool IMuseInternal::startSound(int sound) { return false; player->clear(); + return player->startSound(sound); } @@ -1011,7 +1012,7 @@ byte VolumeFader::fading_to() { return newvol; } -int IMuseInternal::get_sound_status(int sound) { +int IMuseInternal::getSoundStatus(int sound) { int i; Player *player; for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) { @@ -1028,7 +1029,7 @@ int IMuseInternal::get_sound_status(int sound) { return get_queue_sound_status(sound); } -// This is exactly the same as get_sound_status except that +// This is exactly the same as getSoundStatus except that // it treats sounds that are fading out just the same as // other sounds. This is the method to use when determining // what resources to expire from memory. @@ -1286,7 +1287,7 @@ int32 IMuseInternal::doCommand(int a, int b, int c, int d, int e, int f, int g, } return -1; case 13: - return get_sound_status(b); + return getSoundStatus(b); case 14: // Sam and Max: Volume Fader? // Prevent instantaneous volume fades. @@ -1490,7 +1491,7 @@ int32 IMuseInternal::ImSetTrigger (int sound, int id, int a, int b, int c, int d // If the command is to start a sound, stop that sound if it's already playing. // This fixes some carnival music problems. - if (trig->command [0] == 8 && get_sound_status (trig->command [1])) + if (trig->command [0] == 8 && getSoundStatus (trig->command [1])) stopSound (trig->command [1]); return 0; } @@ -3554,7 +3555,7 @@ int IMuse::get_master_volume() { in(); int ret = _target->get_master_volume(); o bool IMuse::startSound(int sound) { in(); bool ret = _target->startSound (sound); out(); return ret; } int IMuse::stopSound(int sound) { in(); int ret = _target->stopSound (sound); out(); return ret; } int IMuse::stop_all_sounds() { in(); int ret = _target->stop_all_sounds(); out(); return ret; } -int IMuse::get_sound_status(int sound) { in(); int ret = _target->get_sound_status (sound); out(); return ret; } +int IMuse::getSoundStatus(int sound) { in(); int ret = _target->getSoundStatus (sound); out(); return ret; } bool IMuse::get_sound_active(int sound) { in(); bool ret = _target->get_sound_active (sound); out(); return ret; } int32 IMuse::doCommand(int a, int b, int c, int d, int e, int f, int g, int h) { in(); int32 ret = _target->doCommand (a,b,c,d,e,f,g,h); out(); return ret; } int IMuse::clear_queue() { in(); int ret = _target->clear_queue(); out(); return ret; } diff --git a/scumm/imuse.h b/scumm/imuse.h index 4923f408c3..adc47399d8 100644 --- a/scumm/imuse.h +++ b/scumm/imuse.h @@ -57,7 +57,7 @@ public: bool startSound(int sound); int stopSound(int sound); int stop_all_sounds(); - int get_sound_status(int sound); + int getSoundStatus(int sound); bool get_sound_active(int sound); int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h); int clear_queue(); diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 7d20494f17..cb4d3c4dfc 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -454,7 +454,6 @@ static int compareMP3OffsetTable(const void *a, const void *b) { int Sound::startTalkSound(uint32 offset, uint32 b, int mode) { int num = 0, i; - byte file_byte, file_byte_2; int size; byte *sound; @@ -520,15 +519,11 @@ int Sound::startTalkSound(uint32 offset, uint32 b, int mode) { } _sfxFile->seek(offset, SEEK_SET); - i = 0; - while (num > 0) { - _sfxFile->read(&file_byte, sizeof(file_byte)); - _sfxFile->read(&file_byte_2, sizeof(file_byte_2)); - assert(i < (int)ARRAYSIZE(_mouthSyncTimes)); - _mouthSyncTimes[i++] = file_byte | (file_byte_2 << 8); - num--; - } - assert(i < (int)ARRAYSIZE(_mouthSyncTimes)); + + assert(num+1 < (int)ARRAYSIZE(_mouthSyncTimes)); + for (i = 0; i < num; i++) + _mouthSyncTimes[i] = _sfxFile->readUint16BE(); + _mouthSyncTimes[i] = 0xFFFF; _sfxMode |= mode; _curSoundPos = 0; @@ -552,7 +547,7 @@ bool Sound::isMouthSyncOff(uint pos) { _endOfMouthSync = false; do { - val ^= 1; + val = !val; j = *ms++; if (j == 0xFFFF) { _endOfMouthSync = true; @@ -587,13 +582,13 @@ int Sound::isSoundRunning(int sound) { return _scumm->_imuseDigital->getSoundStatus(sound); if (_scumm->_imuse) - return _scumm->_imuse->get_sound_status(sound); + return _scumm->_imuse->getSoundStatus(sound); return 0; } // This is exactly the same as isSoundRunning except that it -// calls IMuse::get_sound_active() instead of IMuse::get_sound_status(). +// calls IMuse::get_sound_active() instead of IMuse::getSoundStatus(). // This is necessary when determining what resources to // expire from memory. bool Sound::isSoundActive(int sound) { diff --git a/scumm/string.cpp b/scumm/string.cpp index 824d6b1d4f..f24f4fe096 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -163,7 +163,7 @@ void Scumm::CHARSET_1() { // This hack will force the backup cutoff system to be used instead, // unless the talkChannel is null (eg, this string has no sound attached) if ((_gameId == GID_CMI || _gameId == GID_DIG) && (_sound->_talkChannel > 0)) - return; + return; if (_sound->_sfxMode == 0) stopTalk(); |