From 54ac8eaba661a599983ae4774113d1a15cfa461a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 13 Feb 2020 11:37:37 +0100 Subject: [PATCH] Remove more deprecated methods and code --- SConstruct | 12 +- core/bind/core_bind.cpp | 10 - core/bind/core_bind.h | 3 - core/io/json.cpp | 10 +- core/io/resource_format_binary.cpp | 70 ------ core/io/resource_format_binary.h | 1 - core/math/expression.cpp | 10 +- core/variant_parser.cpp | 201 +----------------- doc/classes/InstancePlaceholder.xml | 15 +- doc/classes/ResourceLoader.xml | 9 - doc/classes/VisualServer.xml | 20 +- editor/scene_tree_editor.cpp | 25 +-- modules/bullet/cone_twist_joint_bullet.cpp | 10 +- modules/bullet/generic_6dof_joint_bullet.cpp | 22 +- modules/bullet/hinge_joint_bullet.cpp | 15 +- modules/bullet/pin_joint_bullet.cpp | 5 +- modules/gdscript/gdscript_parser.cpp | 4 - modules/gdscript/gdscript_tokenizer.cpp | 2 +- .../glue/GodotSharp/GodotSharp/Core/Basis.cs | 6 - .../glue/GodotSharp/GodotSharp/Core/Quat.cs | 27 --- .../GodotSharp/GodotSharp/Core/Vector2.cs | 13 -- .../GodotSharp/GodotSharp/Core/Vector3.cs | 15 -- .../visual_script_expression.cpp | 10 +- scene/3d/world_environment.cpp | 7 +- scene/main/instance_placeholder.cpp | 6 - scene/main/instance_placeholder.h | 1 - scene/main/node.cpp | 5 - scene/register_scene_types.cpp | 1 - scene/resources/environment.cpp | 5 + scene/resources/environment.h | 1 + scene/resources/material.cpp | 6 +- scene/resources/material.h | 1 + scene/resources/mesh.cpp | 4 +- scene/resources/multimesh.cpp | 8 +- scene/resources/multimesh.h | 2 +- servers/visual_server.cpp | 6 - 36 files changed, 66 insertions(+), 502 deletions(-) diff --git a/SConstruct b/SConstruct index 6713b75fc25..2b368f7b196 100644 --- a/SConstruct +++ b/SConstruct @@ -418,17 +418,7 @@ if selected_platform in platform_list: sys.path.insert(0, tmppath) env.current_module = x import config - # can_build changed number of arguments between 3.0 (1) and 3.1 (2), - # so try both to preserve compatibility for 3.0 modules - can_build = False - try: - can_build = config.can_build(env, selected_platform) - except TypeError: - print("Warning: module '%s' uses a deprecated `can_build` " - "signature in its config.py file, it should be " - "`can_build(env, platform)`." % x) - can_build = config.can_build(selected_platform) - if can_build: + if config.can_build(env, selected_platform): config.configure(env) env.module_list.append(x) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 5b25300dbda..9413772f842 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -108,13 +108,6 @@ PoolStringArray _ResourceLoader::get_dependencies(const String &p_path) { return ret; }; -#ifndef DISABLE_DEPRECATED -bool _ResourceLoader::has(const String &p_path) { - WARN_PRINT("ResourceLoader.has() is deprecated, please replace it with the equivalent has_cached() or the new exists()."); - return has_cached(p_path); -} -#endif // DISABLE_DEPRECATED - bool _ResourceLoader::has_cached(const String &p_path) { String local_path = ProjectSettings::get_singleton()->localize_path(p_path); @@ -134,9 +127,6 @@ void _ResourceLoader::_bind_methods() { ClassDB::bind_method(D_METHOD("get_dependencies", "path"), &_ResourceLoader::get_dependencies); ClassDB::bind_method(D_METHOD("has_cached", "path"), &_ResourceLoader::has_cached); ClassDB::bind_method(D_METHOD("exists", "path", "type_hint"), &_ResourceLoader::exists, DEFVAL("")); -#ifndef DISABLE_DEPRECATED - ClassDB::bind_method(D_METHOD("has", "path"), &_ResourceLoader::has); -#endif // DISABLE_DEPRECATED } _ResourceLoader::_ResourceLoader() { diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 22cb4a38284..18bb1408e37 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -55,9 +55,6 @@ public: PoolVector get_recognized_extensions_for_type(const String &p_type); void set_abort_on_missing_resources(bool p_abort); PoolStringArray get_dependencies(const String &p_path); -#ifndef DISABLE_DEPRECATED - bool has(const String &p_path); -#endif // DISABLE_DEPRECATED bool has_cached(const String &p_path); bool exists(const String &p_path, const String &p_type_hint = ""); diff --git a/core/io/json.cpp b/core/io/json.cpp index dbf1676e624..144e4bdc3bd 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -203,8 +203,7 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to case 'f': res = 12; break; case 'r': res = 13; break; case 'u': { - //hexnumbarh - oct is deprecated - + // hex number for (int j = 0; j < 4; j++) { CharType c = p_str[index + j + 1]; if (c == 0) { @@ -226,7 +225,7 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to v = c - 'A'; v += 10; } else { - ERR_PRINT("BUG"); + ERR_PRINT("Bug parsing hex constant."); v = 0; } @@ -236,13 +235,8 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to index += 4; //will add at the end anyway } break; - //case '\"': res='\"'; break; - //case '\\': res='\\'; break; - //case '/': res='/'; break; default: { res = next; - //r_err_str="Invalid escape sequence"; - //return ERR_PARSE_ERROR; } break; } diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 3899147c9e2..4a2bea31825 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -73,13 +73,6 @@ enum { VARIANT_VECTOR2_ARRAY = 37, VARIANT_INT64 = 40, VARIANT_DOUBLE = 41, -#ifndef DISABLE_DEPRECATED - VARIANT_IMAGE = 21, // - no longer variant type - IMAGE_ENCODING_EMPTY = 0, - IMAGE_ENCODING_RAW = 1, - IMAGE_ENCODING_LOSSLESS = 2, - IMAGE_ENCODING_LOSSY = 3, -#endif OBJECT_EMPTY = 0, OBJECT_EXTERNAL_RESOURCE = 1, OBJECT_INTERNAL_RESOURCE = 2, @@ -549,69 +542,6 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { w.release(); r_v = array; } break; -#ifndef DISABLE_DEPRECATED - case VARIANT_IMAGE: { - uint32_t encoding = f->get_32(); - if (encoding == IMAGE_ENCODING_EMPTY) { - r_v = Ref(); - break; - } else if (encoding == IMAGE_ENCODING_RAW) { - uint32_t width = f->get_32(); - uint32_t height = f->get_32(); - uint32_t mipmaps = f->get_32(); - uint32_t format = f->get_32(); - const uint32_t format_version_shift = 24; - const uint32_t format_version_mask = format_version_shift - 1; - - uint32_t format_version = format >> format_version_shift; - - const uint32_t current_version = 0; - if (format_version > current_version) { - - ERR_PRINT("Format version for encoded binary image is too new."); - return ERR_PARSE_ERROR; - } - - Image::Format fmt = Image::Format(format & format_version_mask); //if format changes, we can add a compatibility bit on top - - uint32_t datalen = f->get_32(); - - PoolVector imgdata; - imgdata.resize(datalen); - PoolVector::Write w = imgdata.write(); - f->get_buffer(w.ptr(), datalen); - _advance_padding(datalen); - w.release(); - - Ref image; - image.instance(); - image->create(width, height, mipmaps, fmt, imgdata); - r_v = image; - - } else { - //compressed - PoolVector data; - data.resize(f->get_32()); - PoolVector::Write w = data.write(); - f->get_buffer(w.ptr(), data.size()); - w.release(); - - Ref image; - - if (encoding == IMAGE_ENCODING_LOSSY && Image::lossy_unpacker) { - - image = Image::lossy_unpacker(data); - } else if (encoding == IMAGE_ENCODING_LOSSLESS && Image::lossless_unpacker) { - - image = Image::lossless_unpacker(data); - } - _advance_padding(data.size()); - - r_v = image; - } - - } break; -#endif default: { ERR_FAIL_V(ERR_FILE_CORRUPT); } break; diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index 7737006d104..f02dbaa0c26 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -51,7 +51,6 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader { Vector str_buf; List resource_cache; - //Map string_map; Vector string_map; StringName _get_string(); diff --git a/core/math/expression.cpp b/core/math/expression.cpp index 7faec0817e5..2fda7a27d52 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -1029,8 +1029,7 @@ Error Expression::_get_token(Token &r_token) { case 'f': res = 12; break; case 'r': res = 13; break; case 'u': { - //hexnumbarh - oct is deprecated - + // hex number for (int j = 0; j < 4; j++) { CharType c = GET_CHAR(); @@ -1055,7 +1054,7 @@ Error Expression::_get_token(Token &r_token) { v = c - 'A'; v += 10; } else { - ERR_PRINT("BUG"); + ERR_PRINT("Bug parsing hex constant."); v = 0; } @@ -1064,13 +1063,8 @@ Error Expression::_get_token(Token &r_token) { } } break; - //case '\"': res='\"'; break; - //case '\\': res='\\'; break; - //case '/': res='/'; break; default: { res = next; - //r_err_str="Invalid escape sequence"; - //return ERR_PARSE_ERROR; } break; } diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 4ce33b0123b..996b25308eb 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -235,8 +235,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri case 'f': res = 12; break; case 'r': res = 13; break; case 'u': { - //hexnumbarh - oct is deprecated - + //hex number for (int j = 0; j < 4; j++) { CharType c = p_stream->get_char(); if (c == 0) { @@ -260,7 +259,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri v = c - 'A'; v += 10; } else { - ERR_PRINT("BUG"); + ERR_PRINT("Bug parsing hex constant."); v = 0; } @@ -269,13 +268,8 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri } } break; - //case '\"': res='\"'; break; - //case '\\': res='\\'; break; - //case '/': res='/'; break; default: { res = next; - //r_err_str="Invalid escape sequence"; - //return ERR_PARSE_ERROR; } break; } @@ -866,198 +860,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, return ERR_PARSE_ERROR; } } -#ifndef DISABLE_DEPRECATED - } else if (id == "InputEvent") { - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_PARENTHESIS_OPEN) { - r_err_str = "Expected '('"; - return ERR_PARSE_ERROR; - } - - get_token(p_stream, token, line, r_err_str); - - if (token.type != TK_IDENTIFIER) { - r_err_str = "Expected identifier"; - return ERR_PARSE_ERROR; - } - - String id2 = token.value; - - Ref ie; - - if (id2 == "NONE") { - - get_token(p_stream, token, line, r_err_str); - - if (token.type != TK_PARENTHESIS_CLOSE) { - r_err_str = "Expected ')'"; - return ERR_PARSE_ERROR; - } - - } else if (id2 == "KEY") { - - Ref key; - key.instance(); - ie = key; - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_COMMA) { - r_err_str = "Expected ','"; - return ERR_PARSE_ERROR; - } - - get_token(p_stream, token, line, r_err_str); - if (token.type == TK_IDENTIFIER) { - String name = token.value; - key->set_scancode(find_keycode(name)); - } else if (token.type == TK_NUMBER) { - - key->set_scancode(token.value); - } else { - - r_err_str = "Expected string or integer for keycode"; - return ERR_PARSE_ERROR; - } - - get_token(p_stream, token, line, r_err_str); - - if (token.type == TK_COMMA) { - - get_token(p_stream, token, line, r_err_str); - - if (token.type != TK_IDENTIFIER) { - r_err_str = "Expected identifier with modifier flas"; - return ERR_PARSE_ERROR; - } - - String mods = token.value; - - if (mods.findn("C") != -1) - key->set_control(true); - if (mods.findn("A") != -1) - key->set_alt(true); - if (mods.findn("S") != -1) - key->set_shift(true); - if (mods.findn("M") != -1) - key->set_metakey(true); - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_PARENTHESIS_CLOSE) { - r_err_str = "Expected ')'"; - return ERR_PARSE_ERROR; - } - - } else if (token.type != TK_PARENTHESIS_CLOSE) { - - r_err_str = "Expected ')' or modifier flags."; - return ERR_PARSE_ERROR; - } - - } else if (id2 == "MBUTTON") { - - Ref mb; - mb.instance(); - ie = mb; - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_COMMA) { - r_err_str = "Expected ','"; - return ERR_PARSE_ERROR; - } - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_NUMBER) { - r_err_str = "Expected button index"; - return ERR_PARSE_ERROR; - } - - mb->set_button_index(token.value); - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_PARENTHESIS_CLOSE) { - r_err_str = "Expected ')'"; - return ERR_PARSE_ERROR; - } - - } else if (id2 == "JBUTTON") { - - Ref jb; - jb.instance(); - ie = jb; - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_COMMA) { - r_err_str = "Expected ','"; - return ERR_PARSE_ERROR; - } - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_NUMBER) { - r_err_str = "Expected button index"; - return ERR_PARSE_ERROR; - } - - jb->set_button_index(token.value); - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_PARENTHESIS_CLOSE) { - r_err_str = "Expected ')'"; - return ERR_PARSE_ERROR; - } - - } else if (id2 == "JAXIS") { - - Ref jm; - jm.instance(); - ie = jm; - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_COMMA) { - r_err_str = "Expected ','"; - return ERR_PARSE_ERROR; - } - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_NUMBER) { - r_err_str = "Expected axis index"; - return ERR_PARSE_ERROR; - } - - jm->set_axis(token.value); - - get_token(p_stream, token, line, r_err_str); - - if (token.type != TK_COMMA) { - r_err_str = "Expected ',' after axis index"; - return ERR_PARSE_ERROR; - } - - get_token(p_stream, token, line, r_err_str); - if (token.type != TK_NUMBER) { - r_err_str = "Expected axis sign"; - return ERR_PARSE_ERROR; - } - - jm->set_axis_value(token.value); - - get_token(p_stream, token, line, r_err_str); - - if (token.type != TK_PARENTHESIS_CLOSE) { - r_err_str = "Expected ')' for jaxis"; - return ERR_PARSE_ERROR; - } - - } else { - - r_err_str = "Invalid input event type."; - return ERR_PARSE_ERROR; - } - - value = ie; - - return OK; -#endif } else if (id == "PoolByteArray" || id == "ByteArray") { Vector args; diff --git a/doc/classes/InstancePlaceholder.xml b/doc/classes/InstancePlaceholder.xml index c1d920c2c17..39827f66041 100644 --- a/doc/classes/InstancePlaceholder.xml +++ b/doc/classes/InstancePlaceholder.xml @@ -4,8 +4,8 @@ Placeholder for the root [Node] of a [PackedScene]. - Turning on the option [b]Load As Placeholder[/b] for an instanced scene in the editor causes it to be replaced by an InstancePlaceholder when running the game. This makes it possible to delay actually loading the scene until calling [method replace_by_instance]. This is useful to avoid loading large scenes all at once by loading parts of it selectively. - The InstancePlaceholder does not have a transform. This causes any child nodes to be positioned relatively to the Viewport from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again. + Turning on the option [b]Load As Placeholder[/b] for an instanced scene in the editor causes it to be replaced by an [InstancePlaceholder] when running the game. This makes it possible to delay actually loading the scene until calling [method create_instance]. This is useful to avoid loading large scenes all at once by loading parts of it selectively. + The [InstancePlaceholder] does not have a transform. This causes any child nodes to be positioned relatively to the [Viewport] from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again. @@ -24,7 +24,7 @@ - Gets the path to the [PackedScene] resource file that is loaded by default when calling [method replace_by_instance]. + Gets the path to the [PackedScene] resource file that is loaded by default when calling [method create_instance]. @@ -35,15 +35,6 @@ - - - - - - - Replaces this placeholder by the scene handed as an argument, or the original scene if no argument is given. As for all resources, the scene is loaded only if it's not loaded already. By manually loading the scene beforehand, delays caused by this function can be avoided. - - diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index 661043b0831..85c9438d4f1 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -41,15 +41,6 @@ Returns the list of recognized extensions for a resource type. - - - - - - - [i]Deprecated method.[/i] Use [method has_cached] or [method exists] instead. - - diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index 9de10d12a82..1634db24843 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -592,17 +592,6 @@ To place in a scene, attach this directional light to an instance using [method instance_set_base] using the returned RID. - - - - - - - - - Draws a frame. [i]This method is deprecated[/i], please use [method force_draw] instead. - - @@ -942,7 +931,7 @@ - Returns [code]true[/code] if changes have been made to the VisualServer's data. [method draw] is usually called if this happens. + Returns [code]true[/code] if changes have been made to the VisualServer's data. [method force_draw] is usually called if this happens. @@ -2750,13 +2739,6 @@ To place in a scene, attach this spot light to an instance using [method instance_set_base] using the returned RID. - - - - - Not implemented in Godot 3.x. - - diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index c1684189722..a0b846beb0c 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -187,19 +187,11 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { TreeItem *item = tree->create_item(p_parent); item->set_text(0, p_node->get_name()); - if (can_rename && !part_of_subscene /*(p_node->get_owner() == get_scene_node() || p_node==get_scene_node())*/) + if (can_rename && !part_of_subscene) item->set_editable(0, true); item->set_selectable(0, true); if (can_rename) { -#ifndef DISABLE_DEPRECATED - if (p_node->has_meta("_editor_collapsed")) { - //remove previous way of storing folding, which did not get along with scene inheritance and instancing - if ((bool)p_node->get_meta("_editor_collapsed")) - p_node->set_display_folded(true); - p_node->set_meta("_editor_collapsed", Variant()); - } -#endif bool collapsed = p_node->is_displayed_folded(); if (collapsed) item->set_collapsed(true); @@ -497,21 +489,6 @@ void SceneTreeEditor::_node_script_changed(Node *p_node) { MessageQueue::get_singleton()->push_call(this, "_update_tree"); tree_dirty = true; - /* - changes the order :| - TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL; - if (p_node->get_script().is_null()) { - - int idx=item->get_button_by_id(0,2); - if (idx>=0) - item->erase_button(0,idx); - } else { - - int idx=item->get_button_by_id(0,2); - if (idx<0) - item->add_button(0,get_icon("Script","EditorIcons"),2); - - }*/ } void SceneTreeEditor::_node_removed(Node *p_node) { diff --git a/modules/bullet/cone_twist_joint_bullet.cpp b/modules/bullet/cone_twist_joint_bullet.cpp index afeafcc3565..23eb39fe7e1 100644 --- a/modules/bullet/cone_twist_joint_bullet.cpp +++ b/modules/bullet/cone_twist_joint_bullet.cpp @@ -82,8 +82,8 @@ void ConeTwistJointBullet::set_param(PhysicsServer::ConeTwistJointParam p_param, case PhysicsServer::CONE_TWIST_JOINT_RELAXATION: coneConstraint->setLimit(coneConstraint->getSwingSpan1(), coneConstraint->getSwingSpan2(), coneConstraint->getTwistSpan(), coneConstraint->getLimitSoftness(), coneConstraint->getBiasFactor(), p_value); break; - default: - WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); + case PhysicsServer::CONE_TWIST_MAX: + // Internal size value, nothing to do. break; } } @@ -100,8 +100,10 @@ real_t ConeTwistJointBullet::get_param(PhysicsServer::ConeTwistJointParam p_para return coneConstraint->getLimitSoftness(); case PhysicsServer::CONE_TWIST_JOINT_RELAXATION: return coneConstraint->getRelaxationFactor(); - default: - WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); + case PhysicsServer::CONE_TWIST_MAX: + // Internal size value, nothing to do. return 0; } + // Compiler doesn't seem to notice that all code paths are fulfilled... + return 0; } diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp index 86bedd6c455..45ab3d3bb20 100644 --- a/modules/bullet/generic_6dof_joint_bullet.cpp +++ b/modules/bullet/generic_6dof_joint_bullet.cpp @@ -173,6 +173,9 @@ void Generic6DOFJointBullet::set_param(Vector3::Axis p_axis, PhysicsServer::G6DO case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_equilibriumPoint = p_value; break; + case PhysicsServer::G6DOF_JOINT_MAX: + // Internal size value, nothing to do. + break; default: WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); break; @@ -214,6 +217,9 @@ real_t Generic6DOFJointBullet::get_param(Vector3::Axis p_axis, PhysicsServer::G6 return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_springDamping; case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_equilibriumPoint; + case PhysicsServer::G6DOF_JOINT_MAX: + // Internal size value, nothing to do. + return 0; default: WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); return 0; @@ -240,20 +246,20 @@ void Generic6DOFJointBullet::set_flag(Vector3::Axis p_axis, PhysicsServer::G6DOF sixDOFConstraint->setLimit(p_axis + 3, 0, -1); // Free } break; + case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING: + sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableSpring = p_value; + break; + case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING: + sixDOFConstraint->getTranslationalLimitMotor()->m_enableSpring[p_axis] = p_value; + break; case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR: sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableMotor = flags[p_axis][p_flag]; break; case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: sixDOFConstraint->getTranslationalLimitMotor()->m_enableMotor[p_axis] = flags[p_axis][p_flag]; break; - case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING: - sixDOFConstraint->getTranslationalLimitMotor()->m_enableSpring[p_axis] = p_value; - break; - case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING: - sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableSpring = p_value; - break; - default: - WARN_DEPRECATED_MSG("The flag " + itos(p_flag) + " is deprecated."); + case PhysicsServer::G6DOF_JOINT_FLAG_MAX: + // Internal size value, nothing to do. break; } } diff --git a/modules/bullet/hinge_joint_bullet.cpp b/modules/bullet/hinge_joint_bullet.cpp index 49e67bfbc19..970732688a4 100644 --- a/modules/bullet/hinge_joint_bullet.cpp +++ b/modules/bullet/hinge_joint_bullet.cpp @@ -95,6 +95,9 @@ real_t HingeJointBullet::get_hinge_angle() { void HingeJointBullet::set_param(PhysicsServer::HingeJointParam p_param, real_t p_value) { switch (p_param) { + case PhysicsServer::HINGE_JOINT_BIAS: + WARN_DEPRECATED_MSG("The HingeJoint parameter \"bias\" is deprecated."); + break; case PhysicsServer::HINGE_JOINT_LIMIT_UPPER: hingeConstraint->setLimit(hingeConstraint->getLowerLimit(), p_value, hingeConstraint->getLimitSoftness(), hingeConstraint->getLimitBiasFactor(), hingeConstraint->getLimitRelaxationFactor()); break; @@ -116,8 +119,8 @@ void HingeJointBullet::set_param(PhysicsServer::HingeJointParam p_param, real_t case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE: hingeConstraint->setMaxMotorImpulse(p_value); break; - default: - WARN_DEPRECATED_MSG("The HingeJoint parameter " + itos(p_param) + " is deprecated."); + case PhysicsServer::HINGE_JOINT_MAX: + // Internal size value, nothing to do. break; } } @@ -125,8 +128,8 @@ void HingeJointBullet::set_param(PhysicsServer::HingeJointParam p_param, real_t real_t HingeJointBullet::get_param(PhysicsServer::HingeJointParam p_param) const { switch (p_param) { case PhysicsServer::HINGE_JOINT_BIAS: + WARN_DEPRECATED_MSG("The HingeJoint parameter \"bias\" is deprecated."); return 0; - break; case PhysicsServer::HINGE_JOINT_LIMIT_UPPER: return hingeConstraint->getUpperLimit(); case PhysicsServer::HINGE_JOINT_LIMIT_LOWER: @@ -141,10 +144,12 @@ real_t HingeJointBullet::get_param(PhysicsServer::HingeJointParam p_param) const return hingeConstraint->getMotorTargetVelocity(); case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE: return hingeConstraint->getMaxMotorImpulse(); - default: - WARN_DEPRECATED_MSG("The HingeJoint parameter " + itos(p_param) + " is deprecated."); + case PhysicsServer::HINGE_JOINT_MAX: + // Internal size value, nothing to do. return 0; } + // Compiler doesn't seem to notice that all code paths are fulfilled... + return 0; } void HingeJointBullet::set_flag(PhysicsServer::HingeJointFlag p_flag, bool p_value) { diff --git a/modules/bullet/pin_joint_bullet.cpp b/modules/bullet/pin_joint_bullet.cpp index 1c2e5e65ccc..8d109f18662 100644 --- a/modules/bullet/pin_joint_bullet.cpp +++ b/modules/bullet/pin_joint_bullet.cpp @@ -84,10 +84,9 @@ real_t PinJointBullet::get_param(PhysicsServer::PinJointParam p_param) const { return p2pConstraint->m_setting.m_damping; case PhysicsServer::PIN_JOINT_IMPULSE_CLAMP: return p2pConstraint->m_setting.m_impulseClamp; - default: - WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); - return 0; } + // Compiler doesn't seem to notice that all code paths are fulfilled... + return 0; } void PinJointBullet::setPivotInA(const Vector3 &p_pos) { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 84ac13f45ef..fae6fbbb0cf 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -4099,10 +4099,6 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { _ADVANCE_AND_CONSUME_NEWLINES; - if (tokenizer->get_token() == GDScriptTokenizer::TK_PARENTHESIS_CLOSE) { - WARN_DEPRECATED_MSG("Exporting bit flags hint requires string constants."); - break; - } if (tokenizer->get_token() != GDScriptTokenizer::TK_COMMA) { _set_error("Expected \",\" in the bit flags hint."); return; diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 8e28b7215be..a0e0811c1f1 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -810,7 +810,7 @@ void GDScriptTokenizerText::_advance() { break; //wtf case 'u': { - //hexnumbarh - oct is deprecated + // hex number i += 1; for (int j = 0; j < 4; j++) { CharType c = GETCHAR(i + j); diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs index 55408fecb8a..baf470a0ccc 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs @@ -266,12 +266,6 @@ namespace Godot this[index] = value; } - [Obsolete("GetAxis is deprecated. Use GetColumn instead.")] - public Vector3 GetAxis(int axis) - { - return new Vector3(this.Row0[axis], this.Row1[axis], this.Row2[axis]); - } - public int GetOrthogonalIndex() { var orth = this; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs index 6702634c510..bbc617ea6e3 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs @@ -104,33 +104,6 @@ namespace Godot return this / Length; } - [Obsolete("Set is deprecated. Use the Quat(" + nameof(real_t) + ", " + nameof(real_t) + ", " + nameof(real_t) + ", " + nameof(real_t) + ") constructor instead.", error: true)] - public void Set(real_t x, real_t y, real_t z, real_t w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - [Obsolete("Set is deprecated. Use the Quat(" + nameof(Quat) + ") constructor instead.", error: true)] - public void Set(Quat q) - { - this = q; - } - - [Obsolete("SetAxisAngle is deprecated. Use the Quat(" + nameof(Vector3) + ", " + nameof(real_t) + ") constructor instead.", error: true)] - public void SetAxisAngle(Vector3 axis, real_t angle) - { - this = new Quat(axis, angle); - } - - [Obsolete("SetEuler is deprecated. Use the Quat(" + nameof(Vector3) + ") constructor instead.", error: true)] - public void SetEuler(Vector3 eulerYXZ) - { - this = new Quat(eulerYXZ); - } - public Quat Slerp(Quat b, real_t t) { #if DEBUG diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index f92453f546c..385bfed122e 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs @@ -248,19 +248,6 @@ namespace Godot return new Vector2(Mathf.Round(x), Mathf.Round(y)); } - [Obsolete("Set is deprecated. Use the Vector2(" + nameof(real_t) + ", " + nameof(real_t) + ") constructor instead.", error: true)] - public void Set(real_t x, real_t y) - { - this.x = x; - this.y = y; - } - [Obsolete("Set is deprecated. Use the Vector2(" + nameof(Vector2) + ") constructor instead.", error: true)] - public void Set(Vector2 v) - { - x = v.x; - y = v.y; - } - public Vector2 Sign() { Vector2 v; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index fded34002df..390036c6546 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -270,21 +270,6 @@ namespace Godot return new Basis(axis, phi).Xform(this); } - [Obsolete("Set is deprecated. Use the Vector3(" + nameof(real_t) + ", " + nameof(real_t) + ", " + nameof(real_t) + ") constructor instead.", error: true)] - public void Set(real_t x, real_t y, real_t z) - { - this.x = x; - this.y = y; - this.z = z; - } - [Obsolete("Set is deprecated. Use the Vector3(" + nameof(Vector3) + ") constructor instead.", error: true)] - public void Set(Vector3 v) - { - x = v.x; - y = v.y; - z = v.z; - } - public Vector3 Sign() { Vector3 v; diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 4feef53c2e5..63880df21d9 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -392,8 +392,7 @@ Error VisualScriptExpression::_get_token(Token &r_token) { case 'f': res = 12; break; case 'r': res = 13; break; case 'u': { - //hexnumbarh - oct is deprecated - + // hex number for (int j = 0; j < 4; j++) { CharType c = GET_CHAR(); @@ -418,7 +417,7 @@ Error VisualScriptExpression::_get_token(Token &r_token) { v = c - 'A'; v += 10; } else { - ERR_PRINT("BUG"); + ERR_PRINT("Bug parsing hex constant."); v = 0; } @@ -427,13 +426,8 @@ Error VisualScriptExpression::_get_token(Token &r_token) { } } break; - //case '\"': res='\"'; break; - //case '\\': res='\\'; break; - //case '/': res='/'; break; default: { res = next; - //r_err_str="Invalid escape sequence"; - //return ERR_PARSE_ERROR; } break; } diff --git a/scene/3d/world_environment.cpp b/scene/3d/world_environment.cpp index a4c990c81d6..83a72439066 100644 --- a/scene/3d/world_environment.cpp +++ b/scene/3d/world_environment.cpp @@ -121,7 +121,7 @@ String WorldEnvironment::get_configuration_warning() const { return TTR("WorldEnvironment requires its \"Environment\" property to contain an Environment to have a visible effect."); } - if (/*!is_visible_in_tree() ||*/ !is_inside_tree()) + if (!is_inside_tree()) return String(); List nodes; @@ -131,11 +131,6 @@ String WorldEnvironment::get_configuration_warning() const { return TTR("Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."); } - // Commenting this warning for now, I think it makes no sense. If anyone can figure out what its supposed to do, feedback welcome. Else it should be deprecated. - //if (environment.is_valid() && get_viewport() && !get_viewport()->get_camera() && environment->get_background() != Environment::BG_CANVAS) { - // return TTR("This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set this environment's Background Mode to Canvas (for 2D scenes)."); - //} - return String(); } diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index 0128d1a2180..f1b3f919200 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -112,11 +112,6 @@ Node *InstancePlaceholder::create_instance(bool p_replace, const Ref &p_custom_scene) { - //Deprecated by - create_instance(true, p_custom_scene); -} - Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) { Dictionary ret; @@ -138,7 +133,6 @@ void InstancePlaceholder::_bind_methods() { ClassDB::bind_method(D_METHOD("get_stored_values", "with_order"), &InstancePlaceholder::get_stored_values, DEFVAL(false)); ClassDB::bind_method(D_METHOD("create_instance", "replace", "custom_scene"), &InstancePlaceholder::create_instance, DEFVAL(false), DEFVAL(Variant())); - ClassDB::bind_method(D_METHOD("replace_by_instance", "custom_scene"), &InstancePlaceholder::replace_by_instance, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("get_instance_path"), &InstancePlaceholder::get_instance_path); } diff --git a/scene/main/instance_placeholder.h b/scene/main/instance_placeholder.h index d570b8c2479..9f7b84716df 100644 --- a/scene/main/instance_placeholder.h +++ b/scene/main/instance_placeholder.h @@ -61,7 +61,6 @@ public: Dictionary get_stored_values(bool p_with_order = false); Node *create_instance(bool p_replace = false, const Ref &p_custom_scene = Ref()); - void replace_by_instance(const Ref &p_custom_scene = Ref()); InstancePlaceholder(); }; diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 6a7971ddb33..8ceac74bb84 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2998,11 +2998,6 @@ void Node::_bind_methods() { ADD_GROUP("Pause", "pause_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "pause_mode", PROPERTY_HINT_ENUM, "Inherit,Stop,Process"), "set_pause_mode", "get_pause_mode"); -#ifdef ENABLE_DEPRECATED - //no longer exists, but remains for compatibility (keep previous scenes folded - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor/display_folded", PROPERTY_HINT_NONE, "", 0), "set_display_folded", "is_displayed_folded"); -#endif - ADD_PROPERTY(PropertyInfo(Variant::STRING, "name", PROPERTY_HINT_NONE, "", 0), "set_name", "get_name"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "filename", PROPERTY_HINT_NONE, "", 0), "set_filename", "get_filename"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_owner", "get_owner"); diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 779c63111a0..40f24ece87a 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -734,7 +734,6 @@ void register_scene_types() { ClassDB::register_virtual_class(); //sorry, you can't create it #ifndef DISABLE_DEPRECATED - ClassDB::add_compatibility_class("ImageSkyBox", "PanoramaSky"); ClassDB::add_compatibility_class("SpatialMaterial", "StandardMaterial3D"); ClassDB::add_compatibility_class("Mesh", "ArrayMesh"); ClassDB::add_compatibility_class("AnimationTreePlayer", "AnimationTree"); diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 285b11fefd3..6790f021282 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -815,6 +815,7 @@ float Environment::get_fog_height_curve() const { } #ifndef DISABLE_DEPRECATED +// Kept for compatibility from 3.x to 4.0. bool Environment::_set(const StringName &p_name, const Variant &p_value) { if (p_name == "background_sky") { set_sky(p_value); @@ -822,6 +823,10 @@ bool Environment::_set(const StringName &p_name, const Variant &p_value) { } else if (p_name == "background_sky_custom_fov") { set_sky_custom_fov(p_value); return true; + } else if (p_name == "background_sky_orientation") { + Vector3 euler = p_value.operator Basis().get_euler(); + set_sky_rotation(euler); + return true; } else { return false; } diff --git a/scene/resources/environment.h b/scene/resources/environment.h index 4360ceeca35..f9fe26f792c 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -170,6 +170,7 @@ protected: static void _bind_methods(); virtual void _validate_property(PropertyInfo &property) const; #ifndef DISABLE_DEPRECATED + // Kept for compatibility from 3.x to 4.0. bool _set(const StringName &p_name, const Variant &p_value); #endif diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 1255bb8a87d..01e3c4c9306 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -2598,8 +2598,9 @@ BaseMaterial3D::~BaseMaterial3D() { } ////////////////////// -#ifndef DISABLE_DEPRECATED +#ifndef DISABLE_DEPRECATED +// Kept for compatibility from 3.x to 4.0. bool StandardMaterial3D::_set(const StringName &p_name, const Variant &p_value) { if (p_name == "flags_transparent") { bool transparent = p_value; @@ -2686,5 +2687,4 @@ bool StandardMaterial3D::_set(const StringName &p_name, const Variant &p_value) return false; } - -#endif +#endif // DISABLE_DEPRECATED diff --git a/scene/resources/material.h b/scene/resources/material.h index 328c868f2a6..8c5a648058c 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -697,6 +697,7 @@ class StandardMaterial3D : public BaseMaterial3D { GDCLASS(StandardMaterial3D, BaseMaterial3D) protected: #ifndef DISABLE_DEPRECATED + // Kept for compatibility from 3.x to 4.0. bool _set(const StringName &p_name, const Variant &p_value); #endif diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 6049d96feec..58463abad81 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -743,6 +743,7 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) { } #ifndef DISABLE_DEPRECATED + // Kept for compatibility from 3.x to 4.0. if (!sname.begins_with("surfaces")) return false; @@ -841,8 +842,7 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) { return true; } - -#endif +#endif // DISABLE_DEPRECATED return false; } diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 946511c7669..9c34ae05049 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -29,9 +29,11 @@ /*************************************************************************/ #include "multimesh.h" + #include "servers/visual_server.h" #ifndef DISABLE_DEPRECATED +// Kept for compatibility from 3.x to 4.0. void MultiMesh::_set_transform_array(const PoolVector &p_array) { if (transform_format != TRANSFORM_3D) @@ -193,8 +195,8 @@ PoolVector MultiMesh::_get_custom_data_array() const { return custom_datas; } +#endif // DISABLE_DEPRECATED -#endif void MultiMesh::set_buffer(const PoolVector &p_buffer) { VS::get_singleton()->multimesh_set_buffer(multimesh, p_buffer); } @@ -351,8 +353,7 @@ void MultiMesh::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::POOL_REAL_ARRAY, "buffer", PROPERTY_HINT_NONE), "set_buffer", "get_buffer"); #ifndef DISABLE_DEPRECATED - //kept for compatibility - + // Kept for compatibility from 3.x to 4.0. ClassDB::bind_method(D_METHOD("_set_transform_array"), &MultiMesh::_set_transform_array); ClassDB::bind_method(D_METHOD("_get_transform_array"), &MultiMesh::_get_transform_array); ClassDB::bind_method(D_METHOD("_set_transform_2d_array"), &MultiMesh::_set_transform_2d_array); @@ -367,6 +368,7 @@ void MultiMesh::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::POOL_COLOR_ARRAY, "color_array", PROPERTY_HINT_NONE, "", 0), "_set_color_array", "_get_color_array"); ADD_PROPERTY(PropertyInfo(Variant::POOL_COLOR_ARRAY, "custom_data_array", PROPERTY_HINT_NONE, "", 0), "_set_custom_data_array", "_get_custom_data_array"); #endif + BIND_ENUM_CONSTANT(TRANSFORM_2D); BIND_ENUM_CONSTANT(TRANSFORM_3D); } diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h index e7d62d0993e..5423e663580 100644 --- a/scene/resources/multimesh.h +++ b/scene/resources/multimesh.h @@ -58,7 +58,7 @@ protected: static void _bind_methods(); #ifndef DISABLE_DEPRECATED - + // Kept for compatibility from 3.x to 4.0. void _set_transform_array(const PoolVector &p_array); PoolVector _get_transform_array() const; diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index b345a2ea771..83efbabc364 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -1583,12 +1583,6 @@ void VisualServer::_bind_methods() { ClassDB::bind_method(D_METHOD("force_sync"), &VisualServer::sync); ClassDB::bind_method(D_METHOD("force_draw", "swap_buffers", "frame_step"), &VisualServer::draw, DEFVAL(true), DEFVAL(0.0)); - // "draw" and "sync" are deprecated duplicates of "force_draw" and "force_sync" - // FIXME: Add deprecation messages using GH-4397 once available, and retire - // once the warnings have been enabled for a full release cycle - ClassDB::bind_method(D_METHOD("sync"), &VisualServer::sync); - ClassDB::bind_method(D_METHOD("draw", "swap_buffers", "frame_step"), &VisualServer::draw, DEFVAL(true), DEFVAL(0.0)); - #ifndef _MSC_VER #warning TODO all texture methods need re-binding #endif