diff --git a/stepmania/Themes/default/Sounds/ScreenSelectMusic random music.redir b/stepmania/Themes/default/Sounds/ScreenSelectMusic random music.redir new file mode 100644 index 0000000000..2df592f32c --- /dev/null +++ b/stepmania/Themes/default/Sounds/ScreenSelectMusic random music.redir @@ -0,0 +1 @@ +_common menu music.ogg \ No newline at end of file diff --git a/stepmania/Themes/default/Sounds/ScreenSelectMusic roulette music.redir b/stepmania/Themes/default/Sounds/ScreenSelectMusic roulette music.redir new file mode 100644 index 0000000000..2df592f32c --- /dev/null +++ b/stepmania/Themes/default/Sounds/ScreenSelectMusic roulette music.redir @@ -0,0 +1 @@ +_common menu music.ogg \ No newline at end of file diff --git a/stepmania/src/BPMDisplay.cpp b/stepmania/src/BPMDisplay.cpp index 6df694f3a6..444e7e5d37 100644 --- a/stepmania/src/BPMDisplay.cpp +++ b/stepmania/src/BPMDisplay.cpp @@ -56,7 +56,7 @@ void BPMDisplay::Update( float fDeltaTime ) if( m_fTimeLeftInState < 0 ) { // XXX: the numbers font doesn't have "?". - m_textBPM.SetText( (RandomFloat(0,1)>0.90) ? "???" : ssprintf("%03.0f",RandomFloat(0,600)) ); + m_textBPM.SetText( (RandomFloat(0,1)>0.90) ? "%%%" : ssprintf("%03.0f",RandomFloat(0,600)) ); m_fTimeLeftInState = 0.2f; // reset timer } } diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index f7a87aa657..a345d8dcc2 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -761,6 +761,10 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn ) { TweenOffScreen(); + for( int p=0; pm_bEventMode ) { switch( GAMESTATE->m_PlayMode ) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 0a48932363..4a12873692 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -351,7 +351,17 @@ void ScreenSelectMusic::Update( float fDeltaTime ) /* Make sure we don't start the sample when rouletting is * spinning down. */ if( m_fPlaySampleCountdown <= 0 && !m_MusicWheel.IsRouletting() ) - this->PlayMusicSample(); + { + if( !m_sSampleMusicToPlay.empty() ) + { + SOUNDMAN->PlayMusic( + m_sSampleMusicToPlay, + true, + m_fSampleStartSeconds, + m_fSampleLengthSeconds, + 1.5f); /* fade out for 1.5 seconds */ + } + } } float fNewRotation = m_sprCDTitle.GetRotationY()+PI*fDeltaTime/2; @@ -809,8 +819,12 @@ void ScreenSelectMusic::AfterMusicChange() { SOUNDMAN->StopMusic(); m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY; + m_sSampleMusicToPlay = pSong->GetMusicPath(); + m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds; + m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds; - for( int pn = 0; pn < NUM_PLAYERS; ++pn) { + for( int pn = 0; pn < NUM_PLAYERS; ++pn) + { pSong->GetNotes( m_arrayNotes[pn], GAMESTATE->GetCurrentStyleDef()->m_NotesType ); SortNotesArrayByDifficulty( m_arrayNotes[pn] ); } @@ -866,12 +880,25 @@ void ScreenSelectMusic::AfterMusicChange() m_Banner.LoadRoulette(); m_BPMDisplay.SetBPMRange( 0, 0 ); m_sprCDTitle.UnloadTexture(); + + SOUNDMAN->StopMusic(); + m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY; + m_sSampleMusicToPlay = THEME->GetPathTo("Sounds","ScreenSelectMusic roulette music"); + m_fSampleStartSeconds = -1; + m_fSampleLengthSeconds = -1; + break; case TYPE_RANDOM: if(!no_banner_change) m_Banner.LoadRandom(); m_BPMDisplay.SetBPMRange( 0, 0 ); m_sprCDTitle.UnloadTexture(); + + SOUNDMAN->StopMusic(); + m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY; + m_sSampleMusicToPlay = THEME->GetPathTo("Sounds","ScreenSelectMusic random music"); + m_fSampleStartSeconds = -1; + m_fSampleLengthSeconds = -1; break; default: ASSERT(0); @@ -887,21 +914,6 @@ void ScreenSelectMusic::AfterMusicChange() m_fPlaySampleCountdown = 0; } -void ScreenSelectMusic::PlayMusicSample() -{ - //LOG->Trace( "ScreenSelectSong::PlayMusicSample()" ); - - Song* pSong = m_MusicWheel.GetSelectedSong(); - if( pSong && pSong->HasMusic() ) - { - SOUNDMAN->PlayMusic(pSong->GetMusicPath(), true, - pSong->m_fMusicSampleStartSeconds, - pSong->m_fMusicSampleLengthSeconds, - 1.5f); /* fade out for 1.5 seconds */ - } -// else -// SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenSelectMusic music") ); -} void ScreenSelectMusic::UpdateOptionsDisplays() { diff --git a/stepmania/src/ScreenSelectMusic.h b/stepmania/src/ScreenSelectMusic.h index e1464981f6..2360726b7c 100644 --- a/stepmania/src/ScreenSelectMusic.h +++ b/stepmania/src/ScreenSelectMusic.h @@ -49,7 +49,6 @@ protected: void AfterNotesChange( PlayerNumber pn ); void AfterMusicChange(); - void PlayMusicSample(); void SortOrderChanged(); void UpdateOptionsDisplays(); @@ -84,6 +83,8 @@ protected: bool m_bGoToOptions; Sprite m_sprOptionsMessage; float m_fPlaySampleCountdown; + CString m_sSampleMusicToPlay; + float m_fSampleStartSeconds, m_fSampleLengthSeconds; bool m_bAllowOptionsMenu, m_bAllowOptionsMenuRepeat; RageSound m_soundSelect;