diff --git a/sources.cmake b/sources.cmake
index 99255828b..34ecebe8c 100644
--- a/sources.cmake
+++ b/sources.cmake
@@ -99,9 +99,9 @@ src/karts/controller/default_ai_controller.cpp
src/karts/controller/end_controller.cpp
src/karts/controller/new_ai_controller.cpp
src/karts/controller/player_controller.cpp
-src/karts/emergency_animation.cpp
src/karts/ghost_kart.cpp
src/karts/kart.cpp
+src/karts/kart_animation.cpp
src/karts/kart_gfx.cpp
src/karts/kart_model.cpp
src/karts/kart_properties.cpp
@@ -338,9 +338,9 @@ src/karts/controller/end_controller.hpp
src/karts/controller/kart_control.hpp
src/karts/controller/new_ai_controller.hpp
src/karts/controller/player_controller.hpp
-src/karts/emergency_animation.hpp
src/karts/ghost_kart.hpp
src/karts/kart.hpp
+src/karts/kart_animation.hpp
src/karts/kart_gfx.hpp
src/karts/kart_model.hpp
src/karts/kart_properties.hpp
diff --git a/src/ide/vc9/supertuxkart.vcproj b/src/ide/vc9/supertuxkart.vcproj
index b7c33746f..13b219c40 100644
--- a/src/ide/vc9/supertuxkart.vcproj
+++ b/src/ide/vc9/supertuxkart.vcproj
@@ -832,10 +832,6 @@
RelativePath="..\..\karts\abstract_kart.cpp"
>
-
-
@@ -844,6 +840,10 @@
RelativePath="..\..\karts\kart.cpp"
>
+
+
@@ -1982,10 +1982,6 @@
RelativePath="..\..\karts\abstract_kart.hpp"
>
-
-
@@ -1994,6 +1990,10 @@
RelativePath="..\..\karts\kart.hpp"
>
+
+
diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp
index 8efddef35..f496318a1 100644
--- a/src/karts/kart.cpp
+++ b/src/karts/kart.cpp
@@ -45,6 +45,7 @@
#include "items/attachment.hpp"
#include "items/item_manager.hpp"
#include "karts/controller/end_controller.hpp"
+#include "karts/kart_animation.hpp"
#include "karts/kart_model.hpp"
#include "karts/kart_properties_manager.hpp"
#include "karts/max_speed.hpp"
@@ -81,7 +82,7 @@ Kart::Kart (const std::string& ident, unsigned int world_kart_id,
# pragma warning(1:4355)
#endif
{
- m_emergency_animation = new EmergencyAnimation(this);
+ m_kart_animation = new KartAnimation(this);
m_max_speed = new MaxSpeed(this);
m_terrain_info = new TerrainInfo();
m_powerup = new Powerup(this);
@@ -241,7 +242,7 @@ Kart::~Kart()
}
delete m_skidding;
delete m_max_speed;
- delete m_emergency_animation;
+ delete m_kart_animation;
delete m_terrain_info;
delete m_powerup;
@@ -264,7 +265,7 @@ void Kart::reset()
stopFlying();
}
- m_emergency_animation->reset();
+ m_kart_animation->reset();
m_max_speed->reset();
m_powerup->reset();
@@ -394,27 +395,27 @@ float Kart::getSpeedIncreaseTimeLeft(unsigned int category) const
// -----------------------------------------------------------------------------
bool Kart::playingRescueAnimation() const
{
- return m_emergency_animation->playingRescueAnimation();
+ return m_kart_animation->playingRescueAnimation();
} // playingRescueAnimation
// -----------------------------------------------------------------------------
bool Kart::playingExplosionAnimation() const
{
- return m_emergency_animation->playingExplosionAnimation();
+ return m_kart_animation->playingExplosionAnimation();
} // playingExplosionAnimation
// -----------------------------------------------------------------------------
/** Returns the timer for the currently played animation. */
float Kart::getAnimationTimer() const
{
- return m_emergency_animation->getAnimationTimer();
+ return m_kart_animation->getAnimationTimer();
} // getAnimationTimer
// -----------------------------------------------------------------------------
/** Returns true if an emergency animation is being played. */
bool Kart::playingEmergencyAnimation() const
{
- return m_emergency_animation->playingEmergencyAnimation();
+ return m_kart_animation->playingAnimation();
} // playingEmergencyAnimation
// -----------------------------------------------------------------------------
@@ -902,12 +903,12 @@ bool Kart::isNearGround() const
*/
bool Kart::isEliminated() const
{
- return m_emergency_animation->isEliminated();
+ return m_kart_animation->isEliminated();
} // isEliminated
// ------------------------------------------------------------------------
void Kart::eliminate(bool remove)
{
- m_emergency_animation->eliminate(remove);
+ m_kart_animation->eliminate(remove);
} // eliminate
// ------------------------------------------------------------------------
@@ -917,7 +918,7 @@ void Kart::eliminate(bool remove)
*/
void Kart::handleExplosion(const Vec3& pos, bool direct_hit)
{
- m_emergency_animation->handleExplosion(pos, direct_hit);
+ m_kart_animation->handleExplosion(pos, direct_hit);
} // handleExplosion
//-----------------------------------------------------------------------------
@@ -927,7 +928,7 @@ void Kart::handleExplosion(const Vec3& pos, bool direct_hit)
*/
void Kart::forceRescue(bool is_auto_rescue)
{
- m_emergency_animation->forceRescue(is_auto_rescue);
+ m_kart_animation->forceRescue(is_auto_rescue);
} // forceRescue
//-----------------------------------------------------------------------------
@@ -937,9 +938,9 @@ void Kart::forceRescue(bool is_auto_rescue)
*/
void Kart::update(float dt)
{
- if (m_emergency_animation->isEliminated())
+ if (m_kart_animation->isEliminated())
{
- m_emergency_animation->update(dt);
+ m_kart_animation->update(dt);
return;
}
@@ -1034,7 +1035,7 @@ void Kart::update(float dt)
m_wheel_rotation += m_speed*dt / m_kart_properties->getWheelRadius();
m_wheel_rotation=fmodf(m_wheel_rotation, 2*M_PI);
- m_emergency_animation->update(dt);
+ m_kart_animation->update(dt);
m_attachment->update(dt);
@@ -1286,7 +1287,7 @@ void Kart::handleMaterialGFX()
// something with the wheels, and the material has not the
// below surface property set.
if (material && isOnGround() && !material->isBelowSurface() &&
- !m_emergency_animation->playingRescueAnimation()&&
+ !m_kart_animation->playingRescueAnimation()&&
UserConfigParams::m_graphical_effects)
{
@@ -1343,7 +1344,7 @@ void Kart::handleMaterialGFX()
const ParticleKind *pk =
surface_material->getParticlesWhen(Material::EMIT_ON_DRIVE);
- if(!pk || m_flying || m_emergency_animation->playingRescueAnimation())
+ if(!pk || m_flying || m_kart_animation->playingRescueAnimation())
return;
// Now the kart is under a surface, and there is a surface effect
@@ -1361,7 +1362,7 @@ void Kart::handleMaterialGFX()
// Play special sound effects for this terrain
// -------------------------------------------
const std::string s = surface_material->getSFXName();
- if (s != "" && !m_emergency_animation->playingRescueAnimation()&&
+ if (s != "" && !m_kart_animation->playingRescueAnimation()&&
(m_terrain_sound == NULL || m_terrain_sound->getStatus() == SFXManager::SFX_STOPPED))
{
if (m_previous_terrain_sound) sfx_manager->deleteSFX(m_previous_terrain_sound);
diff --git a/src/karts/kart.hpp b/src/karts/kart.hpp
index fd5510769..72bc3917f 100644
--- a/src/karts/kart.hpp
+++ b/src/karts/kart.hpp
@@ -30,7 +30,6 @@
#include "items/powerup.hpp"
#include "karts/abstract_kart.hpp"
-#include "karts/emergency_animation.hpp"
#include "karts/kart_properties.hpp"
#include "tracks/terrain_info.hpp"
#include "utils/no_copy.hpp"
@@ -41,8 +40,8 @@ class btUprightConstraint;
class Attachment;
class Camera;
class Controller;
-class EmergencyAnimation;
class Item;
+class KartAnimation;
class KartGFX;
class MaxSpeed;
class ParticleEmitter;
@@ -67,8 +66,8 @@ class Kart : public AbstractKart
{
friend class Skidding;
protected:
- /** Handles all emergency animations: rescue and explosion. */
- EmergencyAnimation *m_emergency_animation;
+ /** Handles all kart animations, such as rescue and explosion. */
+ KartAnimation *m_kart_animation;
private:
/** Handles speed increase and capping due to powerup, terrain, ... */
diff --git a/src/karts/emergency_animation.cpp b/src/karts/kart_animation.cpp
similarity index 92%
rename from src/karts/emergency_animation.cpp
rename to src/karts/kart_animation.cpp
index c42d5e562..ba43646b4 100644
--- a/src/karts/emergency_animation.cpp
+++ b/src/karts/kart_animation.cpp
@@ -16,7 +16,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include "karts/emergency_animation.hpp"
+#include "karts/kart_animation.hpp"
#include "graphics/camera.hpp"
#include "graphics/referee.hpp"
@@ -33,7 +33,7 @@
* and initialised the timer.
* \param kart Pointer to the kart which is animated.
*/
-EmergencyAnimation::EmergencyAnimation(Kart *kart)
+KartAnimation::KartAnimation(Kart *kart)
{
m_stars_effect = NULL;
m_referee = NULL;
@@ -45,19 +45,19 @@ EmergencyAnimation::EmergencyAnimation(Kart *kart)
// rescue is not set.
m_kart_mode = EA_NONE;
m_eliminated = false;
-}; // EmergencyAnimation
+}; // KartAnimation
//-----------------------------------------------------------------------------
-EmergencyAnimation::~EmergencyAnimation()
+KartAnimation::~KartAnimation()
{
if(m_stars_effect)
delete m_stars_effect;
-} // ~EmergencyAnimation
+} // ~KartAnimation
//-----------------------------------------------------------------------------
/** Resets all data at the beginning of a race.
*/
-void EmergencyAnimation::reset()
+void KartAnimation::reset()
{
// Create the stars effect in the first reset
@@ -74,7 +74,7 @@ void EmergencyAnimation::reset()
// If the kart was eliminated or rescued, the body was removed from the
// physics world. Add it again.
- if(m_eliminated || playingEmergencyAnimation())
+ if(m_eliminated || playingAnimation())
{
World::getWorld()->getPhysics()->addKart(m_kart);
}
@@ -92,9 +92,9 @@ void EmergencyAnimation::reset()
/** Eliminates a kart from the race. It removes the kart from the physics
* world, and makes the scene node invisible.
*/
-void EmergencyAnimation::eliminate(bool remove)
+void KartAnimation::eliminate(bool remove)
{
- if (!playingEmergencyAnimation() && remove)
+ if (!playingAnimation() && remove)
{
World::getWorld()->getPhysics()->removeKart(m_kart);
}
@@ -119,9 +119,9 @@ void EmergencyAnimation::eliminate(bool remove)
* and saves the current pitch and roll (for the rescue animation). It
* also removes the kart from the physics world.
*/
-void EmergencyAnimation::forceRescue(bool is_auto_rescue)
+void KartAnimation::forceRescue(bool is_auto_rescue)
{
- if(playingEmergencyAnimation()) return;
+ if(playingAnimation()) return;
assert(!m_referee);
m_referee = new Referee(*m_kart);
@@ -155,10 +155,10 @@ void EmergencyAnimation::forceRescue(bool is_auto_rescue)
* \param pos The coordinates of the explosion.
* \param direct_hig True if the kart was hit directly --> maximal impact.
*/
-void EmergencyAnimation::handleExplosion(const Vec3 &pos, bool direct_hit)
+void KartAnimation::handleExplosion(const Vec3 &pos, bool direct_hit)
{
// Avoid doing another explosion while a kart is thrown around in the air.
- if(playingEmergencyAnimation())
+ if(playingAnimation())
return;
if(m_kart->isInvulnerable())
@@ -214,7 +214,7 @@ void EmergencyAnimation::handleExplosion(const Vec3 &pos, bool direct_hit)
* \param dt Time step size.
* \return True if the explosion is still shown, false if it has finished.
*/
-void EmergencyAnimation::update(float dt)
+void KartAnimation::update(float dt)
{
if ( UserConfigParams::m_graphical_effects )
{
@@ -222,7 +222,7 @@ void EmergencyAnimation::update(float dt)
m_stars_effect->update(dt);
}
- if(!playingEmergencyAnimation()) return;
+ if(!playingAnimation()) return;
// See if the timer expires, if so return the kart to normal game play
m_timer -= dt;
diff --git a/src/karts/emergency_animation.hpp b/src/karts/kart_animation.hpp
similarity index 93%
rename from src/karts/emergency_animation.hpp
rename to src/karts/kart_animation.hpp
index 53bd17d8e..95ef5c777 100644
--- a/src/karts/emergency_animation.hpp
+++ b/src/karts/kart_animation.hpp
@@ -38,7 +38,7 @@ class Stars;
* explosion happens.
* \ingroup karts
*/
-class EmergencyAnimation: public NoCopy
+class KartAnimation: public NoCopy
{
protected:
/** The coordinates where the kart was hit originally. */
@@ -79,16 +79,16 @@ protected:
enum {EA_NONE, EA_RESCUE, EA_EXPLOSION}
m_kart_mode;
public:
- EmergencyAnimation(Kart *kart);
- virtual ~EmergencyAnimation();
+ KartAnimation(Kart *kart);
+ virtual ~KartAnimation();
void reset();
virtual void handleExplosion(const Vec3& pos, bool direct_hit);
virtual void forceRescue(bool is_auto_rescue=false);
void update(float dt);
void eliminate (bool remove);
// ------------------------------------------------------------------------
- /** Returns true if an emergency animation is being played. */
- bool playingEmergencyAnimation() const {return m_kart_mode!=EA_NONE; }
+ /** Returns true if an animation is being played. */
+ bool playingAnimation() const {return m_kart_mode!=EA_NONE; }
// ------------------------------------------------------------------------
/** Returns if a rescue animation is being shown. */
bool playingRescueAnimation() const {return m_kart_mode==EA_RESCUE; }
@@ -105,5 +105,5 @@ public:
/** Returns a pointer to the stars effect. */
const Stars *getStarEffect () const {return m_stars_effect; }
-}; // EmergencyAnimation
+}; // KartAnimation
#endif
diff --git a/src/karts/kart_with_stats.cpp b/src/karts/kart_with_stats.cpp
index a92565ea5..718802892 100644
--- a/src/karts/kart_with_stats.cpp
+++ b/src/karts/kart_with_stats.cpp
@@ -18,6 +18,7 @@
#include "karts/kart_with_stats.hpp"
+#include "karts/kart_animation.hpp"
#include "items/item.hpp"
KartWithStats::KartWithStats(const std::string& ident,
@@ -75,10 +76,10 @@ void KartWithStats::handleExplosion(const Vec3& pos, bool direct_hit)
Kart::handleExplosion(pos, direct_hit);
// If a kart is too far away from an explosion to be affected, its timer
// will be 0, and this should then not be counted as an explosion.
- if(is_new_explosion && m_emergency_animation->getAnimationTimer()>0)
+ if(is_new_explosion && m_kart_animation->getAnimationTimer()>0)
{
m_explosion_count ++;
- m_explosion_time += m_emergency_animation->getAnimationTimer();
+ m_explosion_time += m_kart_animation->getAnimationTimer();
}
} // handleExplosion
@@ -97,7 +98,7 @@ void KartWithStats::forceRescue(bool is_auto_rescue)
if(is_new_rescue)
{
m_rescue_count++;
- m_rescue_time += m_emergency_animation->getAnimationTimer();
+ m_rescue_time += m_kart_animation->getAnimationTimer();
}
} // forceRescue