aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx
diff options
context:
space:
mode:
authorMax Horn2011-06-06 00:28:18 +0200
committerMax Horn2011-06-06 11:19:09 +0200
commita6e5b97e9fe20745bddd73e34e9deba57dbda216 (patch)
treeb180d329474151dbe4f46584783b8495728d67ed /engines/sword25/gfx
parentac1c2124e5b945fdd426bebc91d2ead79a3bf504 (diff)
downloadscummvm-rg350-a6e5b97e9fe20745bddd73e34e9deba57dbda216.tar.gz
scummvm-rg350-a6e5b97e9fe20745bddd73e34e9deba57dbda216.tar.bz2
scummvm-rg350-a6e5b97e9fe20745bddd73e34e9deba57dbda216.zip
COMMON: Remove vfprintf call from XML parser
Diffstat (limited to 'engines/sword25/gfx')
-rw-r--r--engines/sword25/gfx/animationresource.cpp14
-rw-r--r--engines/sword25/gfx/fontresource.cpp12
2 files changed, 13 insertions, 13 deletions
diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp
index a9c9cf9c29..b9d70cf87b 100644
--- a/engines/sword25/gfx/animationresource.cpp
+++ b/engines/sword25/gfx/animationresource.cpp
@@ -38,11 +38,11 @@
namespace Sword25 {
-namespace {
-const int DEFAULT_FPS = 10;
-const int MIN_FPS = 1;
-const int MAX_FPS = 200;
-}
+enum {
+ DEFAULT_FPS = 10,
+ MIN_FPS = 1,
+ MAX_FPS = 200
+};
AnimationResource::AnimationResource(const Common::String &filename) :
Resource(filename, Resource::TYPE_ANIMATION),
@@ -112,8 +112,8 @@ bool AnimationResource::parseBooleanKey(Common::String s, bool &result) {
bool AnimationResource::parserCallback_animation(ParserNode *node) {
if (!parseIntegerKey(node->values["fps"], 1, &_FPS) || (_FPS < MIN_FPS) || (_FPS > MAX_FPS)) {
- return parserError("Illegal or missing fps attribute in <animation> tag in \"%s\". Assuming default (\"%d\").",
- getFileName().c_str(), DEFAULT_FPS);
+ return parserError(Common::String::format("Illegal or missing fps attribute in <animation> tag in \"%s\". Assuming default (\"%d\").",
+ getFileName().c_str(), DEFAULT_FPS));
}
// Loop type value
diff --git a/engines/sword25/gfx/fontresource.cpp b/engines/sword25/gfx/fontresource.cpp
index f99987fc91..7657abb5f2 100644
--- a/engines/sword25/gfx/fontresource.cpp
+++ b/engines/sword25/gfx/fontresource.cpp
@@ -115,23 +115,23 @@ bool FontResource::parserCallback_character(ParserNode *node) {
int charCode, top, left, right, bottom;
if (!parseIntegerKey(node->values["code"], 1, &charCode) || (charCode < 0) || (charCode >= 256)) {
- return parserError("Illegal or missing code attribute in <character> tag in \"%s\".", getFileName().c_str());
+ return parserError("Illegal or missing code attribute in <character> tag in '" + getFileName() + "'.");
}
if (!parseIntegerKey(node->values["top"], 1, &top) || (top < 0)) {
- return parserError("Illegal or missing top attribute in <character> tag in \"%s\".", getFileName().c_str());
+ return parserError("Illegal or missing top attribute in <character> tag in '" + getFileName() + "'.");
}
if (!parseIntegerKey(node->values["left"], 1, &left) || (left < 0)) {
- return parserError("Illegal or missing left attribute in <character> tag in \"%s\".", getFileName().c_str());
+ return parserError("Illegal or missing left attribute in <character> tag in '" + getFileName() + "'.");
}
if (!parseIntegerKey(node->values["right"], 1, &right) || (right < 0)) {
- return parserError("Illegal or missing right attribute in <character> tag in \"%s\".", getFileName().c_str());
+ return parserError("Illegal or missing right attribute in <character> tag in '" + getFileName() + "'.");
}
if (!parseIntegerKey(node->values["bottom"], 1, &bottom) || (bottom < 0)) {
- return parserError("Illegal or missing bottom attribute in <character> tag in \"%s\".", getFileName().c_str());
+ return parserError("Illegal or missing bottom attribute in <character> tag in '" + getFileName() + "'.");
}
- this->_characterRects[charCode] = Common::Rect(left, top, right, bottom);
+ _characterRects[charCode] = Common::Rect(left, top, right, bottom);
return true;
}