Added Script methods to query commun file handling

svn-id: r41789
This commit is contained in:
Sven Hesse 2009-06-23 01:19:21 +00:00
parent f6118f7a85
commit 8bd5c0ceba
3 changed files with 26 additions and 4 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;