From 439c0f2011b1cd6aeb6cc18846eae94867d749c9 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 21 Feb 2006 01:48:01 +0000 Subject: [PATCH] IsFixed and AllSongsAreFixed were identical. IsFixed -> AllSongsAreFixed. --- stepmania/src/CatalogXml.cpp | 4 ++-- stepmania/src/Course.cpp | 37 +++++-------------------------- stepmania/src/Course.h | 2 -- stepmania/src/CourseLoaderCRS.cpp | 3 ++- stepmania/src/CourseUtil.cpp | 2 +- 5 files changed, 11 insertions(+), 37 deletions(-) diff --git a/stepmania/src/CatalogXml.cpp b/stepmania/src/CatalogXml.cpp index e64e94668d..a5901af6c0 100644 --- a/stepmania/src/CatalogXml.cpp +++ b/stepmania/src/CatalogXml.cpp @@ -115,7 +115,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) Course* pCourse = vpCourses[i]; // skip non-fixed courses. We don't have any stable data for them other than // the title. - if( !pCourse->IsFixed() ) + if( !pCourse->AllSongsAreFixed() ) continue; if( UNLOCKMAN->CourseIsLocked(pCourse) ) continue; @@ -203,7 +203,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) // skip non-fixed courses. We don't have any stable data for them other than // the title. - if( !pCourse->IsFixed() ) + if( !pCourse->AllSongsAreFixed() ) continue; if( UNLOCKMAN->CourseIsLocked(pCourse) ) continue; diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 6d7711c715..ada80084ae 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -277,20 +277,7 @@ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const // if( m_iTrailCacheSeed != GAMESTATE->m_iStageSeed ) { - /* If we have any random entries (so that the seed matters), invalidate the cache. */ - bool bHaveRandom = false; - FOREACH_CONST( CourseEntry, m_vEntries, e ) - { - if( e->IsRandomSong() ) - { - bHaveRandom = true; - break; - } - } - - if( bHaveRandom ) - m_TrailCache.clear(); - + RegenerateNonFixedTrails(); m_iTrailCacheSeed = GAMESTATE->m_iStageSeed; } @@ -729,7 +716,7 @@ void Course::RegenerateNonFixedTrails() // We can create these Trails on demand because we don't // calculate RadarValues for Trails with one or more non-fixed // entry. - if( !IsFixed() ) + if( !AllSongsAreFixed() ) m_TrailCache.clear(); } @@ -746,14 +733,14 @@ RageColor Course::GetColor() const else return SORT_LEVEL5_COLOR; case PrefsManager::COURSE_SORT_METER: - if( !IsFixed() ) return SORT_LEVEL1_COLOR; + if( !AllSongsAreFixed() ) return SORT_LEVEL1_COLOR; else if( iMeter > 9 ) return SORT_LEVEL2_COLOR; else if( iMeter >= 7 ) return SORT_LEVEL3_COLOR; else if( iMeter >= 5 ) return SORT_LEVEL4_COLOR; else return SORT_LEVEL5_COLOR; case PrefsManager::COURSE_SORT_METER_SUM: - if( !IsFixed() ) return SORT_LEVEL1_COLOR; + if( !AllSongsAreFixed() ) return SORT_LEVEL1_COLOR; if( m_SortOrder_TotalDifficulty >= 40 ) return SORT_LEVEL2_COLOR; if( m_SortOrder_TotalDifficulty >= 30 ) return SORT_LEVEL3_COLOR; if( m_SortOrder_TotalDifficulty >= 20 ) return SORT_LEVEL4_COLOR; @@ -770,21 +757,9 @@ RageColor Course::GetColor() const } } -bool Course::IsFixed() const -{ - for(unsigned i = 0; i < m_vEntries.size(); i++) - { - if( m_vEntries[i].pSong == NULL ) - return false; - } - - return true; -} - - bool Course::GetTotalSeconds( StepsType st, float& fSecondsOut ) const { - if( !IsFixed() ) + if( !AllSongsAreFixed() ) return false; Trail* pTrail = GetTrail( st, DIFFICULTY_MEDIUM ); @@ -892,7 +867,7 @@ void Course::CalculateRadarValues() { // For courses that aren't fixed, the radar values are meaningless. // Makes non-fixed courses have unknown radar values. - if( IsFixed() ) + if( AllSongsAreFixed() ) { Trail *pTrail = GetTrail( st, cd ); if( pTrail == NULL ) diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 7da4c4b369..27b5dd8108 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -165,8 +165,6 @@ public: void SetCourseType( CourseType ct ); PlayMode GetPlayMode() const; - bool IsFixed() const; - bool ShowInDemonstrationAndRanking() const; void RevertFromDisk(); diff --git a/stepmania/src/CourseLoaderCRS.cpp b/stepmania/src/CourseLoaderCRS.cpp index 3ca8ca46ea..1ce9b99bfb 100644 --- a/stepmania/src/CourseLoaderCRS.cpp +++ b/stepmania/src/CourseLoaderCRS.cpp @@ -142,6 +142,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou else if( sParams[1] == "*" ) { //new_entry.bSecret = true; + new_entry.iChooseIndex = -1; } else if( sParams[1].Right(1) == "*" ) { @@ -164,7 +165,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou if( !SONGMAN->DoesSongGroupExist(new_entry.sSongGroup) ) { /* XXX: We need a place to put "user warnings". This is too loud for info.txt-- - * it obscures important warnings--and regular users never look there, anyway. */ + * it obscures important warnings--and regular users never look there, anyway. */ LOG->Trace( "Course file '%s' random_within_group entry '%s' specifies a group that doesn't exist. " "This entry will be ignored.", sPath.c_str(), sSong.c_str()); diff --git a/stepmania/src/CourseUtil.cpp b/stepmania/src/CourseUtil.cpp index f674c72e06..d15bade5c8 100644 --- a/stepmania/src/CourseUtil.cpp +++ b/stepmania/src/CourseUtil.cpp @@ -72,7 +72,7 @@ static bool MovePlayersBestToEnd( const Course* pCourse1, const Course* pCourse2 static bool CompareRandom( const Course* pCourse1, const Course* pCourse2 ) { - return ( pCourse1->IsFixed() && !pCourse2->IsFixed() ); + return ( pCourse1->AllSongsAreFixed() && !pCourse2->AllSongsAreFixed() ); } static bool CompareCoursePointersByRanking( const Course* pCourse1, const Course* pCourse2 )