From a6e5b97e9fe20745bddd73e34e9deba57dbda216 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 00:28:18 +0200 Subject: COMMON: Remove vfprintf call from XML parser --- engines/sword25/gfx/animationresource.cpp | 14 +++++++------- engines/sword25/gfx/fontresource.cpp | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'engines/sword25/gfx') 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 tag in \"%s\". Assuming default (\"%d\").", - getFileName().c_str(), DEFAULT_FPS); + return parserError(Common::String::format("Illegal or missing fps attribute in 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 tag in \"%s\".", getFileName().c_str()); + return parserError("Illegal or missing code attribute in tag in '" + getFileName() + "'."); } if (!parseIntegerKey(node->values["top"], 1, &top) || (top < 0)) { - return parserError("Illegal or missing top attribute in tag in \"%s\".", getFileName().c_str()); + return parserError("Illegal or missing top attribute in tag in '" + getFileName() + "'."); } if (!parseIntegerKey(node->values["left"], 1, &left) || (left < 0)) { - return parserError("Illegal or missing left attribute in tag in \"%s\".", getFileName().c_str()); + return parserError("Illegal or missing left attribute in tag in '" + getFileName() + "'."); } if (!parseIntegerKey(node->values["right"], 1, &right) || (right < 0)) { - return parserError("Illegal or missing right attribute in tag in \"%s\".", getFileName().c_str()); + return parserError("Illegal or missing right attribute in tag in '" + getFileName() + "'."); } if (!parseIntegerKey(node->values["bottom"], 1, &bottom) || (bottom < 0)) { - return parserError("Illegal or missing bottom attribute in tag in \"%s\".", getFileName().c_str()); + return parserError("Illegal or missing bottom attribute in tag in '" + getFileName() + "'."); } - this->_characterRects[charCode] = Common::Rect(left, top, right, bottom); + _characterRects[charCode] = Common::Rect(left, top, right, bottom); return true; } -- cgit v1.2.3