1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-30 16:26:50 +00:00
Commit Graph

16521 Commits

Author SHA1 Message Date
Thaddeus Crews
37d1e7fc89 Merge pull request #99268 from Meorge/add-volume-linear
Add `volume_linear` property and getter/setter methods for audio-related classes
2024-12-19 19:59:47 -06:00
Thaddeus Crews
d3e5b62ea2 Merge pull request #99230 from paddy-exe/instance_uniforms_compatability_renderer
Implement 2D instance uniforms
2024-12-19 19:59:37 -06:00
Markus Sauermann
0a875ab3bb Highlight hovered GraphEdit connection by widening the line
This change causes the connections to be additionally highlighted by
widening the line with a configurable factor.
2024-12-20 00:55:35 +01:00
Markus Sauermann
4887172a59 Fix ViewPanner panning mouse warp
Currently the mouse cursor jumps in unexpected ways, when a `ViewPanner`
is used in SubViewports or embedded Windows.

This is caused by providing wrong coordinate systems to
Input::warp_mouse_motion.

This PR replaces the use of `Input::warp_mouse_motion` with
`Viewport::wrap_mouse_in_rect` and makes sure, that the correct
coordinate systems are used.

This change makes it necessary, that all classes, that currently
use ViewPanner, need to provide the correct Viewport to ViewPanner.
2024-12-20 00:28:49 +01:00
Hakim
483c1348d0 Allow Timer nodes to ignore engine time scale 2024-12-19 18:40:24 +01:00
Zshandi Krahn
0d40fe46e3 Node2D/3D: Make position follow default float step 2024-12-19 00:11:39 -08:00
bruvzg
b9a00feb66 [Windows, FileDialog] Prepend drive letter to the absolute paths without drive letter. 2024-12-19 09:47:46 +02:00
Hilderin
9d2a4c03be Embedding game process in editor 2024-12-18 17:52:42 -05:00
Malcolm Anderson
2f5b97c7f9 Add volume_linear property and methods for audio-related classes
Remove default value from `volume_linear` property documentation

Remove `volume_linear` internal property from `AudioBusLayout`

Update doc/classes/AudioEffectAmplify.xml [no ci]

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>

Make documentation more concise [no ci]
2024-12-18 12:41:57 -08:00
Hendrik Brucker
a3525bc015 Add transparency support for LightmapGI
Co-authored-by: Guerro323 <kaltobattle@gmail.com>
2024-12-18 19:36:16 +01:00
Rémi Verschelde
46c8f8c5c5 Merge pull request #100093 from dalexeev/fix-collision-shape-2d-3d-debug-color
Fix `CollisionShape{2D,3D}.debug_color` inconsistencies
2024-12-18 18:23:54 +01:00
Rémi Verschelde
e69a5618c0 Merge pull request #100494 from havi05/bbcode-rainbow-effect
Fix `RichTextLabel` bbcode rainbow play reversed and paused
2024-12-18 17:23:36 +01:00
Rémi Verschelde
7b90590e85 Merge pull request #100422 from hpvb/from-the-depth-of-despair
Fix a crash trying to save an empty AudioStream
2024-12-18 00:39:53 +01:00
Rémi Verschelde
90555e6b4d Merge pull request #100378 from clayjohn/particles-preprocess
Reduce slider range for Particles preprocess to discourage setting a preprocess time of 10 minutes
2024-12-18 00:39:49 +01:00
kobewi
ceefc0d38a Implement 2D instance shader parameters
Co-authored-by: kobewi <kobewi4e@gmail.com>
Co-authored-by: yesfish <huwpascoe@users.noreply.github.com>
Co-authored-by: Álex Román Núñez <eirexe123@gmail.com>
2024-12-17 23:59:16 +01:00
HP van Braam
eb948bc5a8 Fix a crash trying to save an empty AudioStream
My friends, gather around as I learned something about the C standard
that is horrifying and may keep you, dear reader, up at night.

My journey began trying to fix something entirely unrelated and not
wanting to wait for ubsan builds when changing a testcase. So me, in my
infinite naivete just built the engine with tests=yes, but
optimizations turned on.

This resulted in a segfault on "[Audio][AudioStreamWAV] Save empty file".

Well, then, I thought. Lets built with asan then and find out where this
happens! Would it surprise you, my fellow traveler, that the results
were that no such crash occurred?

Thus, to the debugger I go! Fearless, with great optimism. Where I find
that through many an indirection the crash came because, somehow,
CowData::_unref() was getting called with a _ptr set to 0x1.

This can of course only end in tears. Or segmentation faults as we try
to read an atomic variable at the somewhat inconveniently situated
address at 0xfffffffffffffff0.

So I went and looked at the likely culprit, blaming many an innocent
recent change along the way. I shall spare you the falsly accused. But
if for some reason you slept poorly last night, I can assure you that
the voodoo dolls have been put away and will not be harmed further.

So in AudioStreamWAV::get_data() we go, where we find a perfectly
reasonable function! It checks to see whether or not its data is empty,
and if it is not it will resize a temporary Vector to have data_bytes of
space, after which it will do a perfectly pedestrian memcpy() and all is
well in the world.

Or so it seems! After many an hour of despair and disassembly I, at
last, decided to look at where the data gets set! A breakthrough!
Because of the padding data is never empty! So the code always runs!

Eureka! One would think. But then, foolishly, I looked into the
get_data() function one more. My mortal enemy was staring me in the
face, laughing. Because it did not care about this. Sure, the check was
worthless but still... What are we left with.

At this point I could feel the method mocking me.

"I resize the vector to 0, I then memcpy zero bytes into it." It said,
DARING me to object to this state of affairs.

And yet, if I changed the function to check for "data_bytes" rather
than data.is_empty() no crashes.

Was this a compiler bug? Am I losing my mind? But then... I remembered
the mantra of the wise compiler druids... "It Is Not A Compiler Bug".

But what then! The bug does not happen when memory is being watched!
Valgrind agreed that while accessing the SafeRefCount at
0xfffffffffffffff0 was incredibly rude, it did not inform me of anything
else untoward happening. So I read the memcpy() manpage... nothing... I
read the the memcpy() posix spec... nothing.

Finally, in despair and because I had nothing left to lose... The ISO C
language specification. As I was reading, I could hear
AudioStreamWAV::get_data() cackling, knowing that its time was up, but
proud of the madness it caused in my soul. Knowing I would never be the
same.

The behavior is undefined if either dest or src is an invalid or null pointer.

So... Here I stand before you, a broken person. But one richer in
knowledge.

I write you this from the depths of madness in the hopes that you, dear
reader, can be spared this ordeal.

May god have mercy on our souls.

We trigger the following sequence of events:

* memcpy(null, null, 0) is UB, thus dest and src cannot be null
* we inline the calls to the ctor and dtor
* now we have a function that does something that "proves"
  dest cannot be null
* we inline cowdata::_unref() which does a null check, on something
  that the compiler just convinced itself cannot be null
* the compiler removes the dead code branch where _ptr == nullptr
* we start to do pointer arithmetic on a nullptr and get send to
  uninitialized memory.

Co-Authored-By: Jason Beckmann <jasonabeckmann@gmail.com>
2024-12-17 23:14:39 +01:00
Rémi Verschelde
382b0dfad1 Merge pull request #100373 from TokageItLab/fix-blendspace-discrete-sync
Fix Sync in BlendSpace1D/2D with BlendModeDiscrete
2024-12-17 23:00:02 +01:00
Rémi Verschelde
f1eb2f928d Merge pull request #100039 from TokageItLab/ping-pong-param
Make `backward` be parameter of the `AnimationTree` in the `AnimationNodeAnimation`
2024-12-17 22:59:47 +01:00
Hugo Locurcio
7a04d85ec3 Only allow valid types in Decal, Light3D projector, PointLight2D texture and CSGMesh3D mesh
If an invalid type is supplied (which can still be done from a script),
a warning is printed (along with a workaround for ViewportTexture).

This also adds support for "negative" resource hints such as
"Texture2D,-ViewportTexture" to exclude one or more subclasses
from a class hint.

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2024-12-17 20:41:12 +01:00
Rémi Verschelde
ed51ec999c Merge pull request #100451 from larspet/update-syntax-highlight
Clear syntax highlighter cache when theme or syntax highlighter is changed
2024-12-17 16:19:37 +01:00
Rémi Verschelde
b69a28a613 Merge pull request #100429 from havi05/itemlist-draw-focus-syle-last
`Itemlist` draw focus stylebox after items
2024-12-17 16:19:25 +01:00
Rémi Verschelde
9830780b3d Merge pull request #100416 from TokageItLab/anode-ex
Make `AnimationNodeExtension` extend `AnimationNode` instead of `AnimationRootNode`
2024-12-17 16:19:22 +01:00
Rémi Verschelde
98ca63ae47 Merge pull request #99849 from Sauermann/fix-menu-button-hover
Fix `switch_on_hover` for `MenuButton`
2024-12-17 16:19:03 +01:00
Rémi Verschelde
1c94d13e21 Merge pull request #99721 from ryevdokimov/fix-spin-box
Fix removing last digit in spinbox while `update_on_text_changed` is true
2024-12-17 16:18:58 +01:00
Rémi Verschelde
d60c0e21a6 Merge pull request #88313 from wagnerfs/run-time-anisotropic-filtering
Allow changing the anisotropic filter level at run-time per Viewport
2024-12-17 16:18:38 +01:00
Rémi Verschelde
d701bc0032 Merge pull request #83917 from Calinou/directionallight3d-add-specular
Implement per-light Specular property in DirectionalLight3D
2024-12-17 16:18:29 +01:00
Markus Sauermann
0eff41d045 Fix displaying of embedded Window
Fix Rect of texture to take window and stretch transform into account.

There is no need for `viewport_attach_to_screen` for embedded windows,
since their display is handled via `Viewport::_sub_window_update`.
2024-12-17 08:38:14 +01:00
havi05
b905014128 Fix RichTextLabel bbcode rainbow play reversed and paused 2024-12-16 23:52:26 +01:00
Markus Sauermann
9c5886f95a Fix switch_on_hover for MenuButton
Previously, embedded Windows (the opened menu) were not accounted for
when checking for `switch_on_hover`.

`gui_get_hovered_control()` is more appropriate to check for the hover
status of other `MenuButton` nodes at the mouse position.

Explain the usage of the incorrectly used function in a comment.
2024-12-16 22:11:42 +01:00
havi05
0ee78a79cf Itemlist - draw focus stylebox after items 2024-12-16 19:49:14 +01:00
Andrew_Shobbrook
e42def12d0 Implement per-light Specular property in DirectionalLight3D 2024-12-16 19:18:18 +01:00
Thaddeus Crews
b1fb0f5f2f Merge pull request #100442 from GuilhermeGSousa/rename-animation-node-process
Rename animation node process function to avoid gdextension name collision
2024-12-16 12:10:02 -06:00
Thaddeus Crews
4d4c229a83 Merge pull request #100432 from markdibarry/add_get_line_range_rtl
Add `get_line_range()` to `RichTextLabel`
2024-12-16 12:09:54 -06:00
Thaddeus Crews
9c9af038d5 Merge pull request #91060 from dalexeev/code-edit-add-doc-tooltips
Code Editor: Add documentation tooltips
2024-12-16 12:09:45 -06:00
Thaddeus Crews
017f0eb33a Merge pull request #97449 from Geometror/ge-connections-prop
[GraphEdit] Make connections a property
2024-12-16 12:09:43 -06:00
Thaddeus Crews
ee7de7d088 Merge pull request #99361 from havi05/itemlist-hover-on-selected
`ItemList` highlight selected items and draw `cursor`-stylebox last
2024-12-16 12:09:42 -06:00
Rémi Verschelde
08508d2e01 Merge pull request #99700 from hpvb/scene_tree_editor_performance
Improve Scene Tree editor performance
2024-12-16 17:16:00 +01:00
Hendrik Brucker
e5be03a42b [GraphEdit] Make connections a property 2024-12-16 02:28:34 +01:00
Mark DiBarry
53a1be61a1 Add get_line_range to RTL 2024-12-15 19:09:42 -05:00
Lars Pettersson
2c16cfb52a Clear cache on syntax highlighter or theme change 2024-12-15 22:41:30 +01:00
Guilherme Sousa
469f5a8fbc Rename animation node process function 2024-12-15 18:27:21 +01:00
Danil Alexeev
80d11500b5 Code Editor: Add documentation tooltips 2024-12-15 10:51:33 +03:00
Silc Lizard (Tokage) Renew
8d5a5f130a Make AnimationNodeExtention extend AnimationNode instead of RootNode 2024-12-15 06:36:47 +09:00
havi05
b05111799b ItemList - highlight selected items && draw cursor last 2024-12-14 19:03:43 +01:00
Rémi Verschelde
ffe0cdebab Merge pull request #99355 from havi05/itemlist-toggle-mode
Add `Toggle` selection mode to `ItemList`
2024-12-14 18:25:25 +01:00
Rémi Verschelde
66a2ea4718 Merge pull request #98610 from Flarkk/fix_sphere_capsule
Fix normals of very large `SphereMesh` and `CapsuleMesh`
2024-12-14 18:25:17 +01:00
Rémi Verschelde
36c6ce92db Merge pull request #97660 from HolonProduction/completion-cancelation-🌈
GUI: Only cancel completion with the `ui_cancel` action
2024-12-14 18:25:13 +01:00
Rémi Verschelde
20064cf5c0 Merge pull request #95044 from Hilderin/fix-double-click-signal-connection
Fix connecting a signal with a double click is too difficult
2024-12-14 18:25:07 +01:00
Hilderin
4e19ab8afe Fix connecting a signal with a double click is too difficult
Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2024-12-14 16:18:34 +03:00
Silc Lizard (Tokage) Renew
d54229de8c Fix Sync in BlendSpace1D/2D with BlendModeDiscrete 2024-12-14 13:00:29 +09:00