From c55e4a15b465179528982485a3c38ac46211d803 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 11 Feb 2003 02:44:26 +0000 Subject: [PATCH] Oops. Fix my broken ScreenEval logic and other things. --- stepmania/src/ScreenAttract.cpp | 4 ++-- stepmania/src/ScreenDemonstration.cpp | 4 ++-- stepmania/src/ScreenEvaluation.cpp | 24 ++++++++++++++++-------- stepmania/src/ScreenJukebox.cpp | 4 ++-- stepmania/src/ScreenNameEntry.cpp | 7 ++++--- stepmania/src/Song.cpp | 9 +++++++-- 6 files changed, 33 insertions(+), 19 deletions(-) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 2ed6250e6e..35f1f78758 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -99,7 +99,7 @@ void ScreenAttract::Input( const DeviceInput& DeviceI, const InputEventType type case MENU_BUTTON_COIN: Screen::MenuCoin( MenuI.player ); // increment coins, play sound SOUNDMAN->StopMusic(); - ::Sleep( 200 ); // do a little pause, like the arcade does + ::Sleep( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; case MENU_BUTTON_START: @@ -115,7 +115,7 @@ void ScreenAttract::Input( const DeviceInput& DeviceI, const InputEventType type case PrefsManager::COIN_HOME: SOUNDMAN->StopMusic(); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") ); - ::Sleep( 200 ); // do a little pause, like the arcade does + ::Sleep( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; default: diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index 8baf4d823b..a43e0a92e6 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -208,7 +208,7 @@ void ScreenDemonstration::Input( const DeviceInput& DeviceI, const InputEventTyp case MENU_BUTTON_COIN: Screen::MenuCoin( MenuI.player ); // increment coins, play sound m_soundMusic.Stop(); - ::Sleep( 200 ); // do a little pause, like the arcade does + ::Sleep( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; case MENU_BUTTON_START: @@ -224,7 +224,7 @@ void ScreenDemonstration::Input( const DeviceInput& DeviceI, const InputEventTyp case PrefsManager::COIN_HOME: m_soundMusic.Stop(); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") ); - ::Sleep( 200 ); // do a little pause, like the arcade does + ::Sleep( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; default: diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index fb14f61c7a..ef82f5209e 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -806,15 +806,18 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn ) } else // not event mode { - if( m_bTryExtraStage ) - m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic ); - else if( m_ResultMode == RM_ARCADE_STAGE ) + switch( m_ResultMode ) { - if( GAMESTATE->IsFinalStage() ) + case RM_ARCADE_STAGE: + if( m_bTryExtraStage ) + { + m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic ); + } + else if( GAMESTATE->IsFinalStage() || GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) { /* Tween the screen out, but leave the MenuElements where they are. - * Play the "swoosh" sound manually (would normally be played by the ME - * tween out). */ + * Play the "swoosh" sound manually (would normally be played by the ME + * tween out). */ SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu swoosh") ); TweenOffScreen(); SCREENMAN->SendMessageToTopScreen( SM_GoToFinalEvaluation, MENU_ELEMENTS_TWEEN_TIME ); @@ -823,9 +826,14 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn ) { m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic ); } - } - else + break; + case RM_ARCADE_SUMMARY: m_Menu.TweenOffScreenToBlack( SM_GoToGameFinished, false ); + break; + case RM_COURSE: + m_Menu.TweenOffScreenToBlack( SM_GoToGameFinished, false ); + break; + } } switch( m_ResultMode ) diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index bd1bc43551..243cbfbc77 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -190,7 +190,7 @@ void ScreenJukebox::Input( const DeviceInput& DeviceI, const InputEventType type case MENU_BUTTON_COIN: Screen::MenuCoin( MenuI.player ); // increment coins, play sound m_soundMusic.Stop(); - ::Sleep( 200 ); // do a little pause, like the arcade does + ::Sleep( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; case MENU_BUTTON_START: @@ -206,7 +206,7 @@ void ScreenJukebox::Input( const DeviceInput& DeviceI, const InputEventType type case PrefsManager::COIN_HOME: m_soundMusic.Stop(); SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","insert coin") ); - ::Sleep( 200 ); // do a little pause, like the arcade does + ::Sleep( 800 ); // do a little pause, like the arcade does SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; default: diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 8f9565f6f7..a2374575a4 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -63,11 +63,12 @@ const char NAME_CHARS[] = #define HEIGHT_OF_ALL_CHARS (NUM_NAME_CHARS * g_fCharsSpacingY) - int GetClosestCharIndex( float fFakeBeat ) { - return ((int)roundf(fFakeBeat)) % NUM_NAME_CHARS; -}; + int iCharIndex = (int)roundf(fFakeBeat) % NUM_NAME_CHARS; + ASSERT( iCharIndex >= 0 ); + return iCharIndex; +} // return value is relative to gray arrows float GetClosestCharYOffset( float fFakeBeat ) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index ea80c13ecd..e75371c938 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -832,10 +832,15 @@ bool Song::IsEasy( NotesType nt ) const Notes* pHardNotes = GetNotes( nt, DIFFICULTY_HARD ); // HACK: Looks bizarre to see the easy mark by Legend of MAX. - if( pHardNotes->GetMeter() <= 9 ) + if( pHardNotes && pHardNotes->GetMeter()<=9 ) return false; - return pBeginnerNotes->GetMeter() == 1 || pEasyNotes->GetMeter() == 1; + if( pBeginnerNotes && pBeginnerNotes->GetMeter()==1 ) + return true; + else if( pEasyNotes && pEasyNotes->GetMeter()==1 ) + return true; + else + return false; } bool Song::HasEdits( NotesType nt ) const