Code cleanup (replaced unnecessary inlines, added missing inlines,

replaced Vec3 parameters with const &).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@3052 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-01-27 02:36:37 +00:00
parent cdba286d28
commit 1eb42a9ff6
11 changed files with 22 additions and 18 deletions

View File

@ -18,14 +18,15 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "graphics/camera.hpp"
#define _WINSOCKAPI_
#include <plib/ssg.h>
#include "modes/world.hpp"
#include "camera.hpp"
#include "user_config.hpp"
#include "race_manager.hpp"
#include "audio/sound_manager.hpp"
#include "karts/player_kart.hpp"
#include "modes/world.hpp"
#include "race_manager.hpp"
#include "tracks/track.hpp"
#include "utils/constants.hpp"
#include "utils/coord.hpp"

View File

@ -21,6 +21,7 @@
#include "scene.hpp"
#include "karts/kart.hpp"
#include "physics/btKart.hpp"
#include "utils/coord.hpp"
float SkidMarks::m_avoid_z_fighting = 0.0f;

View File

@ -21,6 +21,7 @@
#include "smoke.hpp"
#include "material_manager.hpp"
#include "karts/kart.hpp"
#include "physics/btKart.hpp"
#include "utils/constants.hpp"
Smoke::Smoke(Kart* kart)

View File

@ -91,12 +91,8 @@ TrackSel::TrackSel()
m_current_track = -1;
for(unsigned int i=0; i<m_index_avail_tracks.size(); i++)
{
assert(i < m_index_avail_tracks.size());
//assert( m_index_avail_tracks[i] >= 0);
// FIXME - someone had a crash because m_index_avail_tracks[i] was set to a negative number, e.g. -2
// I have no clue what causes this issue, consider this as a temporary fix
if(m_index_avail_tracks[i] < 0) continue;
// Ignore track groups (which are negative)
if(m_index_avail_tracks[i]<0) continue;
if(track_manager->getTrack(m_index_avail_tracks[i])->getIdent()==
user_config->m_last_track)
{

View File

@ -69,9 +69,10 @@ Flyable::Flyable(Kart *kart, PowerupType type, float mass) : Moveable()
scene->add(m);
} // Flyable
// ----------------------------------------------------------------------------
void Flyable::createPhysics(float y_offset, const btVector3 velocity,
void Flyable::createPhysics(float y_offset, const btVector3 &velocity,
btCollisionShape *shape, const float gravity,
const bool rotates, const bool turn_around, const btTransform* customDirection)
const bool rotates, const bool turn_around,
const btTransform* customDirection)
{
// Get Kart heading direction
btTransform trans = ( customDirection == NULL ? m_owner->getKartHeading() : *customDirection );

View File

@ -86,7 +86,7 @@ protected:
const bool backwards=false) const;
/** init bullet for moving objects like projectiles */
void createPhysics(float y_offset,
const btVector3 velocity,
const btVector3 &velocity,
btCollisionShape *shape, const float gravity=0.0f,
const bool rotates=false, const bool turn_around=false,
const btTransform* customDirection=NULL);

View File

@ -45,6 +45,7 @@
#include "karts/kart_properties_manager.hpp"
#include "network/race_state.hpp"
#include "network/network_manager.hpp"
#include "physics/btKart.hpp"
#include "physics/btUprightConstraint.hpp"
#include "physics/physics.hpp"
#include "tracks/track.hpp"

View File

@ -31,7 +31,6 @@
#include "karts/kart_properties.hpp"
#include "karts/kart_control.hpp"
#include "karts/kart_model.hpp"
#include "physics/btKart.hpp"
#include "tracks/terrain_info.hpp"
class SkidMarks;
@ -40,6 +39,8 @@ class Smoke;
class Nitro;
class SFXBase;
class btUprightConstraint;
class btKart;
class btRaycastVehicle::btVehicleTuning;
class Kart : public TerrainInfo, public Moveable
{
@ -68,7 +69,8 @@ protected:
* is disabled to allow the karts to bounce back*/
// physics parameters, storing it saves time
btKart::btVehicleTuning *m_tuning;
btRaycastVehicle::btVehicleTuning
*m_tuning;
btCompoundShape m_kart_chassis;
btVehicleRaycaster *m_vehicle_raycaster;
btKart *m_vehicle;

View File

@ -21,6 +21,7 @@
#include "user_config.hpp"
#include "network/race_state.hpp"
#include "physics/btKart.hpp"
#include "physics/btUprightConstraint.hpp"
#include "tracks/track.hpp"
#include "utils/ssg_help.hpp"

View File

@ -33,8 +33,8 @@ TriangleMesh::~TriangleMesh()
} // ~TriangleMesh
// -----------------------------------------------------------------------------
void TriangleMesh::addTriangle(btVector3 t1, btVector3 t2, btVector3 t3,
const Material* m)
void TriangleMesh::addTriangle(const btVector3 &t1, const btVector3 &t2,
const btVector3 &t3, const Material* m)
{
m_triangleIndex2Material.push_back(m);
m_mesh.addTriangle(t1, t2, t3);

View File

@ -41,8 +41,8 @@ private:
public:
TriangleMesh() : m_mesh() {};
~TriangleMesh();
void addTriangle(btVector3 t1, btVector3 t2, btVector3 t3,
const Material* m);
void addTriangle(const btVector3 &t1, const btVector3 &t2,
const btVector3 &t3, const Material* m);
void createBody(btCollisionObject::CollisionFlags flags=
(btCollisionObject::CollisionFlags)0);
const Material* getMaterial(int n) const {return m_triangleIndex2Material[n];}