diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index e6370212a..6d513a114 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -2198,7 +2198,6 @@ void GameView::OnDraw() if(showHud && introText < 51) { //FPS and some version info -#ifndef DEBUG //In debug mode, the Engine will draw FPS and other info instead std::stringstream fpsInfo; fpsInfo.precision(2); #ifdef SNAPSHOT @@ -2207,6 +2206,9 @@ void GameView::OnDraw() fpsInfo << "Beta " << SAVE_VERSION << "." << MINOR_VERSION << "." << BUILD_NUM << ", "; #endif fpsInfo << "FPS: " << std::fixed << ui::Engine::Ref().GetFps(); +#ifdef DEBUG + fpsInfo << " Delta: " << std::fixed << ui::Engine::Ref().GetDelta(); +#endif if (showDebug) fpsInfo << " Parts: " << sample.NumParts; @@ -2221,7 +2223,6 @@ void GameView::OnDraw() int alpha = 255-introText*5; g->fillrect(12, 12, textWidth+8, 15, 0, 0, 0, alpha*0.5); g->drawtext(16, 16, (const char*)fpsInfo.str().c_str(), 32, 216, 255, alpha*0.75); -#endif } //Tooltips diff --git a/src/gui/interface/Engine.cpp b/src/gui/interface/Engine.cpp index 29fd5aab1..fb8b1c9c5 100644 --- a/src/gui/interface/Engine.cpp +++ b/src/gui/interface/Engine.cpp @@ -232,11 +232,6 @@ void Engine::Draw() if(state_) state_->DoDraw(); -#ifdef DEBUG - char fpsText[512]; - sprintf(fpsText, "FPS: %.2f, Delta: %.3f", fps, dt); - ui::Engine::Ref().g->drawtext(10, 10, fpsText, 255, 255, 255, 255); -#endif g->Finalise(); g->Release(); FrameIndex++; diff --git a/src/gui/interface/Engine.h b/src/gui/interface/Engine.h index 4436f4bd0..d61521adb 100644 --- a/src/gui/interface/Engine.h +++ b/src/gui/interface/Engine.h @@ -54,6 +54,7 @@ namespace ui void SetFps(float fps); inline float GetFps() { return fps; } + inline float GetDelta() { return dt; } inline int GetMouseButton() { return mouseb_; } inline int GetMouseX() { return mousex_; }