diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-05-28 08:47:09 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-28 08:47:09 -0300 |
commit | 5bb412f389c443d7562bdd28b973936c40c7a56e (patch) | |
tree | 25d5bc1ce9bad1fe4a0589dd547a3273f087f12e /main | |
parent | 856d945248a8ff3518de80eba48f19d2388c06f9 (diff) |
Revert "Make the performance reporting update frequency customizable"
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 18 | ||||
-rw-r--r-- | main/main.h | 2 |
2 files changed, 6 insertions, 14 deletions
diff --git a/main/main.cpp b/main/main.cpp index ad49e1f5bd..70713e2dd8 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1706,7 +1706,7 @@ bool Main::start() { uint64_t Main::last_ticks = 0; uint64_t Main::target_ticks = 0; -Array Main::frame_times = Array(); +uint32_t Main::frames = 0; uint32_t Main::frame = 0; bool Main::force_redraw_requested = false; @@ -1825,19 +1825,10 @@ bool Main::iteration() { script_debugger->idle_poll(); } + frames++; Engine::get_singleton()->_idle_frames++; - // FPS counter - frame_times.push_back(ticks); - int frames = frame_times.size(); - - while (frame_times.size() > 0 && (int)frame_times.get(0) <= ticks - 1000000) { - frame_times.pop_front(); - } - - int update_frequency = MAX(1, (int)GLOBAL_GET("debug/settings/performance/update_frequency_msec")); - - if (frame > update_frequency * 1000) { + if (frame > 1000000) { if (editor || project_manager) { if (print_fps) { @@ -1853,7 +1844,8 @@ bool Main::iteration() { idle_process_max = 0; physics_process_max = 0; - frame %= update_frequency * 1000; + frame %= 1000000; + frames = 0; } if (fixed_fps != -1) diff --git a/main/main.h b/main/main.h index 8f264d7720..c20592bf3b 100644 --- a/main/main.h +++ b/main/main.h @@ -44,7 +44,7 @@ class Main { static void print_help(const char *p_binary); static uint64_t last_ticks; static uint64_t target_ticks; - static Array frame_times; + static uint32_t frames; static uint32_t frame; static bool force_redraw_requested; |