[Scummvm-git-logs] scummvm master -> 5c855a0a5a71ca17dae6015ea0676fc2e2c4f249

csnover csnover at users.noreply.github.com
Sat Dec 2 02:43:21 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5c855a0a5a BACKENDS: Fix shake position getting stuck


Commit: 5c855a0a5a71ca17dae6015ea0676fc2e2c4f249
    https://github.com/scummvm/scummvm/commit/5c855a0a5a71ca17dae6015ea0676fc2e2c4f249
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-12-01T19:43:12-06:00

Commit Message:
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.

Changed paths:
    backends/graphics/opengl/opengl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp


diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 7bac4c8..7d29a81 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 c2e0fd2..6e85613 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;





More information about the Scummvm-git-logs mailing list