diff options
Diffstat (limited to 'backends/graphics/gph')
-rw-r--r-- | backends/graphics/gph/gph-graphics.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index a55a8869bb..cb3e09ac49 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -78,6 +78,8 @@ ScalerProc *GPHGraphicsManager::getGraphicsScalerProc(int mode) const { void GPHGraphicsManager::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 GPHGraphicsManager::internUpdateScreen() { #endif // If the shake position changed, fill the dirty area with blackness - if (_currentShakePos != _newShakePos || - (_cursorNeedsRedraw && _mouseBackup.y <= _currentShakePos)) { - SDL_Rect blackrect = {0, 0, _videoMode.screenWidth *_videoMode.scaleFactor, _newShakePos *_videoMode.scaleFactor}; + if (_currentShakePos != _gameScreenShakeOffset || + (_cursorNeedsRedraw && _mouseBackup.y <= _currentShakePos)) { + 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; } |