Skip to content

Commit

Permalink
LASTEXPRESS: Replace INVERT_Y macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Templier committed Jul 17, 2012
1 parent 3cf7e8c commit be94a24
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
32 changes: 17 additions & 15 deletions engines/lastexpress/game/beetle.cpp
Expand Up @@ -336,33 +336,35 @@ void Beetle::drawUpdate() {
}
}

#define INVERT_Y() \
switch (_data->indexes[_data->offset]) { \
default: \
break; \
case 24: \
case 25: \
case 26: \
case 27: \
case 28: \
_data->coordY = -_data->coordY; \
break; \
}

// Invert direction
INVERT_Y();
invertDirection();

SequenceFrame *frame = new SequenceFrame(_data->currentSequence, (uint16)_data->currentFrame);
updateFrame(frame);

INVERT_Y();
invertDirection();

getScenes()->addToQueue(frame);

SAFE_DELETE(_data->frame);
_data->frame = frame;
}

void Beetle::invertDirection() {
switch (_data->indexes[_data->offset]) {
default:
break;

case 24:
case 25:
case 26:
case 27:
case 28:
_data->coordY = -_data->coordY;
break;
}
}

void Beetle::move() {
if (!_data)
error("[Beetle::move] Sequences have not been loaded");
Expand Down
1 change: 1 addition & 0 deletions engines/lastexpress/game/beetle.h
Expand Up @@ -111,6 +111,7 @@ class Beetle {
void updateFrame(SequenceFrame *frame) const;
void updateData(uint32 index);
void drawUpdate();
void invertDirection();
};

} // End of namespace LastExpress
Expand Down

0 comments on commit be94a24

Please sign in to comment.