Removed unused animation_manager (track object manager takes care

of animations).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7040 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2010-12-16 21:15:59 +00:00
parent f5662118c6
commit 1c90d679e2
7 changed files with 1 additions and 154 deletions

View File

@@ -14,8 +14,6 @@ supertuxkart_SOURCES = \
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/ipo.cpp \

View File

@@ -1,75 +0,0 @@
// $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 Track &track, const XMLNode &node)
{
for(unsigned int i=0; i<node.getNumNodes(); i++)
{
const XMLNode *anim_node = node.getNode(i);
std::string type = anim_node->getName();
if(type=="anim_billboard")
m_all_animations.push_back(new BillboardAnimation(*anim_node));
else if(type=="animations-IPO")
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
// ----------------------------------------------------------------------------
/** Removes all animations from the scene node and memory. Called from
* Track::cleanup().
*/
AnimationManager::~AnimationManager()
{
std::vector<AnimationBase*>::iterator i;
for(i=m_all_animations.begin(); i!=m_all_animations.end(); i++)
delete *i;
m_all_animations.clear();
} // ~AnimationManager
// ----------------------------------------------------------------------------
/** Resets all animations.
*/
void AnimationManager::reset()
{
std::vector<AnimationBase*>::iterator i;
for(i=m_all_animations.begin(); i!=m_all_animations.end(); i++)
(*i)->reset();
} // reset
// ----------------------------------------------------------------------------
/** Updates all animations. Called once per time step.
* \param dt Time since last call.
*/
void AnimationManager::update(float dt)
{
std::vector<AnimationBase*>::iterator i;
for(i=m_all_animations.begin(); i!=m_all_animations.end(); i++)
(*i)->update(dt);
} // update

View File

@@ -1,49 +0,0 @@
// $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 <string>
#include <vector>
#include "utils/no_copy.hpp"
class AnimationBase;
class Track;
class XMLNode;
/**
* \brief Controls all animations of a track.
* \ingroup animations
*/
class AnimationManager : public NoCopy
{
private:
std::vector<AnimationBase*> m_all_animations;
public:
AnimationManager(const Track &track, const XMLNode &node);
~AnimationManager();
void update(float dt);
void reset();
}; // AnimationManager
#endif

View File

@@ -930,10 +930,6 @@
RelativePath="..\..\animations\animation_base.cpp"
>
</File>
<File
RelativePath="..\..\animations\animation_manager.cpp"
>
</File>
<File
RelativePath="..\..\animations\billboard_animation.cpp"
>
@@ -1820,10 +1816,6 @@
RelativePath="..\..\animations\animation_base.hpp"
>
</File>
<File
RelativePath="..\..\animations\animation_manager.hpp"
>
</File>
<File
RelativePath="..\..\animations\billboard_animation.hpp"
>

View File

@@ -557,7 +557,7 @@ void FileManager::checkAndCreateAddonsDir()
std::string FileManager::getAddonsDir() const
{
return m_addons_dir;
} // getConfigDir
} // getADdonsDir
/* see l450: to avoid the compilation of unused methods. */
#endif

View File

@@ -27,7 +27,6 @@
#include "irrlicht.h"
using namespace irr;
#include "animations/animation_manager.hpp"
#include "audio/music_manager.hpp"
#include "config/stk_config.hpp"
#include "config/user_config.hpp"
@@ -72,7 +71,6 @@ Track::Track(std::string filename)
m_is_arena = false;
m_camera_far = 1000.0f;
m_quad_graph = NULL;
m_animation_manager = NULL;
m_check_manager = NULL;
m_mini_map = NULL;
m_sky_dx = 0.05f;
@@ -98,8 +96,6 @@ Track::~Track()
void Track::reset()
{
m_ambient_color = m_default_ambient_color;
if(m_animation_manager)
m_animation_manager->reset();
if(m_check_manager)
m_check_manager->reset(*this);
item_manager->reset();
@@ -139,12 +135,6 @@ void Track::cleanup()
irr_driver->removeMesh(m_all_meshes[i]);
}
m_all_meshes.clear();
if(m_animation_manager)
{
delete m_animation_manager;
m_animation_manager = NULL;
}
if(m_check_manager)
{
@@ -618,8 +608,6 @@ void Track::update(float dt)
{
m_animated_textures[i]->update(dt);
}
if(m_animation_manager)
m_animation_manager->update(dt);
if(m_check_manager)
m_check_manager->update(dt);
item_manager->update(dt);
@@ -826,10 +814,6 @@ void Track::loadTrackModel(World* parent, unsigned int mode_id)
{
node->get("far", &m_camera_far);
}
else if(name=="animations")
{
m_animation_manager = new AnimationManager(*this, *node);
}
else if(name=="checks")
{
m_check_manager = new CheckManager(*node, this);

View File

@@ -155,9 +155,6 @@ 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;
/** Checkline manager. */
CheckManager *m_check_manager;