Major audio cleanup : remove sound effects names. Now their filename is their identifier. This simplifies things a lot

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8424 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2011-04-23 00:22:16 +00:00
parent 9dcb8b7753
commit 8b725a88c2
13 changed files with 23 additions and 21 deletions

View File

@@ -219,13 +219,15 @@ void SFXManager::loadSingleSfx(const XMLNode* node,
return;
}
std::string sfx_name;
std::string sfx_name = StringUtils::removeExtension(filename);
/*
if (node->get("name", &sfx_name) == 0)
{
fprintf(stderr,
"/!\\ The 'name' attribute is mandatory in the SFX XML file!\n");
return;
}
*/
if(m_all_sfx_types.find(sfx_name)!=m_all_sfx_types.end())
{
fprintf(stderr,

View File

@@ -42,7 +42,7 @@ public:
static void init(const XMLNode &node, scene::IMesh *bowling);
virtual void update(float dt);
const char* getExplosionSound() const { return "bowling_strike"; }
const char* getExplosionSound() const { return "strike"; }
}; // Bowling

View File

@@ -150,11 +150,11 @@ void Powerup::set(PowerupManager::PowerupType type, int n)
break ;
case PowerupManager::POWERUP_ANVIL:
m_sound_use = sfx_manager->createSoundSource("use_anvil");
m_sound_use = sfx_manager->createSoundSource("anvil");
break;
case PowerupManager::POWERUP_PARACHUTE:
m_sound_use = sfx_manager->createSoundSource("use_parachute");
m_sound_use = sfx_manager->createSoundSource("parachute");
break;
case PowerupManager::POWERUP_BUBBLEGUM:
@@ -169,7 +169,7 @@ void Powerup::set(PowerupManager::PowerupType type, int n)
case PowerupManager::POWERUP_CAKE:
case PowerupManager::POWERUP_PLUNGER:
default :
m_sound_use = sfx_manager->createSoundSource("shot");
m_sound_use = sfx_manager->createSoundSource("shoot");
break ;
}
@@ -201,7 +201,7 @@ void Powerup::use()
{
//if (m_type == POWERUP_SWITCH) m_sound_use = sfx_manager->newSFX(SFXManager::SOUND_SWAP);
//else
m_sound_use = sfx_manager->createSoundSource("shot");
m_sound_use = sfx_manager->createSoundSource("shoot");
}
m_number--;

View File

@@ -54,8 +54,8 @@ PlayerController::PlayerController(Kart *kart, StateManager::ActivePlayer *playe
m_bzzt_sound = sfx_manager->createSoundSource( "bzzt" );
m_wee_sound = sfx_manager->createSoundSource( "wee" );
m_ugh_sound = sfx_manager->createSoundSource( "ugh" );
m_grab_sound = sfx_manager->createSoundSource( "grab" );
m_full_sound = sfx_manager->createSoundSource( "full" );
m_grab_sound = sfx_manager->createSoundSource( "grab_collectable" );
m_full_sound = sfx_manager->createSoundSource( "energy_bar_full" );
reset();
} // PlayerController

View File

@@ -132,7 +132,7 @@ Kart::Kart (const std::string& ident, Track* track, int position, bool is_first_
}*/
m_engine_sound = sfx_manager->createSoundSource(m_kart_properties->getEngineSfxType());
m_beep_sound = sfx_manager->createSoundSource( "beep" );
m_beep_sound = sfx_manager->createSoundSource( "horn" );
m_crash_sound = sfx_manager->createSoundSource( "crash" );
m_goo_sound = sfx_manager->createSoundSource( "goo" );
m_skid_sound = sfx_manager->createSoundSource( "skid" );

View File

@@ -27,7 +27,7 @@
#include "karts/kart.hpp"
#include "utils/constants.hpp"
#define SKELETON_DEBUG 1
#define SKELETON_DEBUG 0
float KartModel::UNDEFINED = -99.9f;

View File

@@ -37,7 +37,7 @@
LinearWorld::LinearWorld() : WorldWithRank()
{
m_kart_display_info = NULL;
m_last_lap_sfx = sfx_manager->createSoundSource("lastlap");
m_last_lap_sfx = sfx_manager->createSoundSource("last_lap_fanfare");
m_last_lap_sfx_played = false;
m_last_lap_sfx_playing = false;
} // LinearWorld

View File

@@ -36,8 +36,8 @@ WorldStatus::WorldStatus()
m_phase = SETUP_PHASE;
m_previous_phase = UNDEFINED_PHASE; // initialise it just in case
m_prestart_sound = sfx_manager->createSoundSource("prestart");
m_start_sound = sfx_manager->createSoundSource("start");
m_prestart_sound = sfx_manager->createSoundSource("pre_start_race");
m_start_sound = sfx_manager->createSoundSource("start_race");
m_track_intro_sound = sfx_manager->createSoundSource("track_intro");
music_manager->stopMusic();

View File

@@ -115,7 +115,7 @@ void EnterPlayerNameDialog::onEnterPressedInternal()
{
LabelWidget* label = getWidget<LabelWidget>("title");
label->setText(_("Cannot add a player with this name."), false);
sfx_manager->quickSound( "use_anvil" );
sfx_manager->quickSound( "anvil" );
return;
}
@@ -130,7 +130,7 @@ void EnterPlayerNameDialog::onEnterPressedInternal()
{
LabelWidget* label = getWidget<LabelWidget>("title");
label->setText(_("Cannot add a player with this name."), false);
sfx_manager->quickSound( "use_anvil" );
sfx_manager->quickSound( "anvil" );
}
}

View File

@@ -202,7 +202,7 @@ GUIEngine::EventPropagation GPInfoDialog::processEvent(const std::string& eventS
}
else if (eventSource == "cannot_start")
{
sfx_manager->quickSound( "use_anvil" );
sfx_manager->quickSound( "anvil" );
}
return GUIEngine::EVENT_LET;

View File

@@ -222,7 +222,7 @@ void GrandPrixWin::init()
m_light->getLightData().AmbientColor = irr::video::SColorf(0.25f, 0.25f, 0.25f, 1.0f);
m_light->getLightData().SpecularColor = irr::video::SColorf(0.0f, 0.0f, 0.0f, 1.0f);
sfx_manager->quickSound("winner");
sfx_manager->quickSound("gp_end");
} // init
// -------------------------------------------------------------------------------------

View File

@@ -1045,7 +1045,7 @@ bool KartSelectionScreen::playerJoin(InputDevice* device, bool firstPlayer)
if (StateManager::get()->activePlayerCount() >= MAX_PLAYER_COUNT)
{
std::cerr << "[KartSelectionScreen] Maximum number of players reached\n";
sfx_manager->quickSound( "use_anvil" );
sfx_manager->quickSound( "anvil" );
return false;
}
@@ -1173,7 +1173,7 @@ bool KartSelectionScreen::playerQuit(StateManager::ActivePlayer* player)
// Check that this player has not already confirmed, then they can't back out
if (m_kart_widgets[n].isReady())
{
sfx_manager->quickSound( "use_anvil" );
sfx_manager->quickSound( "anvil" );
return true;
}
@@ -1325,7 +1325,7 @@ void KartSelectionScreen::playerConfirm(const int playerID)
if (UserConfigParams::m_verbosity>=5)
printf("[KartSelectionScreen] You can't select this identity or kart, someone already took it!!\n");
sfx_manager->quickSound( "use_anvil" );
sfx_manager->quickSound( "anvil" );
return;
}

View File

@@ -164,7 +164,7 @@ void OptionsScreenAudio::eventCallback(Widget* widget, const std::string& name,
if (UserConfigParams::m_sfx)
{
sfx_manager->quickSound("beep");
sfx_manager->quickSound("horn");
}
}
} // eventCallback