aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorColin Snover2017-12-01 11:41:49 -0600
committerColin Snover2017-12-01 19:43:12 -0600
commit5c855a0a5a71ca17dae6015ea0676fc2e2c4f249 (patch)
treeba9b8c9b53eaed0271b08dc758a8948311b476c4 /backends/graphics
parent4d3f05ae7928ba625f29749b73b754314bdbe728 (diff)
downloadscummvm-rg350-5c855a0a5a71ca17dae6015ea0676fc2e2c4f249.tar.gz
scummvm-rg350-5c855a0a5a71ca17dae6015ea0676fc2e2c4f249.tar.bz2
scummvm-rg350-5c855a0a5a71ca17dae6015ea0676fc2e2c4f249.zip
BACKENDS: Fix shake position getting stuck
If a game is doing a screen shake (for example, DOTT when the stereo is on), and the user does an RTL, the screen shake offset may get stuck if the engine does not reset it on shutdown. To avoid this in all cases, just always reset the screen shake whenever the graphics manager is told to switch to a new graphics mode.
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp1
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 7bac4c85cb..7d29a81f12 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -342,6 +342,7 @@ void OpenGLGraphicsManager::initSize(uint width, uint height, const Graphics::Pi
_currentState.gameWidth = width;
_currentState.gameHeight = height;
+ _gameScreenShakeOffset = 0;
}
int16 OpenGLGraphicsManager::getWidth() const {
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index c2e0fd20e4..6e8561321b 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -748,6 +748,8 @@ bool SurfaceSdlGraphicsManager::setShader(int id) {
void SurfaceSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
+ _newShakePos = 0;
+
#ifdef USE_RGB_COLOR
//avoid redundant format changes
Graphics::PixelFormat newFormat;