diff options
author | Eugene Sandulenko | 2010-08-21 19:26:10 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 23:10:57 +0000 |
commit | bab1358e51ab1e457f98b5d8f4e8550b2bcfefc0 (patch) | |
tree | 2282bbdc411c0d10eacc7a1c97442fdef0b2cd09 /engines | |
parent | c51f4629cfab692e0e1fc62f0030e4c67cd8d9c5 (diff) | |
download | scummvm-rg350-bab1358e51ab1e457f98b5d8f4e8550b2bcfefc0.tar.gz scummvm-rg350-bab1358e51ab1e457f98b5d8f4e8550b2bcfefc0.tar.bz2 scummvm-rg350-bab1358e51ab1e457f98b5d8f4e8550b2bcfefc0.zip |
SWORD25: More tweaking to image Blit, doesn't assert anymore.
Though in fact it is all wrong now.
svn-id: r53270
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword25/gfx/opengl/glimage.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/engines/sword25/gfx/opengl/glimage.cpp b/engines/sword25/gfx/opengl/glimage.cpp index 919721df18..ccf7c48cf8 100644 --- a/engines/sword25/gfx/opengl/glimage.cpp +++ b/engines/sword25/gfx/opengl/glimage.cpp @@ -181,8 +181,23 @@ bool GLImage::Blit(int PosX, int PosY, int Flipping, Common::Rect *pPartRect, un warning("STUB: Sprite flipping"); } - w = CLIP(x1 + w, 0, (int)_backSurface->w); - h = CLIP(y1 + h, 0, (int)_backSurface->h); + if (PosX < 0) { + w -= PosX; + x1 = -PosX; + PosX = 0; + } + + if (PosY < 0) { + h -= PosY; + y1 = -PosY; + PosY = 0; + } + + w = CLIP(PosX + w, 0, (int)_backSurface->w - PosX - 1); + h = CLIP(PosY + h, 0, (int)_backSurface->h - PosY - 1); + + if (w == 0 || h == 0) + return true; // Rendern // TODO: |