From ede51c528e5cebc7f1930d5c9da541e7d11c0138 Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Fri, 7 Feb 2014 23:58:09 +0100 Subject: Conditional -> GUIObject and make all gui objects children of GUIObject Signed-off-by: Vojtech Bocek Change-Id: Ic0a7d6354dabe5919b83942f2f1aa0715625e522 --- gui/animation.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gui/animation.cpp') diff --git a/gui/animation.cpp b/gui/animation.cpp index 8c922786d..771e1c116 100644 --- a/gui/animation.cpp +++ b/gui/animation.cpp @@ -26,7 +26,7 @@ extern "C" { #include "objects.hpp" -GUIAnimation::GUIAnimation(xml_node<>* node) +GUIAnimation::GUIAnimation(xml_node<>* node) : GUIObject(node) { xml_node<>* child; xml_attribute<>* attr; @@ -101,6 +101,9 @@ GUIAnimation::GUIAnimation(xml_node<>* node) int GUIAnimation::Render(void) { + if(!isConditionTrue()) + return 0; + if (!mAnimation || !mAnimation->GetResource(mFrame)) return -1; gr_blit(mAnimation->GetResource(mFrame), 0, 0, mRenderW, mRenderH, mRenderX, mRenderY); @@ -109,6 +112,9 @@ int GUIAnimation::Render(void) int GUIAnimation::Update(void) { + if(!isConditionTrue()) + return 0; + if (!mAnimation) return -1; // Handle the "end-of-animation" state -- cgit v1.2.3