| 61 | } |
| 62 | |
| 63 | void EditorProfiler::add_frame_metric(const Metric &p_metric, bool p_final) { |
| 64 | ++last_metric; |
| 65 | if (last_metric >= frame_metrics.size()) { |
| 66 | last_metric = 0; |
| 67 | } |
| 68 | |
| 69 | total_metrics++; |
| 70 | if (total_metrics > frame_metrics.size()) { |
| 71 | total_metrics = frame_metrics.size(); |
| 72 | } |
| 73 | |
| 74 | frame_metrics.write[last_metric] = p_metric; |
| 75 | _make_metric_ptrs(frame_metrics.write[last_metric]); |
| 76 | |
| 77 | updating_frame = true; |
| 78 | clear_button->set_disabled(false); |
| 79 | cursor_metric_edit->set_editable(true); |
| 80 | cursor_metric_edit->set_max(p_metric.frame_number); |
| 81 | cursor_metric_edit->set_min(_get_frame_metric(0).frame_number); |
| 82 | |
| 83 | if (!seeking) { |
| 84 | cursor_metric_edit->set_value(p_metric.frame_number); |
| 85 | } |
| 86 | |
| 87 | updating_frame = false; |
| 88 | |
| 89 | if (frame_delay->is_stopped()) { |
| 90 | frame_delay->set_wait_time(p_final ? 0.1 : 1); |
| 91 | frame_delay->start(); |
| 92 | } |
| 93 | |
| 94 | if (plot_delay->is_stopped()) { |
| 95 | plot_delay->set_wait_time(0.1); |
| 96 | plot_delay->start(); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | void EditorProfiler::clear() { |
| 101 | int metric_size = EDITOR_GET("debugger/profiler_frame_history_size"); |
no test coverage detected