diff options
author | Cameron Cawley | 2019-07-27 14:40:50 +0100 |
---|---|---|
committer | Filippos Karapetis | 2019-08-15 02:01:21 +0300 |
commit | 1feb86ee97eaaaf326918d4945cdaa0a2f61d33f (patch) | |
tree | ee051b4732b9d65bb57940af07e3d4cf91aba7f5 /backends/graphics/wincesdl | |
parent | 0bf74e590d6da396ae10793191fad92f4424ae6d (diff) | |
download | scummvm-rg350-1feb86ee97eaaaf326918d4945cdaa0a2f61d33f.tar.gz scummvm-rg350-1feb86ee97eaaaf326918d4945cdaa0a2f61d33f.tar.bz2 scummvm-rg350-1feb86ee97eaaaf326918d4945cdaa0a2f61d33f.zip |
BACKENDS: Handle screen shaking in WindowedGraphicsManager
Diffstat (limited to 'backends/graphics/wincesdl')
-rw-r--r-- | backends/graphics/wincesdl/wincesdl-graphics.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index 80792d439c..9bfcd64079 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -498,12 +498,17 @@ void WINCESdlGraphicsManager::internUpdateScreen() { } // If the shake position changed, fill the dirty area with blackness - if (_currentShakePos != _newShakePos) { - SDL_Rect blackrect = {0, 0, _videoMode.screenWidth *_scaleFactorXm / _scaleFactorXd, _newShakePos *_scaleFactorYm / _scaleFactorYd}; + if (_currentShakePos != _gameScreenShakeOffset || + (_cursorNeedsRedraw && _mouseBackup.y <= _currentShakePos)) { + SDL_Rect blackrect = {0, 0, (Uint16)(_videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd), (Uint16)(_gameScreenShakeOffset * _scaleFactorYm / _scaleFactorYd)}; + if (_videoMode.aspectRatioCorrection) blackrect.h = real2Aspect(blackrect.h - 1) + 1; + SDL_FillRect(_hwScreen, &blackrect, 0); - _currentShakePos = _newShakePos; + + _currentShakePos = _gameScreenShakeOffset; + _forceRedraw = true; } |