From daf06557547066b1068f974ee37f69ecee975e7c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 8 Dec 2015 01:33:59 +0200 Subject: LAB: Use SWAP<> to simplify the transition code --- engines/lab/transitions.cpp | 30 ++++++++---------------------- 1 file 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(x1, x2); - if (y1 > y2) { - temp = y2; - y2 = y1; - y1 = temp; - } + if (y1 > y2) + SWAP(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(x1, x2); - if (y1 > y2) { - temp = y2; - y2 = y1; - y1 = temp; - } + if (y1 > y2) + SWAP(y1, y2); im._width = x2 - x1 + 1; im._height = y2 - y1 + 1 - dy; -- cgit v1.2.3