MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / add_frame_metric

Method add_frame_metric

editor/debugger/editor_profiler.cpp:63–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void 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
100void EditorProfiler::clear() {
101 int metric_size = EDITOR_GET("debugger/profiler_frame_history_size");

Callers 2

Calls 9

is_stoppedMethod · 0.80
set_wait_timeMethod · 0.80
sizeMethod · 0.65
set_disabledMethod · 0.45
set_editableMethod · 0.45
set_maxMethod · 0.45
set_minMethod · 0.45
set_valueMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected