diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index f023f9342dd6..e88bd27c917e 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -152,7 +152,7 @@ bool ASurface::clip(Common::Rect &r) { _leftSkip = _rightSkip = 0; _topSkip = _bottomSkip = 0; - if (r.left > _clipWidth) { + if (r.left > _clipWidth || r.left < 0) { if (r.left >= 0) return true; @@ -171,7 +171,7 @@ bool ASurface::clip(Common::Rect &r) { _rightSkip = skip; } - if (r.top > _clipHeight) { + if (r.top > _clipHeight || r.top < 0) { if (r.top >= 0) return true; @@ -285,10 +285,7 @@ void ASurface::sPlotB(SpriteFrame *frame, const Common::Rect &bounds) { } void ASurface::copyBlock(ASurface *src, const Common::Rect &bounds) { - Common::Rect destBounds = bounds; - //destBounds.translate(src->_scrollX, src->_scrollY); - - copyRectToSurface(*src, destBounds.left, destBounds.top, bounds); + copyRectToSurface(*src, bounds.left, bounds.top, bounds); } void ASurface::saveBlock(const Common::Rect &bounds) { diff --git a/engines/access/asurface.h b/engines/access/asurface.h index be3597d21791..84fe90dbbd06 100644 --- a/engines/access/asurface.h +++ b/engines/access/asurface.h @@ -86,7 +86,7 @@ class ASurface : public Graphics::Surface { */ void plotB(SpriteFrame *frame, const Common::Point &pt); - void copyBlock(ASurface *src, const Common::Rect &bounds); + virtual void copyBlock(ASurface *src, const Common::Rect &bounds); void copyTo(ASurface *dest, const Common::Point &destPos); diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 83fcce1a158c..225cd8054891 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -296,6 +296,10 @@ void Room::buildScreen() { int cnt = _vm->_screen->_vWindowWidth + 1; int offset = 0; + // Clear current background buffer + _vm->_buffer1.clearBuffer(); + + // Loop through drawing each column of tiles forming the background for (int idx = 0; idx < cnt; offset += TILE_WIDTH, ++idx) { buildColumn(_vm->_screen->_scrollCol, offset); ++_vm->_screen->_scrollCol; diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp index 3092d7e152c4..af97e2e236b6 100644 --- a/engines/access/screen.cpp +++ b/engines/access/screen.cpp @@ -236,4 +236,11 @@ void Screen::moveBufferUp() { error("TODO: UP"); } +void Screen::copyBlock(ASurface *src, const Common::Rect &bounds) { + Common::Rect destBounds = bounds; + destBounds.translate(_windowXAdd, _windowYAdd + _screenYOff); + + copyRectToSurface(*src, destBounds.left, destBounds.top, bounds); +} + } // End of namespace Access diff --git a/engines/access/screen.h b/engines/access/screen.h index 98e77b4cf4a7..e66a7a375915 100644 --- a/engines/access/screen.h +++ b/engines/access/screen.h @@ -79,6 +79,8 @@ class Screen: public ASurface { int _bufferBytesWide; int _vWindowLinesTall; bool _screenChangeFlag; +public: + virtual void copyBlock(ASurface *src, const Common::Rect &bounds); public: Screen(AccessEngine *vm);