aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2010-09-14 09:54:41 +0000
committerEugene Sandulenko2010-10-12 23:48:32 +0000
commitcf664780cb860078f4e06684d862ce4a2c981316 (patch)
tree2f676f2eda2ad9a80b0fbdba98905a737f3a9a80 /engines
parent3fe27789709bbf5bf68a782a26fc11aaf8ca4e68 (diff)
downloadscummvm-rg350-cf664780cb860078f4e06684d862ce4a2c981316.tar.gz
scummvm-rg350-cf664780cb860078f4e06684d862ce4a2c981316.tar.bz2
scummvm-rg350-cf664780cb860078f4e06684d862ce4a2c981316.zip
SWORD25: Bugfix to not draw off-screen images
svn-id: r53350
Diffstat (limited to 'engines')
-rw-r--r--engines/sword25/gfx/opengl/glimage.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sword25/gfx/opengl/glimage.cpp b/engines/sword25/gfx/opengl/glimage.cpp
index f5dac96039..038514ab32 100644
--- a/engines/sword25/gfx/opengl/glimage.cpp
+++ b/engines/sword25/gfx/opengl/glimage.cpp
@@ -226,13 +226,13 @@ bool GLImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRect, ui
// Handle off-screen clipping
if (posY < 0) {
- img->h -= -posY;
+ img->h = MAX(0, (int)img->h - -posY);
img->pixels = (byte *)img->pixels + img->pitch * -posY;
posY = 0;
}
if (posX < 0) {
- img->w -= -posX;
+ img->w = MAX(0, (int)img->w - -posX);
img->pixels = (byte *)img->pixels + (-posX * 4);
posX = 0;
}