From c4d8f11ded765f5f762b1b2bbf10fac952730bbe Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 18 Mar 2022 01:24:57 +0100 Subject: Fixed FPS counter --- Stars45/Game.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'Stars45/Game.cpp') diff --git a/Stars45/Game.cpp b/Stars45/Game.cpp index 2b38db7..c5c9ab8 100644 --- a/Stars45/Game.cpp +++ b/Stars45/Game.cpp @@ -38,8 +38,7 @@ const double MAX_FRAME_TIME_NORMAL = 1.0 / 5.0; Game::Game() : world(0), video_factory(0), video(0), video_settings(0), soundcard(0), screen(0), totaltime(0), - hInst(0), hwnd(0), frame_rate(0), frame_count(0), frame_count0(0), - frame_time(0), frame_time0(0), + hInst(0), hwnd(0), status(Game::OK), exit_code(0), window_style(0) { if (!game) { @@ -112,17 +111,6 @@ bool Game::IsWindowed() // +--------------------------------------------------------------------+ -double -Game::FrameRate() -{ - if (game) - return game->frame_rate; - - return 0; -} - -// +--------------------------------------------------------------------+ - bool Game::Init(HINSTANCE hi, HINSTANCE hpi, LPSTR cmdline, int nCmdShow) { @@ -614,16 +602,8 @@ Game::GetScreenHeight() void Game::CollectStats() { - frame_count++; - if (!totaltime) totaltime = clock.RealTime(); - if (frame_time - frame_time0 > 200) { - frame_rate = (frame_count - frame_count0) * 1000.0 / (frame_time - frame_time0); - frame_time0 = frame_time; - frame_count0 = frame_count; - } - if (video) { stats.nframe = video->GetStats().nframe; stats.nverts = video->GetStats().nverts; -- cgit v1.1