[Scummvm-cvs-logs] SF.net SVN: scummvm: [22779] scummvm/trunk/gui

sev at users.sourceforge.net sev at users.sourceforge.net
Tue May 30 11:37:02 CEST 2006


Revision: 22779
Author:   sev
Date:     2006-05-30 11:36:08 -0700 (Tue, 30 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22779&view=rev

Log Message:
-----------
Fixes for MM NES resolution:
- Introduce useAsIs keyword for resolution aliases
- Extend skipFor keyword to accept multiple values

Modified Paths:
--------------
    scummvm/trunk/gui/theme-config.cpp
    scummvm/trunk/gui/themes/modern.ini
Modified: scummvm/trunk/gui/theme-config.cpp
===================================================================
--- scummvm/trunk/gui/theme-config.cpp	2006-05-30 18:27:04 UTC (rev 22778)
+++ scummvm/trunk/gui/theme-config.cpp	2006-05-30 18:36:08 UTC (rev 22779)
@@ -62,6 +62,10 @@
 "scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h\n"
 "scummsaveload_extinfo.visible=false\n"
 "\n"
+"# MM NES resolution\n"
+"[256x240]\n"
+"useAsIs=320xY\n"
+"\n"
 "[XxY]\n"
 "def_widgetSize=kBigWidgetSize\n"
 "def_buttonWidth=kBigButtonWidth\n"
@@ -493,6 +497,14 @@
 			processResSection(config, iterk->value, true);
 			continue;
 		}
+		if (iterk->key == "useAsIs") {
+			if (iterk->value == name)
+				error("Theme section [%s]: cannot use itself", name.c_str());
+			if (!config.hasSection(name))
+				error("Undefined use of section [%s]", name.c_str());
+			processResSection(config, iterk->value);
+			continue;
+		}
 		if (iterk->key == "useWithPrefix") {
 			const char *temp = iterk->value.c_str();
             const char *pos = strrchr(temp, ' ');
@@ -555,7 +567,7 @@
 
 	x = y = 0;
 
-	while (ptr && phase != 2) {
+	while (phase != 3) {
 		switch (phase) {
 		case 0:
 			if (*ptr >= '0' && *ptr <= '9') {
@@ -570,13 +582,32 @@
 			break;
 		case 1:
 			if (*ptr >= '0' && *ptr <= '9') {
-				x = x * 10 + *ptr - '0';
-			} else if (*ptr == 'Y') {
+				y = y * 10 + *ptr - '0';
+			} else if (*ptr == 'Y' || !*ptr || *ptr == ',') {
 				phase = 2;
+
+				if ((x == w || x == 0) && (y == h || y == 0))
+					return true;
+				if (!*ptr)
+					return false;
+				if (*ptr == ',') {
+					phase = x = y = 0;
+				}
 			} else {
 				error("Syntax error. Wrong resolution in skipFor in section %s", name);
 			}
 			break;
+		case 2:
+			if (*ptr == ',') {
+				phase = x = y = 0;
+			} else if (!*ptr) {
+				if ((x == w || x == 0) && (y == h || y == 0))
+					return true;
+				return false;
+			} else {
+				error ("Syntax error. Wrong resolution in skipFor in section %s", name);
+			}
+			break;
 		default:
 			break;
 		}
@@ -584,13 +615,7 @@
 		ptr++;
 	}
 
-	if (x != w && x)
-		return false;
-
-	if (y != h && y)
-		return false;
-
-	return true;
+	return false;
 }
 
 void Theme::loadTheme(Common::ConfigFile &config, bool reset) {

Modified: scummvm/trunk/gui/themes/modern.ini
===================================================================
--- scummvm/trunk/gui/themes/modern.ini	2006-05-30 18:27:04 UTC (rev 22778)
+++ scummvm/trunk/gui/themes/modern.ini	2006-05-30 18:36:08 UTC (rev 22779)
@@ -165,7 +165,7 @@
 cursor_targetScale=3
 
 [XxY]
-skipFor=320xY
+skipFor=320xY,256x240
 def_widgetSize=kBigWidgetSize
 def_buttonWidth=120
 def_buttonHeight=25


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list