summaryrefslogtreecommitdiffstats
path: root/gui/animation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/animation.cpp')
-rw-r--r--gui/animation.cpp8
1 files changed, 7 insertions, 1 deletions
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