[Scummvm-cvs-logs] SF.net SVN: scummvm:[34961] scummvm/trunk/gui
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Nov 9 16:59:14 CET 2008
Revision: 34961
http://scummvm.svn.sourceforge.net/scummvm/?rev=34961&view=rev
Author: fingolfin
Date: 2008-11-09 15:59:14 +0000 (Sun, 09 Nov 2008)
Log Message:
-----------
minor tweaks
Modified Paths:
--------------
scummvm/trunk/gui/ThemeEngine.h
scummvm/trunk/gui/ThemeParser.cpp
scummvm/trunk/gui/ThemeParser.h
scummvm/trunk/gui/theme.h
Modified: scummvm/trunk/gui/ThemeEngine.h
===================================================================
--- scummvm/trunk/gui/ThemeEngine.h 2008-11-09 15:22:36 UTC (rev 34960)
+++ scummvm/trunk/gui/ThemeEngine.h 2008-11-09 15:59:14 UTC (rev 34961)
@@ -27,16 +27,11 @@
#define GUI_THEME_ENGINE_H
#include "common/scummsys.h"
-#include "graphics/surface.h"
#include "common/system.h"
#include "graphics/surface.h"
#include "graphics/fontman.h"
-//#include "gui/dialog.h"
-//#include "gui/ThemeParser.h"
-//#include "graphics/VectorRenderer.h"
-//#include "gui/ThemeEval.h"
#include "gui/theme.h"
namespace Graphics {
@@ -395,14 +390,14 @@
* Finishes buffering: widgets from then on will be drawn straight on the screen
* without drawing queues.
*/
- void finishBuffering() { _buffering = false; }
- void startBuffering() { _buffering = true; }
+ inline void finishBuffering() { _buffering = false; }
+ inline void startBuffering() { _buffering = true; }
- ThemeEval *getEvaluator() { return _themeEval; }
- Graphics::VectorRenderer *renderer() { return _vectorRenderer; }
+ inline ThemeEval *getEvaluator() { return _themeEval; }
+ inline Graphics::VectorRenderer *renderer() { return _vectorRenderer; }
- bool supportsImages() const { return true; }
- bool ownCursor() const { return _useCursor; }
+ inline bool supportsImages() const { return true; }
+ inline bool ownCursor() const { return _useCursor; }
Graphics::Surface *getBitmap(const Common::String &name) {
return _bitmaps.contains(name) ? _bitmaps[name] : 0;
Modified: scummvm/trunk/gui/ThemeParser.cpp
===================================================================
--- scummvm/trunk/gui/ThemeParser.cpp 2008-11-09 15:22:36 UTC (rev 34960)
+++ scummvm/trunk/gui/ThemeParser.cpp 2008-11-09 15:59:14 UTC (rev 34961)
@@ -75,28 +75,16 @@
Graphics::DrawStep *ThemeParser::defaultDrawStep() {
Graphics::DrawStep *step = new Graphics::DrawStep;
+
+ memset(step, 0, sizeof(Graphics::DrawStep));
- step->fgColor.set = false;
- step->bgColor.set = false;
- step->gradColor1.set = false;
- step->gradColor2.set = false;
-
step->xAlign = Graphics::DrawStep::kVectorAlignManual;
step->yAlign = Graphics::DrawStep::kVectorAlignManual;
- step->x = 0;
- step->y = 0;
- step->w = 0;
- step->h = 0;
-
- step->extraData = 0;
step->factor = 1;
step->autoWidth = true;
step->autoHeight = true;
step->fillMode = Graphics::VectorRenderer::kFillDisabled;
step->scale = (1 << 16);
- step->shadow = 0;
- step->bevel = 0;
- step->stroke = 0;
step->radius = 0xFF;
return step;
@@ -144,10 +132,10 @@
if (_palette.contains(node->values["color"]))
getPaletteColor(node->values["color"], red, green, blue);
else if (!parseIntegerKey(node->values["color"].c_str(), 3, &red, &green, &blue))
- return parserError("Error when parsing color value for font definition.");
+ return parserError("Error parsing color value for font definition.");
if (!_theme->addFont(node->values["id"], node->values["file"], red, green, blue))
- return parserError("Error when loading Font in theme engine.");
+ return parserError("Error loading Font in theme engine.");
return true;
}
@@ -165,13 +153,13 @@
int spotx, spoty, scale;
if (!parseIntegerKey(node->values["hotspot"].c_str(), 2, &spotx, &spoty))
- return parserError("Error when parsing cursor Hot Spot coordinates.");
+ return parserError("Error parsing cursor Hot Spot coordinates.");
if (!parseIntegerKey(node->values["scale"].c_str(), 1, &scale))
- return parserError("Error when parsing cursor scale.");
+ return parserError("Error parsing cursor scale.");
if (!_theme->createCursor(node->values["file"], spotx, spoty, scale))
- return parserError("Error when creating Bitmap Cursor.");
+ return parserError("Error creating Bitmap Cursor.");
return true;
}
@@ -183,7 +171,7 @@
}
if (!_theme->addBitmap(node->values["filename"]))
- return parserError("Error when loading Bitmap file '%s'", node->values["filename"].c_str());
+ return parserError("Error loading Bitmap file '%s'", node->values["filename"].c_str());
return true;
}
@@ -209,7 +197,7 @@
else return parserError("Invalid value for text alignment.");
if (!_theme->addTextData(getParentNode(node)->values["id"], node->values["font"], alignH, alignV))
- return parserError("Error when adding Text Data for '%s'.", getParentNode(node)->values["id"].c_str());
+ return parserError("Error adding Text Data for '%s'.", getParentNode(node)->values["id"].c_str());
return true;
}
@@ -242,7 +230,7 @@
if (parseIntegerKey(node->values["rgb"].c_str(), 3, &red, &green, &blue) == false ||
red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255)
- return parserError("Error when parsing RGB values for palette color '%s'", name.c_str());\
+ return parserError("Error parsing RGB values for palette color '%s'", name.c_str());\
_palette[name].r = red;
_palette[name].g = green;
@@ -288,7 +276,7 @@
}
if (_theme->addDrawData(node->values["id"], cached) == false)
- return parserError("Error when adding Draw Data set: Invalid DrawData name.");
+ return parserError("Error adding Draw Data set: Invalid DrawData name.");
if (_defaultStepLocal) {
delete _defaultStepLocal;
@@ -315,7 +303,7 @@
#define __PARSER_ASSIGN_INT(struct_name, key_name, force) \
if (stepNode->values.contains(key_name)) { \
if (!parseIntegerKey(stepNode->values[key_name].c_str(), 1, &x)) \
- return parserError("Error when parsing key value for '%s'.", key_name); \
+ return parserError("Error parsing key value for '%s'.", key_name); \
\
drawstep->struct_name = x; \
} else if (force) { \
@@ -340,7 +328,7 @@
blue = _palette[val].b; \
} else if (parseIntegerKey(val.c_str(), 3, &red, &green, &blue) == false || \
red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255) \
- return parserError("Error when parsing color struct '%s'", val.c_str());\
+ return parserError("Error parsing color struct '%s'", val.c_str());\
\
drawstep->struct_name.r = red; \
drawstep->struct_name.g = green; \
@@ -515,7 +503,7 @@
var = "Globals." + node->values["name"] + ".";
if (!parseCommonLayoutProps(node, var))
- return parserError("Error when parsing Layout properties of '%s'.", var.c_str());
+ return parserError("Error parsing Layout properties of '%s'.", var.c_str());
} else {
var = node->values["name"];
@@ -593,7 +581,7 @@
bool ThemeParser::parserCallback_import(ParserNode *node) {
if (!_theme->getEvaluator()->addImportedLayout(node->values["layout"]))
- return parserError("Error when importing external layout");
+ return parserError("Error importing external layout");
return true;
}
@@ -607,7 +595,6 @@
if (node->values["type"] == "vertical")
_theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutVertical, spacing, node->values["center"] == "true");
-
else if (node->values["type"] == "horizontal")
_theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutHorizontal, spacing, node->values["center"] == "true");
else
Modified: scummvm/trunk/gui/ThemeParser.h
===================================================================
--- scummvm/trunk/gui/ThemeParser.h 2008-11-09 15:22:36 UTC (rev 34960)
+++ scummvm/trunk/gui/ThemeParser.h 2008-11-09 15:59:14 UTC (rev 34961)
@@ -38,7 +38,7 @@
typedef void (Graphics::VectorRenderer::*DrawingFunctionCallback)(const Common::Rect &, const Graphics::DrawStep &);
public:
- ThemeParser(GUI::ThemeEngine *parent);
+ ThemeParser(ThemeEngine *parent);
virtual ~ThemeParser();
Modified: scummvm/trunk/gui/theme.h
===================================================================
--- scummvm/trunk/gui/theme.h 2008-11-09 15:22:36 UTC (rev 34960)
+++ scummvm/trunk/gui/theme.h 2008-11-09 15:59:14 UTC (rev 34961)
@@ -318,7 +318,7 @@
*
* @return true on support, else false
*/
- virtual bool supportsImages() const { return false; }
+// virtual bool supportsImages() const { return false; }
//! Special image ids for images used in the GUI
enum kThemeImages {
@@ -334,7 +334,7 @@
*
* @see kThemeImages
*/
- virtual const Graphics::Surface *getImageSurface(const kThemeImages n) const { return 0; }
+// virtual const Graphics::Surface *getImageSurface(const kThemeImages n) const { return 0; }
public:
bool needThemeReload() { return ((_loadedThemeX != g_system->getOverlayWidth()) ||
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