aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/game
diff options
context:
space:
mode:
authorLittleboy2012-07-16 23:16:17 -0400
committerLittleboy2012-07-16 23:51:31 -0400
commitbe94a24fd2cf3e89e3976eb52581c5a8a65d81a1 (patch)
treed5b16989b2134feb4739622cea246fb8e8dcc24b /engines/lastexpress/game
parent3cf7e8ccf347fd57a82eb5df39ac4941a4f6c2b1 (diff)
downloadscummvm-rg350-be94a24fd2cf3e89e3976eb52581c5a8a65d81a1.tar.gz
scummvm-rg350-be94a24fd2cf3e89e3976eb52581c5a8a65d81a1.tar.bz2
scummvm-rg350-be94a24fd2cf3e89e3976eb52581c5a8a65d81a1.zip
LASTEXPRESS: Replace INVERT_Y macro
Diffstat (limited to 'engines/lastexpress/game')
-rw-r--r--engines/lastexpress/game/beetle.cpp32
-rw-r--r--engines/lastexpress/game/beetle.h1
2 files changed, 18 insertions, 15 deletions
diff --git a/engines/lastexpress/game/beetle.cpp b/engines/lastexpress/game/beetle.cpp
index f95947617a..2a72459697 100644
--- a/engines/lastexpress/game/beetle.cpp
+++ b/engines/lastexpress/game/beetle.cpp
@@ -336,26 +336,13 @@ 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);
@@ -363,6 +350,21 @@ void Beetle::drawUpdate() {
_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");
diff --git a/engines/lastexpress/game/beetle.h b/engines/lastexpress/game/beetle.h
index d3c47f39e5..034ebbd557 100644
--- a/engines/lastexpress/game/beetle.h
+++ b/engines/lastexpress/game/beetle.h
@@ -111,6 +111,7 @@ private:
void updateFrame(SequenceFrame *frame) const;
void updateData(uint32 index);
void drawUpdate();
+ void invertDirection();
};
} // End of namespace LastExpress