From 9ca62e6f619fc45b6d305ed46eea439cf78855c9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 4 Jul 2015 11:28:55 -0400 Subject: SHERLOCK: RT: Consolidate scroll position into the Screen class --- engines/sherlock/screen.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'engines/sherlock/screen.cpp') diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp index 404b3d5984..b16518cf95 100644 --- a/engines/sherlock/screen.cpp +++ b/engines/sherlock/screen.cpp @@ -358,19 +358,9 @@ void Screen::slamArea(int16 xp, int16 yp, int16 width, int16 height) { } void Screen::slamRect(const Common::Rect &r) { - if (r.width() && r.height() > 0) { - Common::Rect tempRect = r; - tempRect.clip(Common::Rect(0, 0, this->w(), this->h())); - - if (tempRect.isValidRect()) - blitFrom(*_backBuffer, Common::Point(tempRect.left, tempRect.top), tempRect); - } -} - -void Screen::slamRect(const Common::Rect &r, const Common::Point ¤tScroll) { if (r.width() && r.height() > 0) { Common::Rect srcRect = r, destRect = r; - srcRect.translate(currentScroll.x, currentScroll.y); + srcRect.translate(_currentScroll.x, _currentScroll.y); if (destRect.left < 0) { srcRect.left += -destRect.left; @@ -464,14 +454,13 @@ void Screen::flushImage(ImageFrame *frame, const Common::Point &pt, Common::Rect newBounds = Common::Rect(newPos.x, newPos.y, newPos.x + newSize.x, newPos.y + newSize.y); } -void Screen::blockMove(const Common::Rect &r, const Common::Point &scrollPos) { +void Screen::blockMove(const Common::Rect &r) { Common::Rect bounds = r; - bounds.translate(scrollPos.x, scrollPos.y); slamRect(bounds); } -void Screen::blockMove(const Common::Point &scrollPos) { - blockMove(Common::Rect(0, 0, w(), h()), scrollPos); +void Screen::blockMove() { + blockMove(Common::Rect(0, 0, w(), h())); } void Screen::print(const Common::Point &pt, byte color, const char *formatStr, ...) { -- cgit v1.2.3