feat: updated engine
This commit is contained in:
parent
cbe99774ff
commit
f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions
|
|
@ -31,6 +31,7 @@
|
|||
#include "editor_profiler.h"
|
||||
|
||||
#include "core/io/image.h"
|
||||
#include "core/object/callable_mp.h"
|
||||
#include "core/string/translation_server.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/run/editor_run_bar.h"
|
||||
|
|
@ -38,6 +39,7 @@
|
|||
#include "editor/themes/editor_scale.h"
|
||||
#include "scene/gui/check_box.h"
|
||||
#include "scene/gui/flow_container.h"
|
||||
#include "scene/gui/label.h"
|
||||
#include "scene/resources/image_texture.h"
|
||||
|
||||
void EditorProfiler::_make_metric_ptrs(Metric &m) {
|
||||
|
|
@ -49,7 +51,7 @@ void EditorProfiler::_make_metric_ptrs(Metric &m) {
|
|||
}
|
||||
}
|
||||
|
||||
EditorProfiler::Metric EditorProfiler::_get_frame_metric(int index) {
|
||||
const EditorProfiler::Metric &EditorProfiler::_get_frame_metric(int index) const {
|
||||
return frame_metrics[(frame_metrics.size() + last_metric - (total_metrics - 1) + index) % frame_metrics.size()];
|
||||
}
|
||||
|
||||
|
|
@ -186,6 +188,20 @@ void EditorProfiler::_item_edited() {
|
|||
_update_plot();
|
||||
}
|
||||
|
||||
void EditorProfiler::_item_collapsed(TreeItem *p_item) {
|
||||
if (!p_item) {
|
||||
return;
|
||||
}
|
||||
StringName signature = p_item->get_metadata(0);
|
||||
bool collapsed = p_item->is_collapsed();
|
||||
|
||||
if (collapsed) {
|
||||
collapsed_categories.insert(signature);
|
||||
} else {
|
||||
collapsed_categories.erase(signature);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorProfiler::_update_plot() {
|
||||
const int w = MAX(1, graph->get_size().width); // Clamp to 1 to prevent from crashing when profiler is autostarted.
|
||||
const int h = MAX(1, graph->get_size().height);
|
||||
|
|
@ -362,6 +378,10 @@ void EditorProfiler::_update_frame() {
|
|||
category->set_auto_translate_mode(0, AUTO_TRANSLATE_MODE_DISABLED);
|
||||
category->set_text(1, _get_time_as_text(m, m.categories[i].total_time, 1));
|
||||
|
||||
if (collapsed_categories.has(m.categories[i].signature)) {
|
||||
category->set_collapsed(true);
|
||||
}
|
||||
|
||||
if (plot_sigs.has(m.categories[i].signature)) {
|
||||
category->set_checked(0, true);
|
||||
category->set_custom_color(0, _get_color_from_signature(m.categories[i].signature));
|
||||
|
|
@ -755,7 +775,6 @@ EditorProfiler::EditorProfiler() {
|
|||
|
||||
variables = memnew(Tree);
|
||||
variables->set_custom_minimum_size(Size2(320, 0) * EDSCALE);
|
||||
variables->set_hide_folding(true);
|
||||
h_split->add_child(variables);
|
||||
variables->set_hide_root(true);
|
||||
variables->set_columns(3);
|
||||
|
|
@ -774,6 +793,7 @@ EditorProfiler::EditorProfiler() {
|
|||
variables->set_column_custom_minimum_width(2, 50 * EDSCALE);
|
||||
variables->set_theme_type_variation("TreeSecondary");
|
||||
variables->connect("item_edited", callable_mp(this, &EditorProfiler::_item_edited));
|
||||
variables->connect("item_collapsed", callable_mp(this, &EditorProfiler::_item_collapsed));
|
||||
|
||||
graph = memnew(TextureRect);
|
||||
graph->set_custom_minimum_size(Size2(250 * EDSCALE, 0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue