summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-16 16:55:07 +0100
committerGitHub <noreply@github.com>2022-02-16 16:55:07 +0100
commit51a00c2855009ce4cd6475c09209ebd22641f448 (patch)
tree56b249dbe446b5e24946c16ee13bd8241a119de6 /editor
parent33c7f52f361961c64432cfd772909ed3ba76cd51 (diff)
parentb8b45804485f7ca18f035f1eeb7a1ac0cf591cac (diff)
Merge pull request #58182 from akien-mga/style-cleanup-if-semicolons-deadcode
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_bezier_editor.cpp8
-rw-r--r--editor/debugger/editor_visual_profiler.cpp14
-rw-r--r--editor/editor_data.cpp5
-rw-r--r--editor/editor_inspector.cpp2
-rw-r--r--editor/editor_node.cpp4
-rw-r--r--editor/import/collada.cpp26
-rw-r--r--editor/import/resource_importer_obj.cpp2
-rw-r--r--editor/import/resource_importer_wav.h40
-rw-r--r--editor/plugins/node_3d_editor_gizmos.cpp1
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp2
-rw-r--r--editor/plugins/shader_editor_plugin.cpp8
11 files changed, 12 insertions, 100 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 6e97151465..c8c8c7d891 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -1289,10 +1289,6 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &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;
@@ -1303,10 +1299,6 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &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 c137740bda..2a1b0029d4 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<String> stack;
for (int i = 0; i < frame_metrics[last_metric].areas.size(); i++) {
@@ -482,19 +481,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<String> &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<SceneState> ss;
if (p_node == p_root) {
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index cbdfc4c65a..675ef808e1 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1867,7 +1867,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) {
@@ -1879,7 +1878,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<Script> EditorNode::get_object_custom_type_base(const Object *p_object) cons
if (script.is_valid()) {
// Uncommenting would break things! Consider adding a parameter if you need it.
// StringName name = EditorNode::get_editor_data().script_class_get_name(base_script->get_path());
- // if (name != StringName())
+ // if (name != StringName()) {
// return name;
+ // }
// should probably be deprecated in 4.x
StringName base = script->get_instance_base_type();
@@ -5745,7 +5746,6 @@ static void _execute_thread(void *p_ud) {
}
eta->done.set();
- ;
}
int EditorNode::execute_and_show_output(const String &p_title, const String &p_path, const List<String> &p_arguments, bool p_close_on_ok, bool p_close_on_errors) {
diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp
index 605f385de2..fe32399fc6 100644
--- a/editor/import/collada.cpp
+++ b/editor/import/collada.cpp
@@ -1009,11 +1009,6 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name
String source = _uri_to_id(parser.get_attribute_value("source"));
if (semantic == "TEXCOORD") {
- /*
- if (parser.has_attribute("set"))// a texcoord
- semantic+=parser.get_attribute_value("set");
- else
- semantic="TEXCOORD0";*/
semantic = "TEXCOORD" + itos(last_ref++);
}
int offset = parser.get_attribute_value("offset").to_int();
@@ -1194,11 +1189,6 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) {
skindata.weights = weights;
}
- /*
- else if (!parser.is_empty())
- parser.skip_section();
- */
-
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "skin") {
break;
}
@@ -1258,19 +1248,8 @@ void Collada::_parse_morph_controller(XMLParser &parser, String p_id) {
}
} else if (section == "Name_array" || section == "IDREF_array") {
// create a new array and read it.
-
- /*
- if (section=="IDREF_array")
- morphdata.use_idrefs=true;
- */
if (morphdata.sources.has(current_source)) {
morphdata.sources[current_source].sarray = _read_string_array(parser);
- /*
- if (section=="IDREF_array") {
- Vector<String> sa = morphdata.sources[current_source].sarray;
- for(int i=0;i<sa.size();i++)
- state.idref_joints.insert(sa[i]);
- }*/
COLLADA_PRINT("section: " + current_source + " read " + itos(morphdata.sources[current_source].array.size()) + " values.");
}
} else if (section == "technique_common") {
@@ -1303,11 +1282,6 @@ void Collada::_parse_morph_controller(XMLParser &parser, String p_id) {
}
}
}
- /*
- else if (!parser.is_empty())
- parser.skip_section();
- */
-
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "morph") {
break;
}
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp
index 96645665aa..9042f1e32c 100644
--- a/editor/import/resource_importer_obj.cpp
+++ b/editor/import/resource_importer_obj.cpp
@@ -317,8 +317,6 @@ static Error _parse_obj(const String &p_path, List<Ref<Mesh>> &r_meshes, bool p_
ERR_FAIL_INDEX_V(vtx, vertices.size(), ERR_FILE_CORRUPT);
Vector3 vertex = vertices[vtx];
- //if (weld_vertices)
- // vertex.snap(Vector3(weld_tolerance, weld_tolerance, weld_tolerance));
if (!smoothing) {
smooth_group++;
}
diff --git a/editor/import/resource_importer_wav.h b/editor/import/resource_importer_wav.h
index a5b576ceb9..2316ce80e5 100644
--- a/editor/import/resource_importer_wav.h
+++ b/editor/import/resource_importer_wav.h
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef RESOURCEIMPORTWAV_H
-#define RESOURCEIMPORTWAV_H
+#ifndef RESOURCE_IMPORTER_WAV_H
+#define RESOURCE_IMPORTER_WAV_H
#include "core/io/resource_importer.h"
@@ -50,9 +50,6 @@ public:
virtual bool get_option_visibility(const String &p_path, const String &p_option, const Map<StringName, Variant> &p_options) const override;
static void _compress_ima_adpcm(const Vector<float> &p_data, Vector<uint8_t> &dst_data) {
- /*p_sample_data->data = (void*)malloc(len);
- xm_s8 *dataptr=(xm_s8*)p_sample_data->data;*/
-
static const int16_t _ima_adpcm_step_table[89] = {
7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
@@ -81,15 +78,14 @@ public:
int i, step_idx = 0, prev = 0;
uint8_t *out = w;
- //int16_t xm_prev=0;
const float *in = p_data.ptr();
- /* initial value is zero */
+ // Initial value is zero.
*(out++) = 0;
*(out++) = 0;
- /* Table index initial value */
+ // Table index initial value.
*(out++) = 0;
- /* unused */
+ // Unused.
*(out++) = 0;
for (i = 0; i < datalen; i++) {
@@ -101,15 +97,8 @@ public:
xm_sample = 0;
} else {
xm_sample = CLAMP(in[i] * 32767.0, -32768, 32767);
- /*
- if (xm_sample==32767 || xm_sample==-32768)
- printf("clippy!\n",xm_sample);
- */
}
- //xm_sample=xm_sample+xm_prev;
- //xm_prev=xm_sample;
-
diff = (int)xm_sample - prev;
nibble = 0;
@@ -129,7 +118,7 @@ public:
step >>= 1;
mask >>= 1;
- };
+ }
if (nibble & 8) {
prev -= vpdiff;
@@ -137,20 +126,10 @@ public:
prev += vpdiff;
}
- if (prev > 32767) {
- //printf("%i,xms %i, prev %i,diff %i, vpdiff %i, clip up %i\n",i,xm_sample,prev,diff,vpdiff,prev);
- prev = 32767;
- } else if (prev < -32768) {
- //printf("%i,xms %i, prev %i,diff %i, vpdiff %i, clip down %i\n",i,xm_sample,prev,diff,vpdiff,prev);
- prev = -32768;
- }
+ prev = CLAMP(prev, -32768, 32767);
step_idx += _ima_adpcm_index_table[nibble];
- if (step_idx < 0) {
- step_idx = 0;
- } else if (step_idx > 88) {
- step_idx = 88;
- }
+ step_idx = CLAMP(step_idx, 0, 88);
if (i & 1) {
*out |= nibble << 4;
@@ -158,7 +137,6 @@ public:
} else {
*out = nibble;
}
- /*dataptr[i]=prev>>8;*/
}
}
@@ -167,4 +145,4 @@ public:
ResourceImporterWAV();
};
-#endif // RESOURCEIMPORTWAV_H
+#endif // RESOURCE_IMPORTER_WAV_H
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp
index 9f432a1fc7..46b33f62fe 100644
--- a/editor/plugins/node_3d_editor_gizmos.cpp
+++ b/editor/plugins/node_3d_editor_gizmos.cpp
@@ -1069,7 +1069,6 @@ void EditorNode3DGizmoPlugin::_bind_methods() {
GDVIRTUAL_BIND(_get_subgizmo_transform, "gizmo", "subgizmo_id");
GDVIRTUAL_BIND(_set_subgizmo_transform, "gizmo", "subgizmo_id", "transform");
GDVIRTUAL_BIND(_commit_subgizmos, "gizmo", "ids", "restores", "cancel");
- ;
}
bool EditorNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 62987dfe0f..f096b2abb1 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -1070,7 +1070,7 @@ void Polygon2DEditor::_uv_draw() {
if (uv_create && i == uvs.size() - 1) {
next_point = uv_create_to;
}
- if (i < uv_draw_max /*&& polygons.size() == 0 && polygon_create.size() == 0*/) { //if using or creating polygons, do not show outline (will show polygons instead)
+ if (i < uv_draw_max) { // If using or creating polygons, do not show outline (will show polygons instead).
uv_edit_draw->draw_line(mtx.xform(uvs[i]), mtx.xform(next_point), poly_line_color, Math::round(EDSCALE));
}
}
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index 25906f33de..cea1a0e808 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -464,14 +464,6 @@ void ShaderEditor::_bind_methods() {
}
void ShaderEditor::ensure_select_current() {
- /*
- if (tab_container->get_child_count() && tab_container->get_current_tab()>=0) {
- ShaderTextEditor *ste = Object::cast_to<ShaderTextEditor>(tab_container->get_child(tab_container->get_current_tab()));
- if (!ste)
- return;
- Ref<Shader> shader = ste->get_edited_shader();
- get_scene()->get_root_node()->call("_resource_selected",shader);
- }*/
}
void ShaderEditor::goto_line_selection(int p_line, int p_begin, int p_end) {