mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 01:38:36 +00:00
BACKENDS: OPENGLSDL: Fix division by zero when no previous resizing events occured
This commit is contained in:
parent
ba5e103a29
commit
e2d417e785
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user