[Scummvm-cvs-logs] CVS: scummvm/gui newgui.cpp,1.102,1.103

Max Horn fingolfin at users.sourceforge.net
Sat Mar 12 07:05:23 CET 2005


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11293

Modified Files:
	newgui.cpp 
Log Message:
Fix crash that occured when disabling the GUI scaling code

Index: newgui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/newgui.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- newgui.cpp	9 Mar 2005 23:07:31 -0000	1.102
+++ newgui.cpp	12 Mar 2005 15:04:49 -0000	1.103
@@ -77,16 +77,15 @@
 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);





More information about the Scummvm-git-logs mailing list