summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_track_editor.cpp1
-rw-r--r--editor/collada/collada.cpp2
-rw-r--r--editor/dependency_editor.cpp1
-rw-r--r--editor/editor_data.cpp2
-rw-r--r--editor/editor_folding.cpp3
-rw-r--r--editor/editor_node.cpp6
-rw-r--r--editor/editor_properties.cpp2
-rw-r--r--editor/export_template_manager.cpp2
-rw-r--r--editor/find_in_files.cpp1
-rw-r--r--editor/import/editor_import_collada.cpp2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp2
-rw-r--r--editor/project_manager.cpp7
15 files changed, 9 insertions, 30 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 40aa9a28b2..4ec245eacf 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -266,7 +266,6 @@ public:
else
undo_redo->create_action(TTR("Anim Change Call"));
- Variant prev = animation->track_get_key_value(track, key);
setting = true;
undo_redo->add_do_method(animation.ptr(), "track_set_key_value", track, key, d_new);
undo_redo->add_undo_method(animation.ptr(), "track_set_key_value", track, key, d_old);
diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp
index 843d1006d7..745e31e18d 100644
--- a/editor/collada/collada.cpp
+++ b/editor/collada/collada.cpp
@@ -1488,7 +1488,6 @@ Collada::Node *Collada::_parse_visual_instance_geometry(XMLParser &parser) {
Collada::Node *Collada::_parse_visual_instance_camera(XMLParser &parser) {
- String type = parser.get_node_name();
NodeCamera *cam = memnew(NodeCamera);
cam->camera = _uri_to_id(parser.get_attribute_value_safe("url"));
@@ -1509,7 +1508,6 @@ Collada::Node *Collada::_parse_visual_instance_camera(XMLParser &parser) {
Collada::Node *Collada::_parse_visual_instance_light(XMLParser &parser) {
- String type = parser.get_node_name();
NodeLight *cam = memnew(NodeLight);
cam->light = _uri_to_id(parser.get_attribute_value_safe("url"));
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 1f58eda396..c6046f7e19 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -49,7 +49,6 @@ void DependencyEditor::_searched(const String &p_path) {
void DependencyEditor::_load_pressed(Object *p_item, int p_cell, int p_button) {
TreeItem *ti = Object::cast_to<TreeItem>(p_item);
- String fname = ti->get_text(0);
replacing = ti->get_text(1);
search->set_title(TTR("Search Replacement For:") + " " + replacing.get_file());
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 1cafd1d1f4..0ac7b66ae4 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -727,7 +727,7 @@ uint64_t EditorData::get_edited_scene_version() const {
return edited_scene[current_edited_scene].version;
}
uint64_t EditorData::get_scene_version(int p_idx) const {
- ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), false);
+ ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), 0);
return edited_scene[p_idx].version;
}
diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp
index 9f13049a6b..9ed74b0d84 100644
--- a/editor/editor_folding.cpp
+++ b/editor/editor_folding.cpp
@@ -55,7 +55,6 @@ void EditorFolding::save_resource_folding(const RES &p_resource, const String &p
PoolVector<String> unfolds = _get_unfolds(p_resource.ptr());
config->set_value("folding", "sections_unfolded", unfolds);
- String path = EditorSettings::get_singleton()->get_project_settings_dir();
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
config->save(file);
@@ -76,7 +75,6 @@ void EditorFolding::load_resource_folding(RES p_resource, const String &p_path)
Ref<ConfigFile> config;
config.instance();
- String path = EditorSettings::get_singleton()->get_project_settings_dir();
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
@@ -151,7 +149,6 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path
config->set_value("folding", "resource_unfolds", res_unfolds);
config->set_value("folding", "nodes_folded", nodes_folded);
- String path = EditorSettings::get_singleton()->get_project_settings_dir();
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
config->save(file);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 383514164a..980d82d6df 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -963,7 +963,7 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj, Map<RES, bool>
int len = varray.size();
for (int i = 0; i < len; i++) {
- Variant v = varray.get(i);
+ const Variant &v = varray.get(i);
RES res = v;
if (_find_and_save_resource(res, processed, flags))
ret_changed = true;
@@ -1027,13 +1027,10 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
int c3d = 0;
_find_node_types(editor_data.get_edited_scene_root(), c2d, c3d);
- RID viewport;
bool is2d;
if (c3d < c2d) {
- viewport = scene_root->get_viewport_rid();
is2d = true;
} else {
- viewport = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_viewport_rid();
is2d = false;
}
save.step(TTR("Creating Thumbnail"), 1);
@@ -1282,7 +1279,6 @@ void EditorNode::restart_editor() {
}
_exit_editor();
- String exec = OS::get_singleton()->get_executable_path();
List<String> args;
args.push_back("--path");
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index e14beabfa2..4bce6f34d3 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -979,8 +979,6 @@ void EditorPropertyEasing::_draw_easing() {
RID ci = easing_draw->get_canvas_item();
Size2 s = easing_draw->get_size();
- Rect2 r(Point2(), s);
- r = r.grow(3);
const int points = 48;
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index f47f9b8b92..318fee01f2 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -172,7 +172,7 @@ void ExportTemplateManager::_uninstall_template_confirm() {
ERR_FAIL_COND_MSG(err != OK, "Could not remove all templates in '" + templates_dir.plus_file(to_remove) + "'.");
da->change_dir("..");
- da->remove(to_remove);
+ err = da->remove(to_remove);
ERR_FAIL_COND_MSG(err != OK, "Could not remove templates directory at '" + templates_dir.plus_file(to_remove) + "'.");
_update_template_list();
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 752e49a932..01d645e231 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -889,7 +889,6 @@ String FindInFilesPanel::get_replace_text() {
void FindInFilesPanel::update_replace_buttons() {
- String text = get_replace_text();
bool disabled = _finder->is_searching();
_replace_all_button->set_disabled(disabled);
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index d604a95320..2eef0a07b5 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -1015,8 +1015,6 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres
Path *path = Object::cast_to<Path>(node);
- String curve = ng->source;
-
if (curve_cache.has(ng->source)) {
path->set_curve(curve_cache[ng->source]);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 718156f12a..1480cc6ac4 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1092,8 +1092,6 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag)
if (!player->has_animation(player->get_assigned_animation()))
return;
- Ref<Animation> anim = player->get_animation(player->get_assigned_animation());
-
updating = true;
frame->set_value(Math::stepify(p_pos, _get_editor_step()));
updating = false;
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index de9efaf8ba..d5dc74c134 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -54,7 +54,7 @@
#define MIN_ZOOM 0.01
#define MAX_ZOOM 100
-#define RULER_WIDTH 15 * EDSCALE
+#define RULER_WIDTH (15 * EDSCALE)
#define SCALE_HANDLE_DISTANCE 25
class SnapDialog : public ConfirmationDialog {
@@ -3210,7 +3210,7 @@ void CanvasItemEditor::_draw_selection() {
int next = (i + 1) % 4;
Vector2 ofs = ((endpoints[i] - endpoints[prev]).normalized() + ((endpoints[i] - endpoints[next]).normalized())).normalized();
- ofs *= 1.4144 * (select_handle->get_size().width / 2);
+ ofs *= Math_SQRT2 * (select_handle->get_size().width / 2);
select_handle->draw(ci, (endpoints[i] + ofs - (select_handle->get_size() / 2)).floor());
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 34780af59e..a4c3ff5dcd 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -403,7 +403,6 @@ void SpriteFramesEditor::_up_pressed() {
sel = to_move;
sel -= 1;
- Ref<Texture> r = frames->get_frame(edited_anim, to_move);
undo_redo->create_action(TTR("Delete Resource"));
undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move, frames->get_frame(edited_anim, to_move - 1));
undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move - 1, frames->get_frame(edited_anim, to_move));
@@ -428,7 +427,6 @@ void SpriteFramesEditor::_down_pressed() {
sel = to_move;
sel += 1;
- Ref<Texture> r = frames->get_frame(edited_anim, to_move);
undo_redo->create_action(TTR("Delete Resource"));
undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move, frames->get_frame(edited_anim, to_move + 1));
undo_redo->add_do_method(frames, "set_frame", edited_anim, to_move + 1, frames->get_frame(edited_anim, to_move));
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index a2f4040152..8e49bba7b2 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -150,7 +150,7 @@ void TextureRegionEditor::_region_draw() {
int next = (i + 1) % 4;
Vector2 ofs = ((endpoints[i] - endpoints[prev]).normalized() + ((endpoints[i] - endpoints[next]).normalized())).normalized();
- ofs *= 1.4144 * (select_handle->get_size().width / 2);
+ ofs *= Math_SQRT2 * (select_handle->get_size().width / 2);
edit_draw->draw_line(endpoints[i] - draw_ofs * draw_zoom, endpoints[next] - draw_ofs * draw_zoom, color, 2);
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index d3bab64ccf..8de4fda662 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -349,16 +349,15 @@ private:
void _path_selected(const String &p_path) {
- String p = p_path;
- String sp = p.simplify_path();
+ String sp = p_path.simplify_path();
project_path->set_text(sp);
_path_text_changed(sp);
get_ok()->call_deferred("grab_focus");
}
void _install_path_selected(const String &p_path) {
- String p = p_path;
- String sp = p.simplify_path();
+
+ String sp = p_path.simplify_path();
install_path->set_text(sp);
_path_text_changed(sp);
get_ok()->call_deferred("grab_focus");