diff --git a/sources.cmake b/sources.cmake index 1d57b1d54..d9d5229fc 100644 --- a/sources.cmake +++ b/sources.cmake @@ -94,7 +94,7 @@ src/items/rubber_band.cpp src/items/swatter.cpp src/karts/abstract_kart_animation.cpp src/karts/abstract_kart.cpp -src/karts/canon_animation.cpp +src/karts/cannon_animation.cpp src/karts/controller/ai_base_controller.cpp src/karts/controller/controller.cpp src/karts/controller/default_ai_controller.cpp @@ -205,7 +205,7 @@ src/tinygettext/stk_file_system.cpp src/tinygettext/tinygettext.cpp src/tracks/ambient_light_sphere.cpp src/tracks/bezier_curve.cpp -src/tracks/check_canon.cpp +src/tracks/check_cannon.cpp src/tracks/check_lap.cpp src/tracks/check_line.cpp src/tracks/check_manager.cpp @@ -336,7 +336,7 @@ src/items/rubber_band.hpp src/items/swatter.hpp src/karts/abstract_kart_animation.hpp src/karts/abstract_kart.hpp -src/karts/canon_animation.hpp +src/karts/cannon_animation.hpp src/karts/controller/ai_base_controller.hpp src/karts/controller/controller.hpp src/karts/controller/default_ai_controller.hpp @@ -462,7 +462,7 @@ src/tinygettext/stk_file_system.hpp src/tinygettext/tinygettext.hpp src/tracks/ambient_light_sphere.hpp src/tracks/bezier_curve.hpp -src/tracks/check_canon.hpp +src/tracks/check_cannon.hpp src/tracks/check_lap.hpp src/tracks/check_line.hpp src/tracks/check_manager.hpp diff --git a/src/karts/abstract_kart_animation.hpp b/src/karts/abstract_kart_animation.hpp index a073f9267..8bca9c7ee 100644 --- a/src/karts/abstract_kart_animation.hpp +++ b/src/karts/abstract_kart_animation.hpp @@ -26,7 +26,7 @@ class AbstractKart; -/** The base class for all kart animation, like rescue, explosion, or canon. +/** The base class for all kart animation, like rescue, explosion, or cannon. * Kart animations are done by removing the physics body from the physics * world, and instead modifying the rotation and position of the kart * directly. They are registered with the kart, and only one can be diff --git a/src/karts/canon_animation.cpp b/src/karts/cannon_animation.cpp similarity index 90% rename from src/karts/canon_animation.cpp rename to src/karts/cannon_animation.cpp index 6576df47b..fa23c90ba 100644 --- a/src/karts/canon_animation.cpp +++ b/src/karts/cannon_animation.cpp @@ -16,14 +16,14 @@ // 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/canon_animation.hpp" +#include "karts/cannon_animation.hpp" #include "karts/abstract_kart.hpp" #include "modes/world.hpp" #include "LinearMath/btTransform.h" -CanonAnimation::CanonAnimation(AbstractKart *kart, const Vec3 &target, +CannonAnimation::CannonAnimation(AbstractKart *kart, const Vec3 &target, float speed) : AbstractKartAnimation(kart) { @@ -42,24 +42,24 @@ CanonAnimation::CanonAnimation(AbstractKart *kart, const Vec3 &target, m_add_rotation.setHeading(0); m_add_rotation.setPitch( 0); m_add_rotation.setRoll( 0); -} // CanonAnimation +} // CannonAnimation // ---------------------------------------------------------------------------- -CanonAnimation::~CanonAnimation() +CannonAnimation::~CannonAnimation() { btTransform trans = m_kart->getTrans(); trans.setOrigin(m_xyz); m_kart->setTrans(trans); m_kart->getBody()->setCenterOfMassTransform(trans); World::getWorld()->getPhysics()->addKart(m_kart); -} // ~CanonAnimation +} // ~CannonAnimation // ---------------------------------------------------------------------------- /** Updates the kart animation. * \param dt Time step size. * \return True if the explosion is still shown, false if it has finished. */ -void CanonAnimation::update(float dt) +void CannonAnimation::update(float dt) { m_xyz += dt*m_velocity; m_kart->setXYZ(m_xyz); diff --git a/src/karts/canon_animation.hpp b/src/karts/cannon_animation.hpp similarity index 84% rename from src/karts/canon_animation.hpp rename to src/karts/cannon_animation.hpp index 19a66f706..69988e915 100644 --- a/src/karts/canon_animation.hpp +++ b/src/karts/cannon_animation.hpp @@ -16,8 +16,8 @@ // 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_CANON_ANIMATION_HPP -#define HEADER_CANON_ANIMATION_HPP +#ifndef HEADER_CANNON_ANIMATION_HPP +#define HEADER_CANNON_ANIMATION_HPP #include "karts/abstract_kart_animation.hpp" #include "utils/vec3.hpp" @@ -29,7 +29,7 @@ class AbstractKart; -class CanonAnimation: public AbstractKartAnimation +class CannonAnimation: public AbstractKartAnimation { protected: /** The coordinates where the kart was hit originally. */ @@ -51,11 +51,11 @@ protected: float m_duration; public: - CanonAnimation(AbstractKart *kart, const Vec3 &target, + CannonAnimation(AbstractKart *kart, const Vec3 &target, float speed); - virtual ~CanonAnimation(); + virtual ~CannonAnimation(); virtual void update(float dt); - virtual const std::string getName() const {return "Canon";} + virtual const std::string getName() const {return "Cannon";} -}; // CanonAnimation +}; // CannonAnimation #endif diff --git a/src/states_screens/race_gui_base.cpp b/src/states_screens/race_gui_base.cpp index 001d51b2b..805232368 100644 --- a/src/states_screens/race_gui_base.cpp +++ b/src/states_screens/race_gui_base.cpp @@ -41,7 +41,6 @@ #include "items/powerup.hpp" #include "karts/abstract_kart.hpp" #include "karts/abstract_kart_animation.hpp" -#include "karts/canon_animation.hpp" #include "karts/controller/controller.hpp" #include "karts/explosion_animation.hpp" #include "karts/kart_properties.hpp" diff --git a/src/tracks/check_canon.cpp b/src/tracks/check_cannon.cpp similarity index 79% rename from src/tracks/check_canon.cpp rename to src/tracks/check_cannon.cpp index d5e90f3b8..02b2af232 100644 --- a/src/tracks/check_canon.cpp +++ b/src/tracks/check_cannon.cpp @@ -16,36 +16,36 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "tracks/check_canon.hpp" +#include "tracks/check_cannon.hpp" #include "io/xml_node.hpp" #include "karts/abstract_kart.hpp" -#include "karts/canon_animation.hpp" +#include "karts/cannon_animation.hpp" #include "modes/world.hpp" -/** Constructor for a check canon. +/** Constructor for a check cannon. * \param node XML node containing the parameters for this checkline. * \param index Index of this check structure in the check manager. */ -CheckCanon::CheckCanon(const XMLNode &node, unsigned int index) +CheckCannon::CheckCannon(const XMLNode &node, unsigned int index) : CheckLine(node, index) { core::vector3df p1, p2; if(!node.get("target-p1", &p1) || !node.get("target-p2", &p2) ) { - printf("CheckCanon has no target line specified.\n"); + printf("CheckCannon has no target line specified.\n"); exit(-1); } m_target.setLine(p1, p2); m_speed = -1; node.get("speed", &m_speed); -} // CheckCanon +} // CheckCannon // ---------------------------------------------------------------------------- -void CheckCanon::trigger(unsigned int kart_index) +void CheckCannon::trigger(unsigned int kart_index) { Vec3 target(m_target.getMiddle()); AbstractKart *kart = World::getWorld()->getKart(kart_index); - new CanonAnimation(kart, target, m_speed); -} // CheckCanon + new CannonAnimation(kart, target, m_speed); +} // CheckCannon diff --git a/src/tracks/check_canon.hpp b/src/tracks/check_cannon.hpp similarity index 88% rename from src/tracks/check_canon.hpp rename to src/tracks/check_cannon.hpp index edf24b03d..2db209932 100644 --- a/src/tracks/check_canon.hpp +++ b/src/tracks/check_cannon.hpp @@ -16,8 +16,8 @@ // 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_CHECK_CANON_HPP -#define HEADER_CHECK_CANON_HPP +#ifndef HEADER_CHECK_CANNON_HPP +#define HEADER_CHECK_CANNON_HPP #include "tracks/check_line.hpp" @@ -30,7 +30,7 @@ class CheckManager; * * \ingroup tracks */ -class CheckCanon : public CheckLine +class CheckCannon : public CheckLine { private: /** The target point the kart will fly to. */ @@ -40,7 +40,7 @@ private: float m_speed; public: - CheckCanon(const XMLNode &node, unsigned int index); + CheckCannon(const XMLNode &node, unsigned int index); virtual void trigger(unsigned int kart_index); }; // CheckLine diff --git a/src/tracks/check_manager.cpp b/src/tracks/check_manager.cpp index 3208b7320..058870532 100644 --- a/src/tracks/check_manager.cpp +++ b/src/tracks/check_manager.cpp @@ -23,7 +23,7 @@ #include "io/xml_node.hpp" #include "tracks/ambient_light_sphere.hpp" -#include "tracks/check_canon.hpp" +#include "tracks/check_cannon.hpp" #include "tracks/check_lap.hpp" #include "tracks/check_line.hpp" #include "tracks/check_structure.hpp" @@ -48,9 +48,9 @@ void CheckManager::load(const XMLNode &node) { m_all_checks.push_back(new CheckLap(*check_node, i)); } - else if(type=="canon") + else if(type=="cannon") { - m_all_checks.push_back(new CheckCanon(*check_node, i)); + m_all_checks.push_back(new CheckCannon(*check_node, i)); } else if(type=="check-sphere") { diff --git a/src/tracks/check_structure.cpp b/src/tracks/check_structure.cpp index 2a500c70d..26d063679 100644 --- a/src/tracks/check_structure.cpp +++ b/src/tracks/check_structure.cpp @@ -48,8 +48,8 @@ CheckStructure::CheckStructure(const XMLNode &node, unsigned int index) m_check_type = CT_TOGGLE; else if(kind=="ambient-light") m_check_type = CT_AMBIENT_SPHERE; - else if(kind=="canon") - m_check_type = CT_CANON; + else if(kind=="cannon") + m_check_type = CT_CANNON; else { printf("Unknown check structure '%s' - ignored.\n", kind.c_str()); @@ -64,8 +64,8 @@ CheckStructure::CheckStructure(const XMLNode &node, unsigned int index) == m_same_group.end()) m_same_group.push_back(m_index); - // As a default, only lap lines and canons are activated - m_active_at_reset= m_check_type==CT_NEW_LAP || m_check_type==CT_CANON; + // As a default, only lap lines and cannons are activated + m_active_at_reset= m_check_type==CT_NEW_LAP || m_check_type==CT_CANNON; node.get("active", &m_active_at_reset); } // CheckStructure diff --git a/src/tracks/check_structure.hpp b/src/tracks/check_structure.hpp index e47645547..e7a442b2f 100644 --- a/src/tracks/check_structure.hpp +++ b/src/tracks/check_structure.hpp @@ -40,7 +40,7 @@ class CheckManager; * CT_ACTIVATE: Activates the specified other check structures. * CT_TOGGLE: Toggles the specified other check structures (active to * inactive and vice versa. - * CT_CANON: A check line that 'shoots' the kart to a specified location. + * CT_CANNON: A check line that 'shoots' the kart to a specified location. * Each check structure can be active or inactive. Only lap counters are * initialised to be active, all other check structures are inactive. * @@ -54,14 +54,14 @@ public: * the state that check structure is in) * TOGGLE: Switches (inverts) the state of another check structure. * NEW_LAP: On crossing a new lap is counted. - * CANON: Causes the kart to be shot to a specified point. + * CANNON: Causes the kart to be shot to a specified point. * AMBIENT_SPHERE: Modifies the ambient color. * A combination of an activate and new_lap line are used to * avoid shortcuts: a new_lap line is deactivated after crossing it, and * you have to cross a corresponding activate structure to re-activate it, * enabling you to count the lap again. */ - enum CheckType {CT_NEW_LAP, CT_ACTIVATE, CT_TOGGLE, CT_CANON, + enum CheckType {CT_NEW_LAP, CT_ACTIVATE, CT_TOGGLE, CT_CANNON, CT_AMBIENT_SPHERE}; protected: