From b8b45804485f7ca18f035f1eeb7a1ac0cf591cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 16 Feb 2022 13:56:32 +0100 Subject: Style: Cleanup single-line blocks, semicolons, dead code Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported. --- editor/animation_bezier_editor.cpp | 8 ------ editor/debugger/editor_visual_profiler.cpp | 14 ---------- editor/editor_data.cpp | 5 ---- editor/editor_inspector.cpp | 2 -- editor/editor_node.cpp | 4 +-- editor/import/collada.cpp | 26 ------------------- editor/import/resource_importer_obj.cpp | 2 -- editor/import/resource_importer_wav.h | 40 +++++++---------------------- editor/plugins/node_3d_editor_gizmos.cpp | 1 - editor/plugins/polygon_2d_editor_plugin.cpp | 2 +- editor/plugins/shader_editor_plugin.cpp | 8 ------ 11 files changed, 12 insertions(+), 100 deletions(-) (limited to 'editor') diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 40b5de2ec7..cc9c6c26c5 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -1281,10 +1281,6 @@ void AnimationBezierTrackEdit::gui_input(const Ref &p_event) { // 3-move the keys (re insert them) for (SelectionSet::Element *E = selection.back(); E; E = E->prev()) { float newpos = editor->snap_time(animation->track_get_key_time(E->get().first, E->get().second) + moving_selection_offset.x); - /* - if (newpos<0) - continue; //no add at the beginning - */ Array key = animation->track_get_key_value(E->get().first, E->get().second); float h = key[0]; h += moving_selection_offset.y; @@ -1295,10 +1291,6 @@ void AnimationBezierTrackEdit::gui_input(const Ref &p_event) { // 4-(undo) remove inserted keys for (SelectionSet::Element *E = selection.back(); E; E = E->prev()) { float newpos = editor->snap_time(animation->track_get_key_time(E->get().first, E->get().second) + moving_selection_offset.x); - /* - if (newpos<0) - continue; //no remove what no inserted - */ undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_time", E->get().first, newpos); } diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 3cb5d3513d..4b821f2a12 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -41,7 +41,6 @@ void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) { } frame_metrics.write[last_metric] = p_metric; - // _make_metric_ptrs(frame_metrics.write[last_metric]); List stack; for (int i = 0; i < frame_metrics[last_metric].areas.size(); i++) { @@ -478,19 +477,6 @@ void EditorVisualProfiler::_graph_tex_draw() { graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x, font->get_ascent(font_size) + 2), "CPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); - - /* - if (hover_metric != -1 && frame_metrics[hover_metric].valid) { - int max_frames = frame_metrics.size(); - int frame = frame_metrics[hover_metric].frame_number - (frame_metrics[last_metric].frame_number - max_frames + 1); - if (frame < 0) - frame = 0; - - int cur_x = frame * graph->get_size().x / max_frames; - - graph->draw_line(Vector2(cur_x, 0), Vector2(cur_x, graph->get_size().y), Color(1, 1, 1, 0.4)); - } -*/ } void EditorVisualProfiler::_graph_tex_mouse_exit() { diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 91bd89b201..69c7e9d52c 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -589,11 +589,6 @@ void EditorData::remove_scene(int p_idx) { } bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, Set &checked_paths) { - /* - if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner())) - return false; - */ - Ref ss; if (p_node == p_root) { diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index d5cd61d792..c56ebaa499 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1858,7 +1858,6 @@ int EditorInspectorArray::_drop_position() const { void EditorInspectorArray::_new_size_line_edit_text_changed(String p_text) { bool valid = false; - ; if (p_text.is_valid_int()) { int val = p_text.to_int(); if (val > 0 && val != count) { @@ -1870,7 +1869,6 @@ void EditorInspectorArray::_new_size_line_edit_text_changed(String p_text) { void EditorInspectorArray::_new_size_line_edit_text_submitted(String p_text) { bool valid = false; - ; if (p_text.is_valid_int()) { int val = p_text.to_int(); if (val > 0 && val != count) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 208640a2e3..a10eecbca1 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3916,8 +3916,9 @@ Ref