diff options
author | Johannes Schickel | 2008-01-10 23:25:19 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-01-10 23:25:19 +0000 |
commit | 2dd6db4ca5b65c4976f3e61b8009474591978dcb (patch) | |
tree | ccdf084c580ff5b80e41dd88a8f4ed6643b2e4e7 /engines/kyra/kyra_v2.cpp | |
parent | 89cedb5d1e87da3da1e65e9b7714926f8ea1fb5c (diff) | |
download | scummvm-rg350-2dd6db4ca5b65c4976f3e61b8009474591978dcb.tar.gz scummvm-rg350-2dd6db4ca5b65c4976f3e61b8009474591978dcb.tar.bz2 scummvm-rg350-2dd6db4ca5b65c4976f3e61b8009474591978dcb.zip |
Commit slighty modified patch #1865509 "KYRA: kyradat support for hof".
svn-id: r30394
Diffstat (limited to 'engines/kyra/kyra_v2.cpp')
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 81 |
1 files changed, 21 insertions, 60 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index b009e4d53e..aef4967f63 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -49,6 +49,9 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi _activeWSA = 0; _activeText = 0; _seqWsa = 0; + _sequences = 0; + _nSequences = 0; + _gamePlayBuffer = 0; _cCodeBuffer = _optionsBuffer = _chapterBuffer = 0; @@ -93,6 +96,11 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi KyraEngine_v2::~KyraEngine_v2() { seq_uninit(); + if (_sequences) + delete [] _sequences; + if (_nSequences) + delete [] _nSequences; + delete [] _mouseSHPBuf; delete _screen; delete _text; @@ -112,6 +120,7 @@ int KyraEngine_v2::init() { error("_screen->init() failed"); KyraEngine::init(); + initStaticResource(); _debugger = new Debugger_v2(this); assert(_debugger); @@ -132,30 +141,6 @@ int KyraEngine_v2::init() { _abortIntroFlag = false; - // temporary solution until staticres manager support (kyra.dat) is added for kyra 2 - if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { - _sequenceSoundList = (const char * const *) _sequenceSoundList_TOWNS; - _sequenceSoundListSize = _sequenceSoundListSize_TOWNS; - _sequenceStrings = (const char * const *) _sequenceStrings_TOWNS_EN; - _sequenceStringsSize = _sequenceStringsSize_TOWNS_EN; - _sequences = (const Sequence*) _sequences_TOWNS; - _soundData = (const AudioDataStruct *) _soundData_TOWNS; - } else if (_flags.isTalkie) { - _sequenceSoundList = (const char * const *) _sequenceSoundList_PC; - _sequenceSoundListSize = _sequenceSoundListSize_PC; - _sequenceStrings = (const char * const *) _sequenceStrings_PC_EN; - _sequenceStringsSize = _sequenceStringsSize_PC_EN; - _sequences = (const Sequence*) _sequences_PC; - _soundData = (const AudioDataStruct *) _soundData_PC; - } else { - _sequenceSoundList = (const char * const *) _sequenceSoundList_PCFLOPPY; - _sequenceSoundListSize = _sequenceSoundListSize_PCFLOPPY; - _sequenceStrings = (const char * const *) _sequenceStrings_PC_EN; - _sequenceStringsSize = _sequenceStringsSize_PC_EN; - _sequences = (const Sequence*) _sequences_PC; - _soundData = (const AudioDataStruct *) _soundData_PC; - } - for (int i = 0; i < 33; i++) _sequenceStringsDuration[i] = (int) strlen(_sequenceStrings[i]) * 8; @@ -179,39 +164,18 @@ int KyraEngine_v2::go() { if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) seq_showStarcraftLogo(); - if (_flags.platform == Common::kPlatformPC && _flags.isDemo) { - _res->loadPakFile("VOC.PAK"); - _menuChoice = 2; - } else { - seq_playSequences(kSequenceVirgin, kSequenceZanfaun); - //seq_playSequences(kSequenceFunters, kSequenceFrash); - - _res->unloadAllPakFiles(); - - if (_menuChoice != 4) { - // load just the pak files needed for ingame - if (_flags.platform == Common::kPlatformPC && _flags.isTalkie) { - _res->loadFileList("FILEDATA.FDT"); - _res->loadPakFile("KYRA.DAT"); - } else if (_flags.platform == Common::kPlatformPC) { - // TODO - - } else if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) { - char tmpfilename[13]; - static const char * pakfiles [] = { "KYRA.DAT", "AUDIO.PAK", "CAULDRON.PAK", - "MISC_CPS.PAK", "MISC_EMC.PAK", "OTHER.PAK", "VOC.PAK", "WSCORE.PAK" }; - for (int i = 0; i < 8; i++) - _res->loadPakFile(pakfiles[i]); - for (int i = 1; i < 10; i++) { - sprintf(tmpfilename, "COST%d_SH.PAK", i); - _res->loadPakFile(tmpfilename); - } - for (int i = 1; i < 6; i++) { - sprintf(tmpfilename, "HOFCH_%d.PAK", i); - _res->loadPakFile(tmpfilename); - } - } - } + seq_playSequences(kSequenceVirgin, kSequenceZanfaun); + //seq_playSequences(kSequenceFunters, kSequenceFrash); + + _res->unloadAllPakFiles(); + + if (_menuChoice != 4) { + // load just the pak files needed for ingame + _res->loadPakFile(StaticResource::staticDataFilename()); + if (_flags.platform == Common::kPlatformPC && _flags.isTalkie) + _res->loadFileList("FILEDATA.FDT"); + else + _res->loadFileList(_ingamePakList, _ingamePakListSize); } if (_menuChoice == 1) { @@ -221,9 +185,6 @@ int KyraEngine_v2::go() { } else if (_menuChoice == 3) { // TODO: Load Game - } else if (_menuChoice == 2) { - // TODO: Run Demo - } return 0; |