From 792e77e653bcb8c023919ee3d07110fb84e1cb60 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Tue, 23 Jun 2009 01:22:30 +0000 Subject: Added Script::getStartOffset() svn-id: r41795 --- engines/gob/game_v1.cpp | 2 +- engines/gob/game_v2.cpp | 2 +- engines/gob/script.cpp | 6 ++++++ engines/gob/script.h | 36 +++++++++++++++++++----------------- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp index 960c8e6e39..92679cb568 100644 --- a/engines/gob/game_v1.cpp +++ b/engines/gob/game_v1.cpp @@ -164,7 +164,7 @@ void Game_v1::playTot(int16 skipPlay) { if (!_vm->_inter->_variables) _vm->_inter->allocateVars(_script->getVariablesCount() & 0xFFFF); - _script->seek(READ_LE_UINT32(_script->getData() + 0x64)); + _script->seek(_script->getStartOffset()); _vm->_inter->renewTimeInVars(); diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp index 96a25cdf61..e4b4b73661 100644 --- a/engines/gob/game_v2.cpp +++ b/engines/gob/game_v2.cpp @@ -199,7 +199,7 @@ void Game_v2::playTot(int16 skipPlay) { if (!_vm->_inter->_variables) _vm->_inter->allocateVars(_script->getVariablesCount() & 0xFFFF); - _script->seek(READ_LE_UINT16(_script->getData() + 0x64)); + _script->seek(_script->getStartOffset()); _vm->_inter->renewTimeInVars(); diff --git a/engines/gob/script.cpp b/engines/gob/script.cpp index ef7fc40db0..18d47d4333 100644 --- a/engines/gob/script.cpp +++ b/engines/gob/script.cpp @@ -422,6 +422,8 @@ bool Script::getTOTProperties() { _exFileNumber = _totData[60]; _communHandling = _totData[61]; + _startOffset = READ_LE_UINT32(_totData + 100); + return true; } @@ -534,6 +536,10 @@ uint8 Script::getCommunHandling() const { return _communHandling; } +uint32 Script::getStartOffset() const { + return _startOffset; +} + uint32 Script::getVariablesCount(const char *fileName, GobEngine *vm) { if (!vm->_dataIO->existData(fileName)) return 0; diff --git a/engines/gob/script.h b/engines/gob/script.h index 0e5dfc825c..6fa08aa7ae 100644 --- a/engines/gob/script.h +++ b/engines/gob/script.h @@ -117,15 +117,16 @@ public: void call(uint32 offset); // Fixed properties - uint8 getVersionMajor() const; - uint8 getVersionMinor() const; - uint32 getVariablesCount() const; - uint32 getTextsOffset() const; + uint8 getVersionMajor () const; + uint8 getVersionMinor () const; + uint32 getVariablesCount () const; + uint32 getTextsOffset () const; uint32 getResourcesOffset() const; - uint16 getAnimDataSize() const; - uint8 getImFileNumber() const; - uint8 getExFileNumber() const; - uint8 getCommunHandling() const; + uint16 getAnimDataSize () const; + uint8 getImFileNumber () const; + uint8 getExFileNumber () const; + uint8 getCommunHandling () const; + uint32 getStartOffset () const; static uint32 getVariablesCount(const char *fileName, GobEngine *vm); @@ -147,15 +148,16 @@ private: int16 _lomHandle; - uint8 _versionMajor; - uint8 _versionMinor; - uint32 _variablesCount; - uint32 _textsOffset; - uint32 _resourcesOffset; - uint16 _animDataSize; - uint8 _imFileNumber; - uint8 _exFileNumber; - uint8 _communHandling; + uint8 _versionMajor; + uint8 _versionMinor; + uint32 _variablesCount; + uint32 _textsOffset; + uint32 _resourcesOffset; + uint16 _animDataSize; + uint8 _imFileNumber; + uint8 _exFileNumber; + uint8 _communHandling; + uint32 _startOffset; Common::Stack _callStack; -- cgit v1.2.3