From b2a38854fdde296fd2d7da139a29b23a18ab494d Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Sat, 2 Sep 2017 22:32:31 +0200 Subject: Fix unused variable warnings The forth in my quest to make Godot 3.x compile with -Werror on GCC7 --- editor/plugins/script_text_editor.cpp | 2 +- editor/plugins/shader_editor_plugin.cpp | 8 ++------ editor/plugins/spatial_editor_plugin.cpp | 8 -------- editor/plugins/tile_map_editor_plugin.cpp | 1 - 4 files changed, 3 insertions(+), 16 deletions(-) (limited to 'editor/plugins') diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index fae57eb5d2..2192d3ac49 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -624,7 +624,7 @@ void ScriptTextEditor::_code_complete_script(const String &p_code, List } String hint; Error err = script->get_language()->complete_code(p_code, script->get_path().get_base_dir(), base, r_options, r_force, hint); - if (hint != "") { + if (err == OK && hint != "") { code_editor->get_text_edit()->set_code_hint(hint); } } diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index b02016c273..1b02f18d85 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -164,6 +164,8 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List String calltip; Error err = sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip); + if (err != OK) + ERR_PRINT("Shaderlang complete failed"); if (calltip != "") { get_text_edit()->set_code_hint(calltip); @@ -403,13 +405,7 @@ void ShaderEditorPlugin::edit(Object *p_object) { bool ShaderEditorPlugin::handles(Object *p_object) const { - bool handles = true; Shader *shader = Object::cast_to(p_object); - /* - if (Object::cast_to(shader)) // Don't handle ShaderGraph's - handles = false; - */ - return shader != NULL; } diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 4e722be44b..235700a3c3 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2528,7 +2528,6 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const found_gizmos.insert(seg); - int handle = -1; Vector3 hit_point; Vector3 hit_normal; bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal, NULL, false); @@ -3423,13 +3422,6 @@ void SpatialEditor::set_state(const Dictionary &p_state) { settings_znear->set_value(float(d["znear"])); if (d.has("fov")) settings_fov->set_value(float(d["fov"])); - - if (d.has("default_srgb")) { - bool use = d["default_srgb"]; - - //viewport_environment->set_enable_fx(Environment::FX_SRGB,use); - //view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB), use ); - } if (d.has("show_grid")) { bool use = d["show_grid"]; diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index f943ee5f6d..43856116a6 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -550,7 +550,6 @@ void TileMapEditor::_draw_fill_preview(int p_cell, const Point2i &p_point, bool PoolVector points = _bucket_fill(p_point, false, true); PoolVector::Read pr = points.read(); int len = points.size(); - int time_after = OS::get_singleton()->get_ticks_msec(); for (int i = 0; i < len; ++i) { _draw_cell(p_cell, pr[i], p_flip_h, p_flip_v, p_transpose, p_xform); -- cgit v1.2.3