1) Added support for disabling an animation.
2) Only print warning about empty curves in debug mode. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11101 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -36,14 +36,15 @@ AnimationBase::AnimationBase(const XMLNode &node)
|
||||
Ipo *ipo = new Ipo(*node.getNode(i), fps);
|
||||
m_all_ipos.push_back(ipo);
|
||||
}
|
||||
m_playing = true;
|
||||
#ifdef DEBUG
|
||||
if(m_all_ipos.size()==0)
|
||||
{
|
||||
printf("Warning: empty animation curve.\n");
|
||||
return;
|
||||
//exit(-1);
|
||||
m_playing = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_playing = true;
|
||||
} // AnimationBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -88,6 +89,8 @@ void AnimationBase::reset()
|
||||
*/
|
||||
void AnimationBase::update(float dt, Vec3 *xyz, Vec3 *hpr, Vec3 *scale)
|
||||
{
|
||||
// Don't do anything if the animation is disabled
|
||||
if(!m_playing) return;
|
||||
m_current_time += dt;
|
||||
|
||||
if ( UserConfigParams::m_graphical_effects )
|
||||
|
||||
@@ -75,6 +75,9 @@ public:
|
||||
void setInitialTransform(const Vec3 &xyz,
|
||||
const Vec3 &hpr);
|
||||
void reset();
|
||||
// ------------------------------------------------------------------------
|
||||
/** Disables or enables an animation. */
|
||||
void setPlaying(bool playing) {m_playing = playing; }
|
||||
|
||||
}; // AnimationBase
|
||||
|
||||
|
||||
Reference in New Issue
Block a user