diff options
author | Filippos Karapetis | 2015-12-08 01:33:59 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:54 +0100 |
commit | daf06557547066b1068f974ee37f69ecee975e7c (patch) | |
tree | f975a8b823e360ba119a9894bff0ddc62b5cc136 /engines/lab | |
parent | 2d21f51c34e3cdb8dd2aa4d0364600e4bf7e488a (diff) | |
download | scummvm-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.cpp | 30 |
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; |