summaryrefslogtreecommitdiffstats
path: root/gui/image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/image.cpp')
-rw-r--r--gui/image.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/gui/image.cpp b/gui/image.cpp
index 2cf3b68af..60b1cb956 100644
--- a/gui/image.cpp
+++ b/gui/image.cpp
@@ -40,12 +40,8 @@ GUIImage::GUIImage(xml_node<>* node) : GUIObject(node)
child = node->first_node("image");
if (child)
{
- attr = child->first_attribute("resource");
- if (attr)
- mImage = PageManager::FindResource(attr->value());
- attr = child->first_attribute("highlightresource");
- if (attr)
- mHighlightImage = PageManager::FindResource(attr->value());
+ mImage = LoadAttrImage(child, "resource");
+ mHighlightImage = LoadAttrImage(child, "highlightresource");
}
// Load the placement
@@ -53,8 +49,8 @@ GUIImage::GUIImage(xml_node<>* node) : GUIObject(node)
if (mImage && mImage->GetResource())
{
- mRenderW = gr_get_width(mImage->GetResource());
- mRenderH = gr_get_height(mImage->GetResource());
+ mRenderW = mImage->GetWidth();
+ mRenderH = mImage->GetHeight();
// Adjust for placement
if (mPlacement != TOP_LEFT && mPlacement != BOTTOM_LEFT)
@@ -73,8 +69,6 @@ GUIImage::GUIImage(xml_node<>* node) : GUIObject(node)
}
SetPlacement(TOP_LEFT);
}
-
- return;
}
int GUIImage::Render(void)