diff options
author | Paul Gilbert | 2014-11-23 21:13:55 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:42:36 -0500 |
commit | 68dc425cd4ba6907be6b1fa46c2251e5715b8803 (patch) | |
tree | 96b3e2eb4c2a975df8d723a686dde39a79b52258 /engines/access | |
parent | cc07c2e5a229381a5efe5d2aa092270b6dd0b75a (diff) | |
download | scummvm-rg350-68dc425cd4ba6907be6b1fa46c2251e5715b8803.tar.gz scummvm-rg350-68dc425cd4ba6907be6b1fa46c2251e5715b8803.tar.bz2 scummvm-rg350-68dc425cd4ba6907be6b1fa46c2251e5715b8803.zip |
ACCESS: Implemented buildRow for vertical screen scrolling
Diffstat (limited to 'engines/access')
-rw-r--r-- | engines/access/asurface.cpp | 4 | ||||
-rw-r--r-- | engines/access/room.cpp | 22 |
2 files changed, 23 insertions, 3 deletions
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index dbbf119171..96cb1991be 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -337,12 +337,12 @@ void ASurface::moveBufferRight() { void ASurface::moveBufferUp() { byte *p = (byte *)getPixels(); - Common::copy(p + w, p + (w * h), p); + Common::copy(p + (w * TILE_HEIGHT), p + (w * h), p); } void ASurface::moveBufferDown() { byte *p = (byte *)getPixels(); - Common::copy_backward(p, p + (w * (h - 1)), p + (w * h)); + Common::copy_backward(p, p + (w * (h - TILE_HEIGHT)), p + (w * h)); } } // End of namespace Access diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 37746d1b7c..f32bc95ae0 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -339,7 +339,27 @@ void Room::buildColumn(int playX, int screenX) { } void Room::buildRow(int playY, int screenY) { - error("TODO: buildRow"); + if (playY < 0 || playY >= _playFieldHeight) + return; + assert(screenY <= (_vm->_screen->h - TILE_HEIGHT)); + + const byte *pSrc = _playField + screenY *_playFieldWidth + _vm->_screen->_scrollCol; + + // WORKAROUND: Original's use of '+ 1' would frequently cause memory overruns + int w = MIN(_vm->_screen->_vWindowWidth + 1, _playFieldWidth); + + for (int x = 0; x < w; ++x) { + byte *pTile = _tile + (*pSrc << 8); + byte *pDest = (byte *)_vm->_buffer1.getBasePtr(w * TILE_WIDTH, screenY); + + for (int tileY = 0; tileY < TILE_HEIGHT; ++tileY) { + Common::copy(pTile, pTile + TILE_WIDTH, pDest); + pTile += TILE_WIDTH; + pDest += _vm->_buffer1.pitch; + } + + ++pSrc; + } } void Room::loadPlayField(int fileNum, int subfile) { |