aboutsummaryrefslogtreecommitdiff
path: root/backends/wince/wince.cpp
diff options
context:
space:
mode:
authorNicolas Bacca2003-07-21 12:50:20 +0000
committerNicolas Bacca2003-07-21 12:50:20 +0000
commit0bb6f3497d0f011458823b369f6d6cb84a914c36 (patch)
treeeea1fb0a47ce011ecb24b1781fe9185bb3ad85fd /backends/wince/wince.cpp
parent93cb369da7d251d55661b108dca633ff47412b84 (diff)
downloadscummvm-rg350-0bb6f3497d0f011458823b369f6d6cb84a914c36.tar.gz
scummvm-rg350-0bb6f3497d0f011458823b369f6d6cb84a914c36.tar.bz2
scummvm-rg350-0bb6f3497d0f011458823b369f6d6cb84a914c36.zip
Fix 774982
svn-id: r9107
Diffstat (limited to 'backends/wince/wince.cpp')
-rw-r--r--backends/wince/wince.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/backends/wince/wince.cpp b/backends/wince/wince.cpp
index 100a339ba4..ab12d86559 100644
--- a/backends/wince/wince.cpp
+++ b/backends/wince/wince.cpp
@@ -1445,6 +1445,26 @@ void OSystem_WINCE3::copy_rect(const byte *buf, int pitch, int x, int y, int w,
if (!hide_cursor && _mouse_drawn)
undraw_mouse();
+ /* Clip */
+ if (x < 0) {
+ w += x;
+ buf -= x;
+ x = 0;
+ }
+ if (y < 0) {
+ h += y;
+ buf -= y * pitch;
+ y = 0;
+ }
+ if (w > _screenWidth - x)
+ w = _screenWidth - x;
+
+ if (h > _screenHeight - y)
+ h = _screenHeight - y;
+
+ if (w <= 0 || h <= 0)
+ return;
+
AddDirtyRect(x, y, w, h);
if (x == 0 && y == 0 && w == _screenWidth && h == _screenHeight) {