summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/callable_method_pointer.h17
-rw-r--r--editor/animation_track_editor.cpp2
-rw-r--r--editor/animation_track_editor.h2
-rw-r--r--editor/filesystem_dock.cpp2
-rw-r--r--editor/filesystem_dock.h2
-rw-r--r--editor/groups_editor.cpp3
-rw-r--r--editor/inspector_dock.cpp6
-rw-r--r--editor/inspector_dock.h6
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp13
-rw-r--r--editor/plugins/animation_player_editor_plugin.h1
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.cpp7
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.h1
-rw-r--r--editor/plugins/particles_editor_plugin.cpp26
-rw-r--r--editor/plugins/particles_editor_plugin.h2
14 files changed, 29 insertions, 61 deletions
diff --git a/core/callable_method_pointer.h b/core/callable_method_pointer.h
index fed793dfca..a931a344e6 100644
--- a/core/callable_method_pointer.h
+++ b/core/callable_method_pointer.h
@@ -134,7 +134,7 @@ void call_with_variant_args_helper(T *p_instance, void (T::*p_method)(P...), con
#ifdef DEBUG_METHODS_ENABLED
(p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
- (p_instance->*p_method)(VariantCaster<P...>::cast(p_args[Is])...);
+ (p_instance->*p_method)(VariantCaster<P>::cast(p_args[Is])...);
#endif
}
@@ -201,6 +201,15 @@ Callable create_custom_callable_function_pointer(T *p_instance,
// VERSION WITH RETURN
+// GCC 8 raises "parameter 'p_args' set but not used" here, probably using a
+// template version that does not have arguments and thus sees it unused, but
+// obviously the template can be used for functions with and without them, and
+// the optimizer will get rid of it anyway.
+#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
+#endif
+
template <class T, class R, class... P, size_t... Is>
void call_with_variant_args_ret_helper(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, Variant &r_ret, Callable::CallError &r_error, IndexSequence<Is...>) {
r_error.error = Callable::CallError::CALL_OK;
@@ -208,10 +217,14 @@ void call_with_variant_args_ret_helper(T *p_instance, R (T::*p_method)(P...), co
#ifdef DEBUG_METHODS_ENABLED
r_ret = (p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
- (p_instance->*p_method)(VariantCaster<P...>::cast(p_args[Is])...);
+ (p_instance->*p_method)(VariantCaster<P>::cast(p_args[Is])...);
#endif
}
+#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
template <class T, class R, class... P>
void call_with_variant_args_ret(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) {
#ifdef DEBUG_METHODS_ENABLED
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index f5c7b91a99..b311ea1675 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -5707,7 +5707,7 @@ float AnimationTrackEditor::snap_time(float p_value, bool p_relative) {
return p_value;
}
-void AnimationTrackEditor::_show_imported_anim_warning() const {
+void AnimationTrackEditor::_show_imported_anim_warning() {
// It looks terrible on a single line but the TTR extractor doesn't support line breaks yet.
EditorNode::get_singleton()->show_warning(TTR("This animation belongs to an imported scene, so changes to imported tracks will not be saved.\n\nTo enable the ability to add custom tracks, navigate to the scene's import settings and set\n\"Animation > Storage\" to \"Files\", enable \"Animation > Keep Custom Tracks\", then re-import.\nAlternatively, use an import preset that imports animations to separate files."),
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index c2660652d6..26f9c15f6c 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -314,7 +314,7 @@ class AnimationTrackEditor : public VBoxContainer {
OptionButton *snap_mode;
Button *imported_anim_warning;
- void _show_imported_anim_warning() const;
+ void _show_imported_anim_warning();
void _snap_mode_changed(int p_mode);
Vector<AnimationTrackEdit *> track_edits;
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 4172570089..5363d6a1e2 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1775,7 +1775,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
}
}
-void FileSystemDock::_resource_created() const {
+void FileSystemDock::_resource_created() {
Object *c = new_resource_dialog->instance_selected();
ERR_FAIL_COND(!c);
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h
index d20d4add4e..1969f85e72 100644
--- a/editor/filesystem_dock.h
+++ b/editor/filesystem_dock.h
@@ -215,7 +215,7 @@ private:
void _files_moved(String p_old_file, String p_new_file);
void _folder_moved(String p_old_folder, String p_new_folder);
- void _resource_created() const;
+ void _resource_created();
void _make_dir_confirm();
void _make_scene_confirm();
void _rename_operation_confirm();
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp
index 739e9f68c5..444958b0ac 100644
--- a/editor/groups_editor.cpp
+++ b/editor/groups_editor.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "groups_editor.h"
+
#include "editor/scene_tree_editor.h"
#include "editor_node.h"
#include "editor_scale.h"
@@ -468,7 +469,6 @@ GroupDialog::GroupDialog() {
nodes_to_add->set_select_mode(Tree::SELECT_MULTI);
nodes_to_add->set_v_size_flags(SIZE_EXPAND_FILL);
nodes_to_add->add_constant_override("draw_guides", 1);
- nodes_to_add->connect_compat("item_selected", this, "_nodes_to_add_selected");
HBoxContainer *add_filter_hbc = memnew(HBoxContainer);
add_filter_hbc->add_constant_override("separate", 0);
@@ -515,7 +515,6 @@ GroupDialog::GroupDialog() {
nodes_to_remove->set_hide_folding(true);
nodes_to_remove->set_select_mode(Tree::SELECT_MULTI);
nodes_to_remove->add_constant_override("draw_guides", 1);
- nodes_to_remove->connect_compat("item_selected", this, "_node_to_remove_selected");
HBoxContainer *remove_filter_hbc = memnew(HBoxContainer);
remove_filter_hbc->add_constant_override("separate", 0);
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 85356a209f..1f96092bba 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -260,7 +260,7 @@ void InspectorDock::_prepare_history() {
}
}
-void InspectorDock::_select_history(int p_idx) const {
+void InspectorDock::_select_history(int p_idx) {
//push it to the top, it is not correct, but it's more useful
ObjectID id = EditorNode::get_singleton()->get_editor_history()->get_history_obj(p_idx);
Object *obj = ObjectDB::get_instance(id);
@@ -269,7 +269,7 @@ void InspectorDock::_select_history(int p_idx) const {
editor->push_item(obj);
}
-void InspectorDock::_resource_created() const {
+void InspectorDock::_resource_created() {
Object *c = new_resource_dialog->instance_selected();
ERR_FAIL_COND(!c);
@@ -280,7 +280,7 @@ void InspectorDock::_resource_created() const {
editor->push_item(c);
}
-void InspectorDock::_resource_selected(const RES &p_res, const String &p_property) const {
+void InspectorDock::_resource_selected(const RES &p_res, const String &p_property) {
if (p_res.is_null())
return;
diff --git a/editor/inspector_dock.h b/editor/inspector_dock.h
index a7da4bef4c..016aee12cf 100644
--- a/editor/inspector_dock.h
+++ b/editor/inspector_dock.h
@@ -104,13 +104,13 @@ class InspectorDock : public VBoxContainer {
void _paste_resource() const;
void _warning_pressed();
- void _resource_created() const;
- void _resource_selected(const RES &p_res, const String &p_property = "") const;
+ void _resource_created();
+ void _resource_selected(const RES &p_res, const String &p_property = "");
void _edit_forward();
void _edit_back();
void _menu_collapseall();
void _menu_expandall();
- void _select_history(int p_idx) const;
+ void _select_history(int p_idx);
void _prepare_history();
void _property_keyed(const String &p_keyed, const Variant &p_value, bool p_advance);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 26c3c21d61..0f2a7376f5 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -38,10 +38,8 @@
#include "editor/animation_track_editor.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
-
-// For onion skinning.
-#include "editor/plugins/canvas_item_editor_plugin.h"
-#include "editor/plugins/spatial_editor_plugin.h"
+#include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning.
+#include "editor/plugins/spatial_editor_plugin.h" // For onion skinning.
#include "scene/main/viewport.h"
#include "servers/visual_server.h"
@@ -375,8 +373,7 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource> &p_resou
Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
if (err != OK) {
- accept->set_text(TTR("Error saving resource!"));
- accept->popup_centered_minsize();
+ EditorNode::get_singleton()->show_warning(TTR("Error saving resource!"));
return;
}
@@ -1628,10 +1625,6 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
scale->set_tooltip(TTR("Scale animation playback globally for the node."));
scale->hide();
- accept = memnew(AcceptDialog);
- add_child(accept);
- accept->connect_compat("confirmed", this, "_menu_confirm_current");
-
delete_dialog = memnew(ConfirmationDialog);
add_child(delete_dialog);
delete_dialog->connect_compat("confirmed", this, "_animation_remove_confirmed");
diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h
index ab9db279d5..40815151a3 100644
--- a/editor/plugins/animation_player_editor_plugin.h
+++ b/editor/plugins/animation_player_editor_plugin.h
@@ -110,7 +110,6 @@ class AnimationPlayerEditor : public VBoxContainer {
float timeline_position;
EditorFileDialog *file;
- AcceptDialog *accept;
ConfirmationDialog *delete_dialog;
int current_option;
diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_editor_plugin.cpp
index 8a73ae1e1f..3d438226d2 100644
--- a/editor/plugins/cpu_particles_editor_plugin.cpp
+++ b/editor/plugins/cpu_particles_editor_plugin.cpp
@@ -51,12 +51,6 @@ void CPUParticlesEditor::_menu_option(int p_option) {
switch (p_option) {
- case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH: {
-
- emission_file_dialog->popup_centered_ratio();
-
- } break;
-
case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: {
emission_tree_dialog->popup_centered_ratio();
@@ -112,7 +106,6 @@ CPUParticlesEditor::CPUParticlesEditor() {
particles_editor_hb->hide();
options->set_text(TTR("CPUParticles"));
- options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH);
options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Restart"), MENU_OPTION_RESTART);
diff --git a/editor/plugins/cpu_particles_editor_plugin.h b/editor/plugins/cpu_particles_editor_plugin.h
index deaced9ad9..4cf143fc0c 100644
--- a/editor/plugins/cpu_particles_editor_plugin.h
+++ b/editor/plugins/cpu_particles_editor_plugin.h
@@ -41,7 +41,6 @@ class CPUParticlesEditor : public ParticlesEditorBase {
enum Menu {
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE,
- MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH,
MENU_OPTION_CLEAR_EMISSION_VOLUME,
MENU_OPTION_RESTART
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index cea2182ae9..7020abc301 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -231,23 +231,9 @@ ParticlesEditorBase::ParticlesEditorBase() {
emission_dialog->get_ok()->set_text(TTR("Create"));
emission_dialog->connect_compat("confirmed", this, "_generate_emission_points");
- emission_file_dialog = memnew(EditorFileDialog);
- add_child(emission_file_dialog);
- emission_file_dialog->connect_compat("file_selected", this, "_resource_seleted");
emission_tree_dialog = memnew(SceneTreeDialog);
add_child(emission_tree_dialog);
emission_tree_dialog->connect_compat("selected", this, "_node_selected");
-
- List<String> extensions;
- ResourceLoader::get_recognized_extensions_for_type("Mesh", &extensions);
-
- emission_file_dialog->clear_filters();
- for (int i = 0; i < extensions.size(); i++) {
-
- emission_file_dialog->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper());
- }
-
- emission_file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE);
}
void ParticlesEditor::_node_removed(Node *p_node) {
@@ -279,17 +265,6 @@ void ParticlesEditor::_menu_option(int p_option) {
generate_seconds->set_value(trunc(gen_time) + 1.0);
generate_aabb->popup_centered_minsize();
} break;
- case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH: {
-
- Ref<ParticlesMaterial> material = node->get_process_material();
- if (material.is_null()) {
- EditorNode::get_singleton()->show_warning(TTR("A processor material of type 'ParticlesMaterial' is required."));
- return;
- }
- emission_file_dialog->popup_centered_ratio();
-
- } break;
-
case MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE: {
Ref<ParticlesMaterial> material = node->get_process_material();
if (material.is_null()) {
@@ -467,7 +442,6 @@ ParticlesEditor::ParticlesEditor() {
options->set_text(TTR("Particles"));
options->get_popup()->add_item(TTR("Generate AABB"), MENU_OPTION_GENERATE_AABB);
options->get_popup()->add_separator();
- options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH);
options->get_popup()->add_item(TTR("Create Emission Points From Node"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE);
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES);
diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h
index 5419b7d3d5..fb5ce17560 100644
--- a/editor/plugins/particles_editor_plugin.h
+++ b/editor/plugins/particles_editor_plugin.h
@@ -46,7 +46,6 @@ protected:
MenuButton *options;
HBoxContainer *particles_editor_hb;
- EditorFileDialog *emission_file_dialog;
SceneTreeDialog *emission_tree_dialog;
ConfirmationDialog *emission_dialog;
@@ -77,7 +76,6 @@ class ParticlesEditor : public ParticlesEditorBase {
MENU_OPTION_GENERATE_AABB,
MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE,
- MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH,
MENU_OPTION_CLEAR_EMISSION_VOLUME,
MENU_OPTION_CONVERT_TO_CPU_PARTICLES,
MENU_OPTION_RESTART,