Skip to content

Commit ea2e976

Browse files
authored
Merge pull request #36784 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.1) - 3rd batch
2 parents 0d5e483 + 7516416 commit ea2e976

Some content is hidden

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

62 files changed

+532
-194
lines changed

SConstruct

+19-7
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ if selected_platform in platform_list:
291291
if env["extra_suffix"] != '':
292292
env.extra_suffix += '.' + env["extra_suffix"]
293293

294+
# Environment flags
294295
CCFLAGS = env.get('CCFLAGS', '')
295296
env['CCFLAGS'] = ''
296297
env.Append(CCFLAGS=str(CCFLAGS).split())
@@ -307,17 +308,28 @@ if selected_platform in platform_list:
307308
env['LINKFLAGS'] = ''
308309
env.Append(LINKFLAGS=str(LINKFLAGS).split())
309310

311+
# Platform specific flags
310312
flag_list = platform_flags[selected_platform]
311313
for f in flag_list:
312314
if not (f[0] in ARGUMENTS): # allow command line to override platform flags
313315
env[f[0]] = f[1]
314316

315-
# must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11)
317+
# Must happen after the flags definition, so that they can be used by platform detect
316318
detect.configure(env)
317319

318-
# Enable C++11 support
320+
# Set our C and C++ standard requirements.
321+
# Prepending to make it possible to override
322+
# This needs to come after `configure`, otherwise we don't have env.msvc.
319323
if not env.msvc:
320-
env.Append(CXXFLAGS=['-std=c++11'])
324+
# Specifying GNU extensions support explicitly, which are supported by
325+
# both GCC and Clang. This mirrors GCC and Clang's current default
326+
# compile flags if no -std is specified.
327+
env.Prepend(CFLAGS=['-std=gnu11'])
328+
env.Prepend(CXXFLAGS=['-std=gnu++14'])
329+
else:
330+
# MSVC doesn't have clear C standard support, /std only covers C++.
331+
# We apply it to CCFLAGS (both C and C++ code) in case it impacts C features.
332+
env.Prepend(CCFLAGS=['/std:c++14'])
321333

322334
# Configure compiler warnings
323335
if env.msvc:
@@ -338,12 +350,13 @@ if selected_platform in platform_list:
338350
# Force to use Unicode encoding
339351
env.Append(MSVC_FLAGS=['/utf8'])
340352
else: # Rest of the world
353+
version = methods.get_compiler_version(env) or [-1, -1]
354+
341355
shadow_local_warning = []
342356
all_plus_warnings = ['-Wwrite-strings']
343357

344358
if methods.using_gcc(env):
345-
version = methods.get_compiler_version(env)
346-
if version != None and version[0] >= '7':
359+
if version[0] >= 7:
347360
shadow_local_warning = ['-Wshadow-local']
348361

349362
if (env["warnings"] == 'extra'):
@@ -357,8 +370,7 @@ if selected_platform in platform_list:
357370
'-Wduplicated-branches', '-Wduplicated-cond',
358371
'-Wstringop-overflow=4', '-Wlogical-op'])
359372
env.Append(CXXFLAGS=['-Wnoexcept', '-Wplacement-new=1'])
360-
version = methods.get_compiler_version(env)
361-
if version != None and version[0] >= '9':
373+
if version[0] >= 9:
362374
env.Append(CCFLAGS=['-Wattribute-alias=2'])
363375
elif (env["warnings"] == 'all'):
364376
env.Append(CCFLAGS=['-Wall'] + shadow_local_warning)

core/bind/core_bind.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,9 @@ class _Directory : public Reference {
598598
bool _list_skip_hidden;
599599
};
600600

601-
class _Marshalls : public Reference {
601+
class _Marshalls : public Object {
602602

603-
GDCLASS(_Marshalls, Reference);
603+
GDCLASS(_Marshalls, Object);
604604

605605
static _Marshalls *singleton;
606606

core/math/expression.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ Error Expression::_get_token(Token &r_token) {
11741174
if (is_float)
11751175
r_token.value = num.to_double();
11761176
else
1177-
r_token.value = num.to_int();
1177+
r_token.value = num.to_int64();
11781178
return OK;
11791179

11801180
} else if ((cchar >= 'A' && cchar <= 'Z') || (cchar >= 'a' && cchar <= 'z') || cchar == '_') {

core/os/input_event.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void InputEventKey::_bind_methods() {
348348
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
349349
ADD_PROPERTY(PropertyInfo(Variant::INT, "scancode"), "set_scancode", "get_scancode");
350350
ADD_PROPERTY(PropertyInfo(Variant::INT, "unicode"), "set_unicode", "get_unicode");
351-
ADD_PROPERTY(PropertyInfo(Variant::INT, "echo"), "set_echo", "is_echo");
351+
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "echo"), "set_echo", "is_echo");
352352
}
353353

354354
InputEventKey::InputEventKey() {

doc/classes/@GlobalScope.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
The [JavaScript] singleton.
5151
[b]Note:[/b] Only implemented on HTML5.
5252
</member>
53-
<member name="Marshalls" type="Reference" setter="" getter="">
53+
<member name="Marshalls" type="Marshalls" setter="" getter="">
5454
The [Marshalls] singleton.
5555
</member>
5656
<member name="NavigationMeshGenerator" type="EditorNavigationMeshGenerator" setter="" getter="">

doc/classes/ARVRPositionalTracker.xml

+7
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@
5454
Returns the world-space controller position.
5555
</description>
5656
</method>
57+
<method name="get_tracker_id" qualifiers="const">
58+
<return type="int">
59+
</return>
60+
<description>
61+
Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the [ARVRController] and [ARVRAnchor] nodes.
62+
</description>
63+
</method>
5764
<method name="get_tracks_orientation" qualifiers="const">
5865
<return type="bool">
5966
</return>

doc/classes/Array.xml

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
array[2] = "Three"
1515
print(array[-2]) # Three.
1616
[/codeblock]
17+
Arrays can be concatenated using the [code]+[/code] operator:
18+
[codeblock]
19+
var array1 = ["One", 2]
20+
var array2 = [3, "Four"]
21+
print(array1 + array2) # ["One", 2, 3, "Four"]
22+
[/codeblock]
1723
Arrays are always passed by reference.
1824
</description>
1925
<tutorials>

doc/classes/ConcavePolygonShape.xml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
</brief_description>
66
<description>
77
Concave polygon shape resource, which can be set into a [PhysicsBody] or area. This shape is created by feeding a list of triangles.
8+
Note: when used for collision, [ConcavePolygonShape] is intended to work with static [PhysicsBody] nodes like [StaticBody] and will not work with [KinematicBody] or [RigidBody] with a mode other than Static.
89
</description>
910
<tutorials>
1011
</tutorials>

doc/classes/Engine.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@
147147
If [code]true[/code], it is running inside the editor. Useful for tool scripts.
148148
</member>
149149
<member name="iterations_per_second" type="int" setter="set_iterations_per_second" getter="get_iterations_per_second" default="60">
150-
The number of fixed iterations per second (for fixed process and physics).
150+
The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run. This value should generally always be set to [code]60[/code] or above, as Godot doesn't interpolate the physics step. As a result, values lower than [code]60[/code] will look stuttery. This value can be increased to make input more reactive or work around tunneling issues, but keep in mind doing so will increase CPU usage.
151151
</member>
152152
<member name="physics_jitter_fix" type="float" setter="set_physics_jitter_fix" getter="get_physics_jitter_fix" default="0.5">
153-
Controls how much physic ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows to smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
153+
Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows to smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
154154
</member>
155155
<member name="target_fps" type="int" setter="set_target_fps" getter="get_target_fps" default="0">
156156
The desired frames per second. If the hardware cannot keep up, this setting may not be respected. A value of 0 means no limit.

doc/classes/Marshalls.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
2-
<class name="Marshalls" inherits="Reference" version="3.2">
2+
<class name="Marshalls" inherits="Object" version="3.2">
33
<brief_description>
44
Data transformation (marshalling) and encoding helpers.
55
</brief_description>

doc/classes/MeshLibrary.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@
8484
<argument index="0" name="id" type="int">
8585
</argument>
8686
<description>
87-
Returns a generated item preview (a 3D rendering in isometric perspective).
88-
[b]Note:[/b] Since item previews are only generated in an editor context, this function will return an empty [Texture] in a running project.
87+
When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using [method set_item_preview]. Returns an empty [Texture] if no preview was manually set in a running project.
8988
</description>
9089
</method>
9190
<method name="get_item_shapes" qualifiers="const">

doc/classes/Node.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
<return type="float">
327327
</return>
328328
<description>
329-
Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed via [member Engine.target_fps].
329+
Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed via [member Engine.iterations_per_second].
330330
</description>
331331
</method>
332332
<method name="get_position_in_parent" qualifiers="const">
@@ -745,7 +745,7 @@
745745
<argument index="0" name="enable" type="bool">
746746
</argument>
747747
<description>
748-
Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at a fixed (usually 60 FPS, see [member Engine.target_fps] to change) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overridden. Any calls to this before [method _ready] will be ignored.
748+
Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at a fixed (usually 60 FPS, see [member Engine.iterations_per_second] to change) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overridden. Any calls to this before [method _ready] will be ignored.
749749
</description>
750750
</method>
751751
<method name="set_physics_process_internal">

doc/classes/ProjectSettings.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -956,10 +956,12 @@
956956
Enables [member Viewport.physics_object_picking] on the root viewport.
957957
</member>
958958
<member name="physics/common/physics_fps" type="int" setter="" getter="" default="60">
959-
Frames per second used in the physics. Physics always needs a fixed amount of frames per second.
959+
The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run.
960+
[b]Note:[/b] This property is only read when the project starts. To change the physics FPS at runtime, set [member Engine.iterations_per_second] instead.
960961
</member>
961962
<member name="physics/common/physics_jitter_fix" type="float" setter="" getter="" default="0.5">
962963
Fix to improve physics jitter, specially on monitors where refresh rate is different than the physics FPS.
964+
[b]Note:[/b] This property is only read when the project starts. To change the physics FPS at runtime, set [member Engine.physics_jitter_fix] instead.
963965
</member>
964966
<member name="rendering/environment/default_clear_color" type="Color" setter="" getter="" default="Color( 0.3, 0.3, 0.3, 1 )">
965967
Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method VisualServer.set_default_clear_color].

doc/classes/SpringArm.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
<argument index="0" name="RID" type="RID">
1919
</argument>
2020
<description>
21-
Adds the object with the given [RID] to the list of objects excluded from the collision check.
21+
Adds the [PhysicsBody] object with the given [RID] to the list of [PhysicsBody] objects excluded from the collision check.
2222
</description>
2323
</method>
2424
<method name="clear_excluded_objects">
2525
<return type="void">
2626
</return>
2727
<description>
28-
Clears the list of objects excluded from the collision check.
28+
Clears the list of [PhysicsBody] objects excluded from the collision check.
2929
</description>
3030
</method>
3131
<method name="get_hit_length">
@@ -41,7 +41,7 @@
4141
<argument index="0" name="RID" type="RID">
4242
</argument>
4343
<description>
44-
Removes the given [RID] from the list of objects excluded from the collision check.
44+
Removes the given [RID] from the list of [PhysicsBody] objects excluded from the collision check.
4545
</description>
4646
</method>
4747
</methods>

drivers/unix/os_unix.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo
310310
if (p_pipe_mutex) {
311311
p_pipe_mutex->lock();
312312
}
313-
(*r_pipe) += buf;
313+
(*r_pipe) += String::utf8(buf);
314314
if (p_pipe_mutex) {
315315
p_pipe_mutex->unlock();
316316
}

editor/animation_track_editor.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,9 @@ void AnimationTrackEdit::_path_entered(const String &p_text) {
24802480

24812481
bool AnimationTrackEdit::_is_value_key_valid(const Variant &p_key_value, Variant::Type &r_valid_type) const {
24822482

2483+
if (root == nullptr)
2484+
return false;
2485+
24832486
RES res;
24842487
Vector<StringName> leftover_path;
24852488
Node *node = root->get_node_and_resource(animation->track_get_path(track), res, leftover_path);

editor/code_editor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ void CodeTextEditor::clone_lines_down() {
12611261
text_editor->cursor_set_line(cursor_new_line);
12621262
text_editor->cursor_set_column(cursor_new_column);
12631263
if (selection_active) {
1264-
text_editor->select(to_line, to_column, 2 * to_line - from_line, 2 * to_column - from_column);
1264+
text_editor->select(to_line, to_column, 2 * to_line - from_line, to_line == from_line ? 2 * to_column - from_column : to_column);
12651265
}
12661266

12671267
text_editor->end_complex_operation();

editor/connections_dialog.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ Control *ConnectionsDockTree::make_custom_tooltip(const String &p_text) const {
500500
String text = TTR("Signal:") + " [u][b]" + p_text.get_slice("::", 0) + "[/b][/u]";
501501
text += p_text.get_slice("::", 1).strip_edges() + "\n";
502502
text += p_text.get_slice("::", 2).strip_edges();
503-
help_bit->set_text(text);
504503
help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
505504
return help_bit;
506505
}

editor/editor_data.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,14 @@ void EditorData::restore_editor_global_states() {
435435

436436
void EditorData::paste_object_params(Object *p_object) {
437437

438+
ERR_FAIL_NULL(p_object);
439+
undo_redo.create_action(TTR("Paste Params"));
438440
for (List<PropertyData>::Element *E = clipboard.front(); E; E = E->next()) {
439-
440-
p_object->set(E->get().name, E->get().value);
441+
String name = E->get().name;
442+
undo_redo.add_do_property(p_object, name, E->get().value);
443+
undo_redo.add_undo_property(p_object, name, p_object->get(name));
441444
}
445+
undo_redo.commit_action();
442446
}
443447

444448
bool EditorData::call_build() {

editor/editor_file_dialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ void EditorFileDialog::update_file_name() {
691691
String base_name = file_str.get_basename();
692692
Vector<String> filter_substr = filter_str.split(";");
693693
if (filter_substr.size() >= 2) {
694-
file_str = base_name + "." + filter_substr[1].strip_edges().to_lower();
694+
file_str = base_name + "." + filter_substr[0].strip_edges().lstrip("*.").to_lower();
695695
} else {
696696
file_str = base_name + "." + filter_str.get_extension().strip_edges().to_lower();
697697
}

editor/editor_inspector.cpp

+28-8
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,20 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const {
778778
help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel"));
779779
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
780780

781-
String text = TTR("Property:") + " [u][b]" + p_text.get_slice("::", 0) + "[/b][/u]\n";
782-
text += p_text.get_slice("::", 1).strip_edges();
783-
help_bit->set_text(text);
784-
help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
781+
Vector<String> slices = p_text.split("::", false);
782+
if (!slices.empty()) {
783+
String property_name = slices[0].strip_edges();
784+
String text = TTR("Property:") + " [u][b]" + property_name + "[/b][/u]";
785+
786+
if (slices.size() > 1) {
787+
String property_doc = slices[1].strip_edges();
788+
if (property_name != property_doc) {
789+
text += "\n" + property_doc;
790+
}
791+
}
792+
help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
793+
}
794+
785795
return help_bit;
786796
}
787797

@@ -1005,10 +1015,20 @@ Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) cons
10051015
help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel"));
10061016
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
10071017

1008-
String text = "[u][b]" + p_text.get_slice("::", 0) + "[/b][/u]\n";
1009-
text += p_text.get_slice("::", 1).strip_edges();
1010-
help_bit->set_text(text);
1011-
help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
1018+
Vector<String> slices = p_text.split("::", false);
1019+
if (!slices.empty()) {
1020+
String property_name = slices[0].strip_edges();
1021+
String text = "[u][b]" + property_name + "[/b][/u]";
1022+
1023+
if (slices.size() > 1) {
1024+
String property_doc = slices[1].strip_edges();
1025+
if (property_name != property_doc) {
1026+
text += "\n" + property_doc;
1027+
}
1028+
}
1029+
help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
1030+
}
1031+
10121032
return help_bit;
10131033
}
10141034

editor/editor_themes.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
855855
Ref<StyleBoxFlat> style_panel_invisible_top = style_content_panel->duplicate();
856856
int stylebox_offset = theme->get_font("tab_fg", "TabContainer")->get_height() + theme->get_stylebox("tab_fg", "TabContainer")->get_minimum_size().height + theme->get_stylebox("panel", "TabContainer")->get_default_margin(MARGIN_TOP);
857857
style_panel_invisible_top->set_expand_margin_size(MARGIN_TOP, -stylebox_offset);
858+
style_panel_invisible_top->set_default_margin(MARGIN_TOP, 0);
858859
theme->set_stylebox("BottomPanelDebuggerOverride", "EditorStyles", style_panel_invisible_top);
859860

860861
// LineEdit

editor/export_template_manager.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,7 @@ void ExportTemplateManager::_notification(int p_what) {
547547
bool ExportTemplateManager::can_install_android_template() {
548548

549549
const String templates_dir = EditorSettings::get_singleton()->get_templates_dir().plus_file(VERSION_FULL_CONFIG);
550-
return FileAccess::exists(templates_dir.plus_file("android_source.zip")) &&
551-
FileAccess::exists(templates_dir.plus_file("android_release.apk")) &&
552-
FileAccess::exists(templates_dir.plus_file("android_debug.apk"));
550+
return FileAccess::exists(templates_dir.plus_file("android_source.zip"));
553551
}
554552

555553
Error ExportTemplateManager::install_android_template() {

0 commit comments

Comments
 (0)