diff options
-rw-r--r-- | engines/gob/inter.h | 1 | ||||
-rw-r--r-- | engines/gob/inter_v6.cpp | 23 | ||||
-rw-r--r-- | engines/gob/saveload_v6.cpp | 3 |
3 files changed, 25 insertions, 2 deletions
diff --git a/engines/gob/inter.h b/engines/gob/inter.h index cd59b0a596..7026ed5ab6 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -625,6 +625,7 @@ protected: void o6_totSub(); void o6_playVmdOrMusic(); + void o6_openItk(); bool o6_loadCursor(OpFuncParams ¶ms); bool o6_evaluateStore(OpFuncParams ¶ms); diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp index fa21e4d0ba..1571546faa 100644 --- a/engines/gob/inter_v6.cpp +++ b/engines/gob/inter_v6.cpp @@ -219,7 +219,7 @@ void Inter_v6::setupOpcodes() { OPCODE(o6_playVmdOrMusic), /* 84 */ OPCODE(o2_getImdInfo), - OPCODE(o2_openItk), + OPCODE(o6_openItk), OPCODE(o2_closeItk), OPCODE(o2_setImdFrontSurf), /* 88 */ @@ -755,6 +755,27 @@ void Inter_v6::o6_playVmdOrMusic() { _vm->_vidPlayer->primaryClose(); } +void Inter_v6::o6_openItk() { + char fileName[32]; + + evalExpr(0); + strncpy0(fileName, _vm->_global->_inter_resStr, 27); + if (!strchr(fileName, '.')) + strcat(fileName, ".ITK"); + + _vm->_dataIO->openDataFile(fileName, true); + + // WORKAROUND: The CD number detection in Urban Runner is quite daft + // (it checks CD1.ITK - CD4.ITK and the first that's found determines + // the CD number), while its NO_CD modus wants everything in CD1.ITK. + // So we just open the other ITKs, too. + if (!scumm_stricmp(fileName, "cd1.itk")) { + _vm->_dataIO->openDataFile("CD2.ITK", true); + _vm->_dataIO->openDataFile("CD3.ITK", true); + _vm->_dataIO->openDataFile("CD4.ITK", true); + } +} + bool Inter_v6::o6_loadCursor(OpFuncParams ¶ms) { int16 id = load16(); diff --git a/engines/gob/saveload_v6.cpp b/engines/gob/saveload_v6.cpp index 167d84ebac..9e49a3ea63 100644 --- a/engines/gob/saveload_v6.cpp +++ b/engines/gob/saveload_v6.cpp @@ -31,7 +31,8 @@ namespace Gob { SaveLoad_v6::SaveFile SaveLoad_v6::_saveFiles[] = { - {"mdo.def", 0, kSaveModeExists, kSaveNone} + {"mdo.def", 0, kSaveModeExists, kSaveNone}, + {"NO_CD.TXT", 0, kSaveModeExists, kSaveNone} }; SaveLoad_v6::SaveLoad_v6(GobEngine *vm, const char *targetName) : |