diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index a76def6c59..af26551407 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -809,6 +809,17 @@ void SortCoursePointerArrayByDifficulty( vector &apCourses ) sort( apCourses.begin(), apCourses.end(), CompareCoursePointersByDifficulty ); } +static bool CompareCoursePointersByType(const Course* pCourse1, const Course* pCourse2) +{ + return pCourse1->GetPlayMode() < pCourse2->GetPlayMode(); +} + + +void SortCoursePointerArrayByType( vector &apCourses ) +{ + stable_sort( apCourses.begin(), apCourses.end(), CompareCoursePointersByType ); +} + bool Course::HasBanner() const { return m_sBannerPath != "" && IsAFile(m_sBannerPath); diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 77e02f1dd5..86aeec5500 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -116,6 +116,6 @@ private: void SortCoursePointerArrayByDifficulty( vector &apCourses ); - +void SortCoursePointerArrayByType( vector &apCourses ); #endif