From c4780d2befd15dbd66ac54de4a18f29fbc7acd93 Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 6 Jan 2020 23:17:19 +0100 Subject: GRAPHICS: Fix screen shake x/y offsets scaling The x and y offsets need to be scaled the same way as the rest of the screen output. --- backends/graphics/windowed.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h index 40fbe8baf7..bea4522d5a 100644 --- a/backends/graphics/windowed.h +++ b/backends/graphics/windowed.h @@ -405,9 +405,9 @@ private: width = fracToInt(height * displayAspect); } } - - drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset; - drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset; + + drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * _windowWidth / getWidth(); + drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * _windowHeight / getHeight(); drawRect.setWidth(width); drawRect.setHeight(height); } -- cgit v1.2.3