summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp4
-rw-r--r--editor/editor_properties.cpp3
-rw-r--r--editor/editor_properties_array_dict.cpp5
-rw-r--r--editor/import/resource_importer_scene.cpp1
-rw-r--r--editor/import/resource_importer_wav.cpp5
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/material_editor_plugin.cpp3
-rw-r--r--editor/plugins/mesh_editor_plugin.cpp3
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.cpp3
-rw-r--r--editor/plugins/texture_editor_plugin.cpp3
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp11
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp1
-rw-r--r--editor/project_settings_editor.cpp2
-rw-r--r--editor/property_editor.cpp3
-rw-r--r--editor/property_selector.cpp2
15 files changed, 14 insertions, 37 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 8bbfb38845..b59d42a5f7 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -832,7 +832,7 @@ void EditorNode::_get_scene_metadata(const String &p_file) {
for (List<String>::Element *E = esl.front(); E; E = E->next()) {
Variant st = cf->get_value("editor_states", E->get());
- if (st.get_type()) {
+ if (st.get_type() != Variant::NIL) {
md[E->get()] = st;
}
}
@@ -2541,8 +2541,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
restart_editor();
} break;
default: {
- if (p_option >= IMPORT_PLUGIN_BASE) {
- }
}
}
}
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 72506bc4f7..d54f72382c 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -390,7 +390,7 @@ void EditorPropertyMember::_property_select() {
type = Variant::Type(i);
}
}
- if (type)
+ if (type != Variant::NIL)
selector->select_method_from_basic_type(type, current);
} else if (hint == MEMBER_METHOD_OF_BASE_TYPE) {
@@ -2413,7 +2413,6 @@ void EditorPropertyResource::_update_menu_items() {
menu->add_separator();
menu->add_item(TTR("Show in FileSystem"), OBJ_MENU_SHOW_IN_FILE_SYSTEM);
}
- } else {
}
RES cb = EditorSettings::get_singleton()->get_resource_clipboard();
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 347699c632..203136a3f8 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -414,8 +414,6 @@ void EditorPropertyArray::_remove_pressed(int p_index) {
}
void EditorPropertyArray::_notification(int p_what) {
- if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
- }
}
void EditorPropertyArray::_edit_pressed() {
@@ -968,9 +966,6 @@ void EditorPropertyDictionary::_object_id_selected(const String &p_property, Obj
}
void EditorPropertyDictionary::_notification(int p_what) {
-
- if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
- }
}
void EditorPropertyDictionary::_edit_pressed() {
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index a8197ec2a2..53b67c46b0 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -893,7 +893,6 @@ void ResourceImporterScene::_filter_tracks(Node *scene, const String &p_text) {
keep.insert(F->get());
}
_filter_anim_tracks(anim->get_animation(name), keep);
- } else {
}
}
}
diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp
index e728dbac31..d267b29224 100644
--- a/editor/import/resource_importer_wav.cpp
+++ b/editor/import/resource_importer_wav.cpp
@@ -206,6 +206,11 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
frames = chunksize;
+ if (format_channels == 0) {
+ file->close();
+ memdelete(file);
+ ERR_FAIL_COND_V(format_channels == 0, ERR_INVALID_DATA);
+ }
frames /= format_channels;
frames /= (format_bits >> 3);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index d4eab888cc..2078a8b053 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1431,7 +1431,7 @@ bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) {
for (int i = 0; i < 4; i++) {
anchor_pos[i] = (transform * control->get_global_transform_with_canvas()).xform(_anchor_to_position(control, anchor_pos[i]));
anchor_rects[i] = Rect2(anchor_pos[i], anchor_handle->get_size());
- anchor_rects[i].position -= anchor_handle->get_size() * Vector2(i == 0 || i == 3, i <= 1);
+ anchor_rects[i].position -= anchor_handle->get_size() * Vector2(float(i == 0 || i == 3), float(i <= 1));
}
DragType dragger[] = {
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index ebacccb03c..e125c18ef1 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -34,9 +34,6 @@
void MaterialEditor::_notification(int p_what) {
- if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
- }
-
if (p_what == NOTIFICATION_READY) {
//get_scene()->connect("node_removed",this,"_node_removed");
diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp
index 6203035e25..442110cc84 100644
--- a/editor/plugins/mesh_editor_plugin.cpp
+++ b/editor/plugins/mesh_editor_plugin.cpp
@@ -48,9 +48,6 @@ void MeshEditor::_gui_input(Ref<InputEvent> p_event) {
void MeshEditor::_notification(int p_what) {
- if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
- }
-
if (p_what == NOTIFICATION_READY) {
//get_scene()->connect("node_removed",this,"_node_removed");
diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp
index b8d95efd49..620bf28415 100644
--- a/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -39,9 +39,6 @@ void ResourcePreloaderEditor::_gui_input(Ref<InputEvent> p_event) {
void ResourcePreloaderEditor::_notification(int p_what) {
- if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
- }
-
if (p_what == NOTIFICATION_ENTER_TREE) {
load->set_icon(get_icon("Folder", "EditorIcons"));
}
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index 0aa4a7662c..6d71c56ead 100644
--- a/editor/plugins/texture_editor_plugin.cpp
+++ b/editor/plugins/texture_editor_plugin.cpp
@@ -39,9 +39,6 @@ void TextureEditor::_gui_input(Ref<InputEvent> p_event) {
void TextureEditor::_notification(int p_what) {
- if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
- }
-
if (p_what == NOTIFICATION_READY) {
//get_scene()->connect("node_removed",this,"_node_removed");
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index cb48b5eaa5..4d349f06b7 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -193,7 +193,7 @@ void TextureRegionEditor::_region_draw() {
updating_scroll = false;
if (node_ninepatch || obj_styleBox.is_valid()) {
- float margins[4];
+ float margins[4] = { 0 };
if (node_ninepatch) {
margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP);
margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM);
@@ -204,12 +204,8 @@ void TextureRegionEditor::_region_draw() {
margins[1] = obj_styleBox->get_margin_size(MARGIN_BOTTOM);
margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT);
margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT);
- } else {
- margins[0] = 0;
- margins[1] = 0;
- margins[2] = 0;
- margins[3] = 0;
}
+
Vector2 pos[4] = {
mtx.basis_xform(Vector2(0, margins[0])) + Vector2(0, endpoints[0].y - draw_ofs.y * draw_zoom),
-mtx.basis_xform(Vector2(0, margins[1])) + Vector2(0, endpoints[2].y - draw_ofs.y * draw_zoom),
@@ -248,7 +244,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
if (mb->is_pressed()) {
if (node_ninepatch || obj_styleBox.is_valid()) {
edited_margin = -1;
- float margins[4];
+ float margins[4] = { 0 };
if (node_ninepatch) {
margins[0] = node_ninepatch->get_patch_margin(MARGIN_TOP);
margins[1] = node_ninepatch->get_patch_margin(MARGIN_BOTTOM);
@@ -260,6 +256,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
margins[2] = obj_styleBox->get_margin_size(MARGIN_LEFT);
margins[3] = obj_styleBox->get_margin_size(MARGIN_RIGHT);
}
+
Vector2 pos[4] = {
mtx.basis_xform(rect.position + Vector2(0, margins[0])) - draw_ofs * draw_zoom,
mtx.basis_xform(rect.position + rect.size - Vector2(0, margins[1])) - draw_ofs * draw_zoom,
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index aaa99996e6..28719d9e3e 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -1513,7 +1513,6 @@ void VisualShaderEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree())
_update_graph();
- } else if (p_what == NOTIFICATION_PROCESS) {
}
}
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index f05b6b5890..1c588a45f1 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -965,8 +965,6 @@ void ProjectSettingsEditor::_action_add() {
while (r->get_next())
r = r->get_next();
- if (!r)
- return;
r->select(0);
input_editor->ensure_cursor_is_visible();
action_add_error->hide();
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 82d974cae3..899343c0f8 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -614,7 +614,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
type = Variant::Type(i);
}
}
- if (type)
+ if (type != Variant::NIL)
property_select->select_method_from_basic_type(type, v);
updating = false;
return false;
@@ -971,7 +971,6 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
menu->add_separator();
menu->add_item(TTR("Show in FileSystem"), OBJ_MENU_SHOW_IN_FILE_SYSTEM);
}
- } else {
}
RES cb = EditorSettings::get_singleton()->get_resource_clipboard();
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index 813e24bd61..3bc93c3900 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -337,7 +337,7 @@ void PropertySelector::_item_selected() {
String name = item->get_metadata(0);
String class_type;
- if (type) {
+ if (type != Variant::NIL) {
class_type = Variant::get_type_name(type);
} else {