diff options
author | vanfanel | 2015-11-11 17:56:12 +0100 |
---|---|---|
committer | vanfanel | 2015-11-11 17:56:12 +0100 |
commit | 99739a13fe844c807d3cdd87e67e207e888fd48a (patch) | |
tree | 6afbf4763326277efbf528f0bb9e587bf7a01788 /engines/gob/surface.cpp | |
parent | 37e157a11c3fc731dfdcf6ec6b6a5a448550219b (diff) | |
parent | 7e44493fe8877a3c6a65f83b9ed84a5f59169005 (diff) | |
download | scummvm-rg350-99739a13fe844c807d3cdd87e67e207e888fd48a.tar.gz scummvm-rg350-99739a13fe844c807d3cdd87e67e207e888fd48a.tar.bz2 scummvm-rg350-99739a13fe844c807d3cdd87e67e207e888fd48a.zip |
Merge branch 'master' into dispmanx
Diffstat (limited to 'engines/gob/surface.cpp')
-rw-r--r-- | engines/gob/surface.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp index 42ac2b0d74..ed83e8255c 100644 --- a/engines/gob/surface.cpp +++ b/engines/gob/surface.cpp @@ -470,7 +470,7 @@ void Surface::blitScaled(const Surface &from, Common::Rational scale, int32 tran blitScaled(from, 0, 0, from._width - 1, from._height - 1, 0, 0, scale, transp); } -void Surface::fillRect(uint16 left, uint16 top, uint16 right, uint16 bottom, uint32 color) { +void Surface::fillRect(int16 left, int16 top, int16 right, int16 bottom, uint32 color) { // Just in case those are swapped if (left > right) SWAP(left, right); @@ -481,6 +481,11 @@ void Surface::fillRect(uint16 left, uint16 top, uint16 right, uint16 bottom, uin // Nothing to do return; + left = CLIP<int32>(left , 0, _width - 1); + top = CLIP<int32>(top , 0, _height - 1); + right = CLIP<int32>(right , 0, _width - 1); + bottom = CLIP<int32>(bottom, 0, _height - 1); + // Area to actually fill uint16 width = CLIP<int32>(right - left + 1, 0, _width - left); uint16 height = CLIP<int32>(bottom - top + 1, 0, _height - top); |