[Scummvm-cvs-logs] SF.net SVN: scummvm:[55025] scummvm/trunk/engines/sci/engine/object.cpp

lskovlun at users.sourceforge.net lskovlun at users.sourceforge.net
Thu Dec 23 15:03:58 CET 2010


Revision: 55025
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55025&view=rev
Author:   lskovlun
Date:     2010-12-23 14:03:58 +0000 (Thu, 23 Dec 2010)

Log Message:
-----------
SCI: Unbreak script loading on big-endian machines. Thanks to [md5] and wjp.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/object.cpp

Modified: scummvm/trunk/engines/sci/engine/object.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/object.cpp	2010-12-23 13:38:37 UTC (rev 55024)
+++ scummvm/trunk/engines/sci/engine/object.cpp	2010-12-23 14:03:58 UTC (rev 55025)
@@ -63,14 +63,18 @@
 		_variables.resize(READ_LE_UINT16(data + kOffsetSelectorCounter));
 		_baseVars = (uint16 *)(_baseObj + _variables.size() * 2);
 		_methodCount = READ_LE_UINT16(data + READ_LE_UINT16(data + kOffsetFunctionArea) - 2);
-		_baseMethod = Common::Array<uint16>((const uint16 *)(data + READ_LE_UINT16(data + kOffsetFunctionArea)),
-						    _methodCount*2+2);
+		for (int i = 0; i < _methodCount * 2 + 2; ++i)
+		{
+			_baseMethod.push_back(READ_SCI11ENDIAN_UINT16(data + READ_LE_UINT16(data + kOffsetFunctionArea) + i * 2));
+		}
 	} else if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1) {
 		_variables.resize(READ_SCI11ENDIAN_UINT16(data + 2));
 		_baseVars = (uint16 *)(buf + READ_SCI11ENDIAN_UINT16(data + 4));
 		_methodCount = READ_SCI11ENDIAN_UINT16(buf + READ_SCI11ENDIAN_UINT16(data + 6));
-		_baseMethod = Common::Array<uint16>((const uint16 *) (buf + READ_SCI11ENDIAN_UINT16(data + 6)),
-						    _methodCount*2+3);
+		for (int i = 0; i < _methodCount * 2 + 3; ++i)
+		{
+			_baseMethod.push_back(READ_SCI11ENDIAN_UINT16(buf + READ_SCI11ENDIAN_UINT16(data + 6) + i * 2));
+		}
 	} else if (getSciVersion() == SCI_VERSION_3) {
 		initSelectorsSci3(buf);
 	}


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