summaryrefslogtreecommitdiffstats
path: root/gui/slider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/slider.cpp')
-rw-r--r--gui/slider.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/gui/slider.cpp b/gui/slider.cpp
index 98d2ddea3..c53dabc28 100644
--- a/gui/slider.cpp
+++ b/gui/slider.cpp
@@ -47,31 +47,20 @@ GUISlider::GUISlider(xml_node<>* node) : GUIObject(node)
child = node->first_node("resource");
if (child)
{
- attr = child->first_attribute("base");
- if (attr)
- sSlider = PageManager::FindResource(attr->value());
-
- attr = child->first_attribute("used");
- if (attr)
- sSliderUsed = PageManager::FindResource(attr->value());
-
- attr = child->first_attribute("touch");
- if (attr)
- sTouch = PageManager::FindResource(attr->value());
+ sSlider = LoadAttrImage(child, "base");
+ sSliderUsed = LoadAttrImage(child, "used");
+ sTouch = LoadAttrImage(child, "touch");
}
// Load the placement
LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY);
- if (sSlider && sSlider->GetResource())
- {
- mRenderW = gr_get_width(sSlider->GetResource());
- mRenderH = gr_get_height(sSlider->GetResource());
- }
+ mRenderW = sSlider->GetWidth();
+ mRenderH = sSlider->GetHeight();
if (sTouch && sTouch->GetResource())
{
- sTouchW = gr_get_width(sTouch->GetResource()); // Width of the "touch image" that follows the touch (arrow)
- sTouchH = gr_get_height(sTouch->GetResource()); // Height of the "touch image" that follows the touch (arrow)
+ sTouchW = sTouch->GetWidth(); // Width of the "touch image" that follows the touch (arrow)
+ sTouchH = sTouch->GetHeight(); // Height of the "touch image" that follows the touch (arrow)
}
//LOGINFO("mRenderW: %i mTouchW: %i\n", mRenderW, mTouchW);