From d885d6487e73eb79ecf29a4e83dbd8859ee44ba7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 30 Jun 2003 06:51:05 +0000 Subject: [PATCH] Fix difficulty display being shown when not on a song Optimization. --- stepmania/src/ScreenSelectMusic.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index b8fd8486c3..4750cf7621 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -48,6 +48,7 @@ const int NUM_SCORE_DIGITS = 9; #define CDTITLE_SPIN_SECONDS THEME->GetMetricF("ScreenSelectMusic","CDTitleSpinSeconds") static const ScreenMessage SM_AllowOptionsMenuRepeat = ScreenMessage(SM_User+1); +CString g_sFallbackCDTitlePath; /* We make a backface for the CDTitle by rotating it on Y and mirroring it * on Y by flipping texture coordinates. */ @@ -66,6 +67,8 @@ ScreenSelectMusic::ScreenSelectMusic() : Screen("ScreenSelectMusic") { LOG->Trace( "ScreenSelectMusic::ScreenSelectMusic()" ); + /* Cache: */ + g_sFallbackCDTitlePath = THEME->GetPathToG("ScreenSelectMusic fallback cdtitle"); if( GAMESTATE->m_CurStyle == STYLE_INVALID ) RageException::Throw( "The Style has not been set. A theme must set the Style before loading ScreenSelectMusic." ); @@ -800,8 +803,6 @@ void ScreenSelectMusic::AfterMusicChange() if( pSong ) GAMESTATE->m_pCurSong = pSong; - m_sprStage.Load( THEME->GetPathToG("ScreenSelectMusic stage "+GAMESTATE->GetStageText()) ); - m_GrooveGraph.SetFromSong( pSong ); int pn; @@ -823,6 +824,7 @@ void ScreenSelectMusic::AfterMusicChange() m_BPMDisplay.NoBPM(); m_sprCDTitleFront.UnloadTexture(); m_sprCDTitleBack.UnloadTexture(); + m_DifficultyDisplay.UnsetDifficulties(); switch( m_MusicWheel.GetSelectedType() ) { @@ -866,7 +868,7 @@ void ScreenSelectMusic::AfterMusicChange() m_BPMDisplay.SetBPM( pSong ); } - const CString CDTitlePath = pSong->HasCDTitle()? pSong->GetCDTitlePath():THEME->GetPathToG("ScreenSelectMusic fallback cdtitle"); + const CString CDTitlePath = pSong->HasCDTitle()? pSong->GetCDTitlePath():g_sFallbackCDTitlePath; m_sprCDTitleFront.Load( CDTitlePath ); m_sprCDTitleBack.Load( CDTitlePath ); FlipSpriteHorizontally(m_sprCDTitleBack); @@ -911,6 +913,7 @@ void ScreenSelectMusic::AfterMusicChange() m_BPMDisplay.NoBPM(); m_sprCDTitleFront.UnloadTexture(); m_sprCDTitleBack.UnloadTexture(); + m_DifficultyDisplay.UnsetDifficulties(); SOUNDMAN->StopMusic(); m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY;