aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-08 01:33:59 +0200
committerWillem Jan Palenstijn2015-12-23 21:33:54 +0100
commitdaf06557547066b1068f974ee37f69ecee975e7c (patch)
treef975a8b823e360ba119a9894bff0ddc62b5cc136 /engines/lab
parent2d21f51c34e3cdb8dd2aa4d0364600e4bf7e488a (diff)
downloadscummvm-rg350-daf06557547066b1068f974ee37f69ecee975e7c.tar.gz
scummvm-rg350-daf06557547066b1068f974ee37f69ecee975e7c.tar.bz2
scummvm-rg350-daf06557547066b1068f974ee37f69ecee975e7c.zip
LAB: Use SWAP<> to simplify the transition code
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/transitions.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/engines/lab/transitions.cpp b/engines/lab/transitions.cpp
index 80a24ddf2d..b7d8e8c6a1 100644
--- a/engines/lab/transitions.cpp
+++ b/engines/lab/transitions.cpp
@@ -386,21 +386,14 @@ void DisplayMan::blackAllScreen() {
/*****************************************************************************/
void DisplayMan::scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
Image im;
- uint16 temp;
im._imageData = _tempScrollData;
- if (x1 > x2) {
- temp = x2;
- x2 = x1;
- x1 = temp;
- }
+ if (x1 > x2)
+ SWAP<uint16>(x1, x2);
- if (y1 > y2) {
- temp = y2;
- y2 = y1;
- y1 = temp;
- }
+ if (y1 > y2)
+ SWAP<uint16>(y1, y2);
im._width = x2 - x1 + 1 - dx;
im._height = y2 - y1 + 1;
@@ -417,21 +410,14 @@ void DisplayMan::scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint1
/*****************************************************************************/
void DisplayMan::scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
Image im;
- uint16 temp;
im._imageData = _tempScrollData;
- if (x1 > x2) {
- temp = x2;
- x2 = x1;
- x1 = temp;
- }
+ if (x1 > x2)
+ SWAP<uint16>(x1, x2);
- if (y1 > y2) {
- temp = y2;
- y2 = y1;
- y1 = temp;
- }
+ if (y1 > y2)
+ SWAP<uint16>(y1, y2);
im._width = x2 - x1 + 1;
im._height = y2 - y1 + 1 - dy;