aboutsummaryrefslogtreecommitdiff
path: root/gui/theme-config.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2006-05-30 18:36:08 +0000
committerEugene Sandulenko2006-05-30 18:36:08 +0000
commit1ec42e169ed58c2ec591c98f435d30b1709fffa4 (patch)
tree37fffa31b6125810d1d545e7a12a86a02dffaa91 /gui/theme-config.cpp
parentac1b6014290f2dbbc81d46095c7cad6434a2a535 (diff)
downloadscummvm-rg350-1ec42e169ed58c2ec591c98f435d30b1709fffa4.tar.gz
scummvm-rg350-1ec42e169ed58c2ec591c98f435d30b1709fffa4.tar.bz2
scummvm-rg350-1ec42e169ed58c2ec591c98f435d30b1709fffa4.zip
Fixes for MM NES resolution:
- Introduce useAsIs keyword for resolution aliases - Extend skipFor keyword to accept multiple values svn-id: r22779
Diffstat (limited to 'gui/theme-config.cpp')
-rw-r--r--gui/theme-config.cpp45
1 files changed, 35 insertions, 10 deletions
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index 5ea0713984..2401e83fe3 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -62,6 +62,10 @@ const char *Theme::_defaultConfigINI =
"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 @@ void Theme::processResSection(Common::ConfigFile &config, String name, bool skip
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 @@ bool Theme::sectionIsSkipped(Common::ConfigFile &config, const char *name, int w
x = y = 0;
- while (ptr && phase != 2) {
+ while (phase != 3) {
switch (phase) {
case 0:
if (*ptr >= '0' && *ptr <= '9') {
@@ -570,13 +582,32 @@ bool Theme::sectionIsSkipped(Common::ConfigFile &config, const char *name, int w
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 @@ bool Theme::sectionIsSkipped(Common::ConfigFile &config, const char *name, int w
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) {