Add target fps editor setting to visual profiler

Use same max fps as project setting

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
This commit is contained in:
Daniel Kinsman
2024-08-06 11:47:25 +10:00
parent e2dd56bea7
commit 5e04f0760a
3 changed files with 8 additions and 0 deletions

View File

@ -103,6 +103,8 @@ void EditorVisualProfiler::clear() {
variables->clear();
//activate->set_pressed(false);
graph_limit = 1000.0f / CLAMP(int(EDITOR_GET("debugger/profiler_target_fps")), 1, 1000);
updating_frame = true;
cursor_metric_edit->set_min(0);
cursor_metric_edit->set_max(0);
@ -812,6 +814,8 @@ EditorVisualProfiler::EditorVisualProfiler() {
int metric_size = CLAMP(int(EDITOR_GET("debugger/profiler_frame_history_size")), 60, 10000);
frame_metrics.resize(metric_size);
graph_limit = 1000.0f / CLAMP(int(EDITOR_GET("debugger/profiler_target_fps")), 1, 1000);
frame_delay = memnew(Timer);
frame_delay->set_wait_time(0.1);
frame_delay->set_one_shot(true);