Merge pull request #10908 from hpvb/fix-unused-variables
Fix unused variable warnings
This commit is contained in:
commit
aabbd00284
38 changed files with 70 additions and 210 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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++) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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"];
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue