diff options
-rw-r--r-- | engines/kyra/kyra_hof.cpp | 13 | ||||
-rw-r--r-- | engines/kyra/kyra_hof.h | 4 | ||||
-rw-r--r-- | engines/kyra/sound_midi.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 64 |
4 files changed, 80 insertions, 3 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 3ec6a44338..efe3394885 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -1583,16 +1583,23 @@ void KyraEngine_HoF::snd_playSoundEffect(int track, int volume) { } int16 vocIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2]); - if (vocIndex != -1) + if (vocIndex != -1) { _sound->voicePlay(_ingameSoundList[vocIndex], true); - else if (_flags.platform == Common::kPlatformPC) - KyraEngine_v1::snd_playSoundEffect(track); + } else if (_flags.platform == Common::kPlatformPC) { + if (_sound->getSfxType() == Sound::kMidiMT32) + track = track < _mt32SfxMapSize ? _mt32SfxMap[track] - 1 : -1; + else if (_sound->getSfxType() == Sound::kMidiGM) + track = track < _gmSfxMapSize ? _gmSfxMap[track] - 1: -1; + + if (track != -1) + KyraEngine_v1::snd_playSoundEffect(track); // TODO ?? Maybe there is a way to let users select whether they want // voc, midi or adl sfx (even though it makes no sense to choose anything but voc). // The PC-98 version has support for non-pcm sound effects, but only for tracks // which also have voc files. The syntax would be: // KyraEngine_v1::snd_playSoundEffect(vocIndex); + } } #pragma mark - diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index 1204179a05..8db7a28387 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -301,6 +301,10 @@ protected: static const int8 _dosTrackMap[]; static const int _dosTrackMapSize; + static const int8 _mt32SfxMap[]; + static const int _mt32SfxMapSize; + static const int8 _gmSfxMap[]; + static const int _gmSfxMapSize; AudioDataStruct _soundData[3]; protected: diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index 73fad4a4c5..1ba8e79d18 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -602,6 +602,8 @@ void SoundMidiPC::loadSfxFile(Common::String file) { } void SoundMidiPC::playTrack(uint8 track) { + haltTrack(); + Common::StackLock lock(_mutex); _fadeMusicOut = false; diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 53e7ae30da..bd94fe3f25 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -1716,6 +1716,70 @@ const int8 KyraEngine_HoF::_dosTrackMap[] = { const int KyraEngine_HoF::_dosTrackMapSize = ARRAYSIZE(KyraEngine_HoF::_dosTrackMap); +const int8 KyraEngine_HoF::_mt32SfxMap[] = { + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 49, 27, 5, 36, 13, + -1, -1, 68, 55, 37, 73, 43, 61, + 49, -1, 56, -1, 62, 38, -1, -1, + 61, -1, -1, 31, 70, 2, 45, -1, + 45, -1, -1, -1, 10, 14, 24, 25, + -1, -1, 59, 9, 26, -1, 71, 79, + 12, 9, -1, -1, 61, -1, -1, 65, + 66, 50, 27, 24, 29, 29, 15, 16, + 17, 18, 19, 20, 21, 57, -1, -1, + 34, 3, -1, 56, 56, -1, -1, 50, + 43, 68, 32, 33, 67, 25, 60, 40, + 39, 11, 24, 2, 60, 3, 46, 54, + 1, 8, -1, -1, 41, 42, 37, 74, + 69, 62, 58, 27, -1, -1, -1, -1, + 48, 4, -1, 25, 39, 40, 24, 58, + 35, 4, 4, 4, -1, 50, -1, 6, + 8, -1, -1, -1, -1, -1, 53, 52, + -1, 63, 47, -1, -1, -1, 53, -1, + 29, -1, -1, 79, -1, 41, 12, -1, + -1, -1, 26, -1, 7, 27, 72, 51, + 23, 51, 64, -1, -1, -1, 27, 76, + 77, 78, 28, 47, -1, -1, 53, -1, + -1, -1, -1, -1, 2, 22, -1, 51, + 58, -1, -1, 30, -1, 79, -1, -1, + 22, 36, 1, -1, 12, 1, -1, -1, + 41, -1, 76, 77, 47 +}; + +const int KyraEngine_HoF::_mt32SfxMapSize = ARRAYSIZE(KyraEngine_HoF::_mt32SfxMap); + +const int8 KyraEngine_HoF::_gmSfxMap[] = { + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 31, 25, 19, 12, 4, + -1, -1, 46, 18, -1, 21, 15, -1, + 31, -1, -1, -1, -1, -1, 47, -1, + 33, -1, 36, -1, -1, 23, 48, -1, + 48, -1, -1, 49, -1, 50, 22, 24, + 51, -1, 52, 20, -1, -1, 22, 53, + 3, 20, 47, 54, 33, -1, 55, 56, + 57, 33, -1, 51, 58, -1, 5, 6, + 7, 8, 9, 10, 11, 22, -1, -1, + -1, 24, -1, 26, 17, -1, -1, 33, + 15, -1, 23, 23, -1, 22, -1, 23, + 24, 21, 22, -1, -1, 24, 16, -1, + 1, 48, -1, -1, 13, 14, -1, 29, + 64, -1, -1, 25, -1, -1, -1, -1, + -1, 2, 13, 24, 23, 23, 22, -1, + 60, 2, 2, 2, -1, 33, -1, 61, + 48, 62, -1, 39, -1, -1, 28, 63, + 33, -1, 17, -1, 45, 45, 28, 55, + 34, -1, -1, 34, 55, 13, -1, 47, + 54, -1, -1, 33, 44, 25, -1, -1, + -1, 32, -1, -1, -1, -1, 25, 37, + 37, 37, 26, 43, -1, 42, 24, -1, + -1, -1, -1, -1, 23, 32, -1, 32, + -1, -1, -1, 27, 41, 34, -1, 40, + 32, -1, 16, 40, -1, 16, 38, 39, + 13, -1, 37, 28, 33 +}; + +const int KyraEngine_HoF::_gmSfxMapSize = ARRAYSIZE(KyraEngine_HoF::_gmSfxMap); + void KyraEngine_HoF::initInventoryButtonList() { delete[] _inventoryButtons; |