Commit Graph

6362 Commits

Author SHA1 Message Date
220f24c191 Merge pull request #45618 from RandomShaper/modernize_mt_3.2
Backport of all the multi-threading modernization (3.2)
2021-02-18 20:47:24 +01:00
7af8da32b1 Merge pull request #45933 from nekomatata/cylinder-support-3.2
[3.2] Cylinder support in Godot Physics 3D
2021-02-18 19:36:42 +01:00
c6fbd55ca9 Cylinder support in Godot Physics 3D
Backport of cylinder support from Master.
2021-02-18 08:44:23 -07:00
0176cc4fca Merge pull request #46162 from gongpha/jr-_-avoid-get_tree-when-flying-colorpicker
[3.2] Avoid signal methods in ColorPicker to access the tree when it isn't in the tree
2021-02-18 13:15:12 +01:00
3374f84a2f Merge pull request #46165 from angad-k/fix-mesh-instance-crash
add null check in MeshInstance::_mesh_changed()
2021-02-18 13:00:17 +01:00
4485b43a57 Modernize atomics
- Based on C++11's `atomic`
- Reworked `SafeRefCount` (based on the rewrite by @hpvb)
- Replaced free atomic functions by the new `SafeNumeric<T>`
- Replaced wrong cases of `volatile` by the new `SafeFlag`
- Platform-specific implementations no longer needed

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-18 12:23:25 +01:00
013fc360d7 add null check in MeshInstance::_mesh_changed() 2021-02-18 16:36:27 +05:30
f30d827448 Merge pull request #45951 from KoBeWi/copy_of_3.2
[3.2] Add node copy-paste
2021-02-18 12:06:17 +01:00
6d89f675b1 Modernize Thread
- Based on C++11's `thread` and `thread_local`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
- Simpler for `NO_THREADS`
- Thread ids are now the same across platforms (main is 1; others follow)
2021-02-18 11:58:08 +01:00
4ddcdc031b Modernize Mutex
- Based on C++11's `mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
- `BinaryMutex` added for special cases as the non-recursive version
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
2021-02-18 11:58:08 +01:00
b450036120 Modernize RWLock
- Based on C++14's `shared_time_mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
2021-02-18 11:41:07 +01:00
5ec1eee6b1 Avoid function signals in ColorPicker to access the tree when it isn't in the tree 2021-02-18 16:57:47 +07:00
8a426923c2 Fix pops in play() of both spatial audio players
(cherry picked from commit 5e1442ad55)
2021-02-18 10:33:46 +01:00
bba67729ca add null check in _update_particle_data_buffer()
add check to see if p_order is in range for CPUParticles3D::set_draw_order'

(cherry picked from commit c97fffdc59)
2021-02-18 00:36:20 +01:00
d968a03cbc Add animation_finished signal and fix frame_changed signal for AnimatedSprite3D
Fixes #40301.
Fixes #45947.

(cherry picked from commit c3be0c2c04)
2021-02-18 00:36:20 +01:00
61c00938a2 Fixes crash when calling VisualShader::set_mode
(cherry picked from commit f455f873c7)
2021-02-18 00:35:57 +01:00
1ca1b78a09 add checks for node type range in add_node function 2021-02-17 14:22:50 +05:30
c67c3e0a46 Fix StyleBoxLine's incorrect style margin values
(cherry picked from commit ddf05a7c3c)
2021-02-16 14:27:40 +01:00
6440b7fcae Select TreeItem if none is selected
(cherry picked from commit 282639d653)
2021-02-16 14:27:40 +01:00
3d34803edc Return setseek position if one exists in get_playback_position.
(cherry picked from commit 15b8480b2c)
2021-02-16 14:27:40 +01:00
e40682c32d RichTextLabel::add_image Fail if passed image has no area
(cherry picked from commit a4afdd4a77)
2021-02-16 14:27:39 +01:00
31744577b3 VisualShader::_input_type_changed Fix index out of bounds crash.
(cherry picked from commit 7d451c0040)
2021-02-16 14:27:39 +01:00
d91a5e7883 Implement CollisionPolygon3D margin
(cherry picked from commit fbb1ef759c)
2021-02-16 14:27:39 +01:00
ac9e5d9c60 Fix TextEdit autoscroll with wrapped lines
Index to find the last line wrap index was off by one, which prevented the first wrapped line to trigger autoscroll.

(cherry picked from commit 121030940c)
2021-02-16 14:27:38 +01:00
77438f7a45 Merge pull request #46054 from JFonS/cpu_lightmapper_disk
[3.2] Reduce lightmaps file size.
2021-02-16 13:37:09 +01:00
56bf256d76 Add options to reduce lightmaps disk usage.
Added BakedLightmap.use_hdr and BakedLightmap.use_color properties
that can reduce the flie size of lightmap texture at the expense of quality.

Changed the denoiser to work in a single buffer, reducing RAM
usage. Also added the `-mstackrealign` flag in the denoiser compilation
for MinGW builds. This flag helped fix a bug in Embree, so I want to see
if it will help fix GH #45296.
2021-02-16 13:20:27 +01:00
1611d3dc17 Merge pull request #46008 from akien-mga/3.2-fix-camera-align-crash-45976
Camera2D: Fix crash calling align when not in tree
2021-02-16 12:18:38 +01:00
018008ce81 TextEdit respects content margin from StyleBox
Backport from PR #45858 on master.
2021-02-15 10:47:38 -07:00
56fccb1ec1 [3.2] Fix SPACING_SPACE not used for drawing characters. 2021-02-15 18:03:26 +02:00
5a22bd2b3e Camera2D: Fix crash calling align when not in tree
Fixes #45976.
2021-02-15 10:54:16 +01:00
637117c8d1 [3.2] Add node copy-paste 2021-02-13 14:27:36 +01:00
e71510097d Merge pull request #45837 from Kayomn/3.2
Accomodate blend shape ranges of -1 to +1 for GLES
2021-02-12 09:28:19 +01:00
adb93d7120 Update GraphEdit when GraphNode's slot is updated
(cherry picked from commit fe6c8d48e6)
2021-02-11 13:14:33 +01:00
5e978d1df5 Fix contact points debug for 3D Physics
Setting each point's position was missing for 3D. Now enabling collision
render debug will display contact points for 3D physics, the same way it
does for 2D physics.

Note: Multimesh rendering seems not to work in this scenario on master,
but it's working fine on 3.2.

(cherry picked from commit e5e9be8355)
2021-02-11 13:12:06 +01:00
9c4f16f4c1 Fixed completion box not showing properly [3.2] 2021-02-10 20:40:00 +01:00
398a625a9f Merge pull request #39421 from RandomShaper/pause_aware_picking_3.2
Implement pause-aware picking (3.2)
2021-02-09 10:43:48 +01:00
daa0fe101e Merge pull request #45813 from RandomShaper/keep_selected_visible_3.2
Keep selected node visible after filter change (3.2)
2021-02-09 10:43:37 +01:00
2863c6117e Set selected Tree item to null when deselected
Co-authored-by: Brody Eller <wviper3@gmail.com>
(cherry picked from commit ef8ec59f2f)
2021-02-08 22:36:37 +01:00
dad0d4a8ee Update ColorPicker controls when entering tree
(cherry picked from commit 03d4ebf129)
2021-02-08 22:36:37 +01:00
24d03afc9b Fix nan errors when using VehicleBody
(cherry picked from commit 1b8cbcf946)
2021-02-08 22:36:36 +01:00
db57f32194 TextEdit: When left mouse is pressed to place the cursor, do not immediately adjust the viewport when cursor_set_line is called, but afterwards on cursor_set_column (effectively when the cursor reached its final position)
Fixes #45770

(cherry picked from commit 8d598693fc)
2021-02-08 22:36:36 +01:00
b060b2e68f Merge pull request #45750 from revilo/3.2
[3.2] Bugfix: Update transform of collision shape on NOTIFICATION_PARENTED
2021-02-08 21:33:21 +01:00
745c711289 Implement pause-aware picking
This adds a new project setting (`physics/common/enable_pause_aware_picking`). It's disabled by default.

When enabled, it changes the way 2D & 3D physics picking behaves in relation to pause:
- When pause is set, every collision object that is hovered or captured (3D only) is released from that condition, getting the relevant mouse-exit callback., unless its pause mode makes it immune from pause.
- During the pause. picking only considers collision objects immune from pause, sending input events and enter/exit callbacks to them as expected.
- When pause is left, nothing happens. This is a big difference with the classic behavior, which at this point would process all the input events that have been queued against the current state of the 2D/3D world (in other words, checking them against the current position of the objects instead of those at the time of the events).
2021-02-08 20:48:13 +01:00
34d3235c84 [3.2] Visual Shader Parenthesis fix 2021-02-08 19:37:50 +03:00
e1054a17b5 Expose Tree::scroll_to_item() 2021-02-08 02:19:23 +01:00
d923df52c5 Accomodate blend shape ranges of -1 to +1 2021-02-07 21:42:02 +00:00
f05e068d6c Merge pull request #45583 from lawnjelly/optimize_transform_propagate
Optimize transform propagation for hidden 3d objects
2021-02-06 12:23:52 +01:00
f36c529ad0 Merge pull request #45752 from JFonS/cpu_lightmapper_fixes
Assorted CPU lightmapper fixes
2021-02-06 11:44:52 +01:00
09924d6d73 Bugfix: Update transform of collision shape on NOTIFICATION_PARENTED (fixes invalid transform of collision shape in cases where the node is not supposed to enter the scene tree) 2021-02-06 02:41:16 +01:00
27c1e65969 Assorted CPU lightmapper fixes
- Fix crash when a ray hits a texel with a UV2 coordinate exactly
  equal to 1.0.
- Take BakedLightmap extents into account.
- Clear capture data between bakes.
- Fix minor issues with seam correction.
2021-02-05 19:18:19 +01:00