aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/screen.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-04 11:28:55 -0400
committerPaul Gilbert2015-07-04 11:28:55 -0400
commit9ca62e6f619fc45b6d305ed46eea439cf78855c9 (patch)
tree8bb7327818292b230183bb73f23792440ef95bdb /engines/sherlock/screen.cpp
parent39544c1728524f3ebc729c8d90ca0f191078d3a4 (diff)
downloadscummvm-rg350-9ca62e6f619fc45b6d305ed46eea439cf78855c9.tar.gz
scummvm-rg350-9ca62e6f619fc45b6d305ed46eea439cf78855c9.tar.bz2
scummvm-rg350-9ca62e6f619fc45b6d305ed46eea439cf78855c9.zip
SHERLOCK: RT: Consolidate scroll position into the Screen class
Diffstat (limited to 'engines/sherlock/screen.cpp')
-rw-r--r--engines/sherlock/screen.cpp19
1 files changed, 4 insertions, 15 deletions
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
@@ -359,18 +359,8 @@ 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 &currentScroll) {
- 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, ...) {