[Scummvm-cvs-logs] SF.net SVN: scummvm:[35407] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Wed Dec 17 01:41:01 CET 2008


Revision: 35407
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35407&view=rev
Author:   drmccoy
Date:     2008-12-17 00:41:00 +0000 (Wed, 17 Dec 2008)

Log Message:
-----------
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

Modified Paths:
--------------
    scummvm/trunk/engines/gob/inter.h
    scummvm/trunk/engines/gob/inter_v6.cpp
    scummvm/trunk/engines/gob/saveload_v6.cpp

Modified: scummvm/trunk/engines/gob/inter.h
===================================================================
--- scummvm/trunk/engines/gob/inter.h	2008-12-16 23:27:35 UTC (rev 35406)
+++ scummvm/trunk/engines/gob/inter.h	2008-12-17 00:41:00 UTC (rev 35407)
@@ -625,6 +625,7 @@
 
 	void o6_totSub();
 	void o6_playVmdOrMusic();
+	void o6_openItk();
 
 	bool o6_loadCursor(OpFuncParams &params);
 	bool o6_evaluateStore(OpFuncParams &params);

Modified: scummvm/trunk/engines/gob/inter_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v6.cpp	2008-12-16 23:27:35 UTC (rev 35406)
+++ scummvm/trunk/engines/gob/inter_v6.cpp	2008-12-17 00:41:00 UTC (rev 35407)
@@ -219,7 +219,7 @@
 		OPCODE(o6_playVmdOrMusic),
 		/* 84 */
 		OPCODE(o2_getImdInfo),
-		OPCODE(o2_openItk),
+		OPCODE(o6_openItk),
 		OPCODE(o2_closeItk),
 		OPCODE(o2_setImdFrontSurf),
 		/* 88 */
@@ -755,6 +755,27 @@
 		_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();
 

Modified: scummvm/trunk/engines/gob/saveload_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/saveload_v6.cpp	2008-12-16 23:27:35 UTC (rev 35406)
+++ scummvm/trunk/engines/gob/saveload_v6.cpp	2008-12-17 00:41:00 UTC (rev 35407)
@@ -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) :


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list