aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorArnaud Boutonné2009-08-17 09:50:35 +0000
committerArnaud Boutonné2009-08-17 09:50:35 +0000
commitf3918d14d692591d0797ad4b9c03f1fe1cbbb94b (patch)
tree011402811cdcb85903b05b24be1ee696a7cc4b62 /engines/gob
parent374dccc90563c8a1b67c94bf9fb15d7d5b065c1e (diff)
downloadscummvm-rg350-f3918d14d692591d0797ad4b9c03f1fe1cbbb94b.tar.gz
scummvm-rg350-f3918d14d692591d0797ad4b9c03f1fe1cbbb94b.tar.bz2
scummvm-rg350-f3918d14d692591d0797ad4b9c03f1fe1cbbb94b.zip
Added OPCODEDRAW 0x85, with a specific workaround for Bambou hardcoded paths in scripts
svn-id: r43461
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/inter.h1
-rw-r--r--engines/gob/inter_playtoons.cpp23
2 files changed, 24 insertions, 0 deletions
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index c3d3a26f47..e8f39c8db8 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -560,6 +560,7 @@ protected:
bool oPlaytoons_checkData(OpFuncParams &params);
void oPlaytoons_CD_20_23();
void oPlaytoons_CD_25();
+ void oPlaytoons_openItk();
};
} // End of namespace Gob
diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp
index 285360c613..b4a3c36e99 100644
--- a/engines/gob/inter_playtoons.cpp
+++ b/engines/gob/inter_playtoons.cpp
@@ -27,6 +27,7 @@
#include "gob/gob.h"
#include "gob/inter.h"
+#include "gob/helper.h"
#include "gob/global.h"
#include "gob/util.h"
#include "gob/dataio.h"
@@ -70,6 +71,7 @@ void Inter_Playtoons::setupOpcodesDraw() {
OPCODEDRAW(0x20, oPlaytoons_CD_20_23);
OPCODEDRAW(0x23, oPlaytoons_CD_20_23);
OPCODEDRAW(0x25, oPlaytoons_CD_25);
+ OPCODEDRAW(0x85, oPlaytoons_openItk);
}
void Inter_Playtoons::setupOpcodesFunc() {
@@ -137,5 +139,26 @@ void Inter_Playtoons::oPlaytoons_CD_25() {
_vm->_game->_script->readVarIndex();
}
+void Inter_Playtoons::oPlaytoons_openItk() {
+
+ char fileName[128];
+ char *backSlash;
+
+ _vm->_game->_script->evalExpr(0);
+ strncpy0(fileName, _vm->_game->_script->getResultStr(), 124);
+
+ if (!strchr(fileName, '.'))
+ strcat(fileName, ".ITK");
+
+ // Workaround for Bambou : In the script, the path is hardcoded (!!)
+ if (backSlash=strrchr(fileName, '\\')) {
+ debugC(2, kDebugFileIO, "Opening ITK file \"%s\" instead of \"%s\"", backSlash + 1, fileName);
+ _vm->_dataIO->openDataFile(backSlash + 1, true);
+ } else
+ _vm->_dataIO->openDataFile(fileName, true);
+ // All the other checks are meant to verify (if not found at the first try)
+ // if the file is present on the CD or not. As everything is supposed to
+ // be copied, those checks are skipped
+}
} // End of namespace Gob