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/linuxmotosdl | |
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/linuxmotosdl')
-rw-r--r-- | backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp index 45546c10e7..2105bd84d8 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp @@ -88,6 +88,8 @@ ScalerProc *LinuxmotoSdlGraphicsManager::getGraphicsScalerProc(int mode) const { void LinuxmotoSdlGraphicsManager::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; @@ -247,15 +249,16 @@ void LinuxmotoSdlGraphicsManager::internUpdateScreen() { #endif // If the shake position changed, fill the dirty area with blackness - if (_currentShakePos != _newShakePos) { - 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; _forceFull = true; } |