aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrichiesams2013-08-31 18:10:58 -0500
committerWillem Jan Palenstijn2013-09-24 13:59:40 +0200
commit2ad40edd47098144cecb808cf308bca8329479ff (patch)
tree9d8576bf0f3b35aa3f6a7e6d947cbe494e3d3382
parent07fdcdf312e5498508affe825db37a6f1644f738 (diff)
downloadscummvm-rg350-2ad40edd47098144cecb808cf308bca8329479ff.tar.gz
scummvm-rg350-2ad40edd47098144cecb808cf308bca8329479ff.tar.bz2
scummvm-rg350-2ad40edd47098144cecb808cf308bca8329479ff.zip
ZVISION: Limit tilt movement to the size of the image
// TODO: Remove image wrapping logic for the vertical direction since this can never happen now
-rw-r--r--engines/zvision/render_manager.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp
index 96030ba2b9..ea34469baf 100644
--- a/engines/zvision/render_manager.cpp
+++ b/engines/zvision/render_manager.cpp
@@ -324,15 +324,7 @@ void RenderManager::moveBackground(int offset) {
if (state == RenderTable::TILT) {
_backgroundOffset += Common::Point(0, offset);
- if (_backgroundOffset.x <= -_backgroundWidth)
- _backgroundOffset.x += _backgroundWidth;
- else if (_backgroundOffset.x >= _backgroundWidth)
- _backgroundOffset.x -= _backgroundWidth;
-
- if (_backgroundOffset.y <= -_backgroundHeight)
- _backgroundOffset.y += _backgroundHeight;
- else if (_backgroundOffset.y >= _backgroundHeight)
- _backgroundOffset.y -= _backgroundHeight;
+ _backgroundOffset.y = CLIP<int16>(_backgroundOffset.y, _screenCenterY, (int16)_backgroundHeight - _screenCenterY);
renderImageToScreen(_currentBackground, 0, _screenCenterY - _backgroundOffset.y, true);
} else if (state == RenderTable::PANORAMA) {
@@ -343,11 +335,6 @@ void RenderManager::moveBackground(int offset) {
else if (_backgroundOffset.x >= _backgroundWidth)
_backgroundOffset.x -= _backgroundWidth;
- if (_backgroundOffset.y <= -_backgroundHeight)
- _backgroundOffset.y += _backgroundHeight;
- else if (_backgroundOffset.y >= _backgroundHeight)
- _backgroundOffset.y -= _backgroundHeight;
-
renderImageToScreen(_currentBackground, _screenCenterX - _backgroundOffset.x, 0, true);
} else {
renderImageToScreen(_currentBackground, 0, 0);