Compare commits

...

201 Commits

Author SHA1 Message Date
Hein-Pieter van Braam-Stewart
66baa3b633 Also bump Info.plist for MacOS 2019-04-26 16:43:03 +02:00
Hein-Pieter van Braam-Stewart
e4816a8b1c Bump to 3.1.1-stable
Thanks everyone! You're all stars <3
2019-04-26 16:39:11 +02:00
homer666
5b6ad923f0 AnimationPlayer FPS mode fixes
(cherry picked from commit e3b7f9e1ca)
2019-04-26 16:34:18 +02:00
Ignacio Etcheverry
1c77481d3e Fix invalid mono log file name on Windows
(cherry picked from commit d93c354807)
2019-04-26 16:31:01 +02:00
Rémi Verschelde
a24899ee25 Revert "Update freetype to 2.10.0"
This reverts commit 9e2cf9ef0b.

It caused this regression: 28335.
Fixes #28335.
2019-04-25 14:18:42 +02:00
Rémi Verschelde
f7d5bee636 Revert "C#: Add DynamicGodotObject class"
This reverts commit 4c10a322d1.
2019-04-25 14:08:14 +02:00
Rémi Verschelde
23cf9f3b6f i18n: Sync translation template with current source 2019-04-25 14:03:22 +02:00
Rémi Verschelde
348270df38 i18n: Sync translations with Weblate 2019-04-25 14:01:33 +02:00
Rémi Verschelde
a485d862f1 doc: Sync classref with current source 2019-04-25 14:00:31 +02:00
Juan Linietsky
fcbe50befa Added bindings for methods related to obtaining base an instance from VisualInstance
(cherry picked from commit 33a0011ab2)
2019-04-24 07:01:39 +02:00
Juan Linietsky
08113feb5f Expose visible instance count to multimesh
(cherry picked from commits f46899e922)
and 479649b5fb)
2019-04-24 07:01:04 +02:00
Rémi Verschelde
4764e17970 Revert "Added the ability to change the default cursor property for the RichTextLabel component."
This reverts commit 4fda05e15f.
2019-04-23 16:01:16 +02:00
Ignacio Etcheverry
39f1a110a1 Fix wrong method binds and registered class
(cherry picked from commit 2f3328a039)
2019-04-22 21:57:06 +02:00
Rémi Verschelde
cab4921477 Revert "GDScript: Don't allow built-in scripts to use class_name"
This reverts commit 42514bfd80.

There is still an unsolved regression from this commit (#28002)
which needs to be addressed before cherry-picking this one.
2019-04-21 14:06:06 +02:00
Hein-Pieter van Braam-Stewart
4aa7760c74 Revert "Ensure non-emitting particles not processed on entering tree"
This reverts commit 24b7f08892.

This causes a particles regression in tps-demo
2019-04-21 00:59:13 +02:00
Hein-Pieter van Braam-Stewart
4fefc0896d Delete <demos> tag from HeightMapShape xml 2019-04-21 00:11:01 +02:00
Juan Linietsky
d8cae6e7f6 Implement autokeying in Animation editor.
(cherry picked from commit 296c74072c)
2019-04-21 00:02:02 +02:00
Juan Linietsky
a7f0bfb7db Oops I missed a line, continuation to 0d41f8f.
(cherry picked from commit 8f762aefcd)
2019-04-21 00:01:44 +02:00
Juan Linietsky
5cc03473e0 Also show length in FPS when using FPS mode for AnimationPlayer editor
(cherry picked from commit caaa492133)
2019-04-21 00:01:32 +02:00
Juan Linietsky
6fac922bff Add support for FPS snap in Animation Editor.
(cherry picked from commit 4203266923)
2019-04-20 23:57:59 +02:00
Juan Linietsky
0064d26517 Some improvements to is_equal_approx, restored Quat operator.
(cherry picked from commit dee98d3b6d)
2019-04-20 23:52:19 +02:00
Juan Linietsky
c76c33fb50 Added generator audio stream, and spectrum analyzer audio effect
Made AudioFrame and Vector2 equivalent for casting.
Added ability to obtain the playback object from stream players.
Added ability to obtain effect instance from audio server.

(cherry picked from commit e33764744c)
2019-04-20 23:50:19 +02:00
Juan Linietsky
5e02d6d98a Avoid crash on changing snap mode when no animation exists, closes #28031
(cherry picked from commit 0d41f8fb00)
2019-04-20 23:49:20 +02:00
Chaosus
71753edeae Added normally distributed generation function to RNG
(cherry picked from commit 5f137925dc)
2019-04-20 23:39:04 +02:00
Martin Wallin
ff3987598e Ignore default ccls cache folder and compile commands jso
(cherry picked from commit 8be9fd83ad)
2019-04-20 23:38:00 +02:00
Bastiaan Olij
49df4b7a7a Added height map shape that implement heightmap collision shape
(cherry picked from commit 8627f1515b)
2019-04-20 23:33:50 +02:00
Chaosus
6ab01490f5 Added smoothstep built-in function
(cherry picked from commit 514a3fb96a)
2019-04-20 23:30:56 +02:00
Chaosus
340bf6e80c Added direction_to method to vectors
(cherry picked from commit 55f3bd97a2)
2019-04-20 23:24:35 +02:00
Chaosus
9535a6079e Added functions to AStar for disable/enable points
(cherry picked from commit cc71fb2308)
2019-04-20 23:21:06 +02:00
ShyRed
bb8f015595 Add converters / generators to Sprite
Adds the following menu options to the Sprite editor: "Convert to Mesh2D", "Convert to Polygon2D", "Create CollisionPolygon2D Sibling" and "Create LightOccluder2D Sibling"

(cherry picked from commit c218c631f6)
2019-04-20 23:19:55 +02:00
Michael Alexsander Silva Dias
94f6c3a810 Make AnimatedSprite able to play backwards
(cherry picked from commit 4a2c433028)
2019-04-20 23:17:21 +02:00
muiroc
42fa261563 Enable object decoding when serializing binary project settings
(cherry picked from commit 1f54b11da6)
2019-04-20 23:15:08 +02:00
Fabio Alessandrelli
e0fe795433 Add object encoding param to serialization methods
Network peers get_var/put_var
File get_var/store_var
GDScript/Mono/VisualScript bytes2var/var2bytes
Add MultiplayerAPI.allow_object_decoding member which deprecates PacketPeer.allow_object_decoding.

Break ABI compatibaility (API compatibility for GDNative).

(cherry picked from commit 393e62b98a)
2019-04-20 23:15:02 +02:00
Fabio Alessandrelli
a1ad05df86 Multiplayer API now respects allow_object_decoding
Add doc about allow_object_decoding in PacketPeer

(cherry picked from commit 53ab3a1ba9)
2019-04-20 23:14:54 +02:00
Fabio Alessandrelli
ffc47d6fbe Use same boolean for objects encode and decode.
In a very unintuitive move encode needed false to encode an object,
decode needed true to decode it.
They now need the same value: `true`.

(cherry picked from commit e61a074a8e)
2019-04-20 23:14:47 +02:00
Ignacio Etcheverry
9b65bd18bc Fix memory leak introduced in bb6814a
(cherry picked from commit 0338e55a6e)
2019-04-20 23:10:55 +02:00
Ignacio Etcheverry
4c10a322d1 C#: Add DynamicGodotObject class
Expands to Object.call, Object.set and Object.get for accessing members. This means it can also access members from scripts written in other languages, like GDScript.

(cherry picked from commit bb6814aef0)
2019-04-20 23:10:43 +02:00
Mariam Naiga
7851d828a2 Fix cursor color in Label/RTL in editor
Fixes #26246.

(cherry picked from commit d179cbc3c2)
2019-04-20 23:09:47 +02:00
Ignacio Etcheverry
17cb8878c7 Workaround for syntax highlighting issue in GitHub
(cherry picked from commit 7a4cf6339d)
2019-04-20 23:01:08 +02:00
ForLoveOfCats
24ac1439e8 Mono: Convert all items to string before printing
(cherry picked from commit 25f563c4c8)
2019-04-20 23:00:21 +02:00
Rémi Verschelde
1353c98279 FS dock: Allow deselecting items by clicking empty space
Fixes #27546.

(cherry picked from commit 3da2894d82)
2019-04-20 22:59:25 +02:00
Nuno Cardoso
fce901ce40 Fixes #17233 allowing C# to override _GetPropertyList
(cherry picked from commit d011c8e109)
2019-04-20 22:56:42 +02:00
Tomasz Chabora
a758b329d0 Save opened scenes when necessary
(cherry picked from commit 331f922359)
2019-04-20 22:50:16 +02:00
Ignacio Etcheverry
c7e5b371be Mono: Logging improvements
- The default log level in debug builds is now 'info' instead of 'debug'.
- Add option to specify a different log level with the 'GODOT_MONO_LOG_LEVEL' environment variable.
- The name of log files is now a readable date and time.
- Always print the log file path (previously it was printed only it in verbose mode).

(cherry picked from commit 20e5e2fec7)
2019-04-20 22:49:26 +02:00
Bastiaan Olij
edba82b940 Add camera permissions to android
(cherry picked from commit fab84c7dff)
2019-04-20 22:48:34 +02:00
volzhs
9e2cf9ef0b Update freetype to 2.10.0
(cherry picked from commit a6300b454d)
2019-04-20 22:42:45 +02:00
lupoDharkael
904bfa6a72 Validate scripts when they are loaded in the text editor
(cherry picked from commit f137166251)
2019-04-20 22:38:47 +02:00
Chaosus
aa78461ebd Added possibilty to delete multiple nodes in visual shaders via Delete key
(cherry picked from commit 24faddc211)
2019-04-20 22:37:56 +02:00
Tomasz Chabora
ab8ccee1da Focus SceneTree dock after creating new node
(cherry picked from commit 9432e06e05)
2019-04-20 22:37:13 +02:00
George Marques
42514bfd80 GDScript: Don't allow built-in scripts to use class_name
(cherry picked from commit e56f5d5c91)
2019-04-20 22:36:34 +02:00
Bojidar Marinov
667dc0b336 Check for subclasses when checking for name clashes
Fixes #27460

(cherry picked from commit ece09f9872)
2019-04-20 22:35:30 +02:00
Guilherme Felipe
40c2a5ff57 [AnimationNodeBlendTreeEditor] Usability improvements
- Add possibility to exclude multiple (selected) nodes.
- Add context menu (Right click) to add nodes.

(cherry picked from commit ccbf57611b)
2019-04-20 22:31:45 +02:00
Chaosus
d0bebee560 Fix File opened with READ_WRITE on Windows
To allows use read and write anytime and in any order

(cherry picked from commit 8d12dfa24d)
2019-04-20 22:25:02 +02:00
bruvzg
d9aa43e793 [macOS] Allow non-resizeable windows to enter fullscreen mode.
(cherry picked from commit 7c7182483f)
2019-04-20 22:23:25 +02:00
piyushdagar
a329f6fa0b Fixes Adding animation to AnimatedSprite doesn't update inspector immediately
(cherry picked from commit d86d7981cc)
2019-04-20 22:15:01 +02:00
Chaosus
4f3fc559bc Added method to clear all points in Line2D
(cherry picked from commit 61b22beeae)
2019-04-20 22:14:16 +02:00
Chaosus
759c1fb0b8 Added signal for Tween emitted at completion
(cherry picked from commit a19e99aacb)
2019-04-20 22:13:33 +02:00
LATRio
ae6d45b0f2 Fix TextureRegion margin bug introduced in #27122
(cherry picked from commit f38173fb19)
2019-04-20 22:09:57 +02:00
LATRio
2213a21ab3 Fixing zooming in TextureRegion
Fixes #20710

(cherry picked from commit 22030d4cc4)
2019-04-20 22:09:30 +02:00
Martin Wallin
b887d3f8e8 Display vertex number when hovering point in collision polygon
(cherry picked from commit ed06ed38fb)
2019-04-20 22:07:01 +02:00
marxin
c33a924c28 Fix new GCC 9 warnings: -Wdeprecated-copy.
(cherry picked from commit 6be77da7eb)
2019-04-20 22:04:25 +02:00
groud
4be1343f3c Enhance tree scrolling when dragging
(cherry picked from commit 14a901e88f)
2019-04-20 22:00:35 +02:00
Rémi Verschelde
34c2679506 Fix disable_3d=yes -Wunused-variable errors
(cherry picked from commit f25b057846)
2019-04-20 20:30:57 +02:00
Hein-Pieter van Braam-Stewart
650c8512cd Object::script may not be a valid Ref<Script>
It appears that Object::script may be a valid ScriptInstance but not be
castable to Ref<Script>. There were only 5 places in the code that made
this assumption. This commit fixes that.

(cherry picked from commit 20b0046945)
2019-04-20 20:30:30 +02:00
Ignacio Etcheverry
852997e446 Mono: Use exit(status) instead of abort() in exception hook
(cherry picked from commit 8759c0e31a)
2019-04-20 20:30:06 +02:00
Rémi Verschelde
01b39be9e6 Compression: Set Zstd max window size via public parameter
`ZSTD_DCtx_setMaxWindowSize` is still part of the experimental API
(thus unexposed in the shared library). Upstream examples seem to
use `ZSTD_d_windowLogSize` instead, so it's probably what we should
use too.

Fixes #17374.
Distro packagers can now unbundle Zstd.

(cherry picked from commit 20265879e2)
2019-04-20 20:29:45 +02:00
Rémi Verschelde
4298db56cf zstd: Update to upstream 1.4.0
One step towards fixing #17374 as most experimental APIs we use are now
part of the stable 1.4.0.

(cherry picked from commit 88cb9bd27f)
2019-04-20 20:29:34 +02:00
volzhs
3c635b4bdf Fix get_unique_id() on Android
(cherry picked from commit 5a4b2087a0)
2019-04-20 20:29:03 +02:00
James Buck
7b8e7d6514 Fix setting of PopupMenu item IDs in editor
(cherry picked from commit ae646261e3)
2019-04-20 20:28:23 +02:00
CatThingy
4da40c39f1 Removed unnecessary error from _area_inout
The error was previously removed from _body_inout
for the same reason. Fixes #28022.

(cherry picked from commit 8166f8d3c8)
2019-04-20 20:25:40 +02:00
Michael Alexsander Silva Dias
7ddd4f7232 Fix position of tile names in TileSet editor when zooming in/out
Fixes #27713.

(cherry picked from commit d2a7624687)
2019-04-20 20:25:09 +02:00
clayjohn
965b13d62a fixed bug in mip map sigma
(cherry picked from commit 670c1b10b2)
2019-04-20 20:24:44 +02:00
volzhs
20ffda695a Set initial value for autorestart_random_delay of AnimationNodeOneShot
(cherry picked from commit eea3bddd1d)
2019-04-20 20:24:27 +02:00
PouleyKetchoupp
367b371fdd Fixes caches_cleared signal discrepancies in AnimationTree (fixes #25460)
(cherry picked from commit 66e07a2ec6)
2019-04-20 20:23:10 +02:00
PouleyKetchoupp
d0c5dc77f3 EditorFolding ignores hidden properties for folded resources (fixes #26663)
(cherry picked from commit 790a78273f)
2019-04-20 20:22:47 +02:00
Andrea Catania
3d74b1e2ef Added No bone set state in the IK
The problem is that initially the root bone was not set, and you didn't know that because the "no set" state was missing. Now I've added it. https://github.com/godotengine/godot-docs/issues/2333

(cherry picked from commit f65fde73da)
2019-04-20 20:22:01 +02:00
Rémi Verschelde
320105ff05 Fix TTR string for class reference tooltip
Fixes #27852.

(cherry picked from commit 38104bb89d)
2019-04-20 20:21:30 +02:00
Bastiaan Olij
2020f43261 Added eye_height, changed description and fixed size of viewport issue
(cherry picked from commit e0b703e3fe)
2019-04-20 20:21:02 +02:00
Rémi Verschelde
95766f5a6a Fix condition in editor icons filtering logic
Fixes #27595.

(cherry picked from commit 5062b4a26b)
2019-04-20 20:20:48 +02:00
Fabio Alessandrelli
7434760380 Fix jump over uninitialized value in OS Unix/X11
(cherry picked from commit 0bcf0314f7)
2019-04-20 20:18:01 +02:00
PouleyKetchoupp
a028160522 Fixed uninitialized xfade in AnimationNodeTransition
(cherry picked from commit dafd7768ab)
2019-04-20 20:17:35 +02:00
JFonS
792beb4b83 Fix hint_range for GLES2 shader uniforms
(cherry picked from commit 059078f075)
2019-04-20 20:17:13 +02:00
Daniel Kulas
c6fa282fbb Fix "Show in File Manager" option
(cherry picked from commit 22b861ad97)
2019-04-20 20:16:35 +02:00
Hendrikto
456eb53439 Remove unused imports
(cherry picked from commit 49a81308c0)
2019-04-20 20:15:44 +02:00
Rémi Verschelde
782a6dcdde SCons: add methods.using_clang to check used compiler
Also rename `use_gcc` to `using_gcc` to make it clear that it returns
a config but does not alter it.

(cherry picked from commit e4a96164b6)
2019-04-20 20:14:43 +02:00
Hugo Locurcio
a1388dff7e Find the previous match in script editor when pressing Shift + Enter
This allows cycling through matches more efficiently.

(cherry picked from commit 8a1c5a8390)
2019-04-20 20:13:26 +02:00
Ignacio Etcheverry
3445984901 Replace a few #if/#elif with #ifdef and "#elif defined"
(cherry picked from commit ad2127a3e8)
2019-04-20 20:13:07 +02:00
Hugo Locurcio
bd2e707e2f Add support for type hints in non-default script editor templates
This also refactors template processing to avoid repetition.

This closes #27074.

(cherry picked from commit 00799fc8c2)
2019-04-20 20:12:53 +02:00
Michael Alexsander Silva Dias
72b4844d42 Fix crash when using the Tileset Editor when the given shape has no points
(cherry picked from commit 9501900e1b)
2019-04-20 20:10:54 +02:00
Robear Selwans
96222dedb5 Fixed an issue where changing the default_cursor on the RichTextLabel's meta_hover_ended caused the entire project to crash
(cherry picked from commit 84dfb3ff2d)
2019-04-20 20:09:57 +02:00
Guilherme Felipe
aedea36d0c Fix wrong blend of animation tree
Interpolation cannot use zero values, must use the values from the
animation to be blended.

(cherry picked from commit 45d97b9860)
2019-04-20 20:09:34 +02:00
Anish Bhobe
16097dd174 Added GLES2 RenderStorage Info calculations.
Proper counting code has been added to update info struct.

Extra: Added the render_info_capture calculations.
Fixes: #27273
(cherry picked from commit 4839b17f93)
2019-04-20 20:08:54 +02:00
Hugo Locurcio
afe6d654d5 Use the "warning" color for the "restart required" label
This makes the color match the warning icon placed besides the label.

(cherry picked from commit cca1fab1c4)
2019-04-20 20:08:37 +02:00
Vivatchai Kaveeta
59b2f02ac7 Fix import grayscale EXR
Fix #27299

(cherry picked from commit f0562a5ef6)
2019-04-20 20:08:09 +02:00
qarmin
8f537cfa19 Fix toggle visibility in SceneTreeDialog
(cherry picked from commit 2bc6ad670b)
2019-04-20 20:06:50 +02:00
Daniel Rakos
b439515d73 Fix skeleton reparenting to also work when the skeleton node is not a bone
Existing code only did the reparenting when the parent node was a bone. This
change fixes that, plus the reparenting code itself, which used the index of
the skin instead of the skin index itself to address the skeleton array.

(cherry picked from commit 1cf7ca87ce)
2019-04-20 20:06:03 +02:00
Timo Schwarzer
e31d6367ea Allow whitespaces in warning-ignore comments
(cherry picked from commit 7a0dfc04aa)
2019-04-20 20:05:25 +02:00
Will Nations
0e7de28b8d Add EditorInspector getter. Update Sub-Inspectors.
(cherry picked from commit c1b247e4d5)
2019-04-20 20:04:43 +02:00
qarmin
0f51f138b5 Fix perspective button hide when it should be actually disabled
(cherry picked from commit 2e5b6b5bde)
2019-04-20 20:04:21 +02:00
toasteater
511fb03e20 Respect keep_3d_linear when transparent_bg is on.
When transparent_bg is on, or the render target is too small,
Godot would skip postprocessing and disregard keep_3d_linear.

This fixes #26817.

(cherry picked from commit 7cbfce7a8c)
2019-04-20 20:03:16 +02:00
Andrii Doroshenko (Xrayez)
4574894e43 Reorder reverse caps characters table for string lower case conversion
The binary search algorithm used to lookup character codes in the table
relies that the data must be ordered. This fixes `to_lower()` string
method to convert upper case to lower case properly, so that the
algorithm doesn't terminate prematurely.

Co-authored-by: AndreevAndrei (avandrei) <avandrei@MacBookAAV.local>
(cherry picked from commit 34e6737413)
2019-04-20 20:02:45 +02:00
James Buck
f673bc1e3d Fix editor tooltip formatting
Removed unnecessary word wrap which caused broken tags and general
ugliness. Fixes #24926

(cherry picked from commit 8b1b2f6a4c)
2019-04-20 19:53:44 +02:00
Tomasz Chabora
7a94bac34e Document SceneTree.get_frame() and persistent in add_to_group
(cherry picked from commit 1e9128238e)
2019-04-19 13:12:30 +02:00
Rémi Verschelde
781b8a6c0f xatlas: Redo our custom changes, but properly documented
(cherry picked from commit 44f9a966e0)
2019-04-19 13:12:06 +02:00
Rémi Verschelde
a29700e034 xatlas: Revert to unmodified upstream code, add to COPYRIGHT
Imported by @reduz from b8ec29b6b6
Custom changes will be remade properly in the next commit.

(cherry picked from commit 1e39fee140)
2019-04-19 13:11:58 +02:00
Rémi Verschelde
def0820385 Drop unused thekla_atlas dependency
Since f12cb82 @reduz dropped the use of the thirdparty thekla_atlas
library, which is replaced by xatlas.

Fixes #28180.
Fixes #28182.

(cherry picked from commit 6640f397f1)
2019-04-19 13:11:13 +02:00
Rémi Verschelde
53d73f59eb doc: Drop unused <demos> tag
(cherry picked from commit 6af69f851a)
2019-04-19 13:10:25 +02:00
Soham Kar
aa0d4ffe51 Fixed copy&paste error #28117
Changed "left to right" in VSplitContainer to "top to bottom".

(cherry picked from commit aa8b2f4448)
2019-04-19 13:05:50 +02:00
Rémi Verschelde
af12b2d18b doc: Add note about VisibilityNotifier.is_on_screen after instantiation
Fixes #9430.

(cherry picked from commit 3fc1f7dfbe)
2019-04-19 13:05:36 +02:00
Siddharth
d99a0a5fba fixes #25707 documentation of v_scroll_speed
Fixes #25707

Update TextEdit.xml

(cherry picked from commit 3f2aac5e0a)
2019-04-19 13:05:20 +02:00
Michael Alexsander Silva Dias
f12848f9e1 Document String's 'is_valid_filename()'
(cherry picked from commit 70499faff8)
2019-04-19 13:05:06 +02:00
Tomasz Chabora
28f547a021 Added some documentation for Slider
(cherry picked from commit de4877e1fc)
2019-04-19 13:04:51 +02:00
Ryan Roden-Corrent
fd4a65df7b Fill out some of the AnimationNode docs.
The API docs for various animation nodes are pretty empty, yet the
tutorial at
https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html
contains some details.

These details should be included in the API docs so looking up a
particular class actually provides some information rather than
requiring the user to hunt for a different tutorial.

This also links the AnimationTree tutorial and demo in the docs.
I've found the TPS demo to be the best resource so far for learning
how to use the AnimationTree. This should be easy to find if someone
looks up the AnimationTree API docs.

Finally, this fixes a param typo in AnimationNodeStateMachine.

(cherry picked from commit 584288a32c)
2019-04-19 13:04:22 +02:00
toasteater
8d87f624eb Improve RandomNumberGenerator docs.
Clarified behavior of a few methods. Added implementation notes so
that developers not familiar with RNGs are alerted to common pitfalls.

(cherry picked from commit ae1393acae)
2019-04-19 13:03:28 +02:00
Rémi Verschelde
a033640276 Merge pull request #27304 from hasahmed/patch-1
Added minimal documentation for _get_configuration_warning method
2019-04-12 12:47:54 +02:00
Hasan Yusuf Ahmed
0eeb1a7d0d Added minimal documentation for _get_configuration_warning method 2019-04-12 02:56:26 -04:00
Rémi Verschelde
b5d9099626 Revert "Properly setup seed in RNG"
This reverts commit 1dd72dca45.
As pointed out in #27171, it would break compatibility with 3.1.0.
2019-04-09 09:36:31 +02:00
Rémi Verschelde
6137387ede i18n: Sync translations with Weblate
(cherry picked from commit 3c4938d59a)
2019-04-08 12:38:15 +02:00
Rémi Verschelde
4243f8b32a Update AUTHORS and DONORS list
New contributors added to AUTHORS:
@pouleyKetchoupp, @qarmin

Thanks to all contributors and donors for making Godot possible!

(cherry picked from commit 4fad7608c4)
2019-04-07 21:48:00 +02:00
Rémi Verschelde
2fbc4219db Merge pull request #27754 from godotengine/fix_empty_types_in_json
Fix where json exported empty types
2019-04-07 11:54:23 +02:00
Bastiaan Olij
6226be9595 Fix where json exported empty types 2019-04-07 17:33:35 +10:00
Ignacio Etcheverry
b836420fd8 Mono: Buildsystem support for finding MSBuild from VS2019
(cherry picked from commit e82b2def8e)
2019-04-06 21:20:19 +02:00
ForLoveOfCats
37e62939e0 Mono: Make missing default constructor error more foolproof
(cherry picked from commit 444242a080)
2019-04-06 21:19:57 +02:00
ForLoveOfCats
276cd771f9 Mono: Makes GD.Convert take Variant.Type instead of int
(cherry picked from commit 46e79e6fad)
2019-04-06 21:19:36 +02:00
Marc Gilleron
c94e80a0a3 Fix wrong heights data used to compute min and max heights
(cherry picked from commit cdcdba704b)
2019-04-06 21:19:24 +02:00
Andrii Doroshenko (Xrayez)
948562261d Fix BitMap calculating incorrect true bit count
(cherry picked from commit b16946dea6)
2019-04-06 21:19:08 +02:00
Hugo Locurcio
67dc8cf252 Use the editor theme's accent color for 2D/3D selections and rotations
(cherry picked from commit d59b210aec)
2019-04-06 21:18:20 +02:00
Hugo Locurcio
93875a79bb Use the accent color to highlight selected text
This makes selections easier to see, while making them fit better
within the editor theme.

This closes #22552.

(cherry picked from commit 9ba6738719)
2019-04-06 21:18:06 +02:00
ShyRed
d538fb8d6c Remove hardcoded joint bias
Use user provided bias instead of hardcoded bias.

(cherry picked from commit 96093778ed)
2019-04-06 21:17:37 +02:00
qarmin
4ba90b9dda Show bones after creating
(cherry picked from commit 1b6e0d04f0)
2019-04-06 21:17:04 +02:00
qarmin
b5bd8e5f1b Fix deleting properties after deleting files
(cherry picked from commit 4cee053f7c)
2019-04-06 21:16:21 +02:00
shartte
a4610ca61e Clarify encoding used for text by the File class
(cherry picked from commit d1c095b30a)
2019-04-06 21:14:47 +02:00
PouleyKetchoupp
e8e57c49de Fixed Transform FLIP_Y and FLIP_Z set as identity transform
(cherry picked from commit 8828385792)
2019-04-06 21:14:04 +02:00
Rémi Verschelde
40ec89d24d GLES3: Fix regression in particles buffer initialization
Bug introduced in #26343 where `(float *)` was mistakenly converted
to `(uint8_t *)`, so we were getting `2` instead of `8`.

Fixes #27705.

(cherry picked from commit b182e038e7)
2019-04-06 21:13:07 +02:00
Rémi Verschelde
fd3845cdad Revert "Properly explain RPC/RSET mode failure."
This reverts commit 24b049ec9e.
It introduced regressions, see #27655.
2019-04-05 18:18:37 +02:00
Rémi Verschelde
2ad86122ac SCons: Fix OPUS_ARM_OPT flag applied for all android/iphone arches
The first 'if' always evaluated to true, as it evaluated values which are the default
ones for Android and iOS respectively, so even if one of them was overridden, the other
one would be true.

Fixes #27658.

(cherry picked from commit c2fb1c9f01)
2019-04-04 12:41:25 +02:00
Fabio Alessandrelli
24b049ec9e Properly explain RPC/RSET mode failure.
_can_call_mode used to call is_network_master/get_network_master
internally.
This would reset any potential last error set via ERR_EXPLAIN,
preventing it from being displayed correctly.
_can_call_mode now expects the node master ID to be passed instead.

(cherry picked from commit 95ad747dea)
2019-04-04 12:40:59 +02:00
Rémi Verschelde
c4ff65207d dist: Rename Linux mime type to follow system convention
Mime type definitions are usually named like the mime type they define,
i.e. x-godot-project in our case.
It was introduced with reverse DNS naming as that's what FlatHub favors,
so it will need to be renamed there.

(cherry picked from commit 7eabf4c8a3)
2019-04-03 17:02:46 +02:00
Rémi Verschelde
b502152195 SCons: Fix python3 compat for builtin_bullet=no
(cherry picked from commit 44f1b390a3)
2019-04-03 17:01:25 +02:00
marxin
4889c65922 Fix -Wnon-virtual-dtor warnings.
Example of the warning:
./core/script_language.h:198:7: warning: 'class ScriptCodeCompletionCache' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]

(cherry picked from commit f9f2413e69)
2019-04-03 17:01:04 +02:00
Paulb23
4eefd2d581 Fixed not deselecting when clearing lineedit.
(cherry picked from commit bfba1e36bc)
2019-04-03 17:00:45 +02:00
clayjohn
2b3f2ee372 keep DEPTH from causing compile error in GLES2
(cherry picked from commit 5056b4a02c)
2019-04-03 17:00:21 +02:00
Leonard
929e3595c8 Apply proper offset to CSGMesh material and smooth group
(cherry picked from commit 209c2d2c80)
2019-04-03 16:59:48 +02:00
Daniel Rakos
dc928e6174 Fixed handling of depth texture so it's resolved and bound when needed
- Cleaned up and improved the code determining when we need to use a depth
  prepass (previously it wasn't executed in certain cases even if it was
  needed)
- Added code to prepare and bind the depth texture even when no depth prepass
  or MRTs (more precisely effect buffers) are used

Fixes #25870, #25535, and #25387.

(cherry picked from commit 849596c40c)
2019-04-03 16:56:11 +02:00
Allan Davis
38e5f94e19 Enable Mojave "dark mode" on the editor title bar
Enables "dark mode" in the editor and project selector title bars in macOS Mojave when selected in macOS System Preferences

(cherry picked from commit bba5716899)
2019-04-03 16:55:42 +02:00
ShyRed
dc259b95d8 Add Emission Mask to CPUParticle2D
Add ability to load emission masks to CPUParticle2D.

(cherry picked from commit dcd268e183)
2019-04-03 16:54:33 +02:00
Kanabenki
d59b97cca7 Keep binds for connected signals when changing node type
(cherry picked from commit a1e7febbb3)
2019-04-03 16:54:11 +02:00
Marcelo Fernandez
37c97d09e6 Fix MIDI Note Off missing on some devices
(cherry picked from commit ea0c398a19)
2019-04-03 16:53:47 +02:00
Chaosus
1dd72dca45 Properly setup seed in RNG
(cherry picked from commit 6280be46a6)
2019-04-03 16:53:30 +02:00
qarmin
29a6e7d306 Do not lose focus when moving through scene tree
(cherry picked from commit 138698e51f)
2019-04-03 16:52:27 +02:00
marxin
e3ae29e666 Enable warnings=extra on clang and GCC testers.
And remove 2 warnings from warnings=extra.

(cherry picked from commit e7f22ebdcd)
2019-04-03 16:52:01 +02:00
Daniel Spaniol
044ec35f62 Require return in all match branches
Before the parser only checked if the catch-all branch has a return in
order to determine if the entire match block has a return.

This code block was assumed to always return.

    match value:
        "test":
            print("test")
        _:
            return

Now as soon as one of the branches has no return, the entire match block
is marked to not have a return.

(cherry picked from commit 79176decd5)
2019-04-03 16:51:43 +02:00
Will Nations
8b1b8181b3 Fix inherited icons for script classes
(cherry picked from commit 2d106eb715)
2019-04-03 16:50:50 +02:00
Juan Linietsky
5ec63c62a1 Add documentation about nested YSort nodes.
(cherry picked from commit ed3586afa1)
2019-04-03 16:49:34 +02:00
Michael Alexsander Silva Dias
3ccb859711 Remove unused 'fav_rm' ToolButton in EditorFileDialog
(cherry picked from commit 579fffd97e)
2019-04-03 16:49:15 +02:00
Rémi Verschelde
7f691e8bb9 Merge pull request #27419 from GameCoderStudios/keep-custom-tracks-properties
Fix: Keep-custom-tracks option now keeps animation loop property and value track update mode.
2019-04-01 17:16:05 +02:00
Anish
f4578e1008 Prevents crash on loading unrecognized resources.
Editor crashes on trying to load resources with no loaders.
Simple check on the resource loader prevents using a null
resource loader.

Fixes: #27385
(cherry picked from commit 8ee31ace34)
2019-04-01 11:25:43 +02:00
Magnus Specht
1d05568aed Fixed unfinished max_lines handling for crash avoidance.
(cherry picked from commit 601acdf0e1)
2019-04-01 11:25:22 +02:00
Ignacio Etcheverry
e3e33daeb9 C#: Bindings generator now translates BBCode docs to XML comments
(cherry picked from commit 1ad16b3d4a)
2019-04-01 11:24:49 +02:00
thomas.herzog
3e0fc6906e [GDNative] fix NativeScript leak in editor
(cherry picked from commit 5fff7f741a)
2019-04-01 11:23:31 +02:00
thomas.herzog
cf8bd34941 [GDNative] remove spam at editor unfocus when using NativeScript
(cherry picked from commit 0e5b2b16ed)
2019-04-01 11:23:26 +02:00
Sebastian Hartte
08f3562fd1 Add support for new MSBuild directory naming introduced in VS 2019.
(cherry picked from commit 7440295ad1)
2019-04-01 11:22:47 +02:00
Sebastian Hartte
c7c8c0700f Fix parsing of generic type declarations in C# source files.
(cherry picked from commit 34366bc27f)
2019-04-01 11:21:07 +02:00
Daeil Kim
364aea1eff Ensure non-emitting particles not processed on entering tree
Also removed non-active CPUParticles(3d) from render list
Fixes #27066

(cherry picked from commit 24b7f08892)
2019-04-01 11:20:35 +02:00
Kanabenki
72433a35b1 Add missing check for 2d physics bounce and friction setters
The override check was already present for 3d physics but missing for 2d

(cherry picked from commit 3f64215a43)
2019-04-01 11:19:32 +02:00
piyushdagar
683c95ebdb Fixed CollisionObject signals do not trigger on Area
(cherry picked from commit d7387e8a68)
2019-04-01 11:19:13 +02:00
karroffel
03d00ca36b fix GDNative binding generation for object types
(cherry picked from commit 197d642014)
2019-04-01 11:18:51 +02:00
Vivatchai Kaveeta
dffc754a0a Fix order of transformation in GLTF import
From the gltf 2 spec, the order is R  * S. Previously we did S * R, which broke some mesh with non-uniform scale.

Fix #23356, Fix #14725

(cherry picked from commit 32dd9c67c6)
2019-04-01 11:18:23 +02:00
Paulb23
9ca440b763 Fix script editor attempting to set current line to -1 on script open
(cherry picked from commit 6f6d4a6c2e)
2019-04-01 11:17:58 +02:00
Guilherme Felipe
2f8362a2ab StateMachine: Fix sync mode
(cherry picked from commit d35eae166c)
2019-04-01 11:17:33 +02:00
Rémi Verschelde
2e9cf9829c Fix misplaced hint for interface/theme/accent_color
Supersedes #26992.

(cherry picked from commit b17c8c0396)
2019-04-01 11:17:08 +02:00
Michael Alexsander Silva Dias
1f9809032d Make bottom panel only try to hide editors when they're visible
(cherry picked from commit ebabb0ea65)
2019-04-01 11:15:57 +02:00
Fabio Alessandrelli
b2d13ba7b7 Enabled logging of failed image download.
(cherry picked from commit 37c0ac1d6d)
2019-04-01 11:15:30 +02:00
janglee123
9bd25ce7d2 fixed toggelling snap mode while transforming
(cherry picked from commit 05446e8b53)
2019-04-01 11:15:06 +02:00
K. S. Ernest (iFire) Lee
804b68c981 Fix scaling issue for texture button focus texture.
(cherry picked from commit 1971c09e5e)
2019-04-01 11:14:34 +02:00
Michael Alexsander Silva Dias
373e6aa17a Make size cache dirty when removing tiles in 'TileMap'
(cherry picked from commit be5f35dfa0)
2019-04-01 11:14:08 +02:00
Windy Darian
695f1a9185 Fix bone aabb calculation, which caused a skeletal mesh culling issue
There was a bug that could result in most bone aabb boxes ending up with
tiny size upon import and mess up with culling of skeletal meshes. This
fixes it.

(cherry picked from commit ff318d91ee)
2019-04-01 11:13:48 +02:00
qarmin
5650c1ecde Fix inspector update after changing anchor via buttons
(cherry picked from commit 8b391b9ab0)
2019-04-01 11:13:20 +02:00
bruvzg
754e1b073a [macOS] Fix hiDPI scaling support in OS.get_real_window_size and OS.set_window.size functions.
(cherry picked from commit 1b6330b125)
2019-04-01 11:11:50 +02:00
qarmin
ae3047d758 Show in tabs non default class icons
(cherry picked from commit 825a870f06)
2019-04-01 11:11:22 +02:00
Pedro Ciambra
f7f80b009b Implement source lookup for class_name defined classes
Previous to this, classes defined with class_name had no
behavior when ctrl-clicked in the editor.

Fixes #26882

(cherry picked from commit e8fe174616)
2019-04-01 11:10:32 +02:00
Robear Selwans
4fda05e15f Added the ability to change the default cursor property for the RichTextLabel component.
(cherry picked from commit b852a7a854)
2019-04-01 11:10:04 +02:00
Michael Alexsander Silva Dias
3d0dc81e9e Fix clearing scripts while multiple nodes are selected
(cherry picked from commit d3042d162d)
2019-04-01 11:09:32 +02:00
Paul Trojahn
0c3c4d61f7 Remove extraneous line breaks from text resources
Fixes #23539

(cherry picked from commit 9bbda4db2f)
2019-04-01 11:08:47 +02:00
Bojidar Marinov
08b685ab61 Add search box and size slider to GridMap (similar to TileMap's)
Closes #21536

(cherry picked from commit a9ac4c012c)
2019-04-01 11:07:50 +02:00
Bojidar Marinov
848bd54dae Fix renaming actions in the Project settings
Fixes #27113, a regression from 6daed7d122

(cherry picked from commit 699a3957ce)
2019-04-01 11:05:49 +02:00
Rémi Verschelde
d362e3eb11 i18n: Sync translations with Weblate
Also sync translation template.

(cherry picked from commit 472c8a7ba1)
2019-03-28 10:40:13 +01:00
Juan Linietsky
d26c3fca0c Add a "Request Docs" button to code editor.
(cherry picked from commit 6574c557c9)
2019-03-28 10:40:03 +01:00
Angeloss
589c5698a0 Fix: Keep custom tracks option now keeps animation loop property and value track update mode. 2019-03-27 11:32:41 -06:00
Jared
d02ee1ff0e Corrects small typo in atan2() documentation.
(cherry picked from commit 9838c4df7c)
2019-03-27 17:31:29 +01:00
Chris Bradfield
4740489a97 [DOC] Physics[2D]DirectBodyState updates
(cherry picked from commit bb2e6e3ed2)
2019-03-27 17:31:29 +01:00
Tomasz Chabora
e9796044ed Better documentation for some move_and_slide parameters
(cherry picked from commit 0e93714ff7)
2019-03-27 17:31:29 +01:00
homer666
f7ff3ec749 [DOCS] Add tutorial link to Particles2D
(cherry picked from commit bc8aa32593)
2019-03-27 17:31:29 +01:00
Sam Green
dbf2f0c31e Add logging around opengl es context creation. Ensure we can access project settings prior to creating our gl es context, so we can properly determine which driver to use.
(cherry picked from commit 440706814a)
2019-03-16 10:42:50 -07:00
Bojidar Marinov
0d8492cf9e Fix duplicated lines in GDScript bytecode
Fixes #26789

(cherry picked from commit b64f9f03f8)
2019-03-16 10:42:28 -07:00
Chris Bradfield
a51b2b8a82 [DOCS] minor classref updates
(cherry picked from commit 454b701e76)
2019-03-16 10:42:06 -07:00
Sebastian Hartte
d060cd4fef Don't crash when the saved editor state contains fewer viewports than currently supported.
(cherry picked from commit 7bab7fd777)
2019-03-16 10:41:45 -07:00
Andrettin
4023d52399 Made the tooltip position offset configurable
(cherry picked from commit 30c07c1ae1)
2019-03-16 10:41:08 -07:00
clayjohn
77c26d3260 linked tutorials in the classref
(cherry picked from commit 67446ff733)
2019-03-13 20:09:17 +01:00
Ignacio Etcheverry
57f19fd8ee C#: Update exports only in the editor
(cherry picked from commit 5e354162f1)
2019-03-13 20:07:29 +01:00
Rémi Verschelde
51e04c588b Bump version to 3.1.1-devel 2019-03-13 18:44:46 +01:00
1072 changed files with 41922 additions and 45240 deletions

7
.gitignore vendored
View File

@@ -316,3 +316,10 @@ platform/windows/godot_res.res
# Scons progress indicator
.scons_node_count
# ccls cache (https://github.com/MaskRay/ccls)
.ccls-cache/
# compile commands (https://clang.llvm.org/docs/JSONCompilationDatabase.html)
compile_commands.json

View File

@@ -27,7 +27,7 @@ matrix:
packages:
- clang-format-6.0
- env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-8 MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no werror=yes"
- env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-8 MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
os: linux
compiler: gcc-8
addons:
@@ -49,7 +49,7 @@ matrix:
build_command: "scons p=x11 -j2 $OPTIONS"
branch_pattern: coverity_scan
- env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="werror=yes"
- env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
os: linux
compiler: clang
addons:
@@ -57,7 +57,7 @@ matrix:
packages:
- *linux_deps
- env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="werror=yes"
- env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
os: linux
compiler: clang
@@ -69,7 +69,7 @@ matrix:
os: osx
compiler: clang
- env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-8 MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" EXTRA_ARGS="werror=yes"
- env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-8 MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" EXTRA_ARGS="warnings=extra werror=yes"
os: linux
compiler: gcc-8
addons:

View File

@@ -45,6 +45,7 @@ name is available.
Błażej Szczygieł (zaps166)
Bojidar Marinov (bojidar-bg)
bruvzg
Camille Mohr-Daurat (pouleyKetchoupp)
Carl Olsson (not-surt)
Carter Anderson (cart)
Chris Bradfield (cbscribe)
@@ -115,6 +116,7 @@ name is available.
Pieter-Jan Briers (PJB3005)
Poommetee Ketson (Noshyaar)
Przemysław Gołąb (n-pigeon)
Rafał Mikrut (qarmin)
Ralf Hölzemer (rollenrolm)
Ramesh Ravone (RameshRavone)
Ray Koopa (RayKoopa)

View File

@@ -369,17 +369,19 @@ Comment: libSquish
Copyright: 2006, Simon Brown
License: Expat
Files: ./thirdparty/thekla_atlas/
Comment: Thekla Atlas
Copyright: 2013, Thekla, Inc
License: Expat
Files: ./thirdparty/tinyexr/
Comment: TinyEXR
Copyright: 2014-2018, Syoyo Fujita
2002, Industrial Light & Magic, a division of Lucas Digital Ltd. LLC
License: BSD-3-clause
Files: ./thirdparty/xatlas/
Comment: xatlas
Copyright: 2018, Jonathan Young
2013, Thekla, Inc
2006, NVIDIA Corporation, Ignacio Castano
License: Expat
Files: ./thirdparty/zlib/
Comment: zlib
Copyright: 1995-2017, Jean-loup Gailly and Mark Adler

View File

@@ -18,22 +18,21 @@ generous deed immortalized in the next stable release of Godot Engine.
Gamblify <https://www.gamblify.com>
Image Campus <https://www.imagecampus.edu.ar>
Yakaz.com <https://yakaz.com>
## Mini sponsors
Alan Beauchamp
Anandarup Mallik
Andrew Dunai
Arda Erol
Brandon Lamb
Christian Uldall Pedersen
Christoph Woinke
Connor Hill
Edward Flick
GameDev.net
GameDev.tv
Hein-Pieter van Braam
Jamal Alyafei
Jacob McKenney
Javary Games
Jay Sistar
Justin Arnold
@@ -43,22 +42,18 @@ generous deed immortalized in the next stable release of Godot Engine.
Matthieu Huvé
Maxim Karsten
Mike King
Nathan Warden
Neal Gompa (Conan Kudo)
Patrick Aarstad
"Rainway "
Ruslan Mustakov
Slobodan Milnovic
StarFlare Software
Stephan Lanfermann
Stoney Meyerhoeffer
thechris
TigerJ
VilliHaukka
Zashi
## Gold donors
Asdf
Brandon Waite
cheese65536
David Gehrig
@@ -69,8 +64,10 @@ generous deed immortalized in the next stable release of Godot Engine.
Nathanael Beisiegel
Officine Pixel S.n.c.
Retro Village
Sofox
Zaven Muradyan
Alexander Trey Saunders
Allen Schade
Andreas Schüle
Asher Glick
@@ -80,7 +77,6 @@ generous deed immortalized in the next stable release of Godot Engine.
David Giardi
Edward E
Florian Breisch
Gary Oberbrunner
Gero
Jay Horton
Jon Smith
@@ -88,6 +84,8 @@ generous deed immortalized in the next stable release of Godot Engine.
Jorge Bernal
Joshua Lesperance
Justo Delgado Baudí
Karl Werf
Kommentgames
Krzysztof Dluzniewski
Moonwards
Mored1984
@@ -95,6 +93,7 @@ generous deed immortalized in the next stable release of Godot Engine.
paul gruenbacher
Paul LaMotte
Rob Messick
Ross Esmond
Scott Wadden
Sergey
Svenne Krap
@@ -103,19 +102,20 @@ generous deed immortalized in the next stable release of Godot Engine.
Wyatt Goodin
Xananax
BanjoNode2D
Beliar
Abel Oroz Vicente
Chris Serino
Christian Padilla
Conrad Curry
Craig Smith
Daniel Egger
Dean Harmon
Ian Richard Kunert
Ivan Trombley
Joan Fons
Krzysztof Jankowski
Lord Bloodhound
Lucas Ferreira Franca
Michele Zilli
Nathan Lundquist
Pascal Grüter
Petr Malac
@@ -125,27 +125,34 @@ generous deed immortalized in the next stable release of Godot Engine.
Ronnie Ashlock
ScottMakesGames
Thomas Bjarnelöf
Vincent Henderson
Wojciech Chojnacki
Xavier PATRICELLI
Alessandra Pereyra
Alexey Dyadchenko
Andrew Bowen
Asdf
Benjamin W Flint
Chau Siu Hung
Chris Goddard
Chris Petrich
Christian Leth Jeppesen
Christoph Schröder
Cody Parker
ComicSads
D
Daniel
Daniel Eichler
Deadly Lampshade
Eagle 3d
E.G.
Eric
Eric Monson
Ethan Bennis
Eugenio Hugo Salgüero Jáñez
flesk
Francisco Javier Moreno Carracedo
gavlig
GGGames.org
Giles Montgomery
@@ -153,21 +160,24 @@ generous deed immortalized in the next stable release of Godot Engine.
Guilherme Felipe de C. G. da Silva
Heath Hayes
Hysteria
Jalal Chaabane
Jeppe Zapp
Jose Malheiro
Joshua Flores
Juan T Chen
Juraj Móza
Kasper Jeppesen
Klavdij Voncina
Leandro Voltolino
Lukáš Rendvanský
Maarten Elings
Malcolm Peralty
Marius Kamm
Markus Fehr
Markus Wiesner
Martin Eigel
Marvin
Matt Eunson
Matthew Hillier
Max R.R. Collada
MegaC
Nick Nikitin
Oliver Dick
oziatek
@@ -175,39 +185,45 @@ generous deed immortalized in the next stable release of Godot Engine.
Paul Von Zimmerman
Pete Goodwin
Ranoller
ray-tracer
Ruben Soares Luis
Samuel Judd
Sofox
Scott Pilet
spilldata
Stoned Xander
Thomas Krampl
Tobias Bocanegra
Urho
WytRabbit
Xavier Fumado Beltran
yuanzhe zhou
## Silver donors
1D_Inc
Abraham Haskins
Adam Brunnmeier
Adam Carr
Adam Nakonieczny
Adam Smeltzer
Adisibio
Aidan O'Flannagain
Alder Stefano
Alessandro Senese
Alexander Gillberg
Alexander Koppe
Alex Davies-Moore
Alice Robinson
Andreas Evers
Andreas Krampitz
Anthony Bongiovanni
Arbor Interactive
Arda Erol
Arthur S. Muszynski
Aubrey Falconer
Avencherus
Bailey
Balázs Batári
Bastian Böhm
Beliar
Benedikt
Ben Phelan
Ben Vercammen
Bernd Jänichen
Blair Allen
@@ -221,14 +237,17 @@ generous deed immortalized in the next stable release of Godot Engine.
Christian Baune
Christian Winter
Christoffer Sundbom
Christopher Fisher
Chris Wilson
Clay Heaton
Collin Shooltz
Connor Hill
Daniel Johnson
DanielMaximiano
Daniel Reed
David Bullock
David Cravens
David May
Diliup Gabadamudalige
Dominik Wetzel
Duobix
Edward Herbert
@@ -238,20 +257,24 @@ generous deed immortalized in the next stable release of Godot Engine.
Eric Martini
Eric McCarthy
Eric Williams
Fabian Becker
Fabian kes
fengjiongmax
Foomf
G3Dev sàrl
Gary Hulst
Gerrit Großkopf
Grant Clarke
Greg Olson
Greg Pennefather
Guldoman
Haley Aycock
Heribert Hirth
Hiroshi Naruo
HMan
Hunter Jones
ialex32x
Igor Buzatovic
Iiari
Isaac Morton
Jaime Ruiz-Borau Vizárraga
Jako Danar
James A F Manley
@@ -259,6 +282,7 @@ generous deed immortalized in the next stable release of Godot Engine.
Jeremy Kahn
Jesse Dubay
Joel Fivat
Joel Setterberg
Johannes Wuensch
Jonas Rudlang
Jonas Yamazaki
@@ -267,14 +291,16 @@ generous deed immortalized in the next stable release of Godot Engine.
Jonathon
Jon Bonazza
Jon Sully
Jose Aleman
Josh 'Cheeseness' Bush
Juanfran
Juan Negrier
Judd
Julian Murgia
Julius Hackel
Kajornthep Piyanun
KC Chan
Kevin Boyer
kickmaniac
Kiyohiro Kawamura (kyorohiro)
Klagsam
KR McGinley
@@ -289,10 +315,13 @@ generous deed immortalized in the next stable release of Godot Engine.
Major Haul
Malcolm
Markus Michael Egger
Martin Holas
Matthew Little
Matthias Grandis
Matt Welke
Maxwell
medecau
Menno Finlay-Smits
Mertcan Mermerkaya
mhilbrunner
Michael Dürwald
@@ -300,17 +329,19 @@ generous deed immortalized in the next stable release of Godot Engine.
Michael Labbe
Mikael Olsson
Mikayla Hutchinson
Mike Cunningham
MoM
Moritz Laass
Moritz Weissenberger
MuffinManKen
Natrim
nee
Neil Blakey-Milner
Nerdforge
Nick Pavlica
Niclas Eriksen
Nicolás Montaña
Nicolas SAN AGUSTIN
Nithin Jino
Oscar Norlander
Pan Ip
Patrick Nafarrete
@@ -321,20 +352,29 @@ generous deed immortalized in the next stable release of Godot Engine.
Pierre-Igor Berthet
Pietro Vertechi
Piotr Kaczmarski
Pitsanu Tongprasin
Poryg
Prokhorenko Leonid
Psyagnostic
Rafael
Raphael Leroux
Rémi Verschelde
Reneator
Ricardo Alcantara
Richman Stewart
Rob Crowle
Robert Farr (Larington)
Robert Hernandez
Rodrigo Loli
Roger Burgess
Roger Smith
Roland Rząsa
Roman Tinkov
Ryan Cheung
Ryan Groom
Ryan Hentz
Sasori Olkof
Scott D. Yelich
Sebastian Michailidis
Shane Spoor
Simon Wenner
@@ -348,6 +388,7 @@ generous deed immortalized in the next stable release of Godot Engine.
tiansheng li
Tim
Tim Drumheller
Tim Gudex
Tom Larrow
Torsten Crass
Tryggve Sollid
@@ -355,10 +396,13 @@ generous deed immortalized in the next stable release of Godot Engine.
UltyX
Vaiktorg
Victor
Vigilant Watch
Viktor Ferenczi
waka nya
Wayne Haak
werner mendizabal
Wiley Thompson
Will
William Gervasio
William Hogben
Wout Standaert

View File

@@ -5,7 +5,6 @@ EnsureSConsVersion(0, 98, 1)
# System
import glob
import os
import string
import sys
# Local
@@ -181,7 +180,6 @@ opts.Add(BoolVariable('builtin_opus', "Use the built-in Opus library", True))
opts.Add(BoolVariable('builtin_pcre2', "Use the built-in PCRE2 library)", True))
opts.Add(BoolVariable('builtin_recast', "Use the built-in Recast library", True))
opts.Add(BoolVariable('builtin_squish', "Use the built-in squish library", True))
opts.Add(BoolVariable('builtin_thekla_atlas', "Use the built-in thekla_altas library", True))
opts.Add(BoolVariable('builtin_xatlas', "Use the built-in xatlas library", True))
opts.Add(BoolVariable('builtin_zlib', "Use the built-in zlib library", True))
opts.Add(BoolVariable('builtin_zstd', "Use the built-in Zstd library", True))
@@ -342,12 +340,17 @@ if selected_platform in platform_list:
shadow_local_warning = []
all_plus_warnings = ['-Wwrite-strings']
if methods.use_gcc(env):
if methods.using_gcc(env):
version = methods.get_compiler_version(env)
if version != None and version[0] >= '7':
shadow_local_warning = ['-Wshadow-local']
if (env["warnings"] == 'extra'):
env.Append(CCFLAGS=['-Wall', '-Wextra'] + all_plus_warnings + shadow_local_warning)
# FIXME: enable -Wimplicit-fallthrough once #26135 is fixed
# FIXME: enable -Wclobbered once #26351 is fixed
env.Append(CCFLAGS=['-Wall', '-Wextra', '-Wno-implicit-fallthrough', '-Wno-unused-parameter'] + all_plus_warnings + shadow_local_warning)
if methods.using_gcc(env):
env['CCFLAGS'] += ['-Wno-clobbered']
elif (env["warnings"] == 'all'):
env.Append(CCFLAGS=['-Wall'] + shadow_local_warning)
elif (env["warnings"] == 'moderate'):

View File

@@ -792,7 +792,7 @@ Dictionary _OS::get_datetime_from_unix_time(int64_t unix_time_val) const {
size_t imonth = 0;
while (dayno >= MONTH_DAYS_TABLE[LEAPYEAR(year)][imonth]) {
while ((unsigned long)dayno >= MONTH_DAYS_TABLE[LEAPYEAR(year)][imonth]) {
dayno -= MONTH_DAYS_TABLE[LEAPYEAR(year)][imonth];
imonth++;
}
@@ -1908,18 +1908,18 @@ bool _File::file_exists(const String &p_name) const {
return FileAccess::exists(p_name);
}
void _File::store_var(const Variant &p_var) {
void _File::store_var(const Variant &p_var, bool p_full_objects) {
ERR_FAIL_COND(!f);
int len;
Error err = encode_variant(p_var, NULL, len);
Error err = encode_variant(p_var, NULL, len, p_full_objects);
ERR_FAIL_COND(err != OK);
PoolVector<uint8_t> buff;
buff.resize(len);
PoolVector<uint8_t>::Write w = buff.write();
err = encode_variant(p_var, &w[0], len);
err = encode_variant(p_var, &w[0], len, p_full_objects);
ERR_FAIL_COND(err != OK);
w = PoolVector<uint8_t>::Write();
@@ -1927,7 +1927,7 @@ void _File::store_var(const Variant &p_var) {
store_buffer(buff);
}
Variant _File::get_var() const {
Variant _File::get_var(bool p_allow_objects) const {
ERR_FAIL_COND_V(!f, Variant());
uint32_t len = get_32();
@@ -1937,7 +1937,7 @@ Variant _File::get_var() const {
PoolVector<uint8_t>::Read r = buff.read();
Variant v;
Error err = decode_variant(v, &r[0], len);
Error err = decode_variant(v, &r[0], len, NULL, p_allow_objects);
ERR_FAIL_COND_V(err != OK, Variant());
return v;
@@ -1980,7 +1980,7 @@ void _File::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_endian_swap"), &_File::get_endian_swap);
ClassDB::bind_method(D_METHOD("set_endian_swap", "enable"), &_File::set_endian_swap);
ClassDB::bind_method(D_METHOD("get_error"), &_File::get_error);
ClassDB::bind_method(D_METHOD("get_var"), &_File::get_var);
ClassDB::bind_method(D_METHOD("get_var", "allow_objects"), &_File::get_var, DEFVAL(false));
ClassDB::bind_method(D_METHOD("store_8", "value"), &_File::store_8);
ClassDB::bind_method(D_METHOD("store_16", "value"), &_File::store_16);
@@ -1993,7 +1993,7 @@ void _File::_bind_methods() {
ClassDB::bind_method(D_METHOD("store_line", "line"), &_File::store_line);
ClassDB::bind_method(D_METHOD("store_csv_line", "values", "delim"), &_File::store_csv_line, DEFVAL(","));
ClassDB::bind_method(D_METHOD("store_string", "string"), &_File::store_string);
ClassDB::bind_method(D_METHOD("store_var", "value"), &_File::store_var);
ClassDB::bind_method(D_METHOD("store_var", "value", "full_objects"), &_File::store_var, DEFVAL(false));
ClassDB::bind_method(D_METHOD("store_pascal_string", "string"), &_File::store_pascal_string);
ClassDB::bind_method(D_METHOD("get_pascal_string"), &_File::get_pascal_string);
@@ -2223,17 +2223,17 @@ _Marshalls *_Marshalls::get_singleton() {
return singleton;
}
String _Marshalls::variant_to_base64(const Variant &p_var) {
String _Marshalls::variant_to_base64(const Variant &p_var, bool p_full_objects) {
int len;
Error err = encode_variant(p_var, NULL, len);
Error err = encode_variant(p_var, NULL, len, p_full_objects);
ERR_FAIL_COND_V(err != OK, "");
PoolVector<uint8_t> buff;
buff.resize(len);
PoolVector<uint8_t>::Write w = buff.write();
err = encode_variant(p_var, &w[0], len);
err = encode_variant(p_var, &w[0], len, p_full_objects);
ERR_FAIL_COND_V(err != OK, "");
int b64len = len / 3 * 4 + 4 + 1;
@@ -2249,7 +2249,7 @@ String _Marshalls::variant_to_base64(const Variant &p_var) {
return ret;
};
Variant _Marshalls::base64_to_variant(const String &p_str) {
Variant _Marshalls::base64_to_variant(const String &p_str, bool p_allow_objects) {
int strlen = p_str.length();
CharString cstr = p_str.ascii();
@@ -2261,7 +2261,7 @@ Variant _Marshalls::base64_to_variant(const String &p_str) {
int len = base64_decode((char *)(&w[0]), (char *)cstr.get_data(), strlen);
Variant v;
Error err = decode_variant(v, &w[0], len);
Error err = decode_variant(v, &w[0], len, NULL, p_allow_objects);
ERR_FAIL_COND_V(err != OK, Variant());
return v;
@@ -2340,8 +2340,8 @@ String _Marshalls::base64_to_utf8(const String &p_str) {
void _Marshalls::_bind_methods() {
ClassDB::bind_method(D_METHOD("variant_to_base64", "variant"), &_Marshalls::variant_to_base64);
ClassDB::bind_method(D_METHOD("base64_to_variant", "base64_str"), &_Marshalls::base64_to_variant);
ClassDB::bind_method(D_METHOD("variant_to_base64", "variant", "full_objects"), &_Marshalls::variant_to_base64, DEFVAL(false));
ClassDB::bind_method(D_METHOD("base64_to_variant", "base64_str", "allow_objects"), &_Marshalls::base64_to_variant, DEFVAL(false));
ClassDB::bind_method(D_METHOD("raw_to_base64", "array"), &_Marshalls::raw_to_base64);
ClassDB::bind_method(D_METHOD("base64_to_raw", "base64_str"), &_Marshalls::base64_to_raw);

View File

@@ -463,7 +463,7 @@ public:
double get_double() const;
real_t get_real() const;
Variant get_var() const;
Variant get_var(bool p_allow_objects = false) const;
PoolVector<uint8_t> get_buffer(int p_length) const; ///< get an array of bytes
String get_line() const;
@@ -500,7 +500,7 @@ public:
void store_buffer(const PoolVector<uint8_t> &p_buffer); ///< store an array of bytes
void store_var(const Variant &p_var);
void store_var(const Variant &p_var, bool p_full_objects = false);
bool file_exists(const String &p_name) const; ///< return true if a file exists
@@ -569,8 +569,8 @@ protected:
public:
static _Marshalls *get_singleton();
String variant_to_base64(const Variant &p_var);
Variant base64_to_variant(const String &p_str);
String variant_to_base64(const Variant &p_var, bool p_full_objects = false);
Variant base64_to_variant(const String &p_str, bool p_allow_objects = false);
String raw_to_base64(const PoolVector<uint8_t> &p_arr);
PoolVector<uint8_t> base64_to_raw(const String &p_str);

View File

@@ -249,6 +249,11 @@ void ClassDB::set_current_api(APIType p_api) {
current_api = p_api;
}
ClassDB::APIType ClassDB::get_current_api() {
return current_api;
}
HashMap<StringName, ClassDB::ClassInfo> ClassDB::classes;
HashMap<StringName, StringName> ClassDB::resource_base_extensions;
HashMap<StringName, StringName> ClassDB::compat_classes;

View File

@@ -371,6 +371,7 @@ public:
static void init();
static void set_current_api(APIType p_api);
static APIType get_current_api();
static void cleanup();
};

View File

@@ -175,7 +175,9 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
} break;
case MODE_ZSTD: {
ZSTD_DCtx *dctx = ZSTD_createDCtx();
if (zstd_long_distance_matching) ZSTD_DCtx_setMaxWindowSize(dctx, (size_t)1 << zstd_window_log_size);
if (zstd_long_distance_matching) {
ZSTD_DCtx_setParameter(dctx, ZSTD_d_windowLogMax, zstd_window_log_size);
}
int ret = ZSTD_decompressDCtx(dctx, p_dst, p_dst_max_size, p_src, p_src_size);
ZSTD_freeDCtx(dctx);
return ret;
@@ -189,4 +191,4 @@ int Compression::zlib_level = Z_DEFAULT_COMPRESSION;
int Compression::gzip_level = Z_DEFAULT_COMPRESSION;
int Compression::zstd_level = 3;
bool Compression::zstd_long_distance_matching = false;
int Compression::zstd_window_log_size = 27;
int Compression::zstd_window_log_size = 27; // ZSTD_WINDOWLOG_LIMIT_DEFAULT

View File

@@ -272,7 +272,7 @@ int FileAccessPack::get_buffer(uint8_t *p_dst, int p_length) const {
if (eof)
return 0;
int64_t to_read = p_length;
uint64_t to_read = p_length;
if (to_read + pos > pf.size) {
eof = true;
to_read = int64_t(pf.size) - int64_t(pos);

View File

@@ -794,7 +794,7 @@ static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) {
}
}
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_object_as_id) {
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_full_objects) {
uint8_t *buf = r_buffer;
@@ -819,7 +819,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
}
} break;
case Variant::OBJECT: {
if (p_object_as_id) {
if (!p_full_objects) {
flags |= ENCODE_FLAG_OBJECT_AS_ID;
}
} break;
@@ -1086,22 +1086,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
} break;
case Variant::OBJECT: {
if (p_object_as_id) {
if (p_full_objects) {
if (buf) {
Object *obj = p_variant;
ObjectID id = 0;
if (obj && ObjectDB::instance_validate(obj)) {
id = obj->get_instance_id();
}
encode_uint64(id, buf);
}
r_len += 8;
} else {
Object *obj = p_variant;
if (!obj) {
if (buf) {
@@ -1139,7 +1125,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
_encode_string(E->get().name, buf, r_len);
int len;
Error err = encode_variant(obj->get(E->get().name), buf, len, p_object_as_id);
Error err = encode_variant(obj->get(E->get().name), buf, len, p_full_objects);
if (err)
return err;
ERR_FAIL_COND_V(len % 4, ERR_BUG);
@@ -1148,6 +1134,19 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
buf += len;
}
}
} else {
if (buf) {
Object *obj = p_variant;
ObjectID id = 0;
if (obj && ObjectDB::instance_validate(obj)) {
id = obj->get_instance_id();
}
encode_uint64(id, buf);
}
r_len += 8;
}
} break;
@@ -1180,14 +1179,14 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len++; //pad
*/
int len;
encode_variant(E->get(), buf, len, p_object_as_id);
encode_variant(E->get(), buf, len, p_full_objects);
ERR_FAIL_COND_V(len % 4, ERR_BUG);
r_len += len;
if (buf)
buf += len;
Variant *v = d.getptr(E->get());
ERR_FAIL_COND_V(!v, ERR_BUG);
encode_variant(*v, buf, len, p_object_as_id);
encode_variant(*v, buf, len, p_full_objects);
ERR_FAIL_COND_V(len % 4, ERR_BUG);
r_len += len;
if (buf)
@@ -1209,7 +1208,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
for (int i = 0; i < v.size(); i++) {
int len;
encode_variant(v.get(i), buf, len, p_object_as_id);
encode_variant(v.get(i), buf, len, p_full_objects);
ERR_FAIL_COND_V(len % 4, ERR_BUG);
r_len += len;
if (buf)

View File

@@ -199,7 +199,7 @@ public:
EncodedObjectAsID();
};
Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int *r_len = NULL, bool p_allow_objects = true);
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_object_as_id = false);
Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int *r_len = NULL, bool p_allow_objects = false);
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_full_objects = false);
#endif

View File

@@ -299,7 +299,7 @@ void MultiplayerAPI::_process_rpc(Node *p_node, const StringName &p_name, int p_
ERR_FAIL_COND(p_offset >= p_packet_len);
int vlen;
Error err = decode_variant(args.write[i], &p_packet[p_offset], p_packet_len - p_offset, &vlen);
Error err = decode_variant(args.write[i], &p_packet[p_offset], p_packet_len - p_offset, &vlen, allow_object_decoding || network_peer->is_object_decoding_allowed());
ERR_EXPLAIN("Invalid packet received. Unable to decode RPC argument.");
ERR_FAIL_COND(err != OK);
@@ -335,7 +335,7 @@ void MultiplayerAPI::_process_rset(Node *p_node, const StringName &p_name, int p
ERR_FAIL_COND(!_can_call_mode(p_node, rset_mode, p_from));
Variant value;
Error err = decode_variant(value, &p_packet[p_offset], p_packet_len - p_offset);
Error err = decode_variant(value, &p_packet[p_offset], p_packet_len - p_offset, NULL, allow_object_decoding || network_peer->is_object_decoding_allowed());
ERR_EXPLAIN("Invalid packet received. Unable to decode RSET value.");
ERR_FAIL_COND(err != OK);
@@ -526,11 +526,11 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p
if (p_set) {
// Set argument.
Error err = encode_variant(*p_arg[0], NULL, len);
Error err = encode_variant(*p_arg[0], NULL, len, allow_object_decoding || network_peer->is_object_decoding_allowed());
ERR_EXPLAIN("Unable to encode RSET value. THIS IS LIKELY A BUG IN THE ENGINE!");
ERR_FAIL_COND(err != OK);
MAKE_ROOM(ofs + len);
encode_variant(*p_arg[0], &(packet_cache.write[ofs]), len);
encode_variant(*p_arg[0], &(packet_cache.write[ofs]), len, allow_object_decoding || network_peer->is_object_decoding_allowed());
ofs += len;
} else {
@@ -539,11 +539,11 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p
packet_cache.write[ofs] = p_argcount;
ofs += 1;
for (int i = 0; i < p_argcount; i++) {
Error err = encode_variant(*p_arg[i], NULL, len);
Error err = encode_variant(*p_arg[i], NULL, len, allow_object_decoding || network_peer->is_object_decoding_allowed());
ERR_EXPLAIN("Unable to encode RPC argument. THIS IS LIKELY A BUG IN THE ENGINE!");
ERR_FAIL_COND(err != OK);
MAKE_ROOM(ofs + len);
encode_variant(*p_arg[i], &(packet_cache.write[ofs]), len);
encode_variant(*p_arg[i], &(packet_cache.write[ofs]), len, allow_object_decoding || network_peer->is_object_decoding_allowed());
ofs += len;
}
}
@@ -818,6 +818,16 @@ Vector<int> MultiplayerAPI::get_network_connected_peers() const {
return ret;
}
void MultiplayerAPI::set_allow_object_decoding(bool p_enable) {
allow_object_decoding = p_enable;
}
bool MultiplayerAPI::is_object_decoding_allowed() const {
return allow_object_decoding;
}
void MultiplayerAPI::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_root_node", "node"), &MultiplayerAPI::set_root_node);
ClassDB::bind_method(D_METHOD("send_bytes", "bytes", "id", "mode"), &MultiplayerAPI::send_bytes, DEFVAL(NetworkedMultiplayerPeer::TARGET_PEER_BROADCAST), DEFVAL(NetworkedMultiplayerPeer::TRANSFER_MODE_RELIABLE));
@@ -838,6 +848,10 @@ void MultiplayerAPI::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_network_connected_peers"), &MultiplayerAPI::get_network_connected_peers);
ClassDB::bind_method(D_METHOD("set_refuse_new_network_connections", "refuse"), &MultiplayerAPI::set_refuse_new_network_connections);
ClassDB::bind_method(D_METHOD("is_refusing_new_network_connections"), &MultiplayerAPI::is_refusing_new_network_connections);
ClassDB::bind_method(D_METHOD("set_allow_object_decoding", "enable"), &MultiplayerAPI::set_allow_object_decoding);
ClassDB::bind_method(D_METHOD("is_object_decoding_allowed"), &MultiplayerAPI::is_object_decoding_allowed);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_object_decoding"), "set_allow_object_decoding", "is_object_decoding_allowed");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "refuse_new_network_connections"), "set_refuse_new_network_connections", "is_refusing_new_network_connections");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "network_peer", PROPERTY_HINT_RESOURCE_TYPE, "NetworkedMultiplayerPeer", 0), "set_network_peer", "get_network_peer");
@@ -859,7 +873,8 @@ void MultiplayerAPI::_bind_methods() {
BIND_ENUM_CONSTANT(RPC_MODE_PUPPETSYNC);
}
MultiplayerAPI::MultiplayerAPI() {
MultiplayerAPI::MultiplayerAPI() :
allow_object_decoding(false) {
rpc_sender_id = 0;
root_node = NULL;
clear();

View File

@@ -63,6 +63,7 @@ private:
int last_send_cache_id;
Vector<uint8_t> packet_cache;
Node *root_node;
bool allow_object_decoding;
protected:
static void _bind_methods();
@@ -126,6 +127,9 @@ public:
void set_refuse_new_network_connections(bool p_refuse);
bool is_refusing_new_network_connections() const;
void set_allow_object_decoding(bool p_enable);
bool is_object_decoding_allowed() const;
MultiplayerAPI();
~MultiplayerAPI();
};

View File

@@ -79,7 +79,7 @@ Error PacketPeer::put_packet_buffer(const PoolVector<uint8_t> &p_buffer) {
return put_packet(&r[0], len);
}
Error PacketPeer::get_var(Variant &r_variant) {
Error PacketPeer::get_var(Variant &r_variant, bool p_allow_objects) {
const uint8_t *buffer;
int buffer_size;
@@ -87,13 +87,13 @@ Error PacketPeer::get_var(Variant &r_variant) {
if (err)
return err;
return decode_variant(r_variant, buffer, buffer_size, NULL, allow_object_decoding);
return decode_variant(r_variant, buffer, buffer_size, NULL, p_allow_objects || allow_object_decoding);
}
Error PacketPeer::put_var(const Variant &p_packet) {
Error PacketPeer::put_var(const Variant &p_packet, bool p_full_objects) {
int len;
Error err = encode_variant(p_packet, NULL, len, !allow_object_decoding); // compute len first
Error err = encode_variant(p_packet, NULL, len, p_full_objects || allow_object_decoding); // compute len first
if (err)
return err;
@@ -102,15 +102,15 @@ Error PacketPeer::put_var(const Variant &p_packet) {
uint8_t *buf = (uint8_t *)alloca(len);
ERR_FAIL_COND_V(!buf, ERR_OUT_OF_MEMORY);
err = encode_variant(p_packet, buf, len, !allow_object_decoding);
err = encode_variant(p_packet, buf, len, p_full_objects || allow_object_decoding);
ERR_FAIL_COND_V(err, err);
return put_packet(buf, len);
}
Variant PacketPeer::_bnd_get_var() {
Variant PacketPeer::_bnd_get_var(bool p_allow_objects) {
Variant var;
get_var(var);
get_var(var, p_allow_objects);
return var;
};
@@ -132,8 +132,8 @@ Error PacketPeer::_get_packet_error() const {
void PacketPeer::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_var"), &PacketPeer::_bnd_get_var);
ClassDB::bind_method(D_METHOD("put_var", "var"), &PacketPeer::put_var);
ClassDB::bind_method(D_METHOD("get_var", "allow_objects"), &PacketPeer::_bnd_get_var, DEFVAL(false));
ClassDB::bind_method(D_METHOD("put_var", "var", "full_objects"), &PacketPeer::put_var, DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_packet"), &PacketPeer::_get_packet);
ClassDB::bind_method(D_METHOD("put_packet", "buffer"), &PacketPeer::_put_packet);
ClassDB::bind_method(D_METHOD("get_packet_error"), &PacketPeer::_get_packet_error);

View File

@@ -39,8 +39,7 @@ class PacketPeer : public Reference {
GDCLASS(PacketPeer, Reference);
Variant _bnd_get_var();
void _bnd_put_var(const Variant &p_var);
Variant _bnd_get_var(bool p_allow_objects = false);
static void _bind_methods();
@@ -64,8 +63,8 @@ public:
virtual Error get_packet_buffer(PoolVector<uint8_t> &r_buffer);
virtual Error put_packet_buffer(const PoolVector<uint8_t> &p_buffer);
virtual Error get_var(Variant &r_variant);
virtual Error put_var(const Variant &p_packet);
virtual Error get_var(Variant &r_variant, bool p_allow_objects = false);
virtual Error put_var(const Variant &p_packet, bool p_full_objects = false);
void set_allow_object_decoding(bool p_enable);
bool is_object_decoding_allowed() const;

View File

@@ -221,14 +221,14 @@ void StreamPeer::put_utf8_string(const String &p_string) {
put_u32(cs.length());
put_data((const uint8_t *)cs.get_data(), cs.length());
}
void StreamPeer::put_var(const Variant &p_variant) {
void StreamPeer::put_var(const Variant &p_variant, bool p_full_objects) {
int len = 0;
Vector<uint8_t> buf;
encode_variant(p_variant, NULL, len);
encode_variant(p_variant, NULL, len, p_full_objects);
buf.resize(len);
put_32(len);
encode_variant(p_variant, buf.ptrw(), len);
encode_variant(p_variant, buf.ptrw(), len, p_full_objects);
put_data(buf.ptr(), buf.size());
}
@@ -359,7 +359,7 @@ String StreamPeer::get_utf8_string(int p_bytes) {
ret.parse_utf8((const char *)buf.ptr(), buf.size());
return ret;
}
Variant StreamPeer::get_var() {
Variant StreamPeer::get_var(bool p_allow_objects) {
int len = get_32();
Vector<uint8_t> var;
@@ -369,7 +369,7 @@ Variant StreamPeer::get_var() {
ERR_FAIL_COND_V(err != OK, Variant());
Variant ret;
decode_variant(ret, var.ptr(), len);
decode_variant(ret, var.ptr(), len, NULL, p_allow_objects);
return ret;
}
@@ -398,7 +398,7 @@ void StreamPeer::_bind_methods() {
ClassDB::bind_method(D_METHOD("put_double", "value"), &StreamPeer::put_double);
ClassDB::bind_method(D_METHOD("put_string", "value"), &StreamPeer::put_string);
ClassDB::bind_method(D_METHOD("put_utf8_string", "value"), &StreamPeer::put_utf8_string);
ClassDB::bind_method(D_METHOD("put_var", "value"), &StreamPeer::put_var);
ClassDB::bind_method(D_METHOD("put_var", "value", "full_objects"), &StreamPeer::put_var, DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_8"), &StreamPeer::get_8);
ClassDB::bind_method(D_METHOD("get_u8"), &StreamPeer::get_u8);
@@ -412,7 +412,7 @@ void StreamPeer::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_double"), &StreamPeer::get_double);
ClassDB::bind_method(D_METHOD("get_string", "bytes"), &StreamPeer::get_string, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("get_utf8_string", "bytes"), &StreamPeer::get_utf8_string, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("get_var"), &StreamPeer::get_var);
ClassDB::bind_method(D_METHOD("get_var", "allow_objects"), &StreamPeer::get_var, DEFVAL(false));
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "big_endian"), "set_big_endian", "is_big_endian_enabled");
}

View File

@@ -73,7 +73,7 @@ public:
void put_double(double p_val);
void put_string(const String &p_string);
void put_utf8_string(const String &p_string);
void put_var(const Variant &p_variant);
void put_var(const Variant &p_variant, bool p_full_objects = false);
uint8_t get_u8();
int8_t get_8();
@@ -87,7 +87,7 @@ public:
double get_double();
String get_string(int p_bytes = -1);
String get_utf8_string(int p_bytes = -1);
Variant get_var();
Variant get_var(bool p_allow_objects = false);
StreamPeer() { big_endian = false; }
};

View File

@@ -55,6 +55,7 @@ void AStar::add_point(int p_id, const Vector3 &p_pos, real_t p_weight_scale) {
pt->weight_scale = p_weight_scale;
pt->prev_point = NULL;
pt->last_pass = 0;
pt->enabled = true;
points[p_id] = pt;
} else {
points[p_id]->pos = p_pos;
@@ -242,6 +243,9 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
pass++;
if (!end_point->enabled)
return false;
SelfList<Point>::List open_list;
bool found_route = false;
@@ -249,6 +253,10 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
for (Set<Point *>::Element *E = begin_point->neighbours.front(); E; E = E->next()) {
Point *n = E->get();
if (!n->enabled)
continue;
n->prev_point = begin_point;
n->distance = _compute_cost(begin_point->id, n->id) * n->weight_scale;
n->last_pass = pass;
@@ -290,6 +298,9 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
Point *e = E->get();
if (!e->enabled)
continue;
real_t distance = _compute_cost(p->id, e->id) * e->weight_scale + p->distance;
if (e->last_pass == pass) {
@@ -438,6 +449,14 @@ PoolVector<int> AStar::get_id_path(int p_from_id, int p_to_id) {
return path;
}
void AStar::set_point_disabled(int p_id, bool p_disabled) {
points[p_id]->enabled = !p_disabled;
}
bool AStar::is_point_disabled(int p_id) const {
return !points[p_id]->enabled;
}
void AStar::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_available_point_id"), &AStar::get_available_point_id);
@@ -450,6 +469,9 @@ void AStar::_bind_methods() {
ClassDB::bind_method(D_METHOD("has_point", "id"), &AStar::has_point);
ClassDB::bind_method(D_METHOD("get_points"), &AStar::get_points);
ClassDB::bind_method(D_METHOD("set_point_disabled", "id", "disabled"), &AStar::set_point_disabled, DEFVAL(true));
ClassDB::bind_method(D_METHOD("is_point_disabled", "id"), &AStar::is_point_disabled);
ClassDB::bind_method(D_METHOD("get_point_connections", "id"), &AStar::get_point_connections);
ClassDB::bind_method(D_METHOD("connect_points", "id", "to_id", "bidirectional"), &AStar::connect_points, DEFVAL(true));

View File

@@ -54,6 +54,7 @@ class AStar : public Reference {
Vector3 pos;
real_t weight_scale;
uint64_t last_pass;
bool enabled;
Set<Point *> neighbours;
@@ -114,6 +115,9 @@ public:
PoolVector<int> get_point_connections(int p_id);
Array get_points();
void set_point_disabled(int p_id, bool p_disabled = true);
bool is_point_disabled(int p_id) const;
void connect_points(int p_id, int p_with_id, bool bidirectional = true);
void disconnect_points(int p_id, int p_with_id);
bool are_points_connected(int p_id, int p_with_id) const;

View File

@@ -31,6 +31,7 @@
#ifndef AUDIOFRAME_H
#define AUDIOFRAME_H
#include "core/math/vector2.h"
#include "core/typedefs.h"
static inline float undenormalise(volatile float f) {
@@ -122,6 +123,20 @@ struct AudioFrame {
r = p_frame.r;
}
_ALWAYS_INLINE_ AudioFrame operator=(const AudioFrame &p_frame) {
l = p_frame.l;
r = p_frame.r;
return *this;
}
_ALWAYS_INLINE_ operator Vector2() const {
return Vector2(l, r);
}
_ALWAYS_INLINE_ AudioFrame(const Vector2 &p_v2) {
l = p_v2.x;
r = p_v2.y;
}
_ALWAYS_INLINE_ AudioFrame() {}
};

View File

@@ -557,11 +557,23 @@ void Basis::set_euler_yxz(const Vector3 &p_euler) {
*this = ymat * xmat * zmat;
}
bool Basis::is_equal_approx(const Basis &a, const Basis &b) const {
bool Basis::is_equal_approx(const Basis &a, const Basis &b,real_t p_epsilon) const {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (!Math::is_equal_approx_ratio(a.elements[i][j], b.elements[i][j], UNIT_EPSILON))
if (!Math::is_equal_approx(a.elements[i][j], b.elements[i][j], p_epsilon))
return false;
}
}
return true;
}
bool Basis::is_equal_approx_ratio(const Basis &a, const Basis &b,real_t p_epsilon) const {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (!Math::is_equal_approx_ratio(a.elements[i][j], b.elements[i][j], p_epsilon))
return false;
}
}
@@ -605,12 +617,14 @@ Basis::operator String() const {
Quat Basis::get_quat() const {
#ifdef MATH_CHECKS
if (!is_rotation()) {
ERR_EXPLAIN("Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quat() or call orthonormalized() instead.");
ERR_FAIL_V(Quat());
}
#endif
/* Allow getting a quaternion from an unnormalized transform */
Basis m = *this;
m.elements[0].normalize();
m.elements[1].normalize();
m.elements[2].normalize();
real_t trace = m.elements[0][0] + m.elements[1][1] + m.elements[2][2];
real_t temp[4];

View File

@@ -133,7 +133,8 @@ public:
return elements[0][2] * v[0] + elements[1][2] * v[1] + elements[2][2] * v[2];
}
bool is_equal_approx(const Basis &a, const Basis &b) const;
bool is_equal_approx(const Basis &a, const Basis &b, real_t p_epsilon=CMP_EPSILON) const;
bool is_equal_approx_ratio(const Basis &a, const Basis &b, real_t p_epsilon=UNIT_EPSILON) const;
bool operator==(const Basis &p_matrix) const;
bool operator!=(const Basis &p_matrix) const;

View File

@@ -68,6 +68,7 @@ const char *Expression::func_name[Expression::FUNC_MAX] = {
"lerp",
"inverse_lerp",
"range_lerp",
"smoothstep",
"dectime",
"randomize",
"randi",
@@ -164,10 +165,10 @@ int Expression::get_func_argument_count(BuiltinFunc p_func) {
case TEXT_PRINTRAW:
case VAR_TO_STR:
case STR_TO_VAR:
case VAR_TO_BYTES:
case BYTES_TO_VAR:
case TYPE_EXISTS:
return 1;
case VAR_TO_BYTES:
case BYTES_TO_VAR:
case MATH_ATAN2:
case MATH_FMOD:
case MATH_FPOSMOD:
@@ -185,6 +186,7 @@ int Expression::get_func_argument_count(BuiltinFunc p_func) {
return 2;
case MATH_LERP:
case MATH_INVERSE_LERP:
case MATH_SMOOTHSTEP:
case MATH_DECTIME:
case MATH_WRAP:
case MATH_WRAPF:
@@ -392,6 +394,12 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
VALIDATE_ARG_NUM(4);
*r_return = Math::range_lerp((double)*p_inputs[0], (double)*p_inputs[1], (double)*p_inputs[2], (double)*p_inputs[3], (double)*p_inputs[4]);
} break;
case MATH_SMOOTHSTEP: {
VALIDATE_ARG_NUM(0);
VALIDATE_ARG_NUM(1);
VALIDATE_ARG_NUM(2);
*r_return = Math::smoothstep((double)*p_inputs[0], (double)*p_inputs[1], (double)*p_inputs[2]);
} break;
case MATH_DECTIME: {
VALIDATE_ARG_NUM(0);
@@ -696,8 +704,9 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
case VAR_TO_BYTES: {
PoolByteArray barr;
bool full_objects = *p_inputs[1];
int len;
Error err = encode_variant(*p_inputs[0], NULL, len);
Error err = encode_variant(*p_inputs[0], NULL, len, full_objects);
if (err) {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
@@ -709,7 +718,7 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
barr.resize(len);
{
PoolByteArray::Write w = barr.write();
encode_variant(*p_inputs[0], w.ptr(), len);
encode_variant(*p_inputs[0], w.ptr(), len, full_objects);
}
*r_return = barr;
} break;
@@ -724,10 +733,11 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant
}
PoolByteArray varr = *p_inputs[0];
bool allow_objects = *p_inputs[1];
Variant ret;
{
PoolByteArray::Read r = varr.read();
Error err = decode_variant(ret, r.ptr(), varr.size(), NULL);
Error err = decode_variant(ret, r.ptr(), varr.size(), NULL, allow_objects);
if (err != OK) {
r_error_str = RTR("Not enough bytes for decoding bytes, or invalid format.");
r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;

View File

@@ -66,6 +66,7 @@ public:
MATH_LERP,
MATH_INVERSE_LERP,
MATH_RANGE_LERP,
MATH_SMOOTHSTEP,
MATH_DECTIME,
MATH_RANDOMIZE,
MATH_RAND,

View File

@@ -208,6 +208,17 @@ public:
static _ALWAYS_INLINE_ double range_lerp(double p_value, double p_istart, double p_istop, double p_ostart, double p_ostop) { return Math::lerp(p_ostart, p_ostop, Math::inverse_lerp(p_istart, p_istop, p_value)); }
static _ALWAYS_INLINE_ float range_lerp(float p_value, float p_istart, float p_istop, float p_ostart, float p_ostop) { return Math::lerp(p_ostart, p_ostop, Math::inverse_lerp(p_istart, p_istop, p_value)); }
static _ALWAYS_INLINE_ double smoothstep(double p_from, double p_to, double p_weight) {
if (is_equal_approx(p_from, p_to)) return p_from;
double x = CLAMP((p_weight - p_from) / (p_to - p_from), 0.0, 1.0);
return x * x * (3.0 - 2.0 * x);
}
static _ALWAYS_INLINE_ float smoothstep(float p_from, float p_to, float p_weight) {
if (is_equal_approx(p_from, p_to)) return p_from;
float x = CLAMP((p_weight - p_from) / (p_to - p_from), 0.0f, 1.0f);
return x * x * (3.0f - 2.0f * x);
}
static _ALWAYS_INLINE_ double linear2db(double p_linear) { return Math::log(p_linear) * 8.6858896380650365530225783783321; }
static _ALWAYS_INLINE_ float linear2db(float p_linear) { return Math::log(p_linear) * 8.6858896380650365530225783783321; }
@@ -249,11 +260,11 @@ public:
static float random(float from, float to);
static real_t random(int from, int to) { return (real_t)random((real_t)from, (real_t)to); }
static _ALWAYS_INLINE_ bool is_equal_approx_ratio(real_t a, real_t b, real_t epsilon = CMP_EPSILON) {
static _ALWAYS_INLINE_ bool is_equal_approx_ratio(real_t a, real_t b, real_t epsilon = CMP_EPSILON, real_t min_epsilon = CMP_EPSILON) {
// this is an approximate way to check that numbers are close, as a ratio of their average size
// helps compare approximate numbers that may be very big or very small
real_t diff = abs(a - b);
if (diff == 0.0) {
if (diff == 0.0 || diff < min_epsilon) {
return true;
}
real_t avg_size = (abs(a) + abs(b)) / 2.0;

View File

@@ -131,6 +131,14 @@ public:
w(q.w) {
}
Quat operator=(const Quat &q) {
x = q.x;
y = q.y;
z = q.z;
w = q.w;
return *this;
}
Quat(const Vector3 &v0, const Vector3 &v1) // shortest arc
{
Vector3 c = v0.cross(v1);

View File

@@ -40,6 +40,7 @@ void RandomNumberGenerator::_bind_methods() {
ClassDB::bind_method(D_METHOD("randi"), &RandomNumberGenerator::randi);
ClassDB::bind_method(D_METHOD("randf"), &RandomNumberGenerator::randf);
ClassDB::bind_method(D_METHOD("randfn", "mean", "deviation"), &RandomNumberGenerator::randfn, DEFVAL(0.0), DEFVAL(1.0));
ClassDB::bind_method(D_METHOD("randf_range", "from", "to"), &RandomNumberGenerator::randf_range);
ClassDB::bind_method(D_METHOD("randi_range", "from", "to"), &RandomNumberGenerator::randi_range);
ClassDB::bind_method(D_METHOD("randomize"), &RandomNumberGenerator::randomize);

View File

@@ -55,6 +55,8 @@ public:
_FORCE_INLINE_ real_t randf_range(real_t from, real_t to) { return randbase.random(from, to); }
_FORCE_INLINE_ real_t randfn(real_t mean = 0.0, real_t deviation = 1.0) { return randbase.randfn(mean, deviation); }
_FORCE_INLINE_ int randi_range(int from, int to) {
unsigned int ret = randbase.rand();
return ret % (to - from + 1) + from;

View File

@@ -31,6 +31,8 @@
#ifndef RANDOM_PCG_H
#define RANDOM_PCG_H
#include <math.h>
#include "core/math/math_defs.h"
#include "thirdparty/misc/pcg.h"
@@ -61,6 +63,13 @@ public:
_FORCE_INLINE_ double randd() { return (double)rand() / (double)RANDOM_MAX; }
_FORCE_INLINE_ float randf() { return (float)rand() / (float)RANDOM_MAX; }
_FORCE_INLINE_ double randfn(double p_mean, double p_deviation) {
return p_mean + p_deviation * (cos(Math_TAU * randd()) * sqrt(-2.0 * log(randd()))); // Box-Muller transform
}
_FORCE_INLINE_ float randfn(float p_mean, float p_deviation) {
return p_mean + p_deviation * (cos(Math_TAU * randf()) * sqrt(-2.0 * log(randf()))); // Box-Muller transform
}
double random(double p_from, double p_to);
float random(float p_from, float p_to);
real_t random(int p_from, int p_to) { return (real_t)random((real_t)p_from, (real_t)p_to); }

View File

@@ -65,6 +65,7 @@ struct Vector2 {
real_t distance_squared_to(const Vector2 &p_vector2) const;
real_t angle_to(const Vector2 &p_vector2) const;
real_t angle_to_point(const Vector2 &p_vector2) const;
_FORCE_INLINE_ Vector2 direction_to(const Vector2 &p_b) const;
real_t dot(const Vector2 &p_other) const;
real_t cross(const Vector2 &p_other) const;
@@ -236,6 +237,12 @@ Vector2 Vector2::slerp(const Vector2 &p_b, real_t p_t) const {
return rotated(theta * p_t);
}
Vector2 Vector2::direction_to(const Vector2 &p_b) const {
Vector2 ret(p_b.x - x, p_b.y - y);
ret.normalize();
return ret;
}
Vector2 Vector2::linear_interpolate(const Vector2 &p_a, const Vector2 &p_b, real_t p_t) {
Vector2 res = p_a;

View File

@@ -112,6 +112,7 @@ struct Vector3 {
_FORCE_INLINE_ Vector3 project(const Vector3 &p_b) const;
_FORCE_INLINE_ real_t angle_to(const Vector3 &p_b) const;
_FORCE_INLINE_ Vector3 direction_to(const Vector3 &p_b) const;
_FORCE_INLINE_ Vector3 slide(const Vector3 &p_normal) const;
_FORCE_INLINE_ Vector3 bounce(const Vector3 &p_normal) const;
@@ -244,6 +245,12 @@ real_t Vector3::angle_to(const Vector3 &p_b) const {
return Math::atan2(cross(p_b).length(), dot(p_b));
}
Vector3 Vector3::direction_to(const Vector3 &p_b) const {
Vector3 ret(p_b.x - x, p_b.y - y, p_b.z - z);
ret.normalize();
return ret;
}
/* Operators */
Vector3 &Vector3::operator+=(const Vector3 &p_v) {

View File

@@ -1366,7 +1366,10 @@ Array Object::_get_incoming_connections() const {
void Object::get_signal_list(List<MethodInfo> *p_signals) const {
if (!script.is_null()) {
Ref<Script>(script)->get_script_signal_list(p_signals);
Ref<Script> scr = script;
if (scr.is_valid()) {
scr->get_script_signal_list(p_signals);
}
}
ClassDB::get_signal_list(get_class_name(), p_signals);

View File

@@ -75,6 +75,11 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
if (length >= 3) {
event->set_pitch(data[1]);
event->set_velocity(data[2]);
if (event->get_message() == MIDI_MESSAGE_NOTE_ON && event->get_velocity() == 0) {
// https://www.midi.org/forum/228-writing-midi-software-send-note-off,-or-zero-velocity-note-on
event->set_message(MIDI_MESSAGE_NOTE_OFF);
}
}
break;

View File

@@ -114,7 +114,7 @@ Variant PackedDataContainer::_get_at_ofs(uint32_t p_ofs, const uint8_t *p_buf, b
} else {
Variant v;
Error rerr = decode_variant(v, p_buf + p_ofs, datalen - p_ofs, NULL);
Error rerr = decode_variant(v, p_buf + p_ofs, datalen - p_ofs, NULL, false);
if (rerr != OK) {
@@ -249,9 +249,9 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
uint32_t pos = tmpdata.size();
int len;
encode_variant(p_data, NULL, len);
encode_variant(p_data, NULL, len, false);
tmpdata.resize(tmpdata.size() + len);
encode_variant(p_data, &tmpdata.write[pos], len);
encode_variant(p_data, &tmpdata.write[pos], len, false);
return pos;
} break;

View File

@@ -501,7 +501,7 @@ Error ProjectSettings::_load_settings_binary(const String p_path) {
d.resize(vlen);
f->get_buffer(d.ptrw(), vlen);
Variant value;
err = decode_variant(value, d.ptr(), d.size());
err = decode_variant(value, d.ptr(), d.size(), NULL, true);
ERR_EXPLAIN("Error decoding property: " + key);
ERR_CONTINUE(err != OK);
set(key, value);
@@ -656,7 +656,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
file->store_string(key);
int len;
err = encode_variant(p_custom_features, NULL, len);
err = encode_variant(p_custom_features, NULL, len, false);
if (err != OK) {
memdelete(file);
ERR_FAIL_V(err);
@@ -665,7 +665,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
Vector<uint8_t> buff;
buff.resize(len);
err = encode_variant(p_custom_features, buff.ptrw(), len);
err = encode_variant(p_custom_features, buff.ptrw(), len, false);
if (err != OK) {
memdelete(file);
ERR_FAIL_V(err);
@@ -694,7 +694,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
file->store_string(key);
int len;
err = encode_variant(value, NULL, len);
err = encode_variant(value, NULL, len, true);
if (err != OK)
memdelete(file);
ERR_FAIL_COND_V(err != OK, ERR_INVALID_DATA);
@@ -702,7 +702,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
Vector<uint8_t> buff;
buff.resize(len);
err = encode_variant(value, buff.ptrw(), len);
err = encode_variant(value, buff.ptrw(), len, true);
if (err != OK)
memdelete(file);
ERR_FAIL_COND_V(err != OK, ERR_INVALID_DATA);

View File

@@ -205,6 +205,8 @@ public:
static ScriptCodeCompletionCache *get_singleton() { return singleton; }
ScriptCodeCompletionCache();
virtual ~ScriptCodeCompletionCache() {}
};
class ScriptLanguage {

View File

@@ -328,4 +328,10 @@ struct _GlobalLock {
#define _PRINTF_FORMAT_ATTRIBUTE_2_3
#endif
/** This is needed due to a strange OpenGL API that expects a pointer
* type for an argument that is actually an offset.
*/
#define CAST_INT_TO_UCHAR_PTR(ptr) ((uint8_t *)(uintptr_t)(ptr))
#endif // TYPEDEFS_H

File diff suppressed because it is too large Load Diff

View File

@@ -97,6 +97,10 @@ public:
_FORCE_INLINE_ CharString() {}
_FORCE_INLINE_ CharString(const CharString &p_str) { _cowdata._ref(p_str._cowdata); }
_FORCE_INLINE_ CharString operator=(const CharString &p_str) {
_cowdata._ref(p_str._cowdata);
return *this;
}
bool operator<(const CharString &p_right) const;
CharString &operator+=(char p_char);
@@ -339,6 +343,10 @@ public:
_FORCE_INLINE_ String() {}
_FORCE_INLINE_ String(const String &p_str) { _cowdata._ref(p_str._cowdata); }
String operator=(const String &p_str) {
_cowdata._ref(p_str._cowdata);
return *this;
}
String(const char *p_str);
String(const CharType *p_str, int p_clip_to_len = -1);

View File

@@ -341,6 +341,7 @@ struct _VariantCall {
VCALL_LOCALMEM1R(Vector2, project);
VCALL_LOCALMEM1R(Vector2, angle_to);
VCALL_LOCALMEM1R(Vector2, angle_to_point);
VCALL_LOCALMEM1R(Vector2, direction_to);
VCALL_LOCALMEM2R(Vector2, linear_interpolate);
VCALL_LOCALMEM2R(Vector2, slerp);
VCALL_LOCALMEM4R(Vector2, cubic_interpolate);
@@ -397,6 +398,7 @@ struct _VariantCall {
VCALL_LOCALMEM1R(Vector3, distance_squared_to);
VCALL_LOCALMEM1R(Vector3, project);
VCALL_LOCALMEM1R(Vector3, angle_to);
VCALL_LOCALMEM1R(Vector3, direction_to);
VCALL_LOCALMEM1R(Vector3, slide);
VCALL_LOCALMEM1R(Vector3, bounce);
VCALL_LOCALMEM1R(Vector3, reflect);
@@ -773,6 +775,8 @@ struct _VariantCall {
VCALL_PTR0R(Basis, get_orthogonal_index);
VCALL_PTR0R(Basis, orthonormalized);
VCALL_PTR2R(Basis, slerp);
VCALL_PTR2R(Basis, is_equal_approx);
VCALL_PTR0R(Basis, get_rotation_quat);
VCALL_PTR0R(Transform, inverse);
VCALL_PTR0R(Transform, affine_inverse);
@@ -1554,6 +1558,7 @@ void register_variant_methods() {
ADDFUNC0R(VECTOR2, REAL, Vector2, angle, varray());
ADDFUNC0R(VECTOR2, REAL, Vector2, length_squared, varray());
ADDFUNC0R(VECTOR2, BOOL, Vector2, is_normalized, varray());
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, direction_to, VECTOR2, "b", varray());
ADDFUNC1R(VECTOR2, REAL, Vector2, distance_to, VECTOR2, "to", varray());
ADDFUNC1R(VECTOR2, REAL, Vector2, distance_squared_to, VECTOR2, "to", varray());
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, project, VECTOR2, "b", varray());
@@ -1602,6 +1607,7 @@ void register_variant_methods() {
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, linear_interpolate, VECTOR3, "b", REAL, "t", varray());
ADDFUNC2R(VECTOR3, VECTOR3, Vector3, slerp, VECTOR3, "b", REAL, "t", varray());
ADDFUNC4R(VECTOR3, VECTOR3, Vector3, cubic_interpolate, VECTOR3, "b", VECTOR3, "pre_a", VECTOR3, "post_b", REAL, "t", varray());
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, direction_to, VECTOR3, "b", varray());
ADDFUNC1R(VECTOR3, REAL, Vector3, dot, VECTOR3, "b", varray());
ADDFUNC1R(VECTOR3, VECTOR3, Vector3, cross, VECTOR3, "b", varray());
ADDFUNC1R(VECTOR3, BASIS, Vector3, outer, VECTOR3, "b", varray());
@@ -1842,6 +1848,8 @@ void register_variant_methods() {
ADDFUNC1R(BASIS, VECTOR3, Basis, xform_inv, VECTOR3, "v", varray());
ADDFUNC0R(BASIS, INT, Basis, get_orthogonal_index, varray());
ADDFUNC2R(BASIS, BASIS, Basis, slerp, BASIS, "b", REAL, "t", varray());
ADDFUNC2R(BASIS, BOOL, Basis, is_equal_approx, BASIS, "b", REAL, "epsilon", varray(CMP_EPSILON));
ADDFUNC0R(BASIS, QUAT, Basis, get_rotation_quat, varray());
ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, inverse, varray());
ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, affine_inverse, varray());
@@ -1923,9 +1931,9 @@ void register_variant_methods() {
_VariantCall::add_variant_constant(Variant::TRANSFORM, "IDENTITY", identity_transform);
transform_x.set(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
_VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_X", transform_x);
transform_x.set(1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0);
transform_y.set(1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0);
_VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Y", transform_y);
transform_x.set(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0);
transform_z.set(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0);
_VariantCall::add_variant_constant(Variant::TRANSFORM, "FLIP_Z", transform_z);
_VariantCall::add_variant_constant(Variant::PLANE, "PLANE_YZ", Plane(Vector3(1, 0, 0), 0));

View File

@@ -65,7 +65,7 @@ private:
const Pair *a = _cowdata.ptr();
int middle = 0;
#if DEBUG_ENABLED
#ifdef DEBUG_ENABLED
if (low > high)
ERR_PRINT("low > high, this may be a bug");
#endif

View File

@@ -50,7 +50,7 @@ class VSet {
const T *a = &_data[0];
int middle = 0;
#if DEBUG_ENABLED
#ifdef DEBUG_ENABLED
if (low > high)
ERR_PRINT("low > high, this may be a bug");
#endif

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="@GDScript" category="Core" version="3.1">
<class name="@GDScript" category="Core" version="3.1.1">
<brief_description>
Built-in GDScript functions.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="Color8">
<return type="Color">
@@ -127,7 +125,7 @@
<description>
Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.
[codeblock]
a = atan(0, -1) # a is 3.141593
a = atan2(0, -1) # a is 3.141593
[/codeblock]
</description>
</method>
@@ -136,8 +134,11 @@
</return>
<argument index="0" name="bytes" type="PoolByteArray">
</argument>
<argument index="1" name="allow_objects" type="bool" default="false">
</argument>
<description>
Decodes a byte array back to a value.
Decodes a byte array back to a value. When [code]allow_objects[/code] is [code]true[/code] decoding objects is allowed.
[b]WARNING:[/b] Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution).
</description>
</method>
<method name="cartesian2polar">
@@ -972,6 +973,24 @@
[/codeblock]
</description>
</method>
<method name="smoothstep">
<return type="float">
</return>
<argument index="0" name="from" type="float">
</argument>
<argument index="1" name="to" type="float">
</argument>
<argument index="2" name="weight" type="float">
</argument>
<description>
Returns a number smoothly interpolated between the [code]from[/code] and [code]to[/code], based on the [code]weight[/code]. Similar to [method lerp], but interpolates faster at the beginning and slower at the end.
[codeblock]
smooth_step(0, 2, 0.5) # returns 0.15
smooth_step(0, 2, 1.0) # returns 0.5
smooth_step(0, 2, 2.0) # returns 1.0
[/codeblock]
</description>
</method>
<method name="sqrt">
<return type="float">
</return>
@@ -1112,8 +1131,10 @@
</return>
<argument index="0" name="var" type="Variant">
</argument>
<argument index="1" name="full_objects" type="bool" default="false">
</argument>
<description>
Encodes a variable value to a byte array.
Encodes a variable value to a byte array. When [code]full_objects[/code] is [code]true[/code] encoding objects is allowed (and can potentially include code).
</description>
</method>
<method name="var2str">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="@GlobalScope" category="Core" version="3.1">
<class name="@GlobalScope" category="Core" version="3.1.1">
<brief_description>
Global scope constants and variables.
</brief_description>
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="@NativeScript" category="Core" version="3.1">
<class name="@NativeScript" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="@VisualScript" category="Core" version="3.1">
<class name="@VisualScript" category="Core" version="3.1.1">
<brief_description>
Built-in visual script functions.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AABB" category="Built-In Types" version="3.1">
<class name="AABB" category="Built-In Types" version="3.1.1">
<brief_description>
Axis-Aligned Bounding Box.
</brief_description>
@@ -9,8 +9,6 @@
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
</tutorials>
<demos>
</demos>
<methods>
<method name="AABB">
<return type="AABB">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVRAnchor" inherits="Spatial" category="Core" version="3.1">
<class name="ARVRAnchor" inherits="Spatial" category="Core" version="3.1.1">
<brief_description>
Anchor point in AR Space.
</brief_description>
@@ -10,8 +10,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_anchor_name" qualifiers="const">
<return type="String">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVRCamera" inherits="Camera" category="Core" version="3.1">
<class name="ARVRCamera" inherits="Camera" category="Core" version="3.1.1">
<brief_description>
A camera node with a few overrules for AR/VR applied, such as location tracking.
</brief_description>
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVRController" inherits="Spatial" category="Core" version="3.1">
<class name="ARVRController" inherits="Spatial" category="Core" version="3.1.1">
<brief_description>
A spatial node representing a spatially tracked controller.
</brief_description>
@@ -10,8 +10,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_controller_name" qualifiers="const">
<return type="String">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVRInterface" inherits="Reference" category="Core" version="3.1">
<class name="ARVRInterface" inherits="Reference" category="Core" version="3.1.1">
<brief_description>
Base class for ARVR interface implementation.
</brief_description>
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_capabilities" qualifiers="const">
<return type="int">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVROrigin" inherits="Spatial" category="Core" version="3.1">
<class name="ARVROrigin" inherits="Spatial" category="Core" version="3.1.1">
<brief_description>
Our origin point in AR/VR.
</brief_description>
@@ -11,8 +11,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVRPositionalTracker" inherits="Object" category="Core" version="3.1">
<class name="ARVRPositionalTracker" inherits="Object" category="Core" version="3.1.1">
<brief_description>
A tracked object
</brief_description>
@@ -10,8 +10,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_hand" qualifiers="const">
<return type="int" enum="ARVRPositionalTracker.TrackerHand">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVRServer" inherits="Object" category="Core" version="3.1">
<class name="ARVRServer" inherits="Object" category="Core" version="3.1.1">
<brief_description>
This is our AR/VR Server.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="center_on_hmd">
<return type="void">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AStar" inherits="Reference" category="Core" version="3.1">
<class name="AStar" inherits="Reference" category="Core" version="3.1.1">
<brief_description>
AStar class representation that uses vectors as edges.
</brief_description>
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="_compute_cost" qualifiers="virtual">
<return type="float">
@@ -226,6 +224,15 @@
Returns whether a point associated with the given id exists.
</description>
</method>
<method name="is_point_disabled" qualifiers="const">
<return type="bool">
</return>
<argument index="0" name="id" type="int">
</argument>
<description>
Returns whether a point is disabled or not for pathfinding. By default, all points are enabled.
</description>
</method>
<method name="remove_point">
<return type="void">
</return>
@@ -235,6 +242,17 @@
Removes the point associated with the given id from the points pool.
</description>
</method>
<method name="set_point_disabled">
<return type="void">
</return>
<argument index="0" name="id" type="int">
</argument>
<argument index="1" name="disabled" type="bool" default="true">
</argument>
<description>
Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle.
</description>
</method>
<method name="set_point_position">
<return type="void">
</return>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AcceptDialog" inherits="WindowDialog" category="Core" version="3.1">
<class name="AcceptDialog" inherits="WindowDialog" category="Core" version="3.1.1">
<brief_description>
Base dialog for user notification.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_button">
<return type="Button">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimatedSprite" inherits="Node2D" category="Core" version="3.1">
<class name="AnimatedSprite" inherits="Node2D" category="Core" version="3.1.1">
<brief_description>
Sprite node that can use multiple textures for animation.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="is_playing" qualifiers="const">
<return type="bool">
@@ -23,8 +21,10 @@
</return>
<argument index="0" name="anim" type="String" default="&quot;&quot;">
</argument>
<argument index="1" name="backwards" type="bool" default="false">
</argument>
<description>
Play the animation set in parameter. If no parameter is provided, the current animation is played.
Play the animation set in parameter. If no parameter is provided, the current animation is played. Property [code]backwards[/code] plays the animation in reverse if set to [code]true[/code].
</description>
</method>
<method name="stop">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimatedSprite3D" inherits="SpriteBase3D" category="Core" version="3.1">
<class name="AnimatedSprite3D" inherits="SpriteBase3D" category="Core" version="3.1.1">
<brief_description>
2D sprite node in 3D world, that can use multiple 2D textures for animation.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="is_playing" qualifiers="const">
<return type="bool">

View File

@@ -1,17 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimatedTexture" inherits="Texture" category="Core" version="3.1">
<class name="AnimatedTexture" inherits="Texture" category="Core" version="3.1.1">
<brief_description>
Proxy texture for simple frame-based animations.
</brief_description>
<description>
[code]AnimatedTexture[/code] is a resource format for simple frame-based animations, where multiple frames textures can be chained automatically with a predefined delay for each frame. It's not a [Node], contrarily to [AnimationPlayer] or [AnimatedSprite], but has the advantage of being usable at any place where a [Texture] resource can be used, e.g. in a [TileSet].
[code]AnimatedTexture[/code] is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike [AnimationPlayer] or [AnimatedSprite], it isn't a [Node], but has the advantage of being usable anywhere a [Texture] resource can be used, e.g. in a [TileSet].
The playback of the animation is controlled by the [member fps] property as well as each frame's optional delay (see [method set_frame_delay]). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame.
[code]AnimatedTexture[/code] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one.
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_frame_delay" qualifiers="const">
<return type="float">
@@ -19,7 +17,7 @@
<argument index="0" name="frame" type="int">
</argument>
<description>
Retrieves the delayed assigned to the given [code]frame[/code] ID.
Returns the given frame's delay value.
</description>
</method>
<method name="get_frame_texture" qualifiers="const">
@@ -28,7 +26,7 @@
<argument index="0" name="frame" type="int">
</argument>
<description>
Retrieves the [Texture] assigned to the given [code]frame[/code] ID.
Returns the given frame's [Texture].
</description>
</method>
<method name="set_frame_delay">
@@ -39,7 +37,7 @@
<argument index="1" name="delay" type="float">
</argument>
<description>
Defines an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by [member fps]. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be [code]1.0 / fps + delay[/code].
Sets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by [member fps]. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be [code]1.0 / fps + delay[/code].
For example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be:
[codeblock]
Frame 0: 0.5 s (1 / fps)
@@ -57,15 +55,15 @@
<argument index="1" name="texture" type="Texture">
</argument>
<description>
Assigns a [Texture] to the given [code]frame[/code] ID. IDs start at 0 (so the first frame has ID 0, and the last frame of the animation has ID [member frames] - 1).
You can define any frame texture up to [constant MAX_FRAMES], but keep in mind that only frames from 0 to [member frames] - 1 will be part of the animation.
Assigns a [Texture] to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID [member frames] - 1.
You can define any number of textures up to [constant MAX_FRAMES], but keep in mind that only frames from 0 to [member frames] - 1 will be part of the animation.
</description>
</method>
</methods>
<members>
<member name="fps" type="float" setter="set_fps" getter="get_fps">
Number of frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]). Default value: 4.
For example, an animation with 8 frames, no frame delay and a [code]fps[/code] value of 2 will run over 4 seconds, with one frame each 0.5 seconds.
Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [member frames] property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [method set_frame_delay]). Default value: 4.
For example, an animation with 8 frames, no frame delay and a [code]fps[/code] value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds.
</member>
<member name="frames" type="int" setter="set_frames" getter="get_frames">
Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES]. Default value: 1.

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Animation" inherits="Resource" category="Core" version="3.1">
<class name="Animation" inherits="Resource" category="Core" version="3.1.1">
<brief_description>
Contains data used to animate everything in the engine.
</brief_description>
@@ -19,8 +19,6 @@
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_track">
<return type="int">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNode" inherits="Resource" category="Core" version="3.1">
<class name="AnimationNode" inherits="Resource" category="Core" version="3.1.1">
<brief_description>
Base resource for [AnimationTree] nodes.
</brief_description>
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_input">
<return type="void">

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeAdd2" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeAdd2" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeAdd3" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeAdd3" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeAnimation" inherits="AnimationRootNode" category="Core" version="3.1">
<class name="AnimationNodeAnimation" inherits="AnimationRootNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeBlend2" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeBlend2" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeBlend3" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeBlend3" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeBlendSpace1D" inherits="AnimationRootNode" category="Core" version="3.1">
<class name="AnimationNodeBlendSpace1D" inherits="AnimationRootNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_blend_point">
<return type="void">

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeBlendSpace2D" inherits="AnimationRootNode" category="Core" version="3.1">
<class name="AnimationNodeBlendSpace2D" inherits="AnimationRootNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_blend_point">
<return type="void">
@@ -136,8 +134,10 @@
<constant name="BLEND_MODE_INTERPOLATED" value="0" enum="BlendMode">
</constant>
<constant name="BLEND_MODE_DISCRETE" value="1" enum="BlendMode">
Useful for frame-by-frame 2D animations.
</constant>
<constant name="BLEND_MODE_DISCRETE_CARRY" value="2" enum="BlendMode">
Keep the current play position when switching between discrete animations.
</constant>
</constants>
</class>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeBlendTree" inherits="AnimationRootNode" category="Core" version="3.1">
<class name="AnimationNodeBlendTree" inherits="AnimationRootNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_node">
<return type="void">

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeOneShot" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeOneShot" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_mix_mode" qualifiers="const">
<return type="int" enum="AnimationNodeOneShot.MixMode">

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeOutput" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeOutput" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeStateMachine" inherits="AnimationRootNode" category="Core" version="3.1">
<class name="AnimationNodeStateMachine" inherits="AnimationRootNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
Contains multiple root nodes as children in a graph. Each node is used as a state, and provides multiple functions to alternate between states. Retrieve the AnimationNodeStateMachinePlayback object from the [AnimationTree] node to control it programatically.
[codeblock]
var state_machine = anim_tree["parameters/StateMachine/playback"]
state_machine.travel("SomeState")
[codeblock]
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_node">
<return type="void">
@@ -170,7 +173,7 @@
<method name="set_graph_offset">
<return type="void">
</return>
<argument index="0" name="name" type="Vector2">
<argument index="0" name="offset" type="Vector2">
</argument>
<description>
</description>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeStateMachinePlayback" inherits="Resource" category="Core" version="3.1">
<class name="AnimationNodeStateMachinePlayback" inherits="Resource" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_current_node" qualifiers="const">
<return type="String">
@@ -47,6 +45,7 @@
<argument index="0" name="to_node" type="String">
</argument>
<description>
Transition from the current state to another one, while visiting all the intermediate ones. This is done via the A* algorithm.
</description>
</method>
</methods>

View File

@@ -1,27 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeStateMachineTransition" inherits="Resource" category="Core" version="3.1">
<class name="AnimationNodeStateMachineTransition" inherits="Resource" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>
<member name="advance_condition" type="String" setter="set_advance_condition" getter="get_advance_condition">
Turn on auto advance when this condition is set. This is a custom text field that can be filled with a variable name. The variable can be modified from code.
</member>
<member name="auto_advance" type="bool" setter="set_auto_advance" getter="has_auto_advance">
Turn on the transition automatically when this state is reached. This works best with [code]SWITCH_MODE_AT_END[/code].
</member>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled">
Don't use this transition during [method AnimationNodeStateMachinePlayback.travel] or [member auto_advance].
</member>
<member name="priority" type="int" setter="set_priority" getter="get_priority">
Lower priority transitions are preferred when travelling through the tree via [method AnimationNodeStateMachinePlayback.travel] or [member auto_advance].
</member>
<member name="switch_mode" type="int" setter="set_switch_mode" getter="get_switch_mode" enum="AnimationNodeStateMachineTransition.SwitchMode">
The transition type.
</member>
<member name="xfade_time" type="float" setter="set_xfade_time" getter="get_xfade_time">
The time to cross-fade between this state and the next.
</member>
</members>
<signals>
@@ -32,10 +36,13 @@
</signals>
<constants>
<constant name="SWITCH_MODE_IMMEDIATE" value="0" enum="SwitchMode">
Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
</constant>
<constant name="SWITCH_MODE_SYNC" value="1" enum="SwitchMode">
Switch to the next state immediately, but will seek the new state to the playback position of the old state.
</constant>
<constant name="SWITCH_MODE_AT_END" value="2" enum="SwitchMode">
Wait for the current state playback to end, then switch to the beginning of the next state animation.
</constant>
</constants>
</class>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeTimeScale" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeTimeScale" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeTimeSeek" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeTimeSeek" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationNodeTransition" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationNodeTransition" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationPlayer" inherits="Node" category="Core" version="3.1">
<class name="AnimationPlayer" inherits="Node" category="Core" version="3.1.1">
<brief_description>
Container and player of [Animation] resources.
</brief_description>
@@ -10,8 +10,6 @@
<link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/animations.html</link>
<link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_animation">
<return type="int" enum="Error">

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationRootNode" inherits="AnimationNode" category="Core" version="3.1">
<class name="AnimationRootNode" inherits="AnimationNode" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationTrackEditPlugin" inherits="Reference" category="Core" version="3.1">
<class name="AnimationTrackEditPlugin" inherits="Reference" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationTree" inherits="Node" category="Core" version="3.1">
<class name="AnimationTree" inherits="Node" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
<link>https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>
<link>https://github.com/godotengine/tps-demo</link>
</tutorials>
<demos>
</demos>
<methods>
<method name="advance">
<return type="void">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AnimationTreePlayer" inherits="Node" category="Core" version="3.1">
<class name="AnimationTreePlayer" inherits="Node" category="Core" version="3.1.1">
<brief_description>
Animation Player that uses a node graph for blending Animations.
</brief_description>
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_node">
<return type="void">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Area" inherits="CollisionObject" category="Core" version="3.1">
<class name="Area" inherits="CollisionObject" category="Core" version="3.1.1">
<brief_description>
General purpose area node for detection and 3D physics influence.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_collision_layer_bit" qualifiers="const">
<return type="bool">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Area2D" inherits="CollisionObject2D" category="Core" version="3.1">
<class name="Area2D" inherits="CollisionObject2D" category="Core" version="3.1.1">
<brief_description>
2D area for detection and 2D physics influence.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_collision_layer_bit" qualifiers="const">
<return type="bool">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Array" category="Built-In Types" version="3.1">
<class name="Array" category="Built-In Types" version="3.1.1">
<brief_description>
Generic array datatype.
</brief_description>
@@ -17,8 +17,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="Array">
<return type="Array">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ArrayMesh" inherits="Mesh" category="Core" version="3.1">
<class name="ArrayMesh" inherits="Mesh" category="Core" version="3.1.1">
<brief_description>
</brief_description>
<description>
@@ -23,8 +23,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="add_blend_shape">
<return type="void">

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AtlasTexture" inherits="Texture" category="Core" version="3.1">
<class name="AtlasTexture" inherits="Texture" category="Core" version="3.1.1">
<brief_description>
Packs multiple small textures in a single, bigger one. Helps to optimize video memory costs and render calls.
</brief_description>
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioBusLayout" inherits="Resource" category="Core" version="3.1">
<class name="AudioBusLayout" inherits="Resource" category="Core" version="3.1.1">
<brief_description>
Stores information about the audiobusses.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffect" inherits="Resource" category="Core" version="3.1">
<class name="AudioEffect" inherits="Resource" category="Core" version="3.1.1">
<brief_description>
Audio Effect For Audio.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectAmplify" inherits="AudioEffect" category="Core" version="3.1">
<class name="AudioEffectAmplify" inherits="AudioEffect" category="Core" version="3.1.1">
<brief_description>
Adds a Amplify audio effect to an Audio bus.
Increases or decreases the volume of the selected audio bus.
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectBandLimitFilter" inherits="AudioEffectFilter" category="Core" version="3.1">
<class name="AudioEffectBandLimitFilter" inherits="AudioEffectFilter" category="Core" version="3.1.1">
<brief_description>
Adds a band limit filter to the Audio Bus.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectBandPassFilter" inherits="AudioEffectFilter" category="Core" version="3.1">
<class name="AudioEffectBandPassFilter" inherits="AudioEffectFilter" category="Core" version="3.1.1">
<brief_description>
Adds a band pass filter to the Audio Bus.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<constants>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectChorus" inherits="AudioEffect" category="Core" version="3.1">
<class name="AudioEffectChorus" inherits="AudioEffect" category="Core" version="3.1.1">
<brief_description>
Adds a chorus audio effect.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectCompressor" inherits="AudioEffect" category="Core" version="3.1">
<class name="AudioEffectCompressor" inherits="AudioEffect" category="Core" version="3.1.1">
<brief_description>
Adds a Compressor audio effect to an Audio bus.
Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume.
@@ -14,8 +14,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectDelay" inherits="AudioEffect" category="Core" version="3.1">
<class name="AudioEffectDelay" inherits="AudioEffect" category="Core" version="3.1.1">
<brief_description>
Adds a Delay audio effect to an Audio bus. Plays input signal back after a period of time.
Two tap delay and feedback options.
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectDistortion" inherits="AudioEffect" category="Core" version="3.1">
<class name="AudioEffectDistortion" inherits="AudioEffect" category="Core" version="3.1.1">
<brief_description>
Adds a Distortion audio effect to an Audio bus.
Modify the sound to make it dirty.
@@ -10,8 +10,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="AudioEffectEQ" inherits="AudioEffect" category="Core" version="3.1">
<class name="AudioEffectEQ" inherits="AudioEffect" category="Core" version="3.1.1">
<brief_description>
Base class for audio equalizers. Gives you control over frequencies.
Use it to create a custom equalizer if [AudioEffectEQ6], [AudioEffectEQ10] or [AudioEffectEQ21] don't fit your needs.
@@ -9,8 +9,6 @@
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
<method name="get_band_count" qualifiers="const">
<return type="int">

Some files were not shown because too many files have changed in this diff Show More