aboutsummaryrefslogtreecommitdiff
path: root/gui/newgui.cpp
diff options
context:
space:
mode:
authorMax Horn2005-03-12 15:04:49 +0000
committerMax Horn2005-03-12 15:04:49 +0000
commitbf984cb7f0fdd3397db2dafdd93c163536d92bae (patch)
tree5ff43837efdc89109c79272b1b4780a21ea1b533 /gui/newgui.cpp
parent4a18a5de446dceafeaa447dc227f07a939e879ef (diff)
downloadscummvm-rg350-bf984cb7f0fdd3397db2dafdd93c163536d92bae.tar.gz
scummvm-rg350-bf984cb7f0fdd3397db2dafdd93c163536d92bae.tar.bz2
scummvm-rg350-bf984cb7f0fdd3397db2dafdd93c163536d92bae.zip
Fix crash that occured when disabling the GUI scaling code
svn-id: r17098
Diffstat (limited to 'gui/newgui.cpp')
-rw-r--r--gui/newgui.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 9b4529616b..74753584b6 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -77,16 +77,15 @@ void NewGui::updateColors() {
void NewGui::updateScaleFactor() {
if(!_scaleEnable) {
_scaleFactor = 1;
- return;
+ } else {
+ enum {
+ kDefaultGUIWidth = 320,
+ kDefaultGUIHeight = 200
+ };
+
+ _scaleFactor = MIN(_system->getOverlayWidth() / kDefaultGUIWidth, _system->getOverlayHeight() / kDefaultGUIHeight);
}
- enum {
- kDefaultGUIWidth = 320,
- kDefaultGUIHeight = 200
- };
-
- _scaleFactor = MIN(_system->getOverlayWidth() / kDefaultGUIWidth, _system->getOverlayHeight() / kDefaultGUIHeight);
-
// Pick the font depending on the scale factor.
if (_scaleFactor == 1)
_font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);