Erwan
- various optimization fixes
This commit is contained in:
@@ -32,6 +32,11 @@ GameState::GameState(GameApp* parent): mParent(parent)
|
||||
|
||||
GameApp::GameApp(): JApp()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
nbUpdates = 0;
|
||||
totalFPS = 0;
|
||||
#endif
|
||||
|
||||
mScreenShotCount = 0;
|
||||
|
||||
for (int i=0; i < MAX_STATE ; i++)
|
||||
@@ -286,6 +291,20 @@ void GameApp::Render()
|
||||
resources.DebugRender();
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
JGE* mEngine = JGE::GetInstance();
|
||||
float fps = mEngine->GetFPS();
|
||||
totalFPS += fps;
|
||||
nbUpdates+=1;
|
||||
JLBFont * mFont= resources.GetJLBFont("simon");
|
||||
char buf[512];
|
||||
sprintf(buf, "avg:%f - %f fps",totalFPS/nbUpdates, fps);
|
||||
if (mFont) {
|
||||
mFont->SetColor(ARGB(255,255,255,255));
|
||||
mFont->DrawString(buf,1,1);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void GameApp::SetNextState(int state)
|
||||
|
||||
Reference in New Issue
Block a user