diff options
author | Nicolas Bacca | 2003-07-21 12:50:20 +0000 |
---|---|---|
committer | Nicolas Bacca | 2003-07-21 12:50:20 +0000 |
commit | 0bb6f3497d0f011458823b369f6d6cb84a914c36 (patch) | |
tree | eea1fb0a47ce011ecb24b1781fe9185bb3ad85fd /backends | |
parent | 93cb369da7d251d55661b108dca633ff47412b84 (diff) | |
download | scummvm-rg350-0bb6f3497d0f011458823b369f6d6cb84a914c36.tar.gz scummvm-rg350-0bb6f3497d0f011458823b369f6d6cb84a914c36.tar.bz2 scummvm-rg350-0bb6f3497d0f011458823b369f6d6cb84a914c36.zip |
Fix 774982
svn-id: r9107
Diffstat (limited to 'backends')
-rw-r--r-- | backends/wince/wince.cpp | 20 |
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) { |