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/sound.cpp | |
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/sound.cpp')
-rw-r--r-- | scumm/sound.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
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) { |