From bab1358e51ab1e457f98b5d8f4e8550b2bcfefc0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 21 Aug 2010 19:26:10 +0000 Subject: SWORD25: More tweaking to image Blit, doesn't assert anymore. Though in fact it is all wrong now. svn-id: r53270 --- engines/sword25/gfx/opengl/glimage.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'engines') 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: -- cgit v1.2.3