[Scummvm-git-logs] scummvm master -> c9682dfbcf4bb358ec5a7fb1efa97a787da89ce5

criezy criezy at scummvm.org
Fri Aug 13 23:01:01 UTC 2021


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:
c9682dfbcf OPENGLSDL: Fix changing scaler with hotkey in games


Commit: c9682dfbcf4bb358ec5a7fb1efa97a787da89ce5
    https://github.com/scummvm/scummvm/commit/c9682dfbcf4bb358ec5a7fb1efa97a787da89ce5
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-13T23:58:34+01:00

Commit Message:
OPENGLSDL: Fix changing scaler with hotkey in games

Also improve decreasing the scaler when using a custom window size.

Changed paths:
    backends/graphics/openglsdl/openglsdl-graphics.cpp


diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index b7b5726172..87cdb6899f 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -648,7 +648,10 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
 			windowWidth /= scale;
 			windowHeight /= scale;
 	#endif
-			_graphicsScale = MAX<int>(windowWidth / _lastRequestedWidth, windowHeight / _lastRequestedHeight);
+			if (direction > 0)
+				_graphicsScale = MAX<int>(windowWidth / _lastRequestedWidth, windowHeight / _lastRequestedHeight);
+			else
+				_graphicsScale = 1 + MIN<int>((windowWidth - 1) / _lastRequestedWidth, (windowHeight - 1) / _lastRequestedHeight);
 			_graphicsScale = MAX<int>(_graphicsScale + direction, 1);
 
 			// Since we overwrite a user resize here we reset its
@@ -657,6 +660,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
 			_gotResize = false;
 
 			// Try to setup the mode.
+			unlockWindowSize();
 			if (!setupMode(_lastRequestedWidth * _graphicsScale, _lastRequestedHeight * _graphicsScale)) {
 				warning("OpenGLSdlGraphicsManager::notifyEvent: Window resize failed ('%s')", SDL_GetError());
 				g_system->quit();




More information about the Scummvm-git-logs mailing list