diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-02 22:32:31 +0200 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2017-09-08 15:03:53 +0200 |
commit | b2a38854fdde296fd2d7da139a29b23a18ab494d (patch) | |
tree | 951326f4d966e01d4f8d4402dc7beb2252560b7a /editor | |
parent | d1cb73b47a17de830d9474026ffa7b3587cfbc68 (diff) |
Fix unused variable warnings
The forth in my quest to make Godot 3.x compile with -Werror on GCC7
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_export.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 10 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 6 | ||||
-rw-r--r-- | editor/import/resource_importer_wav.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | editor/project_export.cpp | 2 | ||||
-rw-r--r-- | editor/property_editor.cpp | 13 |
10 files changed, 13 insertions, 41 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 915fb7e5db..8623b9acdb 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -697,6 +697,8 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co zd.zip = zip; Error err = export_project_files(p_preset, _save_zip_file, &zd); + if (err != OK) + ERR_PRINT("Failed to export project files"); zipClose(zip, NULL); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 91d2ddcd19..b4412014e7 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -412,7 +412,6 @@ void EditorNode::_fs_changed() { } if (changed.size()) { - int idx = 0; for (List<Ref<Resource> >::Element *E = changed.front(); E; E = E->next()) { E->get()->reload_from_file(); } @@ -1997,6 +1996,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { int cur_idx = editor_data.get_edited_scene(); _remove_edited_scene(); Error err = load_scene(filename); + if (err != OK) + ERR_PRINT("Failed to load scene"); editor_data.move_edited_scene_to_index(cur_idx); get_undo_redo()->clear_history(); scene_tabs->set_current_tab(cur_idx); @@ -3607,13 +3608,6 @@ void EditorNode::_update_dock_slots_visibility() { right_r_vsplit, }; - HSplitContainer *h_splits[4] = { - left_l_hsplit, - left_r_hsplit, - main_hsplit, - right_hsplit, - }; - if (!docks_visible) { for (int i = 0; i < DOCK_SLOT_MAX; i++) { diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 21cf08f524..831eb74b66 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -55,8 +55,8 @@ Error EditorSceneImporterGLTF::_parse_glb(const String &p_path, GLTFState &state uint32_t magic = f->get_32(); ERR_FAIL_COND_V(magic != 0x46546C67, ERR_FILE_UNRECOGNIZED); //glTF - uint32_t version = f->get_32(); - uint32_t length = f->get_32(); + f->get_32(); // version + f->get_32(); // length uint32_t chunk_length = f->get_32(); uint32_t chunk_type = f->get_32(); @@ -1945,7 +1945,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye bool last = false; while (true) { - float value = _interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, track.weight_tracks[i].interpolation); + _interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, track.weight_tracks[i].interpolation); if (last) { break; } diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index e2bacd70e4..025dbbaacf 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -103,7 +103,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s } /* GET FILESIZE */ - uint32_t filesize = file->get_32(); + file->get_32(); // filesize /* CHECK WAVE */ 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> } 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> 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<Shader>(p_object); - /* - if (Object::cast_to<ShaderGraph>(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<Vector2> points = _bucket_fill(p_point, false, true); PoolVector<Vector2>::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); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index d649afc594..a47ad13700 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -732,6 +732,8 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) { ERR_FAIL_COND(platform.is_null()); Error err = platform->export_project(current, export_debug->is_pressed(), p_path, 0); + if (err != OK) + ERR_PRINT("Failed to export project"); } void ProjectExportDialog::_bind_methods() { diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index a42fb41ee2..c7a4e1fc3b 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -2275,19 +2275,6 @@ void PropertyEditor::_check_reload_status(const String &p_name, TreeItem *item) } } - if (_might_be_in_instance()) { - - Variant vorig; - Dictionary d = item->get_metadata(0); - int usage = d.has("usage") ? int(int(d["usage"]) & (PROPERTY_USAGE_STORE_IF_NONONE | PROPERTY_USAGE_STORE_IF_NONZERO)) : 0; - - if (_get_instanced_node_original_property(p_name, vorig) || usage) { - Variant v = obj->get(p_name); - - bool has_reload = _is_property_different(v, vorig, usage); - } - } - if (obj->call("property_can_revert", p_name).operator bool()) { has_reload = true; |