aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2011-01-23 11:00:57 +0000
committerSven Hesse2011-01-23 11:00:57 +0000
commit411d41d3d0a3e4d14187d4a980c25c0a2e41ad9c (patch)
treeeb0bb4a11627cfef68848f6811a2cc09bba33f5b /engines
parent191d85f174128c36890f7616689084ac343a5bfc (diff)
downloadscummvm-rg350-411d41d3d0a3e4d14187d4a980c25c0a2e41ad9c.tar.gz
scummvm-rg350-411d41d3d0a3e4d14187d4a980c25c0a2e41ad9c.tar.bz2
scummvm-rg350-411d41d3d0a3e4d14187d4a980c25c0a2e41ad9c.zip
GOB: Change the NOCD workaround for Urban Runner a bit
Seems like the game does close the CD1.ITK too, so we just open all ITKs right at the start, lest it might blow up when it wants to close the top ITK and that's actually CD4. svn-id: r55461
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/init_v6.cpp20
-rw-r--r--engines/gob/inter.h1
-rw-r--r--engines/gob/inter_v6.cpp22
3 files changed, 17 insertions, 26 deletions
diff --git a/engines/gob/init_v6.cpp b/engines/gob/init_v6.cpp
index 40b4769e78..76f006533f 100644
--- a/engines/gob/init_v6.cpp
+++ b/engines/gob/init_v6.cpp
@@ -28,6 +28,7 @@
#include "gob/gob.h"
#include "gob/init.h"
#include "gob/global.h"
+#include "gob/dataio.h"
namespace Gob {
@@ -40,9 +41,22 @@ Init_v6::~Init_v6() {
void Init_v6::initGame() {
_vm->_global->_noCd = false;
- if (Common::File::exists("cd1.itk") && Common::File::exists("cd2.itk") &&
- Common::File::exists("cd3.itk") && Common::File::exists("cd4.itk")) {
- _vm->_global->_noCd = true;
+ if (_vm->getGameType() == kGameTypeUrban) {
+ if (Common::File::exists("cd1.itk") && Common::File::exists("cd2.itk") &&
+ Common::File::exists("cd3.itk") && Common::File::exists("cd4.itk")) {
+
+ _vm->_global->_noCd = 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.
+ _vm->_dataIO->openArchive("CD1.ITK", false);
+ _vm->_dataIO->openArchive("CD2.ITK", false);
+ _vm->_dataIO->openArchive("CD3.ITK", false);
+ _vm->_dataIO->openArchive("CD4.ITK", false);
+ }
+
}
Init::initGame();
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 9254768055..38bf7dba2b 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -550,7 +550,6 @@ protected:
void o6_totSub();
void o6_playVmdOrMusic();
- void o6_openItk();
bool o6_loadCursor(OpFuncParams &params);
bool o6_assign(OpFuncParams &params);
diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp
index a9262d7c37..3390ed6e9c 100644
--- a/engines/gob/inter_v6.cpp
+++ b/engines/gob/inter_v6.cpp
@@ -57,7 +57,6 @@ void Inter_v6::setupOpcodesDraw() {
OPCODEDRAW(0x40, o6_totSub);
OPCODEDRAW(0x83, o6_playVmdOrMusic);
- OPCODEDRAW(0x85, o6_openItk);
}
void Inter_v6::setupOpcodesFunc() {
@@ -199,27 +198,6 @@ void Inter_v6::o6_playVmdOrMusic() {
}
-void Inter_v6::o6_openItk() {
- char fileName[32];
-
- _vm->_game->_script->evalExpr(0);
- Common::strlcpy(fileName, _vm->_game->_script->getResultStr(), 28);
- if (!strchr(fileName, '.'))
- strcat(fileName, ".ITK");
-
- _vm->_dataIO->openArchive(fileName, false);
-
- // 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 (_vm->_global->_noCd && !scumm_stricmp(fileName, "CD1.ITK")) {
- _vm->_dataIO->openArchive("CD2.ITK", false);
- _vm->_dataIO->openArchive("CD3.ITK", false);
- _vm->_dataIO->openArchive("CD4.ITK", false);
- }
-}
-
bool Inter_v6::o6_loadCursor(OpFuncParams &params) {
int16 id = _vm->_game->_script->readInt16();