From 9dd973553208723ab2287170e64407e8c411f44b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 20 May 2004 23:14:36 +0000 Subject: [PATCH] cleanup, simplify Separate Easy courses aren't needed anymore; just select easy course mode. (Having three times as many autogen courses was way too many, especially considering most beginners don't want to play courses anyway.) --- stepmania/src/Course.cpp | 53 +++++++++++------------------------ stepmania/src/Course.h | 5 ++-- stepmania/src/SongManager.cpp | 41 +++++---------------------- 3 files changed, 25 insertions(+), 74 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index eb51fb81c0..f9aa716c73 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -429,7 +429,7 @@ void Course::Save() } -void Course::AutogenEndlessFromGroup( CString sGroupName, vector &apSongsInGroup, Difficulty diff ) +void Course::AutogenEndlessFromGroup( CString sGroupName, Difficulty diff ) { m_bIsAutogen = true; m_bRepeat = true; @@ -437,15 +437,24 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, vector &apSongs m_iLives = -1; m_iMeter[0] = m_iMeter[1] = -1; - m_sName = SONGMAN->ShortenGroupName( sGroupName ) + GetAutogenDifficultySuffix( diff ); - - m_sBannerPath = SONGMAN->GetGroupBannerPath( sGroupName ); + if( sGroupName == "" ) + { + m_sName = "All Songs"; + // m_sBannerPath = ""; // XXX + } else { + m_sName = SONGMAN->ShortenGroupName( sGroupName ) + GetAutogenDifficultySuffix( diff ); + m_sBannerPath = SONGMAN->GetGroupBannerPath( sGroupName ); + } // We want multiple songs, so we can try to prevent repeats during // gameplay. (We might still get a repeat at the repeat boundary, // but that'd be rare.) -glenn CourseEntry e; - e.type = COURSE_ENTRY_RANDOM_WITHIN_GROUP; + if( sGroupName != "" ) + e.type = COURSE_ENTRY_RANDOM_WITHIN_GROUP; + else + e.type = COURSE_ENTRY_RANDOM; + e.group_name = sGroupName; e.difficulty = diff; e.mystery = true; @@ -456,39 +465,9 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, vector &apSongs m_entries.push_back( e ); } -void Course::AutogenEndlessFromVector( CString sCourseName, vector &apSongsInCourse, Difficulty diff ) +void Course::AutogenNonstopFromGroup( CString sGroupName, Difficulty diff ) { - m_bIsAutogen = true; - m_bRepeat = true; - m_bRandomize = true; - m_iLives = -1; - m_iMeter[0] = m_iMeter[1] = -1; - - m_sName = SONGMAN->ShortenGroupName( sCourseName ) + GetAutogenDifficultySuffix( diff ); - //m_sBannerPath = SONGMAN->GetGroupBannerPath( sBannerName ); - - CourseEntry e; - e.type = COURSE_ENTRY_FIXED; - e.group_name = sCourseName; - e.difficulty = diff; - e.mystery = true; - - for ( unsigned i = 0; i < apSongsInCourse.size(); ++i ) - { - e.pSong = apSongsInCourse[i]; - m_entries.push_back( e ); - } - - //This means that the course will be the same each time until re-init - //Currently, this is only used for the All Songs endless course, so it's - //a non-issue - //Also, it appears to be what COURSE_ENTRY_RANDOM does anyways - random_shuffle(m_entries.begin(),m_entries.end()); -} - -void Course::AutogenNonstopFromGroup( CString sGroupName, vector &apSongsInGroup, Difficulty diff ) -{ - AutogenEndlessFromGroup( sGroupName, apSongsInGroup, diff ); + AutogenEndlessFromGroup( sGroupName, diff ); m_bRepeat = false; diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 5113aac849..c83173299c 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -139,9 +139,8 @@ public: void LoadFromCRSFile( CString sPath ); void Unload(); void Save(); - void AutogenEndlessFromGroup( CString sGroupName, vector &apSongsInGroup, Difficulty diff ); - void AutogenEndlessFromVector( CString sCourseName, vector &apSongsInCourse, Difficulty diff ); - void AutogenNonstopFromGroup( CString sGroupName, vector &apSongsInGroup, Difficulty diff ); + void AutogenEndlessFromGroup( CString sGroupName, Difficulty diff ); + void AutogenNonstopFromGroup( CString sGroupName, Difficulty diff ); RadarValues GetRadarValues( StepsType st, CourseDifficulty cd ) const; diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 1913bf2f6c..d699bc6c35 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -566,55 +566,28 @@ void SongManager::InitAutogenCourses() // CStringArray saGroupNames; this->GetGroupNames( saGroupNames ); - unsigned g; - for( g=0; g apGroupSongs; GetSongs( apGroupSongs, sGroupName ); - Course* pCourse; - //Generate random courses from each group for each of the main three difficulty levels + // Generate random courses from each group. pCourse = new Course; - pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_EASY ); + pCourse->AutogenEndlessFromGroup( sGroupName, DIFFICULTY_MEDIUM ); m_pCourses.push_back( pCourse ); pCourse = new Course; - pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_MEDIUM ); - m_pCourses.push_back( pCourse ); - - pCourse = new Course; - pCourse->AutogenEndlessFromGroup( sGroupName, apGroupSongs, DIFFICULTY_HARD ); - m_pCourses.push_back( pCourse ); - - pCourse = new Course; - pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_EASY ); - m_pCourses.push_back( pCourse ); - - pCourse = new Course; - pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_MEDIUM ); - m_pCourses.push_back( pCourse ); - - pCourse = new Course; - pCourse->AutogenNonstopFromGroup( sGroupName, apGroupSongs, DIFFICULTY_HARD ); + pCourse->AutogenNonstopFromGroup( sGroupName, DIFFICULTY_MEDIUM ); m_pCourses.push_back( pCourse ); } vector apCourseSongs = GetAllSongs(); - Course* pCourse; - - //Generate "All Songs" endless course + // Generate "All Songs" endless course. pCourse = new Course; - pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_EASY ); - m_pCourses.push_back( pCourse ); - - pCourse = new Course; - pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_MEDIUM ); - m_pCourses.push_back( pCourse ); - - pCourse = new Course; - pCourse->AutogenEndlessFromVector( "All Groups", apCourseSongs, DIFFICULTY_HARD ); + pCourse->AutogenEndlessFromGroup( "", DIFFICULTY_MEDIUM ); m_pCourses.push_back( pCourse ); }