make otml simpler and easier to use, improve error handling/exceptions

This commit is contained in:
Eduardo Bart
2011-08-19 15:53:23 -03:00
parent f9e7d52ac0
commit 033f14780d
32 changed files with 646 additions and 622 deletions

View File

@@ -17,9 +17,9 @@ Image::Image(TexturePtr texture, Rect textureCoords)
ImagePtr Image::loadFromOTML(const OTMLNodePtr& imageNode)
{
// load configs from otml node
std::string source = imageNode->hasValue() ? imageNode->read<std::string>() : imageNode->readAt<std::string>("source");
bool smooth = imageNode->readAt("smooth", false);
Rect textureCoords = imageNode->readAt("coords", Rect());
std::string source = imageNode->hasValue() ? imageNode->value() : imageNode->valueAt("source");
bool smooth = imageNode->valueAt("smooth", false);
Rect textureCoords = imageNode->valueAt("coords", Rect());
// load texture
TexturePtr texture = g_textures.getTexture(source);