From 2f919d39e4b9ae0cb1f66b97b29a00525619b4c1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 8 Jan 2020 17:28:59 +0100 Subject: GRAPHICS: (really) fix screen shake x/y offsets I confused window w/h with actual drawing w/h. And obviously forgot to test stretch modes like "Center". Now these modes also seem to work pixel exact... --- backends/graphics/windowed.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h index bea4522d5a..99115275de 100644 --- a/backends/graphics/windowed.h +++ b/backends/graphics/windowed.h @@ -406,8 +406,8 @@ private: } } - drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * _windowWidth / getWidth(); - drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * _windowHeight / getHeight(); + drawRect.left = ((_windowWidth - width) / 2) + _gameScreenShakeXOffset * width / getWidth(); + drawRect.top = ((_windowHeight - height) / 2) + _gameScreenShakeYOffset * height / getHeight(); drawRect.setWidth(width); drawRect.setHeight(height); } -- cgit v1.2.3