aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2007-08-08 03:42:33 +0000
committerSven Hesse2007-08-08 03:42:33 +0000
commitb48a14734bdf74b20d24de1ef002020dda08ce59 (patch)
tree072878fc714e1beebcb0e1858f8726de1c403adb /engines/gob
parentd66750777503d8b05676705e46ab9640240c4b25 (diff)
downloadscummvm-rg350-b48a14734bdf74b20d24de1ef002020dda08ce59.tar.gz
scummvm-rg350-b48a14734bdf74b20d24de1ef002020dda08ce59.tar.bz2
scummvm-rg350-b48a14734bdf74b20d24de1ef002020dda08ce59.zip
(Finally) fixed the turning around counterclockwise in Lost in Time.
svn-id: r28488
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/mult_v2.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp
index cced4aac63..ddce90df0c 100644
--- a/engines/gob/mult_v2.cpp
+++ b/engines/gob/mult_v2.cpp
@@ -259,8 +259,11 @@ void Mult_v2::loadImds(Common::SeekableReadStream &data) {
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 @@ void Mult_v2::multSub(uint16 multIndex) {
}
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 @@ void Mult_v2::advanceObjects(int16 index) {
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 @@ void Mult_v2::advanceObjects(int16 index) {
_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 @@ void Mult_v2::advanceObjects(int16 index) {
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;