From 47b17ca8415a681ebfcb666f7f0913f62d2e738e Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sun, 1 Apr 2007 09:26:53 +0000 Subject: [PATCH] Fix Roulette and Random. Both of these were picking a song immediately but making the wheel spinning noises. Random looks like it was written with two behaviors in mind. The first is that it acts like Roulette except that where you are in the wheel has no correlation with the song picked and it stops spinning immediately. The second (which seems to have been added later), is to pick a song directly, a la Portal but without giving away any information about it. I went with the former since it was easier (less to clean up). Roulette feels horribly wrong to me but at least the basic mechanics are there again. I think the Select() logic is wonky. --- stepmania/src/MusicWheel.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 69b3e121e6..ae8c2bf7bf 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -803,17 +803,18 @@ void MusicWheel::UpdateSwitch() } else { - m_iSwitchesLeftInSpinDown--; + --m_iSwitchesLeftInSpinDown; const float SwitchTimes[] = { 0.5f, 1.3f, 0.8f, 0.4f, 0.2f }; - ASSERT(m_iSwitchesLeftInSpinDown >= 0 && m_iSwitchesLeftInSpinDown <= 4); + ASSERT( m_iSwitchesLeftInSpinDown >= 0 && m_iSwitchesLeftInSpinDown <= 4 ); m_fTimeLeftInState = SwitchTimes[m_iSwitchesLeftInSpinDown]; + m_Moving = 0; LOG->Trace( "m_iSwitchesLeftInSpinDown id %d, m_fTimeLeftInState is %f", m_iSwitchesLeftInSpinDown, m_fTimeLeftInState ); - if( m_iSwitchesLeftInSpinDown < 2 ) - ChangeMusic(randomf(0,1) >= 0.5f? 1:-1); + if( m_iSwitchesLeftInSpinDown == 0 ) + ChangeMusic( randomf(0,1) >= 0.5f? 1:-1 ); else - ChangeMusic(1); + ChangeMusic( 1 ); } break; default: @@ -918,8 +919,10 @@ bool MusicWheel::Select() // return true if this selection ends the screen m_WheelState = STATE_LOCKED; SCREENMAN->PlayStartSound(); m_fLockedWheelVelocity = 0; + // Set m_Moving to zero to stop the sounds from playing. + m_Moving = 0; SCREENMAN->PostMessageToTopScreen( SM_SongChanged, 0 ); - return false; + return true; } if( !WheelBase::Select() ) @@ -929,10 +932,10 @@ bool MusicWheel::Select() // return true if this selection ends the screen { case TYPE_ROULETTE: StartRoulette(); - break; + return false; case TYPE_RANDOM: StartRandom(); - break; + return false; case TYPE_SONG: case TYPE_COURSE: case TYPE_PORTAL: @@ -959,6 +962,7 @@ void MusicWheel::StartRoulette() m_SpinSpeed = 1.0f/ROULETTE_SWITCH_SECONDS; GAMESTATE->m_SortOrder.Set( SORT_ROULETTE ); SetOpenGroup( "" ); + RebuildWheelItems(); } void MusicWheel::StartRandom() @@ -987,7 +991,6 @@ void MusicWheel::StartRandom() SelectSong( GetPreferredSelectionForRandomOrPortal() ); - this->Select(); RebuildWheelItems(); }