aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/mainDraw.cpp
diff options
context:
space:
mode:
authorVincent Hamm2007-05-16 22:44:22 +0000
committerVincent Hamm2007-05-16 22:44:22 +0000
commit67ba6b1e4064de28b27a5979ccf88086aecdaced (patch)
tree340134789d7a00279f5ed585774366efa1689911 /engines/cruise/mainDraw.cpp
parentf243227f098824a74eae078531ccf6af539dfbcb (diff)
downloadscummvm-rg350-67ba6b1e4064de28b27a5979ccf88086aecdaced.tar.gz
scummvm-rg350-67ba6b1e4064de28b27a5979ccf88086aecdaced.tar.bz2
scummvm-rg350-67ba6b1e4064de28b27a5979ccf88086aecdaced.zip
Figured out the bug that was causing the animations to glitch
svn-id: r26856
Diffstat (limited to 'engines/cruise/mainDraw.cpp')
-rw-r--r--engines/cruise/mainDraw.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index 8210f6d404..3d9064cf59 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -865,8 +865,7 @@ void mainDraw(int16 param) {
bgPtr = backgroundPtrtable[currentActiveBackgroundPlane];
if (bgPtr) {
- gfxModuleData_gfxCopyScreen((char *)bgPtr,
- (char *)gfxModuleData.pPage10);
+ gfxModuleData_gfxCopyScreen((char *)bgPtr, (char *)gfxModuleData.pPage10);
}
autoCellHead.next = NULL;
@@ -881,24 +880,16 @@ void mainDraw(int16 param) {
//-------------------------------------------------- PROCESS SPRITES -----------------------------------------//
while (currentObjPtr) {
- if ((currentActiveBackgroundPlane ==
- currentObjPtr->backgroundPlane)
- && (currentObjPtr->freeze == 0)
- && (currentObjPtr->type == OBJ_SPRITE)) {
+ if ((currentActiveBackgroundPlane == currentObjPtr->backgroundPlane) && (currentObjPtr->freeze == 0) && (currentObjPtr->type == OBJ_SPRITE)) {
objectParamsQuery params;
currentObjIdx = currentObjPtr->idx;
- if ((currentObjPtr->followObjectOverlayIdx !=
- currentObjPtr->overlay)
- || (currentObjPtr->followObjectIdx !=
- currentObjPtr->idx)) {
+ if ((currentObjPtr->followObjectOverlayIdx != currentObjPtr->overlay) || (currentObjPtr->followObjectIdx != currentObjPtr->idx)) {
// Declaring this twice ?
// objectParamsQuery params;
- getMultipleObjectParam(currentObjPtr->
- followObjectOverlayIdx,
- currentObjPtr->followObjectIdx, &params);
+ getMultipleObjectParam(currentObjPtr->followObjectOverlayIdx, currentObjPtr->followObjectIdx, &params);
objX1 = params.X;
objY1 = params.Y;
@@ -940,18 +931,20 @@ void mainDraw(int16 param) {
}
}
- if ((currentObjPtr->animStep != 0) && (param == 0)) {
+ // automatic animation process
+ if (currentObjPtr->animStep && !param) {
if (currentObjPtr->animCounter <= 0) {
- int newVal;
+
bool change = true;
- newVal = getValueFromObjectQuerry(&params, currentObjPtr->animChange) + currentObjPtr->animStep;
+ int newVal = getValueFromObjectQuerry(&params, currentObjPtr->animChange) + currentObjPtr->animStep;
if (currentObjPtr->animStep > 0) {
if (newVal > currentObjPtr->animEnd) {
if (currentObjPtr->animLoop) {
newVal = currentObjPtr->animStart;
- currentObjPtr->animLoop--;
+ if(currentObjPtr->animLoop>0)
+ currentObjPtr->animLoop--;
} else {
int16 data2;
data2 = currentObjPtr->animStart;
@@ -968,7 +961,6 @@ void mainDraw(int16 param) {
changeScriptParamInList(currentObjPtr->parentOverlay, currentObjPtr->parent, &relHead, 0, -1);
}
}
- newVal = data2;
}
}
} else {