diff options
author | Paul Gilbert | 2014-08-22 22:55:17 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-08-22 22:55:17 -0400 |
commit | b4d2484633e80ac2a1caccfedb51980cd7926c11 (patch) | |
tree | ed799583beeabfd0cd138a789754e35bf3b686c0 /engines/access | |
parent | e5130bcc6c2c813fa2ab9238fce277f51a999990 (diff) | |
download | scummvm-rg350-b4d2484633e80ac2a1caccfedb51980cd7926c11.tar.gz scummvm-rg350-b4d2484633e80ac2a1caccfedb51980cd7926c11.tar.bz2 scummvm-rg350-b4d2484633e80ac2a1caccfedb51980cd7926c11.zip |
ACCESS: Fixes for drawing scrolling scenes
Diffstat (limited to 'engines/access')
-rw-r--r-- | engines/access/asurface.cpp | 9 | ||||
-rw-r--r-- | engines/access/asurface.h | 2 | ||||
-rw-r--r-- | engines/access/room.cpp | 4 | ||||
-rw-r--r-- | engines/access/screen.cpp | 7 | ||||
-rw-r--r-- | engines/access/screen.h | 2 |
5 files changed, 17 insertions, 7 deletions
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index f023f9342d..e88bd27c91 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 be3597d217..84fe90dbbd 100644 --- a/engines/access/asurface.h +++ b/engines/access/asurface.h @@ -86,7 +86,7 @@ public: */ 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 83fcce1a15..225cd80548 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 3092d7e152..af97e2e236 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 98e77b4cf4..e66a7a3759 100644 --- a/engines/access/screen.h +++ b/engines/access/screen.h @@ -80,6 +80,8 @@ public: int _vWindowLinesTall; bool _screenChangeFlag; public: + virtual void copyBlock(ASurface *src, const Common::Rect &bounds); +public: Screen(AccessEngine *vm); virtual ~Screen() {} |