From a4194cace3efb8d3791d28fb09610ccf488a9346 Mon Sep 17 00:00:00 2001 From: Patrick McIlroy Date: Tue, 13 May 2008 22:34:11 +0000 Subject: [PATCH] git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg@312 83fadc84-e282-4d84-a09a-c4228d6ae7e5 --- src/ScreenSelectMusic.cpp | 38 ++++++++------------------------------ src/ScreenSelectMusic.h | 3 +-- src/Song.cpp | 2 +- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 40ada830..eeb68c31 100755 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -97,6 +97,8 @@ ScreenSelectMusic::ScreenSelectMusic( CString sClassName ) : ScreenWithMenuEleme /* Finish any previous stage. It's OK to call this when we havn't played a stage yet. * Do this before anything that might look at GAMESTATE->m_iCurrentStageIndex. */ GAMESTATE->FinishStage(); + + m_iSavedRoundIndex = GAMESTATE->m_iCurrentStageIndex; } @@ -104,8 +106,6 @@ void ScreenSelectMusic::Init() { m_bSelectIsDown = false; // used by LoadHelpText which is called by ScreenWithMenuElements::Init() - m_bLastSongWasLong = m_bLastSongWasMarathon = false; - ScreenWithMenuElements::Init(); m_DisplayMode = GAMESTATE->IsCourseMode() ? DISPLAY_COURSES : DISPLAY_SONGS; @@ -763,7 +763,8 @@ void ScreenSelectMusic::Update( float fDeltaTime ) m_bgOptionsOut.Update( fDeltaTime ); m_bgNoOptionsOut.Update( fDeltaTime ); m_sprOptionsMessage.Update( fDeltaTime ); - //SCREENMAN->SystemMessageNoAnimate( ssprintf("g_bGoToOptions: %s", g_bGoToOptions ? "true" : "false") ); + SCREENMAN->SystemMessageNoAnimate( ssprintf("currentIndex: %d, songsPerPlay: %d\nfinal: %s", GAMESTATE->m_iCurrentStageIndex, + PREFSMAN->m_iSongsPerPlay.Get(), GAMESTATE->IsFinalStage() ? "true" : "false" ) ); CheckBackgroundRequests(); } @@ -1853,12 +1854,6 @@ void ScreenSelectMusic::AfterMusicChange() m_sprLongBalloon->StopTweening(); COMMAND( m_sprLongBalloon, "Hide" ); - // OpenITG: comment out if necessary as ITG never really - // accounts for marathon songs in the theme. - GAMESTATE->m_iCurrentStageIndex += 2; - m_bLastSongWasLong = false; - m_bLastSongWasMarathon = true; - UpdateStage(); } else if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fLongVerSongSeconds ) { @@ -1868,15 +1863,6 @@ void ScreenSelectMusic::AfterMusicChange() m_sprMarathonBalloon->StopTweening(); COMMAND( m_sprMarathonBalloon, "Hide" ); - - /* OpenITG: candidate system for keeping proper track of rounds: - * If the song is long/marathon, the right flag is set and and is unset if the - * player chooses another song of normal length. Any songs that are unplayable - * because of length do not show up on the song wheel anyway. --infamouspat */ - GAMESTATE->m_iCurrentStageIndex++; - m_bLastSongWasLong = true; - m_bLastSongWasMarathon = false; - UpdateStage(); } else { @@ -1885,20 +1871,12 @@ void ScreenSelectMusic::AfterMusicChange() m_sprMarathonBalloon->StopTweening(); COMMAND( m_sprMarathonBalloon, "Hide" ); - - if ( m_bLastSongWasMarathon ) - { - GAMESTATE->m_iCurrentStageIndex -= 2; - m_bLastSongWasMarathon = false; - } - if ( m_bLastSongWasLong ) - { - GAMESTATE->m_iCurrentStageIndex--; - m_bLastSongWasLong = false; - } - UpdateStage(); } + if ( !GAMESTATE->IsFinalStage() ) + GAMESTATE->m_iCurrentStageIndex = m_iSavedRoundIndex; + UpdateStage(); + COMMAND( m_sprCourseHasMods, "Hide" ); m_Artists.push_back( pSong->GetDisplayArtist() ); diff --git a/src/ScreenSelectMusic.h b/src/ScreenSelectMusic.h index 507e7b9d..83a79577 100755 --- a/src/ScreenSelectMusic.h +++ b/src/ScreenSelectMusic.h @@ -144,8 +144,7 @@ protected: bool m_bAllowOptionsMenu, m_bAllowOptionsMenuRepeat; bool m_bSelectIsDown; - bool m_bLastSongWasMarathon; - bool m_bLastSongWasLong; + int m_iSavedRoundIndex; Transition m_bgOptionsOut; Transition m_bgNoOptionsOut; diff --git a/src/Song.cpp b/src/Song.cpp index b703e37b..8f57328f 100755 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -42,7 +42,7 @@ #define CACHE_DIR "Cache/" -#ifdef ITG_ARCADE && !WIN32 +#if defined(ITG_ARCADE) && !defined(WIN32) #define CUSTOM_SONG_PATH CString("/rootfs/tmp/") #else #define CUSTOM_SONG_PATH CString("Data/temp/") -- 2.11.0