Simplify. Fix metrics not reloading after the game's been running for

a couple weeks.
This commit is contained in:
Glenn Maynard
2003-07-13 00:02:23 +00:00
parent f3bbb5ffa9
commit 5873b47b19
2 changed files with 5 additions and 7 deletions
+3 -6
View File
@@ -43,9 +43,6 @@ ThemeManager::ThemeManager()
{
m_pIniMetrics = new IniFile;
/* Update the metric cache on the first call to GetMetric. */
m_fNextReloadTicks = 0;
m_sCurThemeName = BASE_THEME_NAME; // Use the base theme for now. It's up to PrefsManager to change this.
m_uHashForCurThemeMetrics = m_uHashForBaseThemeMetrics = 0;
@@ -292,10 +289,10 @@ try_metric_again:
CString sDefaultMetricPath = GetMetricsPathFromName(BASE_THEME_NAME);
// Is our metric cache out of date?
// XXX: GTSS wraps every ~40 days. Need a better way to handler timers like this.
if (RageTimer::GetTimeSinceStart() >= m_fNextReloadTicks)
if ( !m_uHashForBaseThemeMetrics || m_ReloadTimer.PeekDeltaTime() >= 1 )
{
m_fNextReloadTicks = RageTimer::GetTimeSinceStart()+1.0f;
m_ReloadTimer.GetDeltaTime();
if( m_uHashForCurThemeMetrics != GetHashForFile(sCurMetricPath) ||
m_uHashForBaseThemeMetrics != GetHashForFile(sDefaultMetricPath) )
{