Skip to content

Commit 23141a4

Browse files
committed
Merge tag '4.5.1-stable' into work2
2 parents 8a679d1 + f62fdbd commit 23141a4

251 files changed

Lines changed: 62863 additions & 8412 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 166 additions & 18 deletions
Large diffs are not rendered by default.

SConstruct

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ opts.Add(
210210
)
211211
)
212212
opts.Add(BoolVariable("tests", "Build the unit tests", False))
213-
opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster rebuilds", False))
213+
opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster incremental builds", False))
214214
opts.Add(BoolVariable("ninja", "Use the ninja backend for faster rebuilds", False))
215215
opts.Add(BoolVariable("ninja_auto_run", "Run ninja automatically after generating the ninja file", True))
216216
opts.Add("ninja_file", "Path to the generated ninja file", "build.ninja")
@@ -469,16 +469,6 @@ for tool in custom_tools:
469469
# Add default include paths.
470470
env.Prepend(CPPPATH=["#"])
471471

472-
# Allow marking includes as external/system to avoid raising warnings.
473-
env["_CCCOMCOM"] += " $_CPPEXTINCFLAGS"
474-
env["CPPEXTPATH"] = []
475-
if env.scons_version < (4, 2):
476-
env["_CPPEXTINCFLAGS"] = "${_concat(EXTINCPREFIX, CPPEXTPATH, EXTINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}"
477-
else:
478-
env["_CPPEXTINCFLAGS"] = (
479-
"${_concat(EXTINCPREFIX, CPPEXTPATH, EXTINCSUFFIX, __env__, RDirs, TARGET, SOURCE, affect_signature=False)}"
480-
)
481-
482472
# configure ENV for platform
483473
env.platform_exporters = platform_exporters
484474
env.platform_apis = platform_apis
@@ -530,10 +520,10 @@ env.Decider("MD5-timestamp")
530520

531521
# SCons speed optimization controlled by the `fast_unsafe` option, which provide
532522
# more than 10 s speed up for incremental rebuilds.
533-
# Unsafe as they reduce the certainty of rebuilding all changed files, so it's
534-
# enabled by default for `debug` builds, and can be overridden from command line.
523+
# Unsafe as they reduce the certainty of rebuilding all changed files.
524+
# If you use it and run into corrupted incremental builds, try to turn it off.
535525
# Ref: https://github.com/SCons/scons/wiki/GoFastButton
536-
if methods.get_cmdline_bool("fast_unsafe", env.dev_build):
526+
if env["fast_unsafe"]:
537527
env.SetOption("implicit_cache", 1)
538528
env.SetOption("max_drift", 60)
539529

@@ -965,19 +955,6 @@ else: # GCC, Clang
965955
if env["werror"]:
966956
env.AppendUnique(CCFLAGS=["-Werror"])
967957

968-
# Configure external includes.
969-
if env.msvc:
970-
if not methods.using_clang(env):
971-
if cc_version_major < 16 or (cc_version_major == 16 and cc_version_minor < 10):
972-
env.AppendUnique(CCFLAGS=["/experimental:external"])
973-
env.AppendUnique(CCFLAGS=["/external:anglebrackets"])
974-
env.AppendUnique(CCFLAGS=["/external:W0"])
975-
env["EXTINCPREFIX"] = "/external:I"
976-
env["EXTINCSUFFIX"] = ""
977-
else:
978-
env["EXTINCPREFIX"] = "-isystem "
979-
env["EXTINCSUFFIX"] = ""
980-
981958
if hasattr(detect, "get_program_suffix"):
982959
suffix = "." + detect.get_program_suffix()
983960
else:

core/SCsub

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ if env["brotli"] and env["builtin_brotli"]:
5151
]
5252
thirdparty_brotli_sources = [thirdparty_brotli_dir + file for file in thirdparty_brotli_sources]
5353

54-
env_thirdparty.Prepend(CPPEXTPATH=[thirdparty_brotli_dir + "include"])
55-
env.Prepend(CPPEXTPATH=[thirdparty_brotli_dir + "include"])
54+
env_thirdparty.Prepend(CPPPATH=[thirdparty_brotli_dir + "include"])
55+
env.Prepend(CPPPATH=[thirdparty_brotli_dir + "include"])
5656

5757
if env.get("use_ubsan") or env.get("use_asan") or env.get("use_tsan") or env.get("use_lsan") or env.get("use_msan"):
5858
env_thirdparty.Append(CPPDEFINES=["BROTLI_BUILD_PORTABLE"])
@@ -69,8 +69,8 @@ if env["builtin_clipper2"]:
6969
]
7070
thirdparty_clipper_sources = [thirdparty_clipper_dir + file for file in thirdparty_clipper_sources]
7171

72-
env_thirdparty.Prepend(CPPEXTPATH=[thirdparty_clipper_dir + "include"])
73-
env.Prepend(CPPEXTPATH=[thirdparty_clipper_dir + "include"])
72+
env_thirdparty.Prepend(CPPPATH=[thirdparty_clipper_dir + "include"])
73+
env.Prepend(CPPPATH=[thirdparty_clipper_dir + "include"])
7474

7575
env_thirdparty.Append(CPPDEFINES=["CLIPPER2_ENABLED"])
7676
env.Append(CPPDEFINES=["CLIPPER2_ENABLED"])
@@ -94,9 +94,9 @@ if env["builtin_zlib"]:
9494
]
9595
thirdparty_zlib_sources = [thirdparty_zlib_dir + file for file in thirdparty_zlib_sources]
9696

97-
env_thirdparty.Prepend(CPPEXTPATH=[thirdparty_zlib_dir])
97+
env_thirdparty.Prepend(CPPPATH=[thirdparty_zlib_dir])
9898
# Needs to be available in main env too
99-
env.Prepend(CPPEXTPATH=[thirdparty_zlib_dir])
99+
env.Prepend(CPPPATH=[thirdparty_zlib_dir])
100100
if env.dev_build:
101101
env_thirdparty.Append(CPPDEFINES=["ZLIB_DEBUG"])
102102
# Affects headers so it should also be defined for Godot code
@@ -151,9 +151,9 @@ if env["builtin_zstd"]:
151151
thirdparty_zstd_sources.append("decompress/huf_decompress_amd64.S")
152152
thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]
153153

154-
env_thirdparty.Prepend(CPPEXTPATH=[thirdparty_zstd_dir, thirdparty_zstd_dir + "common"])
154+
env_thirdparty.Prepend(CPPPATH=[thirdparty_zstd_dir, thirdparty_zstd_dir + "common"])
155155
env_thirdparty.Append(CPPDEFINES=["ZSTD_STATIC_LINKING_ONLY"])
156-
env.Prepend(CPPEXTPATH=thirdparty_zstd_dir)
156+
env.Prepend(CPPPATH=thirdparty_zstd_dir)
157157
# Also needed in main env includes will trigger warnings
158158
env.Append(CPPDEFINES=["ZSTD_STATIC_LINKING_ONLY"])
159159

core/config/project_settings.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,14 @@ ProjectSettings::ProjectSettings() {
17321732
GLOBAL_DEF("navigation/baking/thread_model/baking_use_multiple_threads", true);
17331733
GLOBAL_DEF("navigation/baking/thread_model/baking_use_high_priority_threads", true);
17341734
#endif // !defined(NAVIGATION_2D_DISABLED) || !defined(NAVIGATION_3D_DISABLED)
1735+
#ifndef NAVIGATION_2D_DISABLED
1736+
GLOBAL_DEF("navigation/2d/warnings/navmesh_edge_merge_errors", true);
1737+
GLOBAL_DEF("navigation/2d/warnings/navmesh_cell_size_mismatch", true);
1738+
#endif // NAVIGATION_2D_DISABLED
1739+
#ifndef NAVIGATION_3D_DISABLED
1740+
GLOBAL_DEF("navigation/3d/warnings/navmesh_edge_merge_errors", true);
1741+
GLOBAL_DEF("navigation/3d/warnings/navmesh_cell_size_mismatch", true);
1742+
#endif // NAVIGATION_3D_DISABLED
17351743

17361744
ProjectSettings::get_singleton()->add_hidden_prefix("input/");
17371745
}

core/crypto/SCsub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if is_builtin or not has_module:
1313
# Use our headers for builtin or if the module is not going to be compiled.
1414
# We decided not to depend on system mbedtls just for these few files that can
1515
# be easily extracted.
16-
env_crypto.Prepend(CPPEXTPATH=["#thirdparty/mbedtls/include"])
16+
env_crypto.Prepend(CPPPATH=["#thirdparty/mbedtls/include"])
1717

1818
# MbedTLS core functions (for CryptoCore).
1919
# If the mbedtls module is compiled we don't need to add the .c files with our

core/extension/extension_api_dump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static String fix_doc_description(const String &p_bbcode) {
9696
// Based on what EditorHelp does.
9797

9898
return p_bbcode.dedent()
99-
.remove_chars("\t\r")
99+
.remove_chars("\r")
100100
.strip_edges();
101101
}
102102

core/extension/gdextension.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ void GDExtension::_register_extension_class(GDExtensionClassLibraryPtr p_library
267267
};
268268

269269
const ClassCreationDeprecatedInfo legacy = {
270+
false,
270271
p_extension_funcs->notification_func, // GDExtensionClassNotification notification_func;
271272
p_extension_funcs->free_property_list_func, // GDExtensionClassFreePropertyList free_property_list_func;
272273
p_extension_funcs->create_instance_func, // GDExtensionClassCreateInstance create_instance_func;
@@ -281,7 +282,7 @@ void GDExtension::_register_extension_class2(GDExtensionClassLibraryPtr p_librar
281282
const GDExtensionClassCreationInfo5 class_info5 = {
282283
p_extension_funcs->is_virtual, // GDExtensionBool is_virtual;
283284
p_extension_funcs->is_abstract, // GDExtensionBool is_abstract;
284-
true, // GDExtensionBool is_exposed;
285+
p_extension_funcs->is_exposed, // GDExtensionBool is_exposed;
285286
false, // GDExtensionBool is_runtime;
286287
nullptr, // GDExtensionConstStringPtr icon_path;
287288
p_extension_funcs->set_func, // GDExtensionClassSet set_func;
@@ -305,6 +306,7 @@ void GDExtension::_register_extension_class2(GDExtensionClassLibraryPtr p_librar
305306
};
306307

307308
const ClassCreationDeprecatedInfo legacy = {
309+
!p_extension_funcs->is_exposed, // bool legacy_unexposed_class;
308310
nullptr, // GDExtensionClassNotification notification_func;
309311
p_extension_funcs->free_property_list_func, // GDExtensionClassFreePropertyList free_property_list_func;
310312
p_extension_funcs->create_instance_func, // GDExtensionClassCreateInstance create_instance_func;
@@ -319,7 +321,7 @@ void GDExtension::_register_extension_class3(GDExtensionClassLibraryPtr p_librar
319321
const GDExtensionClassCreationInfo5 class_info5 = {
320322
p_extension_funcs->is_virtual, // GDExtensionBool is_virtual;
321323
p_extension_funcs->is_abstract, // GDExtensionBool is_abstract;
322-
true, // GDExtensionBool is_exposed;
324+
p_extension_funcs->is_exposed, // GDExtensionBool is_exposed;
323325
p_extension_funcs->is_runtime, // GDExtensionBool is_runtime;
324326
nullptr, // GDExtensionConstStringPtr icon_path;
325327
p_extension_funcs->set_func, // GDExtensionClassSet set_func;
@@ -343,6 +345,7 @@ void GDExtension::_register_extension_class3(GDExtensionClassLibraryPtr p_librar
343345
};
344346

345347
const ClassCreationDeprecatedInfo legacy = {
348+
!p_extension_funcs->is_exposed, // bool legacy_unexposed_class;
346349
nullptr, // GDExtensionClassNotification notification_func;
347350
nullptr, // GDExtensionClassFreePropertyList free_property_list_func;
348351
p_extension_funcs->create_instance_func, // GDExtensionClassCreateInstance2 create_instance_func;
@@ -355,9 +358,16 @@ void GDExtension::_register_extension_class3(GDExtensionClassLibraryPtr p_librar
355358

356359
void GDExtension::_register_extension_class4(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringNamePtr p_parent_class_name, const GDExtensionClassCreationInfo4 *p_extension_funcs) {
357360
GDExtensionClassCreationInfo5 class_info5 = *p_extension_funcs;
358-
// Force classes to be exposed, because the behavior of unexposed classes changed in an incompatible (albeit, minor) way.
359-
class_info5.is_exposed = true;
360-
_register_extension_class_internal(p_library, p_class_name, p_parent_class_name, &class_info5);
361+
const ClassCreationDeprecatedInfo legacy = {
362+
!p_extension_funcs->is_exposed, // bool legacy_unexposed_class;
363+
nullptr, // GDExtensionClassNotification notification_func;
364+
nullptr, // GDExtensionClassFreePropertyList free_property_list_func;
365+
nullptr, // GDExtensionClassCreateInstance2 create_instance_func;
366+
nullptr, // GDExtensionClassGetRID get_rid;
367+
nullptr, // GDExtensionClassGetVirtual get_virtual_func;
368+
nullptr, // GDExtensionClassGetVirtual get_virtual_func;
369+
};
370+
_register_extension_class_internal(p_library, p_class_name, p_parent_class_name, &class_info5, &legacy);
361371
}
362372
#endif // DISABLE_DEPRECATED
363373

@@ -447,6 +457,7 @@ void GDExtension::_register_extension_class_internal(GDExtensionClassLibraryPtr
447457
extension->gdextension.validate_property = p_extension_funcs->validate_property_func;
448458
#ifndef DISABLE_DEPRECATED
449459
if (p_deprecated_funcs) {
460+
extension->gdextension.legacy_unexposed_class = p_deprecated_funcs->legacy_unexposed_class;
450461
extension->gdextension.notification = p_deprecated_funcs->notification_func;
451462
extension->gdextension.free_property_list = p_deprecated_funcs->free_property_list_func;
452463
extension->gdextension.create_instance = p_deprecated_funcs->create_instance_func;

core/extension/gdextension.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class GDExtension : public Resource {
6767

6868
struct ClassCreationDeprecatedInfo {
6969
#ifndef DISABLE_DEPRECATED
70+
bool legacy_unexposed_class = false;
7071
GDExtensionClassNotification notification_func = nullptr;
7172
GDExtensionClassFreePropertyList free_property_list_func = nullptr;
7273
GDExtensionClassCreateInstance create_instance_func = nullptr;

core/math/a_star_grid_2d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ void AStarGrid2D::_bind_methods() {
783783
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "jumping_enabled"), "set_jumping_enabled", "is_jumping_enabled");
784784
ADD_PROPERTY(PropertyInfo(Variant::INT, "default_compute_heuristic", PROPERTY_HINT_ENUM, "Euclidean,Manhattan,Octile,Chebyshev"), "set_default_compute_heuristic", "get_default_compute_heuristic");
785785
ADD_PROPERTY(PropertyInfo(Variant::INT, "default_estimate_heuristic", PROPERTY_HINT_ENUM, "Euclidean,Manhattan,Octile,Chebyshev"), "set_default_estimate_heuristic", "get_default_estimate_heuristic");
786-
ADD_PROPERTY(PropertyInfo(Variant::INT, "diagonal_mode", PROPERTY_HINT_ENUM, "Never,Always,At Least One Walkable,Only If No Obstacles"), "set_diagonal_mode", "get_diagonal_mode");
786+
ADD_PROPERTY(PropertyInfo(Variant::INT, "diagonal_mode", PROPERTY_HINT_ENUM, "Always,Never,At Least One Walkable,Only If No Obstacles"), "set_diagonal_mode", "get_diagonal_mode");
787787

788788
BIND_ENUM_CONSTANT(HEURISTIC_EUCLIDEAN);
789789
BIND_ENUM_CONSTANT(HEURISTIC_MANHATTAN);

core/object/class_db.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,12 @@ Object *ClassDB::_instantiate_internal(const StringName &p_class, bool p_require
545545
}
546546
ERR_FAIL_NULL_V_MSG(ti, nullptr, vformat("Cannot get class '%s'.", String(p_class)));
547547
ERR_FAIL_COND_V_MSG(ti->disabled, nullptr, vformat("Class '%s' is disabled.", String(p_class)));
548+
#ifndef DISABLE_DEPRECATED
549+
// Force legacy unexposed classes to skip the exposed check to preserve backcompat.
550+
if (ti->gdextension && ti->gdextension->legacy_unexposed_class) {
551+
p_exposed_only = false;
552+
}
553+
#endif // DISABLE_DEPRECATED
548554
if (p_exposed_only) {
549555
ERR_FAIL_COND_V_MSG(!ti->exposed, nullptr, vformat("Class '%s' isn't exposed.", String(p_class)));
550556
}
@@ -604,6 +610,13 @@ bool ClassDB::_can_instantiate(ClassInfo *p_class_info, bool p_exposed_only) {
604610
return false;
605611
}
606612

613+
#ifndef DISABLE_DEPRECATED
614+
// Force legacy unexposed classes to skip the exposed check to preserve backcompat.
615+
if (p_class_info->gdextension && p_class_info->gdextension->legacy_unexposed_class) {
616+
p_exposed_only = false;
617+
}
618+
#endif // DISABLE_DEPRECATED
619+
607620
if (p_exposed_only && !p_class_info->exposed) {
608621
return false;
609622
}

0 commit comments

Comments
 (0)