diff options
author | Paul Gilbert | 2009-09-26 04:37:19 +0000 |
---|---|---|
committer | Paul Gilbert | 2009-09-26 04:37:19 +0000 |
commit | a5df07f56ae159b306e81d5920ae228be817e284 (patch) | |
tree | d76b87d02f014ce42d8034bda40a73bd17c12b92 /engines | |
parent | 7f1b50f300997a90fa5a66d8e741cd9d0a535231 (diff) | |
download | scummvm-rg350-a5df07f56ae159b306e81d5920ae228be817e284.tar.gz scummvm-rg350-a5df07f56ae159b306e81d5920ae228be817e284.tar.bz2 scummvm-rg350-a5df07f56ae159b306e81d5920ae228be817e284.zip |
Bugfix for the dirty rects for drawn sprites when the sprite is partially off-screen
svn-id: r44372
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cruise/mainDraw.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index edd28748ae..5c4a089957 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -1211,7 +1211,11 @@ void drawSprite(int width, int height, cellStruct *currentObjPtr, const uint8 *d int y = 0; // Flag the given area as having been changed - gfxModuleData_addDirtyRect(Common::Rect(xs, ys, xs + width, ys + height)); + Common::Point ps = Common::Point(MAX(MIN(xs, 320), 0), MAX(MIN(ys, 200), 0)); + Common::Point pe = Common::Point(MAX(MIN(xs + width, 320), 0), MAX(MIN(ys + height, 200), 0)); + if ((ps.x != pe.x) && (ps.y != pe.y)) + // At least part of sprite is on-screen + gfxModuleData_addDirtyRect(Common::Rect(ps.x, ps.y, pe.x, pe.y)); cellStruct* plWork = currentObjPtr; int workBufferSize = height * (width / 8); |