Skip to content

Commit

Permalink
TONY: Clip width to avoid crash when drawing flipped sprite
Browse files Browse the repository at this point in the history
This fixes - or at least work around - a failed assertion when
Pantagruel leaves the office at the beginning of the game.
  • Loading branch information
Torbjörn Andersson committed Aug 1, 2012
1 parent fab814b commit 846f964
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engines/tony/gfxcore.cpp
Expand Up @@ -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));

Expand Down

0 comments on commit 846f964

Please sign in to comment.