move stats formatting to RageDisplay, so renderers can add custom stats
This commit is contained in:
@@ -98,6 +98,15 @@ void RageDisplay::ResetStats()
|
||||
g_LastCheckTimer.GetDeltaTime();
|
||||
}
|
||||
|
||||
CString RageDisplay::GetStats() const
|
||||
{
|
||||
/* If FPS == 0, we don't have stats yet. */
|
||||
if( !GetFPS() )
|
||||
return "-- FPS\n-- av FPS\n-- VPF";
|
||||
|
||||
return ssprintf( "%i FPS\n%i av FPS\n%i VPF", GetFPS(), GetCumFPS(), GetVPF() );
|
||||
}
|
||||
|
||||
void RageDisplay::StatsAddVerts( int iNumVertsRendered ) { g_iVertsRenderedSinceLastCheck += iNumVertsRendered; }
|
||||
|
||||
/* Draw a line as a quad. GL_LINES with SmoothLines off can draw line
|
||||
|
||||
@@ -277,6 +277,7 @@ public:
|
||||
int GetCumFPS() const; /* average FPS since last reset */
|
||||
void ResetStats();
|
||||
void ProcessStatsOnFlip();
|
||||
virtual CString GetStats() const;
|
||||
void StatsAddVerts( int iNumVertsRendered );
|
||||
|
||||
/* World matrix stack functions. */
|
||||
|
||||
@@ -335,15 +335,7 @@ void ScreenSystemLayer::Update( float fDeltaTime )
|
||||
if( PREFSMAN && PREFSMAN->m_bShowStats )
|
||||
{
|
||||
m_textStats.SetDiffuse( RageColor(1,1,1,0.7f) );
|
||||
|
||||
/* If FPS == 0, we don't have stats yet. */
|
||||
if(DISPLAY->GetFPS())
|
||||
m_textStats.SetText( ssprintf(
|
||||
"%i FPS\n%i av FPS\n%i VPF",
|
||||
DISPLAY->GetFPS(), DISPLAY->GetCumFPS(),
|
||||
DISPLAY->GetVPF()) );
|
||||
else
|
||||
m_textStats.SetText( "-- FPS\n-- av FPS\n-- VPF" );
|
||||
m_textStats.SetText( DISPLAY->GetStats() );
|
||||
} else
|
||||
m_textStats.SetDiffuse( RageColor(1,1,1,0) ); /* hide */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user