Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-picks for the 3.2 branch (future 3.2.4) - 14th batch #44795

Merged
merged 45 commits into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8f5bdf6
Changes 'always show grid' hotkey to prevent conflict with 'pan mode'
Chaosus Oct 15, 2020
e0bdb19
Fix camera2d zoom when set to zero (causing ERROR: affine_invert: Con…
dreamsComeTrue Oct 17, 2020
e95c24d
Make `property_list_changed_notify` protected in `Object`
Xrayez Oct 29, 2020
70af745
Remove two very slightly displaced duplicate vertices on Gobot's face
Dec 10, 2020
688d422
PVRTC: Move compress func to `modules/pvr`, drop obsolete PVRTexTool …
akien-mga Dec 10, 2020
107bd09
Fix PathFollow3D updating on unit_offset 0
KoBeWi Dec 11, 2020
70fc0d4
wrong double quote output with .csv fixed
Dec 11, 2020
1a64f5d
ProximityGroup: Fix access modifiers, rename private methods for clarity
akien-mga Dec 11, 2020
4d66d2a
Display the number of results for global search
YuriSizov Dec 11, 2020
d3d34dc
Fixed Geometry2D::get_closest_points_between_segments docs
mbrlabs Dec 12, 2020
9a3cd08
Fixed EditorPropertyText change signal emission.
AndreaCatania Dec 12, 2020
53988c7
Add important note about OS.get_unixtime.
Faless Dec 13, 2020
e072b3d
Pow method doc fix
skyace65 Dec 13, 2020
bf94244
Mono: Add extra WASM framework assemblies on game export
neikeq Dec 14, 2020
2753cc5
Increase the default 3D manipulator gizmo opacity for better visibility
Calinou Dec 14, 2020
f5f04a1
Add a project setting to enable stdout flushing in release builds
Calinou Dec 15, 2020
d097c02
Quick fix to incorrect error messages when writing to compressed or e…
andy-noisyduck Dec 15, 2020
bafbb23
Added a note describing a code behind Vector2/3.direction_to
Chaosus Dec 15, 2020
9248ee3
Changed the rotation gizmo handle to use the active axis color
mbrlabs Dec 16, 2020
3addea0
Move the brightness factor for highlighted 3D gizmos to a variable
Calinou Dec 18, 2020
60959b0
SCons: Add only selected platform's opts to env
akien-mga Dec 16, 2020
ee77567
SCons: Fix build with `p` alias or platform auto-detection
akien-mga Dec 17, 2020
742a3f4
Fix broken members panel in visual script editor
Chaosus Dec 18, 2020
387390d
mbedtls: Update to upstream version 2.16.9
akien-mga Dec 18, 2020
d4bfa5a
Fixes #42149 and fixes indentation errors to pass clang-format
eddsanity Dec 19, 2020
76b5cde
Document how to solve UV jittering when using large procedural meshes
Calinou Dec 19, 2020
2328029
Removed default commit message
Janglee123 Dec 19, 2020
01e1369
Disable "Commit" button in VCS plugin if there's no commit message
YeldhamDev Dec 20, 2020
d0abf5b
Tweak the editor CheckButton "presed" appearance to be more recognizable
Calinou Dec 20, 2020
58b2d66
Fix filename disambiguation on scripts in certain occasions
YeldhamDev Dec 22, 2020
c27c436
Fix invalid invocation of `get_class_loader`.
m4gr3d Dec 23, 2020
f50c0d9
Fix confusing SliderJoint3D brief description
Calinou Dec 24, 2020
1fccf78
Update body transforms on joint2D setup
pouleyKetchoupp Dec 24, 2020
cb629dd
Ensure flags are applied to CVTT options
madmiraal Dec 25, 2020
3db7ff3
Fix and decrease Godot logo size in the HTML5 editor loader
Calinou Dec 26, 2020
85cc313
Properly handle empty CSGShapes
hoontee Dec 27, 2020
9150d35
Mention that change_scene is deferred
KoBeWi Dec 27, 2020
27bfacd
fix missing "s" in Viewport docs
Jummit Dec 28, 2020
a227eef
Rename offset to point in remove_point()
KoBeWi Dec 28, 2020
1062bed
Add an editor setting for the 3D selection box color
Calinou Dec 29, 2020
10cc044
FBX: Clarify outdated format error
akien-mga Dec 29, 2020
151fa89
Complete documentation of EditorExportPlugin
KoBeWi Dec 29, 2020
d84a303
Fix instantiation of resource as property value
RandomShaper Dec 29, 2020
a24a6d5
doc: Sync classref with current source
akien-mga Dec 29, 2020
caa7c6a
i18n: Sync translations with Weblate
akien-mga Dec 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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