mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
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
This commit is contained in:
committed by
Willem Jan Palenstijn
parent
07fdcdf312
commit
2ad40edd47
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user