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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Wed Aug 8 05:42:33 CEST 2007


Revision: 28488
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28488&view=rev
Author:   drmccoy
Date:     2007-08-07 20:42:33 -0700 (Tue, 07 Aug 2007)

Log Message:
-----------
(Finally) fixed the turning around counterclockwise in Lost in Time.

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

Modified: scummvm/trunk/engines/gob/mult_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult_v2.cpp	2007-08-07 20:43:41 UTC (rev 28487)
+++ scummvm/trunk/engines/gob/mult_v2.cpp	2007-08-08 03:42:33 UTC (rev 28488)
@@ -259,8 +259,11 @@
 		return;
 
 	size = data.readSint16LE();
-	_multData->somepointer10 = new char[size * 20];
-	data.read(_multData->somepointer10, size * 20);
+	if (size > 0) {
+		_multData->somepointer10 = new char[size * 20];
+		data.read(_multData->somepointer10, size * 20);
+	}
+
 	size = _vm->_inter->load16();
 	if (size <= 0)
 		return;
@@ -474,12 +477,11 @@
 	}
 
 	if (_multData->animDirection == -1) {
-		for (int i = 0; i < _multData->imdKeysCount[i]; i++) {
-			if (_multData->imdKeys[index][i].frame > startFrame)
-				break;
+		int i = 0;
+		while (_multData->imdKeys[index][i].frame <= startFrame)
+			i++;
 
-			_multData->imdIndices[index] = i - 1;
-		}
+		_multData->imdIndices[index] = i - 1;
 	}
 
 	firstFrame = (_multData->animDirection == 1) ? startFrame : stopFrame;
@@ -1091,15 +1093,11 @@
 	for (int i = 0; i < 4; i++) {
 		int obj = _multData->animObjs[index][i];
 
-		if (_multData->animObjs[index][i] != -1) {
+		if ((obj != -1) && (obj != 1024)) {
 			int keyIndex = _multData->animKeysIndices[index][i];
 			int count = _multData->animKeysCount[i];
 
 			for (int j = keyIndex; j < count; j++) {
-
-				if ((obj == -1) || (obj == 1024))
-					continue;
-
 				Mult_AnimKey &key = _multData->animKeys[i][j];
 				Mult_Object &animObj = _objects[obj];
 				Mult_AnimData &animData = *(animObj.pAnimData);
@@ -1161,7 +1159,7 @@
 					_multData->imdIndices[1] = -1;
 					_multData->imdIndices[2] = -1;
 					_multData->imdIndices[3] = -1;
-					if ((_multData->animDirection == 1) || (key2.imdFile == 1))
+					if ((_multData->animDirection == 1) || (key2.imdFile == -1))
 						_multData->imdIndices[i] = j;
 					else if (_multData->animKeysStopFrames[index] == frame)
 						_multData->imdIndices[i] = -1;
@@ -1187,7 +1185,8 @@
 			imdFile = _multData->imdFiles + fileN * 14;
 			dir = _multData->animDirection;
 			startFrame = frame - key.frame;
-			if ((dir != 1) && (--startFrame > 0))
+
+			if ((dir != 1) && (--startFrame < 0))
 				startFrame = 0;
 
 			hasImds = true;


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