summaryrefslogtreecommitdiffstats
path: root/gui/animation.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-02-18 21:35:00 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-02-21 15:14:24 +0100
commit21ff02a69331fbcd53dc93a1af9a93618225b4bf (patch)
tree623fe5a07a506362b91a16b34d62a875b3d45c32 /gui/animation.cpp
parentgui: make kinetic scrolling deceleration more awesome (diff)
downloadandroid_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.gz
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.bz2
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.lz
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.xz
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.zst
android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.zip
Diffstat (limited to 'gui/animation.cpp')
-rw-r--r--gui/animation.cpp27
1 files changed, 8 insertions, 19 deletions
diff --git a/gui/animation.cpp b/gui/animation.cpp
index 1e9a87d3f..888b4ab08 100644
--- a/gui/animation.cpp
+++ b/gui/animation.cpp
@@ -29,7 +29,6 @@ extern "C" {
GUIAnimation::GUIAnimation(xml_node<>* node) : GUIObject(node)
{
xml_node<>* child;
- xml_attribute<>* attr;
mAnimation = NULL;
mFrame = 1;
@@ -40,36 +39,26 @@ GUIAnimation::GUIAnimation(xml_node<>* node) : GUIObject(node)
if (!node) return;
- child = node->first_node("resource");
- if (child)
- {
- mAnimation = LoadAttrAnimation(child, "name");
- }
+ mAnimation = LoadAttrAnimation(FindNode(node, "resource"), "name");
// Load the placement
- LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, NULL, NULL, &mPlacement);
+ LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, NULL, NULL, &mPlacement);
- child = node->first_node("speed");
+ child = FindNode(node, "speed");
if (child)
{
- attr = child->first_attribute("fps");
- if (attr)
- mFPS = atoi(attr->value());
- attr = child->first_attribute("render");
- if (attr)
- mRender = atoi(attr->value());
+ mFPS = LoadAttrInt(child, "fps", mFPS);
+ mRender = LoadAttrInt(child, "render", mRender);
}
if (mFPS > 30) mFPS = 30;
- child = node->first_node("loop");
+ child = FindNode(node, "loop");
if (child)
{
- attr = child->first_attribute("frame");
+ xml_attribute<>* attr = child->first_attribute("frame");
if (attr)
mLoop = atoi(attr->value()) - 1;
- attr = child->first_attribute("start");
- if (attr)
- mFrame = atoi(attr->value());
+ mFrame = LoadAttrInt(child, "start", mFrame);
}
// Fetch the render sizes