cache all courses
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user