aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/game
diff options
context:
space:
mode:
authorLittleboy2011-09-08 15:47:34 -0400
committerLittleboy2011-09-19 09:22:59 -0400
commitce4c98d75715192823655f8e255b894c5bb92364 (patch)
treebf469d8738951b0017ab7c34243a0a255debf620 /engines/lastexpress/game
parentb76b038ffc8173942927dd9be42dc731573ee3ed (diff)
downloadscummvm-rg350-ce4c98d75715192823655f8e255b894c5bb92364.tar.gz
scummvm-rg350-ce4c98d75715192823655f8e255b894c5bb92364.tar.bz2
scummvm-rg350-ce4c98d75715192823655f8e255b894c5bb92364.zip
LASTEXPRESS: Small cleanup in Entities::processEntity() and Entities::processFrame()
Diffstat (limited to 'engines/lastexpress/game')
-rw-r--r--engines/lastexpress/game/entities.cpp65
1 files changed, 31 insertions, 34 deletions
diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp
index f6bb2030f0..1b31339b7b 100644
--- a/engines/lastexpress/game/entities.cpp
+++ b/engines/lastexpress/game/entities.cpp
@@ -753,50 +753,48 @@ label_nosequence:
if (!data->sequence)
goto label_nosequence;
- if (data->frame->getInfo()->field_30 > data->field_49B + 1 || (data->direction == kDirectionLeft && data->sequence->count() == 1)) {
+ if (data->frame->getInfo()->field_30 > (data->field_49B + 1) || (data->direction == kDirectionLeft && data->sequence->count() == 1)) {
++data->field_49B;
- INCREMENT_DIRECTION_COUNTER();
- return;
- }
+ } else {
+ if (data->frame->getInfo()->field_30 > data->field_49B && !data->frame->getInfo()->keepPreviousFrame) {
+ ++data->field_49B;
+ } else {
+ if (data->frame->getInfo()->keepPreviousFrame == 1)
+ keepPreviousFrame = true;
- if (data->frame->getInfo()->field_30 > data->field_49B && !data->frame->getInfo()->keepPreviousFrame) {
- ++data->field_49B;
- INCREMENT_DIRECTION_COUNTER();
- return;
- }
+ // Increment current frame
+ ++data->currentFrame;
- if (data->frame->getInfo()->keepPreviousFrame == 1)
- keepPreviousFrame = true;
+ if (data->currentFrame > (int16)(data->sequence->count() - 1) || (data->field_4A9 && checkSequenceFromPosition(entityIndex))) {
- // Increment current frame
- ++data->currentFrame;
+ if (data->direction == kDirectionLeft) {
+ data->currentFrame = 0;
+ } else {
+ keepPreviousFrame = true;
+ drawNextSequence(entityIndex);
- if (data->currentFrame > (int16)(data->sequence->count() - 1) || (data->field_4A9 && checkSequenceFromPosition(entityIndex))) {
+ if (getFlags()->flag_entities_0 || data->doProcessEntity)
+ return;
- if (data->direction == kDirectionLeft) {
- data->currentFrame = 0;
- } else {
- keepPreviousFrame = true;
- drawNextSequence(entityIndex);
+ if (!data->sequence2) {
+ updateEntityPosition(entityIndex);
+ data->doProcessEntity = false;
+ return;
+ }
- if (getFlags()->flag_entities_0 || data->doProcessEntity)
- return;
+ copySequenceData(entityIndex);
+ }
- if (!data->sequence2) {
- updateEntityPosition(entityIndex);
- data->doProcessEntity = false;
- return;
}
- copySequenceData(entityIndex);
- }
+ processFrame(entityIndex, keepPreviousFrame, false);
+ if (getFlags()->flag_entities_0 || data->doProcessEntity)
+ return;
+ }
}
- processFrame(entityIndex, keepPreviousFrame, false);
-
- if (!getFlags()->flag_entities_0 && !data->doProcessEntity)
- INCREMENT_DIRECTION_COUNTER();
+ INCREMENT_DIRECTION_COUNTER();
}
void Entities::computeCurrentFrame(EntityIndex entityIndex) const {
@@ -1109,9 +1107,8 @@ void Entities::processFrame(EntityIndex entityIndex, bool keepPreviousFrame, boo
// Get new frame info
FrameInfo *info = data->sequence->getFrameInfo((uint16)data->currentFrame);
- if (data->frame && data->frame->getInfo()->subType != kFrameType3)
- if (!info->field_2E || keepPreviousFrame)
- getScenes()->setCoordinates(data->frame);
+ if (data->frame && data->frame->getInfo()->subType != kFrameType3 && (!info->field_2E || keepPreviousFrame))
+ getScenes()->setCoordinates(data->frame);
// Update position
if (info->entityPosition) {