Skip to content

Commit

Permalink
Merge pull request #44795 from akien-mga/3.2-cherrypicks
Browse files Browse the repository at this point in the history
Cherry-picks for the 3.2 branch (future 3.2.4) - 14th batch
  • Loading branch information
akien-mga authored Dec 29, 2020
2 parents d839afd + caa7c6a commit 541bc18
Show file tree
Hide file tree
Showing 173 changed files with 15,451 additions and 2,144 deletions.
92 changes: 47 additions & 45 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ opts.Add(EnumVariable("target", "Compilation target", "debug", ("debug", "releas
opts.Add(EnumVariable("optimize", "Optimization type", "speed", ("speed", "size")))
opts.Add(BoolVariable("tools", "Build the tools (a.k.a. the Godot editor)", True))
opts.Add(BoolVariable("use_lto", "Use link-time optimization", False))
opts.Add(BoolVariable("use_precise_math_checks", "Math checks use very precise epsilon (debug option)", False))

# Components
opts.Add(BoolVariable("deprecated", "Enable deprecated features", True))
Expand All @@ -130,7 +129,6 @@ opts.Add(BoolVariable("werror", "Treat compiler warnings as errors", False))
opts.Add(BoolVariable("dev", "If yes, alias for verbose=yes warnings=extra werror=yes", False))
opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all generated binary files", "")
opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False))
opts.Add(EnumVariable("macports_clang", "Build using Clang from MacPorts", "no", ("no", "5.0", "devel")))
opts.Add(
BoolVariable(
"split_libmodules",
Expand All @@ -142,9 +140,9 @@ opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable",
opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False))
opts.Add(BoolVariable("no_editor_splash", "Don't use the custom splash screen for the editor", False))
opts.Add("system_certs_path", "Use this path as SSL certificates default for editor (for package maintainers)", "")
opts.Add(BoolVariable("use_precise_math_checks", "Math checks use very precise epsilon (debug option)", False))

# Thirdparty libraries
# opts.Add(BoolVariable('builtin_assimp', "Use the built-in Assimp library", True))
opts.Add(BoolVariable("builtin_bullet", "Use the built-in Bullet library", True))
opts.Add(BoolVariable("builtin_certs", "Use the built-in SSL certificates bundles", True))
opts.Add(BoolVariable("builtin_enet", "Use the built-in ENet library", True))
Expand Down Expand Up @@ -176,16 +174,54 @@ opts.Add("CFLAGS", "Custom flags for the C compiler")
opts.Add("CXXFLAGS", "Custom flags for the C++ compiler")
opts.Add("LINKFLAGS", "Custom flags for the linker")

# add platform specific options
# Update the environment to have all above options defined
# in following code (especially platform and custom_modules).
opts.Update(env_base)

# Platform selection: validate input, and add options.

selected_platform = ""

if env_base["platform"] != "":
selected_platform = env_base["platform"]
elif env_base["p"] != "":
selected_platform = env_base["p"]
else:
# Missing `platform` argument, try to detect platform automatically
if sys.platform.startswith("linux"):
selected_platform = "x11"
elif sys.platform == "darwin":
selected_platform = "osx"
elif sys.platform == "win32":
selected_platform = "windows"
else:
print("Could not detect platform automatically. Supported platforms:")
for x in platform_list:
print("\t" + x)
print("\nPlease run SCons again and select a valid platform: platform=<string>")

if selected_platform != "":
print("Automatically detected platform: " + selected_platform)

if selected_platform in ["linux", "bsd", "linuxbsd"]:
if selected_platform == "linuxbsd":
# Alias for forward compatibility.
print('Platform "linuxbsd" is still called "x11" in Godot 3.2.x. Building for platform "x11".')
# Alias for convenience.
selected_platform = "x11"

# Make sure to update this to the found, valid platform as it's used through the buildsystem as the reference.
# It should always be re-set after calling `opts.Update()` otherwise it uses the original input value.
env_base["platform"] = selected_platform

for k in platform_opts.keys():
opt_list = platform_opts[k]
for o in opt_list:
opts.Add(o)
# Add platform-specific options.
if selected_platform in platform_opts:
for opt in platform_opts[selected_platform]:
opts.Add(opt)

# Update the environment now as the "custom_modules" option may be
# defined in a file rather than specified via the command line.
# Update the environment to take platform-specific options into account.
opts.Update(env_base)
env_base["platform"] = selected_platform # Must always be re-set after calling opts.Update().

# Detect modules.
modules_detected = OrderedDict()
Expand Down Expand Up @@ -225,6 +261,7 @@ methods.write_modules(modules_detected)

# Update the environment again after all the module options are added.
opts.Update(env_base)
env_base["platform"] = selected_platform # Must always be re-set after calling opts.Update().
Help(opts.GenerateHelpText(env_base))

# add default include paths
Expand Down Expand Up @@ -257,41 +294,6 @@ if env_base["no_editor_splash"]:
if not env_base["deprecated"]:
env_base.Append(CPPDEFINES=["DISABLE_DEPRECATED"])

env_base.platforms = {}

selected_platform = ""

if env_base["platform"] != "":
selected_platform = env_base["platform"]
elif env_base["p"] != "":
selected_platform = env_base["p"]
env_base["platform"] = selected_platform
else:
# Missing `platform` argument, try to detect platform automatically
if sys.platform.startswith("linux"):
selected_platform = "x11"
elif sys.platform == "darwin":
selected_platform = "osx"
elif sys.platform == "win32":
selected_platform = "windows"
else:
print("Could not detect platform automatically. Supported platforms:")
for x in platform_list:
print("\t" + x)
print("\nPlease run SCons again and select a valid platform: platform=<string>")

if selected_platform != "":
print("Automatically detected platform: " + selected_platform)
env_base["platform"] = selected_platform

if selected_platform in ["linux", "bsd", "linuxbsd"]:
if selected_platform == "linuxbsd":
# Alias for forward compatibility.
print('Platform "linuxbsd" is still called "x11" in Godot 3.2.x. Building for platform "x11".')
# Alias for convenience.
selected_platform = "x11"
env_base["platform"] = selected_platform

if selected_platform in platform_list:
tmppath = "./platform/" + selected_platform
sys.path.insert(0, tmppath)
Expand Down
4 changes: 2 additions & 2 deletions core/io/file_access_compressed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,15 @@ Error FileAccessCompressed::get_error() const {

void FileAccessCompressed::flush() {
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");

// compressed files keep data in memory till close()
}

void FileAccessCompressed::store_8(uint8_t p_dest) {

ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");

WRITE_FIT(1);
write_ptr[write_pos++] = p_dest;
Expand Down
6 changes: 3 additions & 3 deletions core/io/file_access_encrypted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Error FileAccessEncrypted::get_error() const {

void FileAccessEncrypted::store_buffer(const uint8_t *p_src, int p_length) {

ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");

if (pos < data.size()) {

Expand All @@ -275,14 +275,14 @@ void FileAccessEncrypted::store_buffer(const uint8_t *p_src, int p_length) {
}

void FileAccessEncrypted::flush() {
ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");

// encrypted files keep data in memory till close()
}

void FileAccessEncrypted::store_8(uint8_t p_dest) {

ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");

if (pos < data.size()) {
data.write[pos] = p_dest;
Expand Down
20 changes: 11 additions & 9 deletions core/io/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "core/os/dir_access.h"
#include "core/os/os.h"
#include "core/print_string.h"
#include "core/project_settings.h"

// va_copy was defined in the C99, but not in C++ standards before C++11.
// When you compile C++ without --std=c++<XX> option, compilers still define
Expand Down Expand Up @@ -204,15 +205,14 @@ void RotatedFileLogger::logv(const char *p_format, va_list p_list, bool p_err) {
}
va_end(list_copy);
file->store_buffer((uint8_t *)buf, len);

if (len >= static_buf_size) {
Memory::free_static(buf);
}
#ifdef DEBUG_ENABLED
const bool need_flush = true;
#else
bool need_flush = p_err;
#endif
if (need_flush) {

if (p_err || GLOBAL_GET("application/run/flush_stdout_on_print")) {
// Don't always flush when printing stdout to avoid performance
// issues when `print()` is spammed in release builds.
file->flush();
}
}
Expand All @@ -231,9 +231,11 @@ void StdLogger::logv(const char *p_format, va_list p_list, bool p_err) {
vfprintf(stderr, p_format, p_list);
} else {
vprintf(p_format, p_list);
#ifdef DEBUG_ENABLED
fflush(stdout);
#endif
if (GLOBAL_GET("application/run/flush_stdout_on_print")) {
// Don't always flush when printing stdout to avoid performance
// issues when `print()` is spammed in release builds.
fflush(stdout);
}
}
}

Expand Down
3 changes: 1 addition & 2 deletions core/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,6 @@ class Object {
void _set_indexed_bind(const NodePath &p_name, const Variant &p_value);
Variant _get_indexed_bind(const NodePath &p_name) const;

void property_list_changed_notify();

friend class Reference;
uint32_t instance_binding_count;
void *_script_instance_bindings[MAX_SCRIPT_INSTANCE_BINDINGS];
Expand Down Expand Up @@ -551,6 +549,7 @@ class Object {

void cancel_delete();

void property_list_changed_notify();
virtual void _changed_callback(Object *p_changed, const char *p_prop);

//Variant _call_bind(const StringName& p_name, const Variant& p_arg1 = Variant(), const Variant& p_arg2 = Variant(), const Variant& p_arg3 = Variant(), const Variant& p_arg4 = Variant());
Expand Down
2 changes: 1 addition & 1 deletion core/os/file_access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ Vector<String> FileAccess::get_csv_line(const String &p_delim) const {
strings.push_back(current);
current = String();
} else if (c == '"') {
if (l[i + 1] == '"') {
if (l[i + 1] == '"' && in_quote) {
s[0] = '"';
current += s;
i++;
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/ConeTwistJoint.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ConeTwistJoint" inherits="Joint" version="3.2">
<brief_description>
A twist joint between two 3D bodies.
A twist joint between two 3D PhysicsBodies.
</brief_description>
<description>
The joint can rotate the bodies across an axis defined by the local x-axes of the [Joint].
The twist axis is initiated as the X axis of the [Joint].
Once the Bodies swing, the twist axis is calculated as the middle of the x-axes of the Joint in the local space of the two Bodies.
Once the Bodies swing, the twist axis is calculated as the middle of the x-axes of the Joint in the local space of the two Bodies. See also [Generic6DOFJoint].
</description>
<tutorials>
</tutorials>
Expand Down
1 change: 1 addition & 0 deletions doc/classes/CubeMesh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<description>
Generate an axis-aligned cuboid [PrimitiveMesh].
The cube's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to [code]Vector3(3, 2, 1)[/code].
[b]Note:[/b] When using a large textured [CubeMesh] (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase [member subdivide_depth], [member subdivide_height] and [member subdivide_width] until you no longer notice UV jittering.
</description>
<tutorials>
</tutorials>
Expand Down
15 changes: 13 additions & 2 deletions doc/classes/EditorExportPlugin.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorExportPlugin" inherits="Reference" version="3.2">
<brief_description>
A script that is executed when exporting projects.
A script that is executed when exporting the project.
</brief_description>
<description>
Editor export plugins are automatically activated whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file.
</description>
<tutorials>
</tutorials>
Expand All @@ -20,7 +21,7 @@
<argument index="3" name="flags" type="int">
</argument>
<description>
Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export.
Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export. [code]features[/code] is the list of features for the export, [code]is_debug[/code] is [code]true[/code] for debug builds, [code]path[/code] is the target path for the exported project. [code]flags[/code] is only used when running a runnable profile, e.g. when using native run on Android.
</description>
</method>
<method name="_export_end" qualifiers="virtual">
Expand All @@ -40,6 +41,8 @@
<argument index="2" name="features" type="PoolStringArray">
</argument>
<description>
Virtual method to be overridden by the user. Called for each exported file, providing arguments that can be used to identify the file. [code]path[/code] is the path of the file, [code]type[/code] is the [Resource] represented by the file (e.g. [PackedScene]) and [code]features[/code] is the list of features for the export.
Calling [method skip] inside this callback will make the file not included in the export.
</description>
</method>
<method name="add_file">
Expand All @@ -52,6 +55,7 @@
<argument index="2" name="remap" type="bool">
</argument>
<description>
Adds a custom file to be exported. [code]path[/code] is the virtual path that can be used to load the file, [code]file[/code] is the binary data of the file. If [code]remap[/code] is [code]true[/code], file will not be exported, but instead remapped to the given [code]path[/code].
</description>
</method>
<method name="add_ios_bundle_file">
Expand All @@ -60,6 +64,7 @@
<argument index="0" name="path" type="String">
</argument>
<description>
Adds an iOS bundle file from the given [code]path[/code] to the exported project.
</description>
</method>
<method name="add_ios_cpp_code">
Expand All @@ -68,6 +73,7 @@
<argument index="0" name="code" type="String">
</argument>
<description>
Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin.
</description>
</method>
<method name="add_ios_embedded_framework">
Expand Down Expand Up @@ -96,6 +102,7 @@
<argument index="0" name="flags" type="String">
</argument>
<description>
Adds linker flags for the iOS export.
</description>
</method>
<method name="add_ios_plist_content">
Expand All @@ -104,6 +111,7 @@
<argument index="0" name="plist_content" type="String">
</argument>
<description>
Adds content for iOS Property List files.
</description>
</method>
<method name="add_ios_project_static_lib">
Expand All @@ -112,6 +120,7 @@
<argument index="0" name="path" type="String">
</argument>
<description>
Adds a static lib from the given [code]path[/code] to the iOS project.
</description>
</method>
<method name="add_shared_object">
Expand All @@ -122,12 +131,14 @@
<argument index="1" name="tags" type="PoolStringArray">
</argument>
<description>
Adds a shared object with the given [code]tags[/code] and destination [code]path[/code].
</description>
</method>
<method name="skip">
<return type="void">
</return>
<description>
To be called inside [method _export_file]. Skips the current file, so it's not included in the export.
</description>
</method>
</methods>
Expand Down
1 change: 1 addition & 0 deletions doc/classes/EditorPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<argument index="0" name="plugin" type="EditorExportPlugin">
</argument>
<description>
Registers a new export plugin. Export plugins are used when the project is being exported. See [EditorExportPlugin] for more information.
</description>
</method>
<method name="add_import_plugin">
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Geometry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<argument index="3" name="q2" type="Vector2">
</argument>
<description>
Given the two 2D segments ([code]p1[/code], [code]p2[/code]) and ([code]q1[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PoolVector2Array] that contains this point on ([code]p1[/code], [code]p2[/code]) as well the accompanying point on ([code]q1[/code], [code]q2[/code]).
Given the two 2D segments ([code]p1[/code], [code]q1[/code]) and ([code]p2[/code], [code]q2[/code]), finds those two points on the two segments that are closest to each other. Returns a [PoolVector2Array] that contains this point on ([code]p1[/code], [code]q1[/code]) as well the accompanying point on ([code]p2[/code], [code]q2[/code]).
</description>
</method>
<method name="get_uv84_normal_bit">
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/Gradient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
<method name="remove_point">
<return type="void">
</return>
<argument index="0" name="offset" type="int">
<argument index="0" name="point" type="int">
</argument>
<description>
Removes the color at the index [code]offset[/code].
Removes the color at the index [code]point[/code].
</description>
</method>
<method name="set_color">
Expand Down
Loading

0 comments on commit 541bc18

Please sign in to comment.