aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp')
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index 0b0d9a3a7a..a7dbed18c8 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -86,6 +86,8 @@ ScalerProc *DINGUXSdlGraphicsManager::getGraphicsScalerProc(int mode) const {
void DINGUXSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
+ _gameScreenShakeOffset = 0;
+
#ifdef USE_RGB_COLOR
// Avoid redundant format changes
Graphics::PixelFormat newFormat;
@@ -216,16 +218,16 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() {
#endif
// If the shake position changed, fill the dirty area with blackness
- if (_currentShakePos != _newShakePos ||
+ if (_currentShakePos != _gameScreenShakeOffset ||
(_cursorNeedsRedraw && _mouseBackup.y <= _currentShakePos)) {
- SDL_Rect blackrect = {0, 0, (Uint16)(_videoMode.screenWidth * _videoMode.scaleFactor), (Uint16)(_newShakePos * _videoMode.scaleFactor)};
+ SDL_Rect blackrect = {0, 0, (Uint16)(_videoMode.screenWidth * _videoMode.scaleFactor), (Uint16)(_gameScreenShakeOffset * _videoMode.scaleFactor)};
if (_videoMode.aspectRatioCorrection && !_overlayVisible)
blackrect.h = real2Aspect(blackrect.h - 1) + 1;
SDL_FillRect(_hwScreen, &blackrect, 0);
- _currentShakePos = _newShakePos;
+ _currentShakePos = _gameScreenShakeOffset;
_forceRedraw = true;
}