diff options
Diffstat (limited to 'engines/sherlock/screen.cpp')
-rw-r--r-- | engines/sherlock/screen.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp index e826a10fc0..a3af5559c7 100644 --- a/engines/sherlock/screen.cpp +++ b/engines/sherlock/screen.cpp @@ -283,7 +283,31 @@ void Screen::flushImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, i void Screen::flushScaleImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, int16 *width, int16 *height, int scaleVal) { - error("TODO"); + Common::Point imgPos = pt + frame->_offset; + Common::Rect newBounds(imgPos.x, imgPos.y, imgPos.x + frame->sDrawXSize(scaleVal), + imgPos.y + frame->sDrawYSize(scaleVal)); + Common::Rect oldBounds(*xp, *yp, *xp + *width, *yp + *height); + + if (!_flushScreen) { + // See if the areas of the old and new overlap, and if so combine the areas + if (newBounds.intersects(oldBounds)) { + Common::Rect mergedBounds = newBounds; + mergedBounds.extend(oldBounds); + mergedBounds.right += 1; + mergedBounds.bottom += 1; + + slamRect(mergedBounds); + } else { + // The two areas are independent, so copy them both + slamRect(newBounds); + slamRect(oldBounds); + } + } + + *xp = newBounds.left; + *yp = newBounds.top; + *width = newBounds.width(); + *height = newBounds.height(); } void Screen::print(const Common::Point &pt, byte color, const char *formatStr, ...) { |