From a02626a90f3c071b9288b5112e2aaf339817bd5e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 8 Sep 2005 19:59:07 +0000 Subject: [PATCH] implement IsStagePossible --- stepmania/src/GameState.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index f0a4e2a8f3..5dfbb84310 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -720,8 +720,27 @@ Stage GameState::GetCurrentStage() const bool GameState::IsStagePossible( Stage s ) const { - // Optimize me so that we don't load graphics that can't possibly be shown - return true; + /* HACK: Find out what the stage would be without long or marathon. + * This should never change during a screen. */ + Song *pSong = GAMESTATE->m_pCurSong; + GAMESTATE->m_pCurSong.SetWithoutBroadcast( NULL ); + Stage actual = GetCurrentStage(); + GAMESTATE->m_pCurSong.SetWithoutBroadcast( pSong ); + + /* Check long/marathon, which can change the stage to FINAL. */ + if( s == STAGE_FINAL && actual >= STAGE_1 && actual <= STAGE_FINAL ) + { + Stage max_actual = actual; + if( PREFSMAN->m_fMarathonVerSongSeconds < 9999 ) + enum_add( max_actual, +2 ); + else if( PREFSMAN->m_fLongVerSongSeconds < 9999 ) + enum_add( max_actual, +1 ); + + if( max_actual >= STAGE_FINAL ) + return true; + } + + return s == actual; } int GameState::GetCourseSongIndex() const