aboutsummaryrefslogtreecommitdiff
path: root/gui/theme-config.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2006-06-06 23:57:14 +0000
committerEugene Sandulenko2006-06-06 23:57:14 +0000
commit6f8c4250f9260d7c9edee46a5784f9ee2fb87130 (patch)
treed67a8936b10fb3d11eddeda357e7b7aee2517f11 /gui/theme-config.cpp
parentc17bd63f072e42c90ac9d8f2850b0796c8ffaaad (diff)
downloadscummvm-rg350-6f8c4250f9260d7c9edee46a5784f9ee2fb87130.tar.gz
scummvm-rg350-6f8c4250f9260d7c9edee46a5784f9ee2fb87130.tar.bz2
scummvm-rg350-6f8c4250f9260d7c9edee46a5784f9ee2fb87130.zip
Move whole theme ini file to evaluator. Next step is caching. Also now it is
possible to use per-resolution gfx and colors, i.e. complete customization. svn-id: r22964
Diffstat (limited to 'gui/theme-config.cpp')
-rw-r--r--gui/theme-config.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index 11bdbfa04f..74c283f5c1 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -451,6 +451,9 @@ void Theme::processSingleLine(const String &section, const String &prefix, const
value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name + postfixes[npostfix], start);
+ if (value == EVAL_STRING_VAR)
+ _evaluator->setStringVar(prefixedname, _evaluator->lastToken());
+
// process VAR=VALUE construct
if (npostfix == 0)
_evaluator->setVar(name, value);
@@ -463,6 +466,8 @@ void Theme::processSingleLine(const String &section, const String &prefix, const
_evaluator->getVar(prefixedname + ".x") + _evaluator->getVar(prefixedname + ".w"));
_evaluator->setVar(prefixedname + ".y2",
_evaluator->getVar(prefixedname + ".y") + _evaluator->getVar(prefixedname + ".h"));
+ } else if (npostfix == 2) { // Specify shortcuts for R G B
+ setRGBAlias(prefixedname);
}
if (npostfix != 0)
@@ -539,6 +544,19 @@ void Theme::setSpecialAlias(const String &alias, const String &name) {
}
}
+void Theme::setRGBAlias(const String &name) {
+ const char *frompostfixes[] = {".x", ".y", ".w"};
+ const char *topostfixes[] = {".r", ".g", ".b"};
+ int i;
+
+ for (i = 0; i < ARRAYSIZE(frompostfixes); i++) {
+ String from(name + frompostfixes[i]);
+ String to(name + topostfixes[i]);
+
+ _evaluator->setAlias(to.c_str(), from);
+ }
+}
+
bool Theme::isThemeLoadingRequired() {
int x = g_system->getOverlayWidth(), y = g_system->getOverlayHeight();