Skip to content

Commit

Permalink
ACCESS: Workaround for background rendering bug in original
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 13, 2014
1 parent 386aae3 commit 21c1d0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions engines/access/room.cpp
Expand Up @@ -289,14 +289,16 @@ void Room::setWallCodes() {

void Room::buildScreen() {
int scrollCol = _vm->_screen->_scrollCol;
int cnt = _vm->_screen->_vWindowWidth + 1;
int offset = 0;

// Clear current background buffer
_vm->_buffer1.clearBuffer();

// WORKAROUND: Original's use of '+ 1' would frequently cause memory overruns
int w = MIN(_vm->_screen->_vWindowWidth + 1, _playFieldWidth);

// Loop through drawing each column of tiles forming the background
for (int idx = 0; idx < cnt; offset += TILE_WIDTH, ++idx) {
for (int idx = 0; idx < w; offset += TILE_WIDTH, ++idx) {
buildColumn(_vm->_screen->_scrollCol, offset);
++_vm->_screen->_scrollCol;
}
Expand Down

0 comments on commit 21c1d0f

Please sign in to comment.