diff options
author | Robert Göffringmann | 2005-11-08 10:21:02 +0000 |
---|---|---|
committer | Robert Göffringmann | 2005-11-08 10:21:02 +0000 |
commit | 243f99df401f7455578affe754013ae3834d1e6d (patch) | |
tree | 2d0dec36b76831dce20b9fcde58afbab15d0075d /sword1/screen.cpp | |
parent | be5bae910619c7902640f8d650a94af3ee3cbbb4 (diff) | |
download | scummvm-rg350-243f99df401f7455578affe754013ae3834d1e6d.tar.gz scummvm-rg350-243f99df401f7455578affe754013ae3834d1e6d.tar.bz2 scummvm-rg350-243f99df401f7455578affe754013ae3834d1e6d.zip |
another scrolling fix, the engine didn't scroll all the way to the end of the screens before.
svn-id: r19516
Diffstat (limited to 'sword1/screen.cpp')
-rw-r--r-- | sword1/screen.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sword1/screen.cpp b/sword1/screen.cpp index 1e5787be59..8d070b0d51 100644 --- a/sword1/screen.cpp +++ b/sword1/screen.cpp @@ -89,8 +89,8 @@ void Screen::setScrolling(int16 offsetX, int16 offsetY) { _oldScrollY = Logic::_scriptVars[SCROLL_OFFSET_Y]; int dx = offsetX - Logic::_scriptVars[SCROLL_OFFSET_X]; int dy = offsetY - Logic::_scriptVars[SCROLL_OFFSET_Y]; - int scrlDistX = inRange(-MAX_SCROLL_DISTANCE, ((1 + ABS(dx)) / SCROLL_FRACTION) * ((dx > 0) ? 1 : -1), MAX_SCROLL_DISTANCE); - int scrlDistY = inRange(-MAX_SCROLL_DISTANCE, ((1 + ABS(dy)) / SCROLL_FRACTION) * ((dy > 0) ? 1 : -1), MAX_SCROLL_DISTANCE); + int scrlDistX = inRange(-MAX_SCROLL_DISTANCE, (((SCROLL_FRACTION - 1) + ABS(dx)) / SCROLL_FRACTION) * ((dx > 0) ? 1 : -1), MAX_SCROLL_DISTANCE); + int scrlDistY = inRange(-MAX_SCROLL_DISTANCE, (((SCROLL_FRACTION - 1) + ABS(dy)) / SCROLL_FRACTION) * ((dy > 0) ? 1 : -1), MAX_SCROLL_DISTANCE); if ((scrlDistX != 0) || (scrlDistY != 0)) _fullRefresh = true; Logic::_scriptVars[SCROLL_OFFSET_X] = inRange(0, Logic::_scriptVars[SCROLL_OFFSET_X] + scrlDistX, Logic::_scriptVars[MAX_SCROLL_OFFSET_X]); |