- various optimization fixes
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-10-19 11:37:47 +00:00
parent d557dde656
commit 273b0672e4
23 changed files with 233 additions and 175 deletions

View File

@@ -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)