diff --git a/src/audio/sfx_manager.cpp b/src/audio/sfx_manager.cpp index 44379876f..c43327897 100644 --- a/src/audio/sfx_manager.cpp +++ b/src/audio/sfx_manager.cpp @@ -130,7 +130,8 @@ void SFXManager::loadSfx() loadSingleSfx(lisp, "prestart", SOUND_PRESTART ); loadSingleSfx(lisp, "start", SOUND_START ); loadSingleSfx(lisp, "missile_lock", SOUND_MISSILE_LOCK ); - loadSingleSfx(lisp, "engine", SOUND_ENGINE ); + loadSingleSfx(lisp, "engine_small", SOUND_ENGINE_SMALL ); + loadSingleSfx(lisp, "engine_large", SOUND_ENGINE_LARGE ); } // loadSfx //---------------------------------------------------------------------------- void SFXManager::loadSingleSfx(const lisp::Lisp* lisp, diff --git a/src/audio/sfx_manager.hpp b/src/audio/sfx_manager.hpp index 19cf5f464..c9959da88 100644 --- a/src/audio/sfx_manager.hpp +++ b/src/audio/sfx_manager.hpp @@ -48,7 +48,7 @@ public: SOUND_UGH, SOUND_SKID, SOUND_WINNER, SOUND_CRASH, SOUND_GRAB, SOUND_SHOT, SOUND_WEE, SOUND_EXPLOSION, SOUND_BZZT, SOUND_BEEP, SOUND_BACK_MENU, SOUND_USE_ANVIL, SOUND_USE_PARACHUTE, SOUND_SELECT_MENU, SOUND_MOVE_MENU, SOUND_FULL, - SOUND_PRESTART, SOUND_START, SOUND_MISSILE_LOCK, SOUND_ENGINE, + SOUND_PRESTART, SOUND_START, SOUND_MISSILE_LOCK, SOUND_ENGINE_SMALL, SOUND_ENGINE_LARGE, NUM_SOUNDS }; diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 9317dd2d2..1a126a4c7 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -102,10 +102,10 @@ Kart::Kart (const std::string& kart_name, int position, m_rescue = false; m_wheel_rotation = 0; - m_engine_sound = sfx_manager->newSFX(SFXManager::SOUND_ENGINE ); - m_beep_sound = sfx_manager->newSFX(SFXManager::SOUND_BEEP ); - m_crash_sound = sfx_manager->newSFX(SFXManager::SOUND_CRASH ); - m_skid_sound = sfx_manager->newSFX(SFXManager::SOUND_SKID ); + m_engine_sound = sfx_manager->newSFX(m_kart_properties->getEngineSfxType()); + m_beep_sound = sfx_manager->newSFX( SFXManager::SOUND_BEEP ); + m_crash_sound = sfx_manager->newSFX( SFXManager::SOUND_CRASH ); + m_skid_sound = sfx_manager->newSFX( SFXManager::SOUND_SKID ); if(!m_engine_sound) { diff --git a/src/karts/kart_properties.cpp b/src/karts/kart_properties.cpp index 423c31ea2..7701d1ca6 100644 --- a/src/karts/kart_properties.cpp +++ b/src/karts/kart_properties.cpp @@ -70,7 +70,8 @@ KartProperties::KartProperties() : m_icon_material(0) m_camera_max_accel = m_camera_max_brake = m_camera_distance = UNDEFINED; m_gravity_center_shift = Vec3(UNDEFINED); - m_color.setValue(1.0f, 0.0f, 0.0f); + m_color.setValue(1.0f, 0.0f, 0.0f); + m_engine_sfx_type = SFXManager::SOUND_ENGINE_SMALL; } // KartProperties //----------------------------------------------------------------------------- @@ -183,7 +184,18 @@ void KartProperties::getAllData(const lisp::Lisp* lisp) lisp->get("engine-power", m_engine_power); lisp->get("time-full-steer", m_time_full_steer); lisp->get("brake-factor", m_brake_factor); - lisp->get("mass", m_mass); + lisp->get("mass", m_mass); + + std::string sfx_type_string; + lisp->get("engine-sound", sfx_type_string); + if(sfx_type_string == "large") + { + m_engine_sfx_type = SFXManager::SOUND_ENGINE_LARGE; + } + else if(sfx_type_string == "small") + { + m_engine_sfx_type = SFXManager::SOUND_ENGINE_SMALL; + } std::vector v; if(lisp->getVector("max-speed-radius", v)) diff --git a/src/karts/kart_properties.hpp b/src/karts/kart_properties.hpp index 1cd022834..450899908 100644 --- a/src/karts/kart_properties.hpp +++ b/src/karts/kart_properties.hpp @@ -26,6 +26,7 @@ #include "vec3.hpp" #include "karts/kart_model.hpp" #include "lisp/lisp.hpp" +#include "audio/sfx_manager.hpp" class Material; class ssgEntity; @@ -98,6 +99,8 @@ protected: *m_wheel_transform[4]; /**< The transform for the wheels, used * to rotate the wheels and display * the suspension in the race. */ + SFXManager::SFXType m_engine_sfx_type; + // bullet physics data // ------------------- float m_suspension_stiffness; @@ -166,6 +169,8 @@ public: float getWheelieRestoreRate () const {return m_wheelie_restore_rate; } float getWheelieSpeedBoost () const {return m_wheelie_speed_boost; } float getWheeliePowerBoost () const {return m_wheelie_power_boost; } + SFXManager::SFXType getEngineSfxType() + const {return m_engine_sfx_type; } //bullet physics get functions float getSuspensionStiffness () const {return m_suspension_stiffness; }