From 8204a23032f10a5d7a2195ba8f606f1111bf6db7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 13 Sep 2016 19:35:52 +0200 Subject: FULLPIPE: Simplified Dib clipping code --- engines/fullpipe/gfx.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 1ef5c47cce..90b8ae5c2b 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -843,25 +843,18 @@ void Bitmap::putDib(int x, int y, int32 *palette, int alpha) { return; Common::Rect sub(0, 0, _width, _height); + sub.translate(x, y); + sub.clip(g_fp->_sceneRect); + sub.translate(-x, -y); - if (x1 < 0) { - sub.left = -x1; + if (sub.isEmpty()) + return; + + if (x1 < 0) x1 = 0; - } - if (y1 < 0) { - sub.top = -y1; + if (y1 < 0) y1 = 0; - } - - if (x1 + sub.width() > 799) - sub.right -= x1 + sub.width() - 799; - - if (y1 + sub.height() > 599) - sub.bottom -= y1 + sub.height() - 599; - - if (sub.width() <= 0 || sub.height() <= 0) - return; int alphac = TS_ARGB(0xff, alpha, 0xff, 0xff); -- cgit v1.2.3