diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/lol.h | 1 | ||||
-rw-r--r-- | engines/kyra/sound_lol.cpp | 10 | ||||
-rw-r--r-- | engines/kyra/staticres_lol.cpp | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index e060b307af..af58397200 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -463,6 +463,7 @@ private: const uint8 *_musicTrackMap; const uint16 *_ingameSoundIndex; + int _ingameSoundIndexSize; const uint8 *_ingameGMSoundIndex; int _ingameGMSoundIndexSize; const uint8 *_ingameMT32SoundIndex; diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp index 8be0cb6ab9..6e7551ed0e 100644 --- a/engines/kyra/sound_lol.cpp +++ b/engines/kyra/sound_lol.cpp @@ -161,7 +161,7 @@ void LoLEngine::snd_playSoundEffect(int track, int volume) { return; _lastSfxTrack = track; - if (track == -1 || track >= _ingameSoundListSize) + if (track == -1 || track >= _ingameSoundIndexSize) return; volume &= 0xFF; @@ -216,10 +216,10 @@ bool LoLEngine::snd_processEnvironmentalSoundEffect(int soundId, int block) { for (int i = 3; i > 0; i--) { int dir = calcMonsterDirection(cbl & 0x1F, cbl >> 5, block & 0x1F, block >> 5); cbl = (cbl + blockShiftTable[dir]) & 0x3FF; - if (cbl != block) { - if (testWallFlag(cbl, 0, 1)) - _environmentSfxVol >>= 1; - } + if (cbl == block) + break; + if (testWallFlag(cbl, 0, 1)) + _environmentSfxVol >>= 1; } } diff --git a/engines/kyra/staticres_lol.cpp b/engines/kyra/staticres_lol.cpp index 9a4fc281d5..c40b4a0c7d 100644 --- a/engines/kyra/staticres_lol.cpp +++ b/engines/kyra/staticres_lol.cpp @@ -255,7 +255,7 @@ void LoLEngine::initStaticResource() { int tempSize; _pakFileList = _staticres->loadStrings(kLoLIngamePakFiles, _pakFileListSize); _charDefaults = _staticres->loadCharData(kLoLCharacterDefs, _charDefaultsSize); - _ingameSoundIndex = (const uint16 *)_staticres->loadRawData(kLoLIngameSfxIndex, tempSize); + _ingameSoundIndex = (const uint16 *)_staticres->loadRawData(kLoLIngameSfxIndex, _ingameSoundIndexSize); _musicTrackMap = _staticres->loadRawData(kLoLMusicTrackMap, tempSize); _ingameGMSoundIndex = _staticres->loadRawData(kLoLIngameGMSfxIndex, _ingameGMSoundIndexSize); _ingameMT32SoundIndex = _staticres->loadRawData(kLoLIngameMT32SfxIndex, _ingameMT32SoundIndexSize); |