From: <hik...@us...> - 2008-03-18 01:41:09
|
Revision: 1662 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=1662&view=rev Author: hikerstk Date: 2008-03-17 18:41:06 -0700 (Mon, 17 Mar 2008) Log Message: ----------- Added sound effect when a player_kart is overtaken. Modified Paths: -------------- trunk/supertuxkart/src/kart.hpp trunk/supertuxkart/src/kart_properties.cpp trunk/supertuxkart/src/player_kart.cpp trunk/supertuxkart/src/player_kart.hpp Modified: trunk/supertuxkart/src/kart.hpp =================================================================== --- trunk/supertuxkart/src/kart.hpp 2008-03-18 01:40:04 UTC (rev 1661) +++ trunk/supertuxkart/src/kart.hpp 2008-03-18 01:41:06 UTC (rev 1662) @@ -147,7 +147,7 @@ { m_attachment.set(attachment_, time); } void setCollectable (CollectableType t, int n) { m_collectable.set(t, n); } - void setPosition (int p) + virtual void setPosition (int p) { m_race_position = p; } int getSector () const { return m_track_sector; } float getDistanceDownTrack() const { return m_curr_track_coords[1]; } Modified: trunk/supertuxkart/src/kart_properties.cpp =================================================================== --- trunk/supertuxkart/src/kart_properties.cpp 2008-03-18 01:40:04 UTC (rev 1661) +++ trunk/supertuxkart/src/kart_properties.cpp 2008-03-18 01:41:06 UTC (rev 1662) @@ -95,7 +95,7 @@ m_model = loader->load(m_model_file, CB_KART, false); if(!m_model) { - fprintf(stderr, "Can't find kart model '%s'.\n",m_model_file); + fprintf(stderr, "Can't find kart model '%s'.\n",m_model_file.c_str()); file_manager->popTextureSearchPath(); file_manager->popModelSearchPath(); return; Modified: trunk/supertuxkart/src/player_kart.cpp =================================================================== --- trunk/supertuxkart/src/player_kart.cpp 2008-03-18 01:40:04 UTC (rev 1661) +++ trunk/supertuxkart/src/player_kart.cpp 2008-03-18 01:41:06 UTC (rev 1662) @@ -180,6 +180,18 @@ } // crashed //----------------------------------------------------------------------------- +/** Checks if the kart was overtaken, and if so plays a sound +*/ +void PlayerKart::setPosition(int p) +{ + if(getPosition()<p) + { + sound_manager->playSfx(SOUND_BEEP); + } + Kart::setPosition(p); +} // setPosition + +//----------------------------------------------------------------------------- void PlayerKart::handleZipper() { Kart::handleZipper(); Modified: trunk/supertuxkart/src/player_kart.hpp =================================================================== --- trunk/supertuxkart/src/player_kart.hpp 2008-03-18 01:40:04 UTC (rev 1661) +++ trunk/supertuxkart/src/player_kart.hpp 2008-03-18 01:41:06 UTC (rev 1662) @@ -56,6 +56,8 @@ void crashed (); void handleZipper (); void collectedHerring (Herring* herring); + virtual void setPosition (int p); + int isPlayerKart () const {return 1;} void reset(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |