[Scummvm-cvs-logs] SF.net SVN: scummvm: [32704] scummvm/branches/gsoc2008-gui/gui
Tanoku at users.sourceforge.net
Tanoku at users.sourceforge.net
Sat Jun 14 19:45:26 CEST 2008
Revision: 32704
http://scummvm.svn.sourceforge.net/scummvm/?rev=32704&view=rev
Author: Tanoku
Date: 2008-06-14 10:45:26 -0700 (Sat, 14 Jun 2008)
Log Message:
-----------
Code formating conventions.
Fix in test drawing code.
Modified Paths:
--------------
scummvm/branches/gsoc2008-gui/gui/InterfaceManager.cpp
scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp
scummvm/branches/gsoc2008-gui/gui/ThemeParser.h
Modified: scummvm/branches/gsoc2008-gui/gui/InterfaceManager.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/InterfaceManager.cpp 2008-06-14 16:14:50 UTC (rev 32703)
+++ scummvm/branches/gsoc2008-gui/gui/InterfaceManager.cpp 2008-06-14 17:45:26 UTC (rev 32704)
@@ -197,8 +197,10 @@
steps[2].flags = DrawStep::kStepCallbackOnly;
steps[2].scale = (1 << 16);
- steps[3].drawing_call = &VectorRenderer::drawCallback_ROUNDSQ;
- steps[3].flags = DrawStep::kStepCallbackOnly;
+ steps[3].color1.r = 255;
+ steps[3].color1.g = 255;
+ steps[3].color1.b = 255;
+ steps[3].flags = DrawStep::kStepSettingsOnly | DrawStep::kStepSetFG;
Common::Rect area = Common::Rect(32, 32, 256, 256);
@@ -206,6 +208,7 @@
while (running) { // draw!!
_vectorRenderer->drawStep(Common::Rect(), steps[0]);
+ _vectorRenderer->drawStep(Common::Rect(), steps[3]);
_vectorRenderer->drawStep(area, steps[1]);
_vectorRenderer->drawStep(area, steps[2]);
// _vectorRenderer->drawStep(Common::Rect(32, 32, 256, 256), &steps[3]);
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp 2008-06-14 16:14:50 UTC (rev 32703)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp 2008-06-14 17:45:26 UTC (rev 32704)
@@ -43,13 +43,13 @@
namespace GUI {
void ThemeParser::debug_testEval() {
- static const char *debug_config_text =
+ static const char *debugConfigText =
"</* lol this is just a moronic test */drawdata id = \"background_default\" cache = true>"
"<draw func = \"roundedsq\" /*/fill = \"gradient\" gradient_start = \"255, 255, 128\" gradient_end = \"128, 128, 128\" size = \"auto\"/>"
"<draw func = \"roundedsq\" fill = \"none\" color = /*\"0, 0, 0\"*/\"0, 1, 2\" size = \"auto\"/>"
"</ drawdata>/* lol this is just a simple test*/";
- _text = strdup(debug_config_text);
+ _text = strdup(debugConfigText);
parse();
}
@@ -87,20 +87,19 @@
}
}
-bool ThemeParser::parseKeyValue(Common::String &key_name) {
+bool ThemeParser::parseKeyValue(Common::String keyName) {
assert(_keyValues.empty() == false);
- if (_keyValues.top().contains(key_name))
+ if (_keyValues.top().contains(keyName))
return false;
- Common::String name = key_name;
_token.clear();
- char string_start;
+ char stringStart;
if (_text[_pos] == '"' || _text[_pos] == '\'') {
- string_start = _text[_pos++];
+ stringStart = _text[_pos++];
- while (_text[_pos] && _text[_pos] != string_start)
+ while (_text[_pos] && _text[_pos] != stringStart)
_token += _text[_pos++];
if (_text[_pos++] == 0)
@@ -110,14 +109,14 @@
return false;
}
- _keyValues.top()[name] = _token;
+ _keyValues.top()[keyName] = _token;
return true;
}
bool ThemeParser::parse() {
- bool active_closure = false;
- bool self_closure = false;
+ bool activeClosure = false;
+ bool selfClosure = false;
_state = kParserNeedKey;
_pos = 0;
@@ -136,14 +135,19 @@
switch (_state) {
case kParserNeedKey:
- if (_text[_pos++] != '<' || _text[_pos] == 0) {
+ if (_text[_pos++] != '<') {
parserError("Expecting key start.");
break;
}
+ if (_text[_pos] == 0) {
+ parserError("Unexpected end of file.");
+ break;
+ }
+
if (_text[_pos] == '/' && _text[_pos + 1] != '*') {
_pos++;
- active_closure = true;
+ activeClosure = true;
}
_state = kParserNeedKeyName;
@@ -155,7 +159,7 @@
break;
}
- if (active_closure) {
+ if (activeClosure) {
if (_activeKey.empty() || _token != _activeKey.top())
parserError("Unexpected closure.");
} else {
@@ -167,8 +171,8 @@
break;
case kParserNeedPropertyName:
- if (active_closure) {
- active_closure = false;
+ if (activeClosure) {
+ activeClosure = false;
_activeKey.pop();
_keyValues.pop();
@@ -180,11 +184,11 @@
break;
}
- self_closure = (_text[_pos] == '/');
+ selfClosure = (_text[_pos] == '/');
- if ((self_closure && _text[_pos + 1] == '>') || _text[_pos] == '>') {
- parseActiveKey(self_closure);
- _pos += self_closure ? 2 : 1;
+ if ((selfClosure && _text[_pos + 1] == '>') || _text[_pos] == '>') {
+ parseActiveKey(selfClosure);
+ _pos += selfClosure ? 2 : 1;
_state = kParserNeedKey;
break;
}
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeParser.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeParser.h 2008-06-14 16:14:50 UTC (rev 32703)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeParser.h 2008-06-14 17:45:26 UTC (rev 32704)
@@ -67,9 +67,9 @@
void parserCallback_DRAW();
void parserCallback_DRAWDATA();
- bool parseKeyValue(Common::String &key_name);
+ bool parseKeyValue(Common::String keyName);
void parseActiveKey(bool closed);
- void parserError(const char *error_string);
+ void parserError(const char *errorString);
inline bool skipSpaces() {
if (!isspace(_text[_pos]))
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