From 67ba6b1e4064de28b27a5979ccf88086aecdaced Mon Sep 17 00:00:00 2001 From: Vincent Hamm Date: Wed, 16 May 2007 22:44:22 +0000 Subject: Figured out the bug that was causing the animations to glitch svn-id: r26856 --- engines/cruise/actor.cpp | 113 ++++++++++++++--------------------------------- 1 file changed, 32 insertions(+), 81 deletions(-) (limited to 'engines/cruise/actor.cpp') diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp index 3b430fae1a..cf7ef4b176 100644 --- a/engines/cruise/actor.cpp +++ b/engines/cruise/actor.cpp @@ -788,122 +788,73 @@ void processAnimation(void) { currentActor->pathId = computePathfinding(returnVar2, params.X, params.Y, var34, var35, currentActor->stepX, currentActor->stepY, currentActor->pathId); if (currentActor->pathId == -1) { - if ((currentActor->endDirection != -1) - && (currentActor->endDirection != - currentActor-> - startDirection)) { - currentActor->phase = - ANIM_PHASE_STATIC_END; - currentActor->nextDirection = - currentActor->endDirection; - currentActor->endDirection = - -1; + if ((currentActor->endDirection != -1) && (currentActor->endDirection != currentActor->startDirection)) { + currentActor->phase = ANIM_PHASE_STATIC_END; + currentActor->nextDirection = currentActor->endDirection; + currentActor->endDirection = -1; currentActor->counter = 0; } else { currentActor->pathId = -2; currentActor->flag = 0; - currentActor->endDirection = - -1; - currentActor->phase = - ANIM_PHASE_WAIT; + currentActor->endDirection = -1; + currentActor->phase = ANIM_PHASE_WAIT; } } else { - currentActor->phase = - ANIM_PHASE_STATIC; + currentActor->phase = ANIM_PHASE_STATIC; currentActor->counter = -1; } } else - if ((currentActor->type == 1) - && (currentActor->x_dest != -1) - && (currentActor->y_dest != -1)) { + if ((currentActor->type == 1) && (currentActor->x_dest != -1) && (currentActor->y_dest != -1)) { // track animation - currentActor->pathId = - computePathfinding(returnVar2, params.X, - params.Y, currentActor->x_dest, - currentActor->y_dest, currentActor->stepX, - currentActor->stepY, currentActor->pathId); + currentActor->pathId = computePathfinding(returnVar2, params.X, params.Y, currentActor->x_dest, currentActor->y_dest, currentActor->stepX, currentActor->stepY, currentActor->pathId); currentActor->x_dest = -1; currentActor->y_dest = -1; if (currentActor->pathId == -1) { - if ((currentActor->endDirection != -1) - && (currentActor->endDirection != - currentActor-> - startDirection)) { - currentActor->phase = - ANIM_PHASE_STATIC_END; - currentActor->nextDirection = - currentActor->endDirection; - currentActor->endDirection = - -1; + if ((currentActor->endDirection != -1) && (currentActor->endDirection != currentActor->startDirection)) { + currentActor->phase = ANIM_PHASE_STATIC_END; + currentActor->nextDirection = currentActor->endDirection; + currentActor->endDirection = -1; currentActor->counter = 0; } else { currentActor->pathId = -2; currentActor->flag = 0; - currentActor->endDirection = - -1; - currentActor->phase = - ANIM_PHASE_WAIT; + currentActor->endDirection = -1; + currentActor->phase = ANIM_PHASE_WAIT; } } else { - currentActor->phase = - ANIM_PHASE_STATIC; + currentActor->phase = ANIM_PHASE_STATIC; currentActor->counter = -1; } } animationStart = false; - if (currentActor->pathId >= 0 - || currentActor->phase == ANIM_PHASE_STATIC_END) { + if ((currentActor->pathId >= 0) || (currentActor->phase == ANIM_PHASE_STATIC_END)) { switch (currentActor->phase) { case ANIM_PHASE_STATIC_END: case ANIM_PHASE_STATIC: { - if (currentActor->counter == -1 - && currentActor->phase == - ANIM_PHASE_STATIC) { - affiche_chemin - (currentActor-> - pathId, - returnVar2); - - if (returnVar2[0] == - -1) { - currentActor-> - pathId = - -2; - currentActor-> - flag = 0; - currentActor-> - endDirection - = -1; - currentActor-> - phase = - ANIM_PHASE_WAIT; + if ((currentActor->counter == -1) && (currentActor->phase == ANIM_PHASE_STATIC)) { + affiche_chemin(currentActor->pathId, returnVar2); + + if (returnVar2[0] == -1) { + currentActor->pathId = -2; + currentActor->flag = 0; + currentActor->endDirection = -1; + currentActor->phase = ANIM_PHASE_WAIT; break; } - currentActor->x = - returnVar2[0]; - currentActor->y = - returnVar2[1]; - currentActor-> - nextDirection = - returnVar2[2]; - currentActor->poly = - returnVar2[4]; - currentActor->counter = - 0; + currentActor->x = returnVar2[0]; + currentActor->y = returnVar2[1]; + currentActor->nextDirection = returnVar2[2]; + currentActor->poly = returnVar2[4]; + currentActor->counter = 0; - if (currentActor-> - startDirection == - currentActor-> - nextDirection) - currentActor-> - phase = - ANIM_PHASE_MOVE; + if (currentActor->startDirection == currentActor->nextDirection) + currentActor->phase = ANIM_PHASE_MOVE; } if ((currentActor->counter >= -- cgit v1.2.3