mirror of
https://github.com/edubart/otclient.git
synced 2025-12-25 09:17:11 +01:00
make otml simpler and easier to use, improve error handling/exceptions
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user