make LogFPS a self-registering pref

This commit is contained in:
Chris Danford
2004-09-13 03:58:39 +00:00
parent 36a2a876ff
commit 825c972bf5
3 changed files with 46 additions and 6 deletions
+4 -2
View File
@@ -10,7 +10,7 @@
#include "RageSurface_Save_BMP.h"
#include "SDL_rotozoom.h"
#include "RageSurface.h"
#include "PrefsManager.h"
#include "Preference.h"
//
// Statistics stuff
@@ -30,6 +30,8 @@ static int g_iFramesRenderedSinceLastCheck,
RageDisplay* DISPLAY = NULL;
Preference<bool> LOG_FPS( Debug, "LogFPS", true );
CString RageDisplay::PixelFormatToString( PixelFormat pixfmt )
{
const CString s[NUM_PIX_FORMATS] = {
@@ -109,7 +111,7 @@ void RageDisplay::ProcessStatsOnFlip()
g_iCFPS = g_iFramesRenderedSinceLastReset / g_iNumChecksSinceLastReset;
g_iVPF = g_iVertsRenderedSinceLastCheck / g_iFPS;
g_iFramesRenderedSinceLastCheck = g_iVertsRenderedSinceLastCheck = 0;
if( PREFSMAN->m_bLogFPS )
if( LOG_FPS.GetValue() )
LOG->Trace( "FPS: %d, CFPS %d, VPF: %d", g_iFPS, g_iCFPS, g_iVPF );
}
}