aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2008-12-17 00:41:00 +0000
committerSven Hesse2008-12-17 00:41:00 +0000
commit3591f8859ed5fe6ad4cc94671d7d43a52b9f01b6 (patch)
treedaf95d6b5f181ab861776358f5e40b0fc11b46b5
parentadae869c8a227b0da4abf2b2c30b97e7cf1ea7fb (diff)
downloadscummvm-rg350-3591f8859ed5fe6ad4cc94671d7d43a52b9f01b6.tar.gz
scummvm-rg350-3591f8859ed5fe6ad4cc94671d7d43a52b9f01b6.tar.bz2
scummvm-rg350-3591f8859ed5fe6ad4cc94671d7d43a52b9f01b6.zip
Workaround for Urban Runner's CD number detection daftness.
Basically, now we claim to run in no-CD-mode (by pretending "NO_CD.TXT" exists) and open CD2.ITK, CD3.ITK and CD4.ITK manually svn-id: r35407
-rw-r--r--engines/gob/inter.h1
-rw-r--r--engines/gob/inter_v6.cpp23
-rw-r--r--engines/gob/saveload_v6.cpp3
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 &params);
bool o6_evaluateStore(OpFuncParams &params);
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 &params) {
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) :