diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/InterfaceManager.cpp | 8 | ||||
-rw-r--r-- | gui/ThemeParser.cpp | 13 | ||||
-rw-r--r-- | gui/ThemeParser.h | 15 |
3 files changed, 20 insertions, 16 deletions
diff --git a/gui/InterfaceManager.cpp b/gui/InterfaceManager.cpp index a1eaa71c52..f0874393f0 100644 --- a/gui/InterfaceManager.cpp +++ b/gui/InterfaceManager.cpp @@ -97,7 +97,7 @@ void InterfaceManager::drawDD(DrawData type, const Common::Rect &r) { drawCached(type, r); } else { for (int i = 0; i < _widgets[type]->_stepCount; ++i) - _vectorRenderer->drawStep(r, _widgets[type]->_steps[i]); + _vectorRenderer->drawStep(r, *_widgets[type]->_steps[i]); } } @@ -205,9 +205,9 @@ int InterfaceManager::runGUI() { bool running = true; while (running) { // draw!! - _vectorRenderer->drawStep(Common::Rect(), &steps[0]); - _vectorRenderer->drawStep(area, &steps[1]); - _vectorRenderer->drawStep(area, &steps[2]); + _vectorRenderer->drawStep(Common::Rect(), steps[0]); + _vectorRenderer->drawStep(area, steps[1]); + _vectorRenderer->drawStep(area, steps[2]); // _vectorRenderer->drawStep(Common::Rect(32, 32, 256, 256), &steps[3]); _vectorRenderer->copyFrame(_system); diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index fc960ca4d7..cd77b4a5e1 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -103,14 +103,15 @@ void ThemeParser::parseKeyValue(Common::String &key_name) { skipSpaces(); Common::String data; + char string_start; - if (_text[_pos] == '"') { - data += _text[_pos++]; + if (_text[_pos] == '"' || _text[_pos] == '\'') { + string_start = _text[_pos++]; - while (_text[_pos] != '"') + while (_text[_pos] != string_start) data += _text[_pos++]; - data += _text[_pos++]; + _pos++; } else { while (isValidNameChar(_text[_pos])) data += _text[_pos++]; @@ -131,7 +132,9 @@ bool ThemeParser::parse() { break; skipSpaces(); - skipComments(); + + if (skipComments()) + continue; switch (_state) { case kParserNeedKey: diff --git a/gui/ThemeParser.h b/gui/ThemeParser.h index f87708e3f2..762baefd7f 100644 --- a/gui/ThemeParser.h +++ b/gui/ThemeParser.h @@ -38,8 +38,8 @@ namespace GUI { class ThemeParser { - static const int PARSER_MAX_DEPTH = 4; - typedef void (ThemeParser::*PARSER_CALLBACK)(); + static const int kParserMaxDepth = 4; + typedef void (ThemeParser::*ParserCallback)(); public: ThemeParser() { @@ -73,15 +73,16 @@ protected: _pos++; } - inline void skipComments() { + inline bool skipComments() { if (_text[_pos] == '/' && _text[_pos + 1] == '*') { _pos += 2; while (_text[_pos++]) { if (_text[_pos - 2] == '*' && _text[_pos - 1] == '/') break; } - skipSpaces(); + return true; } + return false; } int _pos; @@ -92,10 +93,10 @@ protected: Common::String _error; Common::String _token; - Common::FixedStack<Common::String, PARSER_MAX_DEPTH> _activeKey; - Common::FixedStack<Common::StringMap, PARSER_MAX_DEPTH> _keyValues; + Common::FixedStack<Common::String, kParserMaxDepth> _activeKey; + Common::FixedStack<Common::StringMap, kParserMaxDepth> _keyValues; - Common::HashMap<Common::String, PARSER_CALLBACK, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _callbacks; + Common::HashMap<Common::String, ParserCallback, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _callbacks; }; } |