aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-21 21:03:44 -0400
committerPaul Gilbert2014-08-21 21:03:44 -0400
commit8d1d1f6739b3b9f456d618a8740d754ddac2eb41 (patch)
treef16670625f49c7a14a38ffcd3e2629e4f8b58bef /engines
parent966515a7d0f0e9bccc8ad2a761020372d4bae19f (diff)
downloadscummvm-rg350-8d1d1f6739b3b9f456d618a8740d754ddac2eb41.tar.gz
scummvm-rg350-8d1d1f6739b3b9f456d618a8740d754ddac2eb41.tar.bz2
scummvm-rg350-8d1d1f6739b3b9f456d618a8740d754ddac2eb41.zip
ACCESS: Fix displaying background in scrolling rooms
Diffstat (limited to 'engines')
-rw-r--r--engines/access/room.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/access/room.cpp b/engines/access/room.cpp
index 0e6cba052d..83fcce1a15 100644
--- a/engines/access/room.cpp
+++ b/engines/access/room.cpp
@@ -256,15 +256,13 @@ void Room::setupRoom() {
_vm->_screen->_scrollX = 0;
_vm->_screen->_scrollCol = 0;
} else {
- _vm->_screen->_scrollX = _vm->_player->_rawPlayer.x -
- (_vm->_player->_rawPlayer.x >> 4);
- int xp = MAX((_vm->_player->_rawPlayer.x >> 4) -
- (_vm->_screen->_vWindowWidth / 2), 0);
- _vm->_screen->_scrollCol = xp;
-
- xp = xp + _vm->_screen->_vWindowWidth - _playFieldWidth;
- if (xp >= 0) {
- _vm->_screen->_scrollCol = xp + 1;
+ int xv = _vm->_player->_rawPlayer.x / TILE_WIDTH;
+ _vm->_screen->_scrollX = _vm->_player->_rawPlayer.x % TILE_WIDTH;
+ _vm->_screen->_scrollCol = MAX(xv - (_vm->_screen->_vWindowWidth / 2), 0);
+
+ int sx = _vm->_screen->_scrollCol + _vm->_screen->_vWindowWidth - _playFieldWidth;
+ if (sx >= 0) {
+ _vm->_screen->_scrollCol -= sx + 1;
}
}