cache all courses

This commit is contained in:
Glenn Maynard
2005-03-19 11:52:14 +00:00
parent 30d3c72cc0
commit 3d7325b457
3 changed files with 1 additions and 16 deletions
+1 -1
View File
@@ -301,7 +301,7 @@ void Course::LoadFromCRSFile( CString sPath )
FOREACH_CourseDifficulty( cd )
{
Trail *pTrail = GetTrail( st, cd );
if( pTrail == NULL || !pTrail->SlowGetRadarValues() )
if( pTrail == NULL )
continue;
RadarValues rv = pTrail->GetRadarValues();
-14
View File
@@ -40,20 +40,6 @@ bool TrailEntry::ContainsTransformOrTurn() const
return false;
}
/* Return true if GetRadarValues may be very slow (reads, decodes and
* transforms the Steps), in which case it's worth caching it in Course. */
bool Trail::SlowGetRadarValues() const
{
FOREACH_CONST( TrailEntry, m_vEntries, e )
{
const Steps *pSteps = e->pSteps;
if( !pSteps->IsAutogen() && e->ContainsTransformOrTurn() )
return true;
}
return false;
}
void Trail::SetRadarValues( const RadarValues &rv )
{
m_CachedRadarValues = rv;
-1
View File
@@ -62,7 +62,6 @@ public:
m_bRadarValuesCached = false;
}
bool SlowGetRadarValues() const;
RadarValues GetRadarValues() const;
void SetRadarValues( const RadarValues &rv ); // for pre-populating cache
int GetMeter() const;