From b579dbb71b4aafa533b06589ced928d788a1c2e6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 12 Aug 2014 21:12:11 -0400 Subject: ACCESS: Fixes for clipping --- engines/access/asurface.cpp | 10 ++++++---- engines/access/screen.cpp | 10 +++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index 5a090afaca..ba75607637 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -115,13 +115,14 @@ bool ASurface::clip(Common::Rect &r) { _topSkip = _bottomSkip = 0; if (r.left > _clipWidth) { + if (r.left >= 0) + return true; + skip = -r.left; r.setWidth(r.width() - skip); _leftSkip = skip; r.moveTo(0, r.top); } - else if (r.left >= 0) - return true; int right = r.right - 1; if (right < 0) @@ -133,13 +134,14 @@ bool ASurface::clip(Common::Rect &r) { } if (r.top > _clipHeight) { + if (r.top >= 0) + return true; + skip = -r.top; r.setHeight(r.height() - skip); _topSkip = skip; r.moveTo(r.left, 0); } - else if (r.top >= 0) - return true; int bottom = r.bottom - 1; if (bottom < 0) diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp index cdd5f2021e..9cefa356ef 100644 --- a/engines/access/screen.cpp +++ b/engines/access/screen.cpp @@ -51,10 +51,18 @@ Screen::Screen(AccessEngine *vm) : _vm(vm) { _scrollCol = _scrollRow = 0; _windowXAdd = _windowYAdd = 0; _screenYOff = 0; + + setDisplayScan(); } void Screen::setDisplayScan() { - warning("TODO: setDisplayScan"); + _clipWidth = this->w - 1; + _clipHeight = this->h - 1; + _windowXAdd = _windowYAdd = 0; + _scrollX = _scrollY = 0; + _scrollCol = _scrollRow = 0; + _bufferStart.x = _bufferStart.y = 0; + _screenYOff = 0; } void Screen::setPanel(int num) { -- cgit v1.2.3