diff options
author | Eugene Sandulenko | 2016-09-13 19:35:52 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-09-13 19:36:21 +0200 |
commit | 8204a23032f10a5d7a2195ba8f606f1111bf6db7 (patch) | |
tree | aa3c31cf981531044f29284e7c7101f321956419 /engines | |
parent | cd803d7ca7dcac1f747e9ec6d75f0048825e6f06 (diff) | |
download | scummvm-rg350-8204a23032f10a5d7a2195ba8f606f1111bf6db7.tar.gz scummvm-rg350-8204a23032f10a5d7a2195ba8f606f1111bf6db7.tar.bz2 scummvm-rg350-8204a23032f10a5d7a2195ba8f606f1111bf6db7.zip |
FULLPIPE: Simplified Dib clipping code
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/gfx.cpp | 23 |
1 files 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); |