[Scummvm-cvs-logs] SF.net SVN: scummvm:[41788] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Tue Jun 23 03:19:03 CEST 2009


Revision: 41788
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41788&view=rev
Author:   drmccoy
Date:     2009-06-23 01:19:03 +0000 (Tue, 23 Jun 2009)

Log Message:
-----------
Added Script methods to get the TOT major and minor version

Modified Paths:
--------------
    scummvm/trunk/engines/gob/draw_v2.cpp
    scummvm/trunk/engines/gob/mult_v2.cpp
    scummvm/trunk/engines/gob/script.cpp
    scummvm/trunk/engines/gob/script.h

Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp	2009-06-23 01:01:16 UTC (rev 41787)
+++ scummvm/trunk/engines/gob/draw_v2.cpp	2009-06-23 01:19:03 UTC (rev 41788)
@@ -329,7 +329,7 @@
 	ptrEnd = ptr;
 	while (((ptrEnd - dataPtr) < size) && (*ptrEnd != 1)) {
 		// Converting to unknown commands/characters to spaces
-		if ((_vm->_game->_script->getData()[0x29] < 0x32) && (*ptrEnd > 3) && (*ptrEnd < 32))
+		if ((_vm->_game->_script->getVersionMinor() < 2) && (*ptrEnd > 3) && (*ptrEnd < 32))
 			*ptrEnd = 32;
 
 		switch (*ptrEnd) {

Modified: scummvm/trunk/engines/gob/mult_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult_v2.cpp	2009-06-23 01:01:16 UTC (rev 41787)
+++ scummvm/trunk/engines/gob/mult_v2.cpp	2009-06-23 01:19:03 UTC (rev 41788)
@@ -253,7 +253,7 @@
 	_multData->execPtr = _vm->_game->_script->getData() + _vm->_game->_script->pos();
 	_vm->_game->_script->skip(size * 2);
 
-	if (_vm->_game->_script->getData()[0x29] < 51)
+	if (_vm->_game->_script->getVersionMinor() < 3)
 		return;
 
 	size = data.readSint16LE();
@@ -871,7 +871,7 @@
 				animObj.newBottom =
 					MAX(animObj.lastBottom, _vm->_scenery->_toRedrawBottom);
 
-				if ((_vm->_game->_script->getData()[0x29] > 50) &&
+				if ((_vm->_game->_script->getVersionMinor() > 2) &&
 						(animObj.newLeft == animObj.lastLeft) &&
 						(animObj.newTop == animObj.lastTop) &&
 						(animObj.newRight == animObj.lastRight) &&

Modified: scummvm/trunk/engines/gob/script.cpp
===================================================================
--- scummvm/trunk/engines/gob/script.cpp	2009-06-23 01:01:16 UTC (rev 41787)
+++ scummvm/trunk/engines/gob/script.cpp	2009-06-23 01:19:03 UTC (rev 41788)
@@ -376,7 +376,10 @@
 		}
 	}
 
-	return (_totData != 0);
+	if (_totData == 0)
+		return false;
+
+	return getTOTProperties();
 }
 
 bool Script::loadLOM(const Common::String &fileName) {
@@ -400,6 +403,17 @@
 	return true;
 }
 
+bool Script::getTOTProperties() {
+	// Offset 39-41: Version in "Major.Minor" string form
+	if (_totData[40] != '.')
+		return false;
+
+	_versionMajor = _totData[39] - '0';
+	_versionMinor = _totData[41] - '0';
+
+	return true;
+}
+
 void Script::unload() {
 	unloadTOT();
 }
@@ -473,4 +487,12 @@
 	seek(offset);
 }
 
+uint8 Script::getVersionMajor() const {
+	return _versionMajor;
+}
+
+uint8 Script::getVersionMinor() const {
+	return _versionMinor;
+}
+
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/script.h
===================================================================
--- scummvm/trunk/engines/gob/script.h	2009-06-23 01:01:16 UTC (rev 41787)
+++ scummvm/trunk/engines/gob/script.h	2009-06-23 01:19:03 UTC (rev 41788)
@@ -116,6 +116,10 @@
 	/** Push the current script position and branch to the specified offset. */
 	void call(uint32 offset);
 
+	// Fixed properties
+	uint8 getVersionMajor() const;
+	uint8 getVersionMinor() const;
+
 private:
 	struct CallEntry {
 		byte *totPtr;
@@ -134,6 +138,9 @@
 
 	int16 _lomHandle;
 
+	uint8 _versionMajor;
+	uint8 _versionMinor;
+
 	Common::Stack<CallEntry> _callStack;
 
 	/** Loading a TOT file. */
@@ -141,6 +148,8 @@
 	/** Loading a LOM file. */
 	bool loadLOM(const Common::String &fileName);
 
+	bool getTOTProperties();
+
 	/** Unloading a TOT file. */
 	void unloadTOT();
 };


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