Added files missing in previous commit.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3660 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
c14ffd586e
commit
fadb3692f8
24
src/animations/animation_base.cpp
Normal file
24
src/animations/animation_base.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
// $Id: animation_base.cpp 1681 2008-04-09 13:52:48Z hikerstk $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009 Joerg Henrichs
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "animations/animation_base.hpp"
|
||||
|
||||
void AnimationBase::update(float dt)
|
||||
{
|
||||
} // float dt
|
52
src/animations/animation_base.hpp
Normal file
52
src/animations/animation_base.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
// $Id: animation_base.hpp 1681 2008-04-09 13:52:48Z hikerstk $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009 Joerg Henrichs
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef HEADER_ANIMATION_BASE_HPP
|
||||
#define HEADER_ANIMATION_BASE_HPP
|
||||
|
||||
/** A base class for all animations. */
|
||||
|
||||
class AnimationBase
|
||||
{
|
||||
private:
|
||||
/** Two types of animations: cyclic ones that play all the time, and
|
||||
* one time only (which might get triggered more than once). */
|
||||
enum AnimTimeType { ATT_CYCLIC, ATT_CYCLIC_ONCE } m_anim_type;
|
||||
|
||||
/** True if the animation is currently playing. */
|
||||
bool m_playing;
|
||||
|
||||
/** For one time animations: start time. */
|
||||
float m_start;
|
||||
|
||||
/** For cyclic animations: duration of the cycle. */
|
||||
float m_cycle_length;
|
||||
|
||||
/** The current time in the cycle of a cyclic animation. */
|
||||
float m_current_time;
|
||||
|
||||
public:
|
||||
AnimationBase() {}
|
||||
|
||||
virtual void update(float dt);
|
||||
|
||||
}; // AnimationBase
|
||||
|
||||
#endif
|
||||
|
47
src/animations/animation_manager.cpp
Normal file
47
src/animations/animation_manager.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
// $Id: animation_manager.cpp 1681 2008-04-09 13:52:48Z hikerstk $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009 Joerg Henrichs
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "animations/animation_manager.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "animations/billboard_animation.hpp"
|
||||
#include "animations/three_d_animation.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
|
||||
AnimationManager::AnimationManager(const XMLNode &node)
|
||||
{
|
||||
for(unsigned int i=0; i<node.getNumNodes(); i++)
|
||||
{
|
||||
const XMLNode *anim_node = node.getNode(i);
|
||||
std::string type;
|
||||
anim_node->get("type", &type);
|
||||
if(type=="anim_billboard")
|
||||
m_all_animations.push_back(new BillboardAnimation(*anim_node));
|
||||
else if(type=="animation_3d")
|
||||
m_all_animations.push_back(new ThreeDAnimation(*anim_node));
|
||||
else
|
||||
fprintf(stderr, "Unknown animation type '%s' - ignored.\n",
|
||||
type.c_str());
|
||||
} // for i<node.getNumNodes
|
||||
} // AnimationManager
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
40
src/animations/animation_manager.hpp
Normal file
40
src/animations/animation_manager.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
// $Id: animation_manager.hpp 1681 2008-04-09 13:52:48Z hikerstk $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009 Joerg Henrichs
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef HEADER_ANIMATION_MANAGER_HPP
|
||||
#define HEADER_ANIMATION_MANAGER_HPP
|
||||
|
||||
#include <vector>
|
||||
|
||||
class AnimationBase;
|
||||
class XMLNode;
|
||||
|
||||
/** Controls all animations of a track. */
|
||||
class AnimationManager
|
||||
{
|
||||
private:
|
||||
std::vector<AnimationBase*> m_all_animations;
|
||||
|
||||
public:
|
||||
AnimationManager(const XMLNode &node);
|
||||
|
||||
}; // AnimationManager
|
||||
|
||||
#endif
|
||||
|
30
src/animations/billboard_animation.cpp
Normal file
30
src/animations/billboard_animation.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
// $Id: billboard_animation.cpp 1681 2008-04-09 13:52:48Z hikerstk $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009 Joerg Henrichs
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "animations/billboard_animation.hpp"
|
||||
|
||||
class XMLNode;
|
||||
|
||||
/** A 2d billboard animation. */
|
||||
BillboardAnimation::BillboardAnimation(const XMLNode &node)
|
||||
{
|
||||
|
||||
} // BillboardAnimation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
38
src/animations/billboard_animation.hpp
Normal file
38
src/animations/billboard_animation.hpp
Normal file
@ -0,0 +1,38 @@
|
||||
// $Id: billboard_animation.hpp 1681 2008-04-09 13:52:48Z hikerstk $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009 Joerg Henrichs
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef HEADER_BILLBOARD_ANIMATION_HPP
|
||||
#define HEADER_BILLBOARD_ANIMATION_HPP
|
||||
|
||||
#include "animations/animation_base.hpp"
|
||||
|
||||
class XMLNode;
|
||||
|
||||
/** A 2d billboard animation. */
|
||||
class BillboardAnimation : public AnimationBase
|
||||
{
|
||||
private:
|
||||
|
||||
public:
|
||||
BillboardAnimation(const XMLNode &node);
|
||||
|
||||
}; // BillboardAnimation
|
||||
|
||||
#endif
|
||||
|
28
src/animations/three_d_animation.cpp
Normal file
28
src/animations/three_d_animation.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
// $Id: three_d_animation.cpp 1681 2008-04-09 13:52:48Z hikerstk $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009 Joerg Henrichs
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "animations/three_d_animation.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
|
||||
ThreeDAnimation::ThreeDAnimation(const XMLNode &node)
|
||||
{
|
||||
} // ThreeDAnimation
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
37
src/animations/three_d_animation.hpp
Normal file
37
src/animations/three_d_animation.hpp
Normal file
@ -0,0 +1,37 @@
|
||||
// $Id: three_d_animation.hpp 1681 2008-04-09 13:52:48Z hikerstk $
|
||||
//
|
||||
// SuperTuxKart - a fun racing game with go-kart
|
||||
// Copyright (C) 2009 Joerg Henrichs
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 3
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef HEADER_THREE_D_ANIMATION_HPP
|
||||
#define HEADER_THREE_D_ANIMATION_HPP
|
||||
|
||||
#include "animations/animation_base.hpp"
|
||||
|
||||
class XMLNode;
|
||||
|
||||
/** A virtual base class for all animations. */
|
||||
class ThreeDAnimation : public AnimationBase
|
||||
{
|
||||
private:
|
||||
|
||||
public:
|
||||
ThreeDAnimation(const XMLNode &node);
|
||||
|
||||
}; // ThreeDAnimation
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user