From ba2923aa0c541dbdfd79b7026d611a7a45e1394d Mon Sep 17 00:00:00 2001 From: sluicebox Date: Sat, 16 Nov 2019 03:06:24 -0800 Subject: PSP: Implement horizontal shake --- backends/platform/3ds/osystem-graphics.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'backends') diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp index 1ea70053fb..fa419f28ec 100644 --- a/backends/platform/3ds/osystem-graphics.cpp +++ b/backends/platform/3ds/osystem-graphics.cpp @@ -370,8 +370,12 @@ void OSystem_3DS::setShakePos(int shakeXOffset, int shakeYOffset) { // TODO: implement this in overlay, top screen, and mouse too _screenShakeXOffset = shakeXOffset; _screenShakeYOffset = shakeYOffset; - _gameTopTexture.setPosition(_gameTopX, _gameTopY + _gameTopTexture.getScaleY() * shakeYOffset); - _gameBottomTexture.setPosition(_gameBottomX, _gameBottomY + _gameBottomTexture.getScaleY() * shakeYOffset); + int topX = _gameTopX + (_gameTopTexture.getScaleX() * shakeXOffset); + int topY = _gameTopY + (_gameTopTexture.getScaleY() * shakeYOffset); + _gameTopTexture.setPosition(topX, topY); + int bottomX = _gameBottomX + (_gameBottomTexture.getScaleX() * shakeXOffset); + int bottomY = _gameBottomY + (_gameBottomTexture.getScaleY() * shakeYOffset); + _gameBottomTexture.setPosition(bottomX, bottomY); } void OSystem_3DS::setFocusRectangle(const Common::Rect &rect) { -- cgit v1.2.3