From 846f9644ddd471b6e6c7b147e971382dddda14fb Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 1 Aug 2012 22:34:00 +0200 Subject: TONY: Clip width to avoid crash when drawing flipped sprite This fixes - or at least work around - a failed assertion when Pantagruel leaves the office at the beginning of the game. --- engines/tony/gfxcore.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/tony') diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp index ca6dd45c14..0c331cc0e9 100644 --- a/engines/tony/gfxcore.cpp +++ b/engines/tony/gfxcore.cpp @@ -927,6 +927,9 @@ void RMGfxSourceBuffer8RLE::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPri u = _dimx - (width + u); x1 = (prim->getDst()._x1 + _dimx - 1) - u; + if (width > x1) + width = x1; + // Specify the drawn area bigBuf.addDirtyRect(Common::Rect(x1 - width, y1, x1, y1 + height)); -- cgit v1.2.3