diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index fcd983cc8d..b3b3ed3f10 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -22,6 +22,8 @@ #include "SongOptions.h" #include "RageUtil.h" #include "TitleSubstitution.h" +#include "Notes.h" +#include "GameState.h" Course::Course() @@ -431,10 +433,26 @@ void Course::GetStageInfo( if( !pSong || !pNotes ) continue; // this song entry isn't playable. Skip. + if(GAMESTATE->m_bDifficultCourses) + { + /* See if we can find a NoteData that's one notch more difficult than + * the one we found above. */ + Difficulty dc = pNotes->GetDifficulty(); + if(dc < DIFFICULTY_CHALLENGE) + { + dc = Difficulty(dc + 1); + Notes* pNewNotes = pSong->GetNotes( nt, dc ); + if(pNewNotes) + pNotes = pNewNotes; + } + } + vSongsOut.push_back( pSong ); vNotesOut.push_back( pNotes ); vsModifiersOut.push_back( e.modifiers ); } + + } bool Course::GetFirstStageInfo( @@ -609,41 +627,6 @@ void Course::AddScores( NotesType nt, bool bPlayerEnabled[NUM_PLAYERS], int iDan } } -bool Course::MakeNormal() -{ - if( !m_bRepeat && m_iLives == -1 ) // nonstop only, not oni or endless - if(m_bDifficult) //only make it easy if it's already difficult - { - unsigned c; - for( c = 0; c < m_entries.size(); c++) - { - if( m_entries[c].difficulty == DIFFICULTY_BEGINNER || m_entries[c].difficulty == DIFFICULTY_INVALID ) // don't suddenly make things invalid or worse - continue; - - m_entries[c].difficulty = Difficulty(m_entries[c].difficulty - 1); - } - m_bDifficult = false; - return true; - } - return false; -} -bool Course::MakeDifficult() -{ - if( !m_bRepeat && m_iLives == -1 ) // nonstop only, not oni or endless - if(!m_bDifficult) //only make it difficult once - { - unsigned c; - for( c = 0; c < m_entries.size(); c++) - { - if( m_entries[c].difficulty < DIFFICULTY_CHALLENGE ) // don't suddenly make things invalid or worse - m_entries[c].difficulty = Difficulty(m_entries[c].difficulty + 1); - } - m_bDifficult = true; - return true; - } - return false; -} - // // Sorting stuff diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 0a230371e1..61b206d0f5 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -76,8 +76,6 @@ public: void GetMeterRange( int stage, int& iMeterLowOut, int& iMeterHighOut ) const; bool ContainsAnyMysterySongs() const; bool GetTotalSeconds( float& fSecondsOut ) const; - bool MakeDifficult(); - bool MakeNormal(); void LoadFromCRSFile( CString sPath ); diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 1ce56d6ffb..4c9dedcb93 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -844,9 +844,6 @@ void MusicWheel::Update( float fDeltaTime ) void MusicWheel::ChangeMusic(int dist) { - if(GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP) - GetSelectedCourse()->MakeNormal(); - m_iSelection += dist; if( m_iSelection < 0 ) m_iSelection = m_CurWheelItemData.size()-1; @@ -857,9 +854,6 @@ void MusicWheel::ChangeMusic(int dist) m_fPositionOffsetFromSelection += dist; - if(GAMESTATE->m_bDifficultCourses && GAMESTATE->m_PlayMode == PLAY_MODE_NONSTOP) - GetSelectedCourse()->MakeDifficult(); - SCREENMAN->PostMessageToTopScreen( SM_SongChanged, 0 ); /* If we're moving automatically, don't play this; it'll be called in Update. */ diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index 8b76e509a1..f69ce9d0e2 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -253,24 +253,20 @@ void ScreenSelectCourse::Input( const DeviceInput& DeviceI, InputEventType type, return; } - if( CodeDetector::EnteredEasierDifficulty(GameI.controller) ) + if( CodeDetector::EnteredEasierDifficulty(GameI.controller) && + GAMESTATE->m_bDifficultCourses) { - if( m_MusicWheel.GetSelectedCourse()->MakeNormal() ) - { - m_soundChangeNotes.Play(); - GAMESTATE->m_bDifficultCourses = false; - SCREENMAN->PostMessageToTopScreen(SM_SongChanged,0); - } + m_soundChangeNotes.Play(); + GAMESTATE->m_bDifficultCourses = false; + SCREENMAN->PostMessageToTopScreen(SM_SongChanged,0); } - if( CodeDetector::EnteredHarderDifficulty(GameI.controller) ) + if( CodeDetector::EnteredHarderDifficulty(GameI.controller) && + !GAMESTATE->m_bDifficultCourses) { - if( m_MusicWheel.GetSelectedCourse()->MakeDifficult() ) - { - m_soundChangeNotes.Play(); - GAMESTATE->m_bDifficultCourses = true; - SCREENMAN->PostMessageToTopScreen(SM_SongChanged,0); - } + m_soundChangeNotes.Play(); + GAMESTATE->m_bDifficultCourses = true; + SCREENMAN->PostMessageToTopScreen(SM_SongChanged,0); }