From 47f23369e8fbcae86c2383191a030f20e79bee32 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 17 Apr 2008 04:37:49 +0000 Subject: [PATCH] Added some const declarations. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1689 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/terrain_info.cpp | 4 ++-- src/terrain_info.hpp | 4 ++-- src/track.cpp | 4 ++-- src/track.hpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/terrain_info.cpp b/src/terrain_info.cpp index a66178d0b..13ea1e3bf 100644 --- a/src/terrain_info.cpp +++ b/src/terrain_info.cpp @@ -23,7 +23,7 @@ #include "world.hpp" #include "constants.hpp" -TerrainInfo::TerrainInfo(btVector3 &pos, int frequency) +TerrainInfo::TerrainInfo(const btVector3 &pos, int frequency) { m_HoT_frequency = frequency; m_HoT_counter = frequency; @@ -31,7 +31,7 @@ TerrainInfo::TerrainInfo(btVector3 &pos, int frequency) update(pos); } //----------------------------------------------------------------------------- -void TerrainInfo::update( btVector3& pos) +void TerrainInfo::update(const btVector3& pos) { m_HoT_counter++; if(m_HoT_counter>=m_HoT_frequency) diff --git a/src/terrain_info.hpp b/src/terrain_info.hpp index af3983b5d..53a0241d4 100644 --- a/src/terrain_info.hpp +++ b/src/terrain_info.hpp @@ -38,9 +38,9 @@ private: public: TerrainInfo(int frequency=1) {m_HoT_frequency=frequency; m_HoT_counter=frequency; } - TerrainInfo(btVector3 &pos, int frequency=1); + TerrainInfo(const btVector3 &pos, int frequency=1); virtual ~TerrainInfo() {}; - virtual void update(btVector3 &pos); + virtual void update(const btVector3 &pos); float getHoT() const { return m_HoT; } const Material* getMaterial() const { return m_material; } const btVector3& getNormal() const { return m_normal; } diff --git a/src/track.cpp b/src/track.cpp index 95fa7338d..c2325b1f9 100644 --- a/src/track.cpp +++ b/src/track.cpp @@ -848,7 +848,7 @@ void Track::loadTrack(std::string filename_) } // loadTrack //----------------------------------------------------------------------------- -void Track::getMusicInformation(std::vector& filenames, +void Track::getMusicInformation(std::vector& filenames, std::vector& music ) { for(int i=0; i<(int)filenames.size(); i++) @@ -1346,7 +1346,7 @@ void Track::herring_command (sgVec3 *xyz, char htype, int bNeedHeight ) } // herring_command // ---------------------------------------------------------------------------- -void Track::getTerrainInfo(btVector3 &pos, float *hot, btVector3* normal, +void Track::getTerrainInfo(const btVector3 &pos, float *hot, btVector3* normal, const Material **material) const { btVector3 to_pos(pos); diff --git a/src/track.hpp b/src/track.hpp index 876b9196d..985110449 100644 --- a/src/track.hpp +++ b/src/track.hpp @@ -194,7 +194,7 @@ public: const std::vector& getWidth () const {return m_path_width; } const std::string& getHerringStyle () const {return m_herring_style; } void getStartCoords (unsigned int pos, sgCoord* coords) const; - void getTerrainInfo(btVector3 &pos, float *hot, btVector3* normal, + void getTerrainInfo(const btVector3 &pos, float *hot, btVector3* normal, const Material **material) const; void createPhysicsModel (); void glVtx (sgVec2 v, float x_offset, float y_offset) const