Added framework for animation (doesn't do anything atm).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3659 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-06-26 03:21:22 +00:00
parent a4ab2fa094
commit c14ffd586e
4 changed files with 61 additions and 1 deletions

View File

@ -12,6 +12,14 @@ supertuxkart_SOURCES = \
main.cpp \
main_loop.cpp \
main_loop.hpp \
animations/animation_base.hpp \
animations/animation_base.cpp \
animations/animation_manager.cpp \
animations/animation_manager.hpp \
animations/billboard_animation.cpp \
animations/billboard_animation.hpp \
animations/three_d_animation.cpp \
animations/three_d_animation.hpp \
audio/music.hpp \
audio/music_information.cpp \
audio/music_information.hpp \

View File

@ -701,6 +701,26 @@
>
</File>
</Filter>
<Filter
Name="animations"
>
<File
RelativePath="..\..\animations\animation_base.cpp"
>
</File>
<File
RelativePath="..\..\animations\animation_manager.cpp"
>
</File>
<File
RelativePath="..\..\animations\billboard_animation.cpp"
>
</File>
<File
RelativePath="..\..\animations\three_d_animation.cpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="Headerdateien"
@ -1295,6 +1315,26 @@
>
</File>
</Filter>
<Filter
Name="animations"
>
<File
RelativePath="..\..\animations\animation_base.hpp"
>
</File>
<File
RelativePath="..\..\animations\animation_manager.hpp"
>
</File>
<File
RelativePath="..\..\animations\billboard_animation.hpp"
>
</File>
<File
RelativePath="..\..\animations\three_d_animation.hpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="Ressourcendateien"

View File

@ -26,6 +26,7 @@
#include "irrlicht.h"
using namespace irr;
#include "animations/animation_manager.hpp"
#include "audio/sound_manager.hpp"
#include "config/stk_config.hpp"
#include "config/user_config.hpp"
@ -70,6 +71,7 @@ Track::Track( std::string filename_, float w, float h, bool stretch )
m_has_final_camera = false;
m_is_arena = false;
m_quad_graph = NULL;
m_animation_manager = NULL;
loadTrack(m_filename);
loadDriveline();
@ -79,7 +81,8 @@ Track::Track( std::string filename_, float w, float h, bool stretch )
/** Destructor, removes quad data structures etc. */
Track::~Track()
{
if(m_quad_graph) delete m_quad_graph;
if(m_quad_graph) delete m_quad_graph;
if(m_animation_manager) delete m_animation_manager;
} // ~Track
//-----------------------------------------------------------------------------
@ -520,6 +523,11 @@ void Track::loadTrack(const std::string &filename)
if(xml_node)
loadCurves(*xml_node);
xml_node = root->getNode("animations");
if(xml_node)
{
m_animation_manager = new AnimationManager(*xml_node);
}
// Set the correct paths
m_screenshot = file_manager->getTrackFile(m_screenshot, getIdent());
delete root;

View File

@ -46,6 +46,7 @@ class MovingTexture;
class XMLNode;
class PhysicalObject;
class BezierCurve;
class AnimationManager;
class Track
{
@ -101,6 +102,9 @@ private:
/** List of all bezier curves in the track - for e.g. camera, ... */
std::vector<BezierCurve*> m_all_curves;
/** Animation manager. */
AnimationManager *m_animation_manager;
void loadCurves(const XMLNode &node);
void handleAnimatedTextures(scene::ISceneNode *node, const XMLNode &xml);