aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2009-06-23 01:19:21 +0000
committerSven Hesse2009-06-23 01:19:21 +0000
commit8bd5c0cebad9733cdb1d1969f9d0ce1991635b81 (patch)
tree73175123445a6409817f01df79f3d753c146c0a6 /engines
parentf6118f7a85bfd2b1ef634fc2aeb8ef9ec960ec6f (diff)
downloadscummvm-rg350-8bd5c0cebad9733cdb1d1969f9d0ce1991635b81.tar.gz
scummvm-rg350-8bd5c0cebad9733cdb1d1969f9d0ce1991635b81.tar.bz2
scummvm-rg350-8bd5c0cebad9733cdb1d1969f9d0ce1991635b81.zip
Added Script methods to query commun file handling
svn-id: r41789
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/game.cpp8
-rw-r--r--engines/gob/script.cpp16
-rw-r--r--engines/gob/script.h6
3 files changed, 26 insertions, 4 deletions
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index ac08954dd1..0ebcbbeb7c 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -176,7 +176,7 @@ byte *Game::loadExtData(int16 itemId, int16 *pResWidth,
tableSize = 0;
_vm->_dataIO->closeData(_extHandle);
strcpy(path, "commun.ex1");
- path[strlen(path) - 1] = *(_script->getData() + 0x3C) + '0';
+ path[strlen(path) - 1] = _script->getExFileNumber() + '0';
commonHandle = _vm->_dataIO->openData(path);
handle = commonHandle;
} else
@@ -451,12 +451,12 @@ void Game::loadExtTable(void) {
void Game::loadImFile(void) {
char path[20];
- if ((_script->getData()[0x3D] != 0) && (_script->getData()[0x3B] == 0))
+ if ((_script->getCommunHandling() != 0) && (_script->getImFileNumber() == 0))
return;
strcpy(path, "commun.im1");
- if (_script->getData()[0x3B] != 0)
- path[strlen(path) - 1] = '0' + _script->getData()[0x3B];
+ if (_script->getImFileNumber() != 0)
+ path[strlen(path) - 1] = '0' + _script->getImFileNumber();
if (!_vm->_dataIO->existData(path))
return;
diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp
index 61876d7a4a..4549fd8698 100644
--- a/engines/gob/script.cpp
+++ b/engines/gob/script.cpp
@@ -411,6 +411,10 @@ bool Script::getTOTProperties() {
_versionMajor = _totData[39] - '0';
_versionMinor = _totData[41] - '0';
+ _imFileNumber = _totData[59];
+ _exFileNumber = _totData[60];
+ _communHandling = _totData[61];
+
return true;
}
@@ -495,4 +499,16 @@ uint8 Script::getVersionMinor() const {
return _versionMinor;
}
+uint8 Script::getImFileNumber() const {
+ return _imFileNumber;
+}
+
+uint8 Script::getExFileNumber() const {
+ return _exFileNumber;
+}
+
+uint8 Script::getCommunHandling() const {
+ return _communHandling;
+}
+
} // End of namespace Gob
diff --git a/engines/gob/script.h b/engines/gob/script.h
index 63cb237e6e..8ea553e92e 100644
--- a/engines/gob/script.h
+++ b/engines/gob/script.h
@@ -119,6 +119,9 @@ public:
// Fixed properties
uint8 getVersionMajor() const;
uint8 getVersionMinor() const;
+ uint8 getImFileNumber() const;
+ uint8 getExFileNumber() const;
+ uint8 getCommunHandling() const;
private:
struct CallEntry {
@@ -140,6 +143,9 @@ private:
uint8 _versionMajor;
uint8 _versionMinor;
+ uint8 _imFileNumber;
+ uint8 _exFileNumber;
+ uint8 _communHandling;
Common::Stack<CallEntry> _callStack;