From 751a96730ef7b43d2f59919b523c07ee685b56c2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 30 Mar 2017 22:24:20 -0400 Subject: TITANIC: Fix rect calculation in CSurfaceArea fillRect --- engines/titanic/star_control/surface_area.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'engines/titanic') diff --git a/engines/titanic/star_control/surface_area.cpp b/engines/titanic/star_control/surface_area.cpp index a3029bde88..4536d7bf4e 100644 --- a/engines/titanic/star_control/surface_area.cpp +++ b/engines/titanic/star_control/surface_area.cpp @@ -169,11 +169,8 @@ double CSurfaceArea::fillRect(const FRect &rect) { } } - Common::Rect rr((int)(r.left - 0.5), (int)(r.top - 0.5), (int)(r.right - 0.5), (int)(r.bottom - 0.5)); - if (rr.left > rr.right) { - SWAP(rr.left, rr.right); - SWAP(rr.top, rr.bottom); - } + Common::Rect rr((int)(MIN(r.left, r.right) - 0.5), (int)(MIN(r.top, r.bottom) - 0.5), + (int)(MAX(r.left, r.right) - 0.5), (int)(MAX(r.top, r.bottom) - 0.5)); Graphics::Surface s; s.setPixels(_pixelsPtr); -- cgit v1.2.3