diff options
author | Johannes Schickel | 2008-08-10 00:36:46 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-08-10 00:36:46 +0000 |
commit | 980b3f8af1318d5b42eb4e5f3c1d0748f46c1a0d (patch) | |
tree | 119707757115f3e6602f1b06e2ce0a717e5ea4ca /engines/kyra | |
parent | 8268b5c210ee5fd7fa264ecd570c98b26b245d60 (diff) | |
download | scummvm-rg350-980b3f8af1318d5b42eb4e5f3c1d0748f46c1a0d.tar.gz scummvm-rg350-980b3f8af1318d5b42eb4e5f3c1d0748f46c1a0d.tar.bz2 scummvm-rg350-980b3f8af1318d5b42eb4e5f3c1d0748f46c1a0d.zip |
Fixed kyra to support properly support restarting of engine (for GSoC RTL, based on a patch from Chris Page).
svn-id: r33736
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra_hof.h | 3 | ||||
-rw-r--r-- | engines/kyra/kyra_lok.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/kyra_lok.h | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_v1.h | 6 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 132 |
5 files changed, 89 insertions, 60 deletions
diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index 279e9e35a6..f6e887c648 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -302,8 +302,7 @@ protected: static const int8 _dosTrackMap[]; static const int _dosTrackMapSize; - const AudioDataStruct *_soundData; - + AudioDataStruct _soundData[3]; protected: // game initialization void startup(); diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index db3a8fb627..c852f6e3ee 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -174,8 +174,7 @@ int KyraEngine_LoK::init() { initStaticResource(); - if (_soundData) - _sound->setSoundList(&_soundData[kMusicIntro]); + _sound->setSoundList(&_soundData[kMusicIntro]); _trackMap = _dosTrackMap; _trackMapSize = _dosTrackMapSize; @@ -318,8 +317,7 @@ void KyraEngine_LoK::startup() { debugC(9, kDebugLevelMain, "KyraEngine_LoK::startup()"); static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 }; _screen->setTextColorMap(colorMap); - if (_soundData) - _sound->setSoundList(&_soundData[kMusicIngame]); + _sound->setSoundList(&_soundData[kMusicIngame]); _sound->loadSoundFile(0); // _screen->setFont(Screen::FID_6_FNT); _screen->setAnimBlockPtr(3750); diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h index cb3062847e..1def95ddbf 100644 --- a/engines/kyra/kyra_lok.h +++ b/engines/kyra/kyra_lok.h @@ -633,7 +633,7 @@ protected: int _soundFilesIntroSize; const int32 *_cdaTrackTable; int _cdaTrackTableSize; - const AudioDataStruct * _soundData; + AudioDataStruct _soundData[3]; // positions of the inventory static const uint16 _itemPosX[]; diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 05c746f289..738a3fc8ec 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -70,9 +70,9 @@ enum { struct AudioDataStruct { const char * const *_fileList; - const int _fileListLen; - const void * const _cdaTracks; - const int _cdaNumTracks; + int _fileListLen; + const void * _cdaTracks; + int _cdaNumTracks; }; // TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 7d7f0cd4b8..bb63c24c36 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -1055,32 +1055,48 @@ void KyraEngine_LoK::initStaticResource() { static const char *tIntro98[] = { "intro%d.dat" }; static const char *tIngame98[] = { "kyram%d.dat" }; - static const AudioDataStruct soundData_PC[] = { - { _soundFilesIntro, _soundFilesIntroSize, 0, 0 }, - { _soundFiles, _soundFilesSize, 0, 0 }, - { 0, 0, 0, 0} - }; - - static const AudioDataStruct soundData_TOWNS[] = { - { _soundFiles, _soundFilesSize, _cdaTrackTable, _cdaTrackTableSize }, - { _soundFiles, _soundFilesSize, _cdaTrackTable, _cdaTrackTableSize }, - { 0, 0, 0, 0} - }; - - static const AudioDataStruct soundData_PC98[] = { - { tIntro98, 1, 0, 0 }, - { tIngame98, 1, 0, 0 }, - { 0, 0, 0, 0} - }; - - if (_flags.platform == Common::kPlatformPC) - _soundData = soundData_PC; - else if (_flags.platform == Common::kPlatformFMTowns) - _soundData = soundData_TOWNS; - else if (_flags.platform == Common::kPlatformPC98) - _soundData = soundData_PC98; - else - _soundData = 0; + if (_flags.platform == Common::kPlatformPC) { + _soundData[0]._fileList = _soundFilesIntro; + _soundData[0]._fileListLen = _soundFilesIntroSize; + _soundData[0]._cdaTracks = 0; + _soundData[0]._cdaNumTracks = 0; + _soundData[1]._fileList = _soundFiles; + _soundData[1]._fileListLen = _soundFilesSize; + _soundData[1]._cdaTracks = 0; + _soundData[1]._cdaNumTracks = 0; + _soundData[2]._fileList = 0; + _soundData[2]._fileListLen = 0; + _soundData[2]._cdaTracks = 0; + _soundData[2]._cdaNumTracks = 0; + } else if (_flags.platform == Common::kPlatformFMTowns) { + _soundData[0]._fileList = _soundFiles; + _soundData[0]._fileListLen = _soundFilesSize; + _soundData[0]._cdaTracks = _cdaTrackTable; + _soundData[0]._cdaNumTracks = _cdaTrackTableSize; + _soundData[1]._fileList = _soundFiles; + _soundData[1]._fileListLen = _soundFilesSize; + _soundData[1]._cdaTracks = _cdaTrackTable; + _soundData[1]._cdaNumTracks = _cdaTrackTableSize; + _soundData[2]._fileList = 0; + _soundData[2]._fileListLen = 0; + _soundData[2]._cdaTracks = 0; + _soundData[2]._cdaNumTracks = 0; + } else if (_flags.platform == Common::kPlatformPC98) { + _soundData[0]._fileList = tIntro98; + _soundData[0]._fileListLen = 1; + _soundData[0]._cdaTracks = 0; + _soundData[0]._cdaNumTracks = 0; + _soundData[1]._fileList = tIngame98; + _soundData[1]._fileListLen = 1; + _soundData[1]._cdaTracks = 0; + _soundData[1]._cdaNumTracks = 0; + _soundData[2]._fileList = 0; + _soundData[2]._fileListLen = 0; + _soundData[2]._cdaTracks = 0; + _soundData[2]._cdaNumTracks = 0; + } else { + memset(_soundData, 0, sizeof(_soundData)); + } } void KyraEngine_LoK::loadMouseShapes() { @@ -1282,30 +1298,46 @@ void KyraEngine_HoF::initStaticResource() { static const char *pc98MusicFileListFinale[] = { "finale%d.86" }; static const char *pc98MusicFileListIngame[] = { "km%02d.86" }; - static const AudioDataStruct soundData_PC[] = { - { _musicFileListIntro, _musicFileListIntroSize, 0, 0 }, - { _musicFileListIngame, _musicFileListIngameSize, 0, 0}, - { _musicFileListFinale, _musicFileListIntroSize, 0, 0 } - }; - - static const AudioDataStruct soundData_TOWNS[] = { - { fmtMusicFileListIntro, 1, _cdaTrackTableIntro, _cdaTrackTableIntroSize >> 1 }, - { fmtMusicFileListIngame, 1, _cdaTrackTableIngame, _cdaTrackTableIngameSize >> 1 }, - { fmtMusicFileListFinale, 1, _cdaTrackTableFinale, _cdaTrackTableFinaleSize >> 1 } - }; - - static const AudioDataStruct soundData_PC98[] = { - { pc98MusicFileListIntro, 1, 0, 0 }, - { pc98MusicFileListIngame, 1, 0, 0 }, - { pc98MusicFileListFinale, 1, 0, 0 } - }; - - if (_flags.platform == Common::kPlatformPC) - _soundData = soundData_PC; - else if (_flags.platform == Common::kPlatformFMTowns) - _soundData = soundData_TOWNS; - else if (_flags.platform == Common::kPlatformPC98) - _soundData = soundData_PC98; + if (_flags.platform == Common::kPlatformPC) { + _soundData[0]._fileList = _musicFileListIntro; + _soundData[0]._fileListLen = _musicFileListIntroSize; + _soundData[0]._cdaTracks = 0; + _soundData[0]._cdaNumTracks = 0; + _soundData[1]._fileList = _musicFileListIngame; + _soundData[1]._fileListLen = _musicFileListIngameSize; + _soundData[1]._cdaTracks = 0; + _soundData[1]._cdaNumTracks = 0; + _soundData[2]._fileList = _musicFileListFinale; + _soundData[2]._fileListLen = _musicFileListIntroSize; + _soundData[2]._cdaTracks = 0; + _soundData[2]._cdaNumTracks = 0; + } else if (_flags.platform == Common::kPlatformFMTowns) { + _soundData[0]._fileList = fmtMusicFileListIntro; + _soundData[0]._fileListLen = 1; + _soundData[0]._cdaTracks = _cdaTrackTableIntro; + _soundData[0]._cdaNumTracks = _cdaTrackTableIntroSize >> 1; + _soundData[1]._fileList = fmtMusicFileListIngame; + _soundData[1]._fileListLen = 1; + _soundData[1]._cdaTracks = _cdaTrackTableIngame; + _soundData[1]._cdaNumTracks = _cdaTrackTableIngameSize >> 1; + _soundData[2]._fileList = fmtMusicFileListFinale; + _soundData[2]._fileListLen = 1; + _soundData[2]._cdaTracks = _cdaTrackTableFinale; + _soundData[2]._cdaNumTracks = _cdaTrackTableFinaleSize >> 1; + } else if (_flags.platform == Common::kPlatformPC98) { + _soundData[0]._fileList = pc98MusicFileListIntro; + _soundData[0]._fileListLen = 1; + _soundData[0]._cdaTracks = 0; + _soundData[0]._cdaNumTracks = 0; + _soundData[1]._fileList = pc98MusicFileListIngame; + _soundData[1]._fileListLen = 1; + _soundData[1]._cdaTracks = 0; + _soundData[1]._cdaNumTracks = 0; + _soundData[2]._fileList = pc98MusicFileListFinale; + _soundData[2]._fileListLen = 1; + _soundData[2]._cdaTracks = 0; + _soundData[2]._cdaNumTracks = 0; + } // setup sequence data _sequences = _staticres->loadHofSequenceData(k2SeqplaySeqData, tmpSize); |