[Scummvm-git-logs] scummvm master -> e2d417e7856e55835567c65c3bde863c4e118e62
lotharsm
mail at serra.me
Sat May 29 17:48:11 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:
e2d417e785 BACKENDS: OPENGLSDL: Fix division by zero when no previous resizing events occured
Commit: e2d417e7856e55835567c65c3bde863c4e118e62
https://github.com/scummvm/scummvm/commit/e2d417e7856e55835567c65c3bde863c4e118e62
Author: Lothar Serra Mari (mail at serra.me)
Date: 2021-05-29T19:47:37+02:00
Commit Message:
BACKENDS: OPENGLSDL: Fix division by zero when no previous resizing events occured
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 09f86495ed..74d7e806eb 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -361,9 +361,10 @@ bool OpenGLSdlGraphicsManager::loadVideoMode(uint requestedWidth, uint requested
// for the last time. We also need to reset any scaling here.
requestedWidth = ConfMan.getInt("window_maximized_width", Common::ConfigManager::kApplicationDomain);
requestedHeight = ConfMan.getInt("window_maximized_height", Common::ConfigManager::kApplicationDomain);
- requestedWidth = requestedWidth / requestedHeight;
- requestedHeight = requestedWidth / requestedHeight;
-
+ if ((requestedWidth > 0) && (requestedHeight > 0)) {
+ requestedWidth = requestedWidth / requestedHeight;
+ requestedHeight = requestedWidth / requestedHeight;
+ }
} else if (ConfMan.hasKey("last_window_width", Common::ConfigManager::kApplicationDomain) && ConfMan.hasKey("last_window_height", Common::ConfigManager::kApplicationDomain)) {
// Restore previously stored window dimensions.
requestedWidth = ConfMan.getInt("last_window_width", Common::ConfigManager::kApplicationDomain);
More information about the Scummvm-git-logs
mailing list