[Scummvm-cvs-logs] SF.net SVN: scummvm:[41792] scummvm/trunk/engines/gob
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Tue Jun 23 03:20:22 CEST 2009
Revision: 41792
http://scummvm.svn.sourceforge.net/scummvm/?rev=41792&view=rev
Author: drmccoy
Date: 2009-06-23 01:20:21 +0000 (Tue, 23 Jun 2009)
Log Message:
-----------
Added Script::getTextsOffset()
Modified Paths:
--------------
scummvm/trunk/engines/gob/game_v1.cpp
scummvm/trunk/engines/gob/game_v2.cpp
scummvm/trunk/engines/gob/script.cpp
scummvm/trunk/engines/gob/script.h
Modified: scummvm/trunk/engines/gob/game_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v1.cpp 2009-06-23 01:20:05 UTC (rev 41791)
+++ scummvm/trunk/engines/gob/game_v1.cpp 2009-06-23 01:20:21 UTC (rev 41792)
@@ -121,15 +121,12 @@
debugC(4, kDebugFileIO, "IMA: %s", _curImaFile);
debugC(4, kDebugFileIO, "EXT: %s", _curExtFile);
- byte *filePtr = _script->getData() + 0x30;
-
_totTextData = 0;
- if (READ_LE_UINT32(filePtr) != (uint32) -1) {
+ if (_script->getTextsOffset() != ((uint32) -1)) {
_totTextData = new TotTextTable;
- _totTextData->dataPtr =
- (_script->getData() + READ_LE_UINT32(_script->getData() + 0x30));
+ _totTextData->dataPtr = _script->getData() + _script->getTextsOffset();
Common::MemoryReadStream totTextData(_totTextData->dataPtr,
- 4294967295U);
+ _script->getSize() - _script->getTextsOffset());
_totTextData->itemsCount = totTextData.readSint16LE();
@@ -140,7 +137,7 @@
}
}
- filePtr = _script->getData() + 0x34;
+ byte *filePtr = _script->getData() + 0x34;
_totResourceTable = 0;
if (READ_LE_UINT32(filePtr) != (uint32) -1) {
_totResourceTable = new TotResTable;
Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp 2009-06-23 01:20:05 UTC (rev 41791)
+++ scummvm/trunk/engines/gob/game_v2.cpp 2009-06-23 01:20:21 UTC (rev 41792)
@@ -128,29 +128,25 @@
debugC(4, kDebugFileIO, "IMA: %s", _curImaFile);
debugC(4, kDebugFileIO, "EXT: %s", _curExtFile);
- filePtr = _script->getData() + 0x30;
-
_totTextData = 0;
totTextLoc = false;
- if (READ_LE_UINT32(filePtr) != (uint32) -1) {
+ if (_script->getTextsOffset() != ((uint32) -1)) {
_totTextData = new TotTextTable;
int32 size;
- if (READ_LE_UINT32(filePtr) == 0) {
+ if (_script->getTextsOffset() == 0) {
_totTextData->dataPtr = loadLocTexts(&size);
totTextLoc = true;
} else {
- _totTextData->dataPtr =
- (_script->getData() + READ_LE_UINT32(_script->getData() + 0x30));
- size = _script->getSize();
+ _totTextData->dataPtr = _script->getData() + _script->getTextsOffset();
+ size = _script->getSize() - _script->getTextsOffset();
_vm->_global->_language = _vm->_global->_languageWanted;
}
_totTextData->items = 0;
if (_totTextData->dataPtr != 0) {
- Common::MemoryReadStream totTextData(_totTextData->dataPtr,
- 4294967295U);
+ Common::MemoryReadStream totTextData(_totTextData->dataPtr, size);
_totTextData->itemsCount = totTextData.readSint16LE() & 0x3FFF;
_totTextData->items = new TotTextItem[_totTextData->itemsCount];
Modified: scummvm/trunk/engines/gob/script.cpp
===================================================================
--- scummvm/trunk/engines/gob/script.cpp 2009-06-23 01:20:05 UTC (rev 41791)
+++ scummvm/trunk/engines/gob/script.cpp 2009-06-23 01:20:21 UTC (rev 41792)
@@ -413,6 +413,8 @@
_variablesCount = READ_LE_UINT32(_totData + 44);
+ _textsOffset = READ_LE_UINT32(_totData + 48);
+
_imFileNumber = _totData[59];
_exFileNumber = _totData[60];
_communHandling = _totData[61];
@@ -505,6 +507,10 @@
return _variablesCount;
}
+uint32 Script::getTextsOffset() const {
+ return _textsOffset;
+}
+
uint8 Script::getImFileNumber() const {
return _imFileNumber;
}
Modified: scummvm/trunk/engines/gob/script.h
===================================================================
--- scummvm/trunk/engines/gob/script.h 2009-06-23 01:20:05 UTC (rev 41791)
+++ scummvm/trunk/engines/gob/script.h 2009-06-23 01:20:21 UTC (rev 41792)
@@ -120,6 +120,7 @@
uint8 getVersionMajor() const;
uint8 getVersionMinor() const;
uint32 getVariablesCount() const;
+ uint32 getTextsOffset() const;
uint8 getImFileNumber() const;
uint8 getExFileNumber() const;
uint8 getCommunHandling() const;
@@ -147,6 +148,7 @@
uint8 _versionMajor;
uint8 _versionMinor;
uint32 _variablesCount;
+ uint32 _textsOffset;
uint8 _imFileNumber;
uint8 _exFileNumber;
uint8 _communHandling;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list