From df06592be1b4c9904acde5a843d3ab3d076c65ac Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 8 Aug 2009 18:23:14 +0000 Subject: Implemented support for Amiga wander score map. svn-id: r43133 --- engines/kyra/kyra_lok.cpp | 9 +++++++-- engines/kyra/kyra_lok.h | 3 +++ engines/kyra/sound.cpp | 7 +++++++ engines/kyra/staticres.cpp | 12 ++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index a3a249de18..3863cad251 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -183,8 +183,13 @@ Common::Error KyraEngine_LoK::init() { _sound->setSoundList(&_soundData[kMusicIntro]); - _trackMap = _dosTrackMap; - _trackMapSize = _dosTrackMapSize; + if (_flags.platform == Common::kPlatformAmiga) { + _trackMap = _amigaTrackMap; + _trackMapSize = _amigaTrackMapSize; + } else { + _trackMap = _dosTrackMap; + _trackMapSize = _dosTrackMapSize; + } if (!_sound->init()) error("Couldn't init sound"); diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h index a905c5521b..4d99ed11af 100644 --- a/engines/kyra/kyra_lok.h +++ b/engines/kyra/kyra_lok.h @@ -504,6 +504,9 @@ protected: static const int8 _dosTrackMap[]; static const int _dosTrackMapSize; + static const int8 _amigaTrackMap[]; + static const int _amigaTrackMapSize; + // TODO: get rid of all variables having pointers to the static resources if possible // i.e. let them directly use the _staticres functions void initStaticResource(); diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index 4d42b1efb7..83584ab454 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -215,6 +215,13 @@ void KyraEngine_v1::snd_playWanderScoreViaMap(int command, int restart) { _sound->playTrack(command); } } + } else if (_flags.platform == Common::kPlatformAmiga) { + if (_curMusicTheme != 1) + snd_playTheme(1, -1); + + assert(command < _trackMapSize); + if (_trackMap[_lastMusicCommand] != _trackMap[command]) + _sound->playTrack(_trackMap[command]); } _lastMusicCommand = command; diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 86680a7b76..cf0b327a8d 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -2332,6 +2332,18 @@ const int8 KyraEngine_LoK::_dosTrackMap[] = { const int KyraEngine_LoK::_dosTrackMapSize = ARRAYSIZE(KyraEngine_LoK::_dosTrackMap); +const int8 KyraEngine_LoK::_amigaTrackMap[] = { + 0, 1, 32, 26, 31, 30, 33, 33, + 32, 17, 27, 32, 25, 29, 25, 24, + 23, 26, 26, 30, 28, 21, 21, 15, + 3, 15, 23, 25, 33, 21, 30, 22, + 15, 3, 33, 11, 12, 13, 14, 22, + 22, 22, 3, 3, 3, 23, 3, 3, + 23, 3, 3, 3, 3, 3, 3, 33 +}; + +const int KyraEngine_LoK::_amigaTrackMapSize = ARRAYSIZE(KyraEngine_LoK::_amigaTrackMap); + // kyra engine v2 static data const int GUI_v2::_sliderBarsPosition[] = { -- cgit v1.2.3