A few audio adjustments for intro cutscene, and now play the scene when playing on the story mode button (sorry story mode will be unavailable for a little while, but you can comment out the sdebugging code that launches the intro)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11306 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -42,6 +42,7 @@ CutsceneWorld::CutsceneWorld() : World()
|
||||
{
|
||||
WorldStatus::setClockMode(CLOCK_NONE);
|
||||
m_use_highscores = false;
|
||||
m_play_racestart_sounds = false;
|
||||
} // CutsceneWorld
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -46,6 +46,8 @@ WorldStatus::WorldStatus()
|
||||
|
||||
music_manager->stopMusic();
|
||||
|
||||
m_play_racestart_sounds = true;
|
||||
|
||||
IrrlichtDevice *device = irr_driver->getDevice();
|
||||
if (device->getTimer()->isStopped()) device->getTimer()->start();
|
||||
} // WorldStatus
|
||||
@@ -135,8 +137,10 @@ void WorldStatus::update(const float dt)
|
||||
case SETUP_PHASE:
|
||||
m_auxiliary_timer = 0.0f;
|
||||
m_phase = TRACK_INTRO_PHASE;
|
||||
if (UserConfigParams::m_music)
|
||||
if (UserConfigParams::m_music && m_play_racestart_sounds)
|
||||
{
|
||||
m_track_intro_sound->play();
|
||||
}
|
||||
return;
|
||||
case TRACK_INTRO_PHASE:
|
||||
m_auxiliary_timer += dt;
|
||||
@@ -150,7 +154,7 @@ void WorldStatus::update(const float dt)
|
||||
&& m_auxiliary_timer<3.5f)
|
||||
return;
|
||||
m_auxiliary_timer = 0.0f;
|
||||
m_prestart_sound->play();
|
||||
if (m_play_racestart_sounds) m_prestart_sound->play();
|
||||
m_phase = READY_PHASE;
|
||||
for(unsigned int i=0; i<World::getWorld()->getNumKarts(); i++)
|
||||
World::getWorld()->getKart(i)->startEngineSFX();
|
||||
@@ -159,7 +163,7 @@ void WorldStatus::update(const float dt)
|
||||
case READY_PHASE:
|
||||
if(m_auxiliary_timer>1.0)
|
||||
{
|
||||
m_prestart_sound->play();
|
||||
if (m_play_racestart_sounds) m_prestart_sound->play();
|
||||
m_phase=SET_PHASE;
|
||||
}
|
||||
m_auxiliary_timer += dt;
|
||||
@@ -173,7 +177,7 @@ void WorldStatus::update(const float dt)
|
||||
{
|
||||
// set phase is over, go to the next one
|
||||
m_phase=GO_PHASE;
|
||||
m_start_sound->play();
|
||||
if (m_play_racestart_sounds) m_start_sound->play();
|
||||
|
||||
World::getWorld()->getTrack()->startMusic();
|
||||
|
||||
|
||||
@@ -94,6 +94,8 @@ protected:
|
||||
float m_time;
|
||||
ClockType m_clock_mode;
|
||||
|
||||
bool m_play_racestart_sounds;
|
||||
|
||||
private:
|
||||
Phase m_phase;
|
||||
|
||||
|
||||
@@ -188,6 +188,18 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
|
||||
std::string selection =
|
||||
ribbon->getSelectionIDString(PLAYER_ID_GAME_MASTER);
|
||||
|
||||
|
||||
if (selection == "story")
|
||||
{
|
||||
StateManager::get()->enterGameState();
|
||||
race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
|
||||
race_manager->setNumKarts( 0 );
|
||||
race_manager->setNumPlayers(0);
|
||||
race_manager->setNumLocalPlayers(0);
|
||||
race_manager->startSingleRace("introcutscene", 999, false);
|
||||
return;
|
||||
}
|
||||
|
||||
#if DEBUG_MENU_ITEM
|
||||
if (selection == "options")
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@ TrackObject::TrackObject(const XMLNode &xml_node)
|
||||
|
||||
// FIXME: at this time sound emitters are just disabled in multiplayer
|
||||
// otherwise the sounds would be constantly heard
|
||||
if (sound.size() > 0 && race_manager->getNumLocalPlayers() == 1)
|
||||
if (sound.size() > 0 && race_manager->getNumLocalPlayers() < 2)
|
||||
{
|
||||
float rolloff = 0.5;
|
||||
xml_node.get("rolloff", &rolloff );
|
||||
|
||||
Reference in New Issue
Block a user