Commit Graph

7680 Commits

Author SHA1 Message Date
Rémi Verschelde d2e1b4b9f0
Merge pull request #68118 from aaronfranke/quat-from-euler
Replace Quaternion Euler constructor with `from_euler` method
2022-11-02 18:51:59 +01:00
kobewi 15831e381b Unify usage of undo_redo in editor 2022-11-02 17:51:58 +01:00
Fabio Alessandrelli 33dda2e68a [MP] Remove connection state signals from MultiplayerPeer.
Now handled directly by the MultiplayerAPI implementation.
2022-11-02 15:17:23 +01:00
Fabio Alessandrelli 9773803e4e [MP] Add optional authentication to SceneMultiplayer.
Add few methods to allow peers to exchange authentication information.

- `set_auth_callback(callback)`: Enable the authentication features.
  The callback is a `Callable` that accepts an `int` (the peer ID), and
  a `PackedByteArray` of data.
- The `peer_authenticating(id)` signal will be emitted instead of
  `peer_connected` when a new peer connects.
- Use `send_auth(id: int, data: PackedByteArray)` to exchange data.
- Call `complete_auth(id: int)` when the authentication process is
  complete and you expect to start receiving game data.
- The `peer_connected` signal will be emitted as soon as both parties
  complete the authentication.
- Use `disconnect_peer(id)` to disconnect a connected peer.
- If the `peer_connected` signal didn't fire for that peer (i.e. it was
  still in the authentication phase), the `peer_auth_failed` signal will
  be emitted instead of `peer_disconnected`.
2022-11-02 15:17:23 +01:00
Rémi Verschelde 7eb44fa47d
Merge pull request #68125 from kleonc/range-fix-single-arg-optimized-type-mismatch
[GDScript] Fix type mismatch in optimized single arg `range`
2022-11-02 14:18:24 +01:00
Rémi Verschelde 34c66fac0a
Merge pull request #68161 from Chaosus/dotnet_quaternion_constructor
Add missed Quaternion constructor to C#
2022-11-02 14:18:19 +01:00
Rémi Verschelde b3c2db954f
Merge pull request #68136 from qarmin/projection_not_equal
Support for checking that Projection is(not) null
2022-11-02 14:17:29 +01:00
Rémi Verschelde 2fd2a04efc
Merge pull request #68131 from benbusby/hotfix/zippacker_null_check
Remove `zf != NULL` check from `ZIPPacker::start_file`
2022-11-02 14:17:07 +01:00
Rémi Verschelde 7c0e46f1c1
Merge pull request #68040 from adamscott/fix-property-getter-return-type
Fix property getter with custom return type
2022-11-02 14:16:37 +01:00
Rémi Verschelde a30ed00fb1
Merge pull request #68057 from Klowner/tga-truncated-crash-fix-67985
Add buffer size check to Image.load_tga_from_buffer(). Fixes #67985
2022-11-02 14:15:40 +01:00
Rémi Verschelde 1bd7f2110a
Merge pull request #68110 from bruvzg/hexbox_ver
[TextServer] Fix hex code box positions in vertical text layout.
2022-11-02 14:15:23 +01:00
kleonc c268e3a235 GDScript Fix type mismatch in optimized single arg `range` 2022-11-02 13:20:47 +01:00
Yuri Rubinsky 9487a6ea32 Add missed Quaternion constructor to C# 2022-11-02 11:41:32 +03:00
Rafał Mikrut d7d130295e Support for checking that Projection is(not) null 2022-11-01 20:49:52 +01:00
Fabio Alessandrelli 0a0e99cadc
Merge pull request #67982 from Faless/mp/4.x_disconnect_close
[MP] Add MultiplayerPeer disconnect_peer, close.
2022-11-01 20:35:04 +01:00
Ben Busby 3b37f50e50
Remove `zf != NULL` check from `ZIPPacker::start_file`
This check was removed because it introduces a bug which prevents
ZIPPacker from actually adding any files, since it must be opened before
adding any files (and therefore shouldn't be NULL at the start of
`start_file`).
2022-11-01 11:37:02 -06:00
Aaron Franke 83634119d4
Replace Quaternion Euler constructor with `from_euler` method 2022-11-01 09:28:12 -05:00
bruvzg 02a4b3f859
[TextServer] Fix hex code box positions in vertical text layout. 2022-11-01 11:51:29 +02:00
Bastiaan Olij a4e58ec84a Fix several render issues found while debugging XR 2022-11-01 13:27:03 +11:00
Haoyu Qiu 3b88851e25 Clarify offset parameter behavior in RegEx methods 2022-11-01 09:29:08 +08:00
bruvzg 397fa2fa7a
[TextServer] Fix incorrect line breaks count for embedded objects (e.g. RTL tables). 2022-10-31 17:34:07 +02:00
bruvzg f0b7ff324c
Improve text line breaking performance for long lines. 2022-10-31 15:35:51 +02:00
Rémi Verschelde cd25e48456
Merge pull request #67562 from bruvzg/improve_font_packing
Improve font glyph cache packing shelf best height fit heuristic.
2022-10-31 14:26:13 +01:00
Rémi Verschelde d43364e3cc
Merge pull request #67968 from bruvzg/icu72.1
ICU: Update to version 72.1
2022-10-31 14:25:37 +01:00
Rémi Verschelde 76ef71bda0
Merge pull request #67585 from bruvzg/fix_no_graphite_build
[TextServer] Fix build with disabled graphite.
2022-10-31 14:22:32 +01:00
Rémi Verschelde ae81a569b9
Merge pull request #67409 from bruvzg/fix_oversampling_rounding
[TextServer] Do not round glyph advances / coordinates if font oversampling or bitmap glyph scaling is used.
2022-10-31 14:21:56 +01:00
Rémi Verschelde 5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Rémi Verschelde 1e0edc48b5
Merge pull request #67826 from Chaosus/gds_fix_enum
Fix enum type to use int64_t instead of int in GDScript
2022-10-31 13:10:28 +01:00
Rémi Verschelde be126d42d4
Merge pull request #67588 from KoBeWi/if(!GDVIRTUAL_CALL)don't
Simplify GDVIRTUAL_CALL calls
2022-10-31 11:55:56 +01:00
Rémi Verschelde f4f98c4ecb
Merge pull request #67055 from GuilhermeGSousa/custom-node-export
Added custom node export
2022-10-31 11:11:07 +01:00
Rémi Verschelde 213ba46672
Merge pull request #68065 from zCubed3/fix_min_max_crash
`GDScriptAnalyzer` Fix math utilities crashing when invalid args are passed
2022-10-31 10:59:27 +01:00
Rémi Verschelde 420eb1aa34
Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
Rémi Verschelde 62a778fdd6
Merge pull request #66929 from MladoniSzabi/save_jpeg_file
Fixed Image.save_jpg() does not write any file
2022-10-31 10:48:10 +01:00
Rémi Verschelde b43cc96535
Merge pull request #62695 from Spartan322/relax-constant-asserts
Allow non-constant string message for assert
2022-10-31 10:44:56 +01:00
Ignacio Roldán Etcheverry 256c0079b0
Merge pull request #67987 from neikeq/dotnet-more-static-marshaling
C#: Reflection-less delegate callables and nested generic Godot collections
2022-10-31 04:21:13 +01:00
zCubed3 b7f0ab13a4
Fix math utility functions crashing when invalid args passed 2022-10-30 15:18:03 -07:00
Mark Riedesel 5cb07486db Add buffer size check to Image.load_tga_from_buffer(). Fixes #67985 2022-10-30 11:20:50 -05:00
Max Hilbrunner 9fb481334a
Merge pull request #68039 from Anutrix/docs-fix-signal-syntax
Fixed signal connection examples to use new callable syntax in the docs
2022-10-30 12:03:37 +01:00
Adam Scott 26f0afdce2 [godot#68001] Fix property getter with custom return type 2022-10-29 20:38:26 -04:00
Anutrix 7984598e33 Fixed signal connection examples to use new callable syntax in the docs 2022-10-30 05:26:46 +05:30
Ignacio Roldán Etcheverry f66a352c0f C#: Add Variant conversion callbacks for generic Godot collections
This allows using generic Godot collections as type arguments for other
generic Godot collections. This also allows generic Godot collections
as parameter or return type in dynamic Callable invocations.
2022-10-30 01:24:15 +02:00
Ignacio Roldán Etcheverry 282bd37e5c C#: Remove need for reflection to invoking callable delegates
We aim to make the C# API reflection-free, mainly for concerns about
performance, and to be able to target NativeAOT in refletion-free mode,
which reduces the binary size.

One of the main usages of reflection still left was the dynamic
invokation of callable delegates, and for some time I wasn't sure
I would find an alternative solution that I'd be happy with.

The new solution uses trampoline functions to invoke the delegates:

```
static void Trampoline(object delegateObj, NativeVariantPtrArgs args, out godot_variant ret)
{
    if (args.Count != 1)
        throw new ArgumentException($"Callable expected 1 arguments but received {args.Count}.");

    string res = ((Func<int, string>)delegateObj)(
        VariantConversionCallbacks.GetToManagedCallback<int>()(args[0])
    );

    ret = VariantConversionCallbacks.GetToVariantCallback<string>()(res);
}

Callable.CreateWithUnsafeTrampoline((int num) => "Foo" + num, &Trampoline);
```

Of course, this is too much boilerplate for user code. To improve this,
the `Callable.From` methods were added. These are overloads that take
`Action` and `Func` delegates, which covers the most common use cases:
lambdas and method groups:

```
// Lambda
Callable.From((int num) => "Foo" + num);

// Method group
string AppendNum(int num) => "Foo" + num;
Callable.From(AppendNum);
```

Unfortunately, due to limitations in the C# language, implicit
conversions from delegates to `Callable` are not supported.

`Callable.From` does not support custom delegates. These should be
uncommon, but the Godot C# API actually uses them for event signals.
As such, the bindings generator was updated to generate trampoline
functions for event signals. It was also optimized to use `Action`
instead of a custom delegate for parameterless signals, which removes
the need for the trampoline functions for those signals.

The change to reflection-free invokation removes one of the last needs
for `ConvertVariantToManagedObjectOfType`. The only remaining usage is
from calling script constructors with parameters from the engine
(`CreateManagedForGodotObjectScriptInstance`). Once that one is made
reflection-free, `ConvertVariantToManagedObjectOfType` can be removed.
2022-10-30 01:24:15 +02:00
Max Hilbrunner a889c1d7a2
Merge pull request #67909 from Calinou/doc-enetpacketpeer
Document the ENetPacketPeer class
2022-10-30 00:09:24 +02:00
Max Hilbrunner 11d74d606a
Merge pull request #67980 from DeeJayLSP/webpcase
Change all WEBP strings and comments to WebP
2022-10-29 19:28:47 +02:00
Clay John 3fa339cfc4
Merge pull request #67849 from kdada/fix-built-in-script-crash
Fix built-in script path of GDScript to prevent crash
2022-10-28 13:04:36 -07:00
Fabio Alessandrelli 39f3d9d59e [MP] Add MultiplayerPeer disconnect_peer, close.
Update ENet, WebRTC, and WebSocket to support peer disconnection and
unify the close function.
2022-10-28 21:18:01 +02:00
DeeJayLSP dd64ceab47 Change all WEBP strings and comments to WebP 2022-10-28 15:17:49 -03:00
bruvzg 4e44a271f0
ICU: Update to version 72.1 2022-10-28 09:11:55 +03:00
Clay John bc7e0f0616
Merge pull request #67946 from BastiaanOlij/openxr_default_aimpose
Change default OpenXR pose to aim pose
2022-10-27 17:17:07 -07:00
Fabio Alessandrelli 7536d15fe3 [MP] Let MultiplayerAPI handle packet relaying and peer signaling.
MultiplayerPeer changes:

- Adds is_server_relay_supported virtual method

Informs the upper MultiplayerAPI layer if it can signal peers connected
to the server to other clients, and perform packet relaying among them.

- Adds get_packet_channel and get_packet_mode virtual methods

Allows the MultiplayerAPI to retrieve the channel and transfer modes to
use when relaying the last received packet.

SceneMultiplayerPeer changes:

- Implement peer signaling and packet relaying when the MultiplayerPeer
  advertise they are supported.

ENet, WebRTC, WebSocket changes:

- Removed custom code for relaying from WebSocket and ENet, and let it
  be handled by the upper layer.
- Update WebRTC to split create_client, create_server, and create_mesh,
  with the latter behaving like the old initialize with
  "server_compatibility = false", and the first two supporting the upper
  layer relaying protocol.
2022-10-27 18:08:58 +02:00
Bastiaan Olij 91945c3077 Change default OpenXR pose to aim pose 2022-10-28 01:56:06 +11:00
Hugo Locurcio 16ba235e0a
Document the ENetPacketPeer class 2022-10-26 19:40:18 +02:00
Max Hilbrunner bb77342c07
Merge pull request #67843 from Calinou/doc-csgshape3d
Document `collision_priority` in the CSGShape3D class
2022-10-25 14:26:47 +02:00
Max Hilbrunner 9e509caa8b
Merge pull request #67858 from TechnoPorg/fix-upnp-docs
Fix Thread usage in UPNP docs.
2022-10-25 14:22:23 +02:00
Yuri Rubinsky 9e04531938 Fix enum type to use int64_t instead of int in GDScript 2022-10-25 09:06:08 +03:00
TechnoPorg 4c06237b93 Fix Thread usage in UPNP docs.
The threading API has changed between Godot 3 and Godot 4.
See https://github.com/godotengine/godot-proposals/issues/4691.
2022-10-24 17:23:33 -06:00
Marc Gilleron 7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
Wei Guo d0edd36f80 Fix built-in script path of GDScript 2022-10-25 03:41:18 +08:00
Clay John c51a42778d
Merge pull request #67541 from RandomShaper/refactor_subgroup_ads
Let the RD driver itself expose subgroup caps
2022-10-24 12:02:06 -07:00
Hugo Locurcio df636ac881
Document `collision_priority` in the CSGShape3D class 2022-10-24 18:44:30 +02:00
Clay John 753a182797
Merge pull request #65334 from dsnopek/opengl-multiview
[opengl] Add multiview to the opengl3 driver
2022-10-23 17:00:01 -07:00
Wei Guo 95113a7cd5 Fix MultiplayerSynchronizer::update_outbound_sync_time when replication_interval is not 0 2022-10-23 14:01:51 +08:00
Raul Santos 687633e5bd
Use `.generated` suffix for generated C# code
Use the `.generated` suffix instead of `_Generated` so .NET marks C#
file generated by Godot source generators as generated code.
2022-10-22 23:13:52 +02:00
David Snopek 398ee08375 Add multiview to the opengl3 driver 2022-10-21 21:00:32 -05:00
Max Hilbrunner 13138b307b
Merge pull request #67656 from MewPurPur/instance🧹
Fix minor mistakes throughout the documentation
2022-10-21 18:19:32 +02:00
VolTer 05a9637d5d Fix small mistakes throughout much of the documentation 2022-10-21 00:20:59 +02:00
Pedro J. Estébanez ae38d7930e Let the RD driver itself expose subgroup caps 2022-10-20 19:37:35 +02:00
Max Hilbrunner cb36006f9e
Merge pull request #67100 from Mickeon/doc-peeves
Tweak `@GDScript` documentation overall
2022-10-19 21:45:35 +02:00
Max Hilbrunner 5f7906a289
Merge pull request #67527 from BastiaanOlij/fix_tracker_names
Fix two typos in tracker names and a bug in OpenXR haptic feedback
2022-10-19 18:18:36 +02:00
DeeJayLSP b87584a070 Update libtheora to GIT (2020.10) 2022-10-18 21:15:13 -03:00
kobewi d06a8320e5 Simplify GDVIRTUAL_CALL calls 2022-10-19 00:05:48 +02:00
Micky a34cf161aa Tweak `@GDScript` documentation overall
- Made use of [param] more frequently,
- Link to other classes' documentation more often, improve the examples.
- Made the writing style closer to how the rest of the documentation is formatted.
- Ensure these are called "functions", not "methods".
- Add [b]Warning:[/b] where more appropriate than [b]Note:[/b]

Most notably, removed " It must be a static string, so format strings can't be used.", as this behavior is actually a bug.
2022-10-18 22:54:46 +02:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
bruvzg c1af9d57a3
Improve font glyph cache packing shelf best height fit heuristic. 2022-10-18 18:42:04 +03:00
bruvzg 634c2fbcae
[TextServer] Fix build with disabled graphite. 2022-10-18 18:41:31 +03:00
Bastiaan Olij 4a96fce801
Merge pull request #67529 from BastiaanOlij/filter_out_htc_paths
Filter out HTC OpenXR paths based on extension
2022-10-19 01:53:56 +11:00
Bastiaan Olij 19f9fe1dec Filter out HTC OpenXR paths based on extension 2022-10-19 00:09:54 +11:00
Bastiaan Olij 45ce45c001 Fix missing itos for OpenXR logging 2022-10-18 13:55:39 +11:00
Rémi Verschelde 28a4eec9a7 Merge pull request #67532 from Faless/ws/4.x_fix_poll
[WebSocket] Fix client failing to connect to direct IP.
2022-10-17 17:32:16 +02:00
Rémi Verschelde 667bc202b5 Merge pull request #67179 from BastiaanOlij/openxr_add_refresh_rate_extension
Adding support for the OpenXR Display Refresh Rate extension
2022-10-17 17:32:01 +02:00
Rémi Verschelde 3c4b110ae0 Merge pull request #67521 from nikitalita/speed_up_texture_pos
Speed up `find_texture_pos_for_glyph()`
2022-10-17 17:31:54 +02:00
Rémi Verschelde 69bcda3dd2 Merge pull request #67514 from timothyqiu/defer
Fix memory leak when `_ensure_cache_for_size()` fails
2022-10-17 17:31:41 +02:00
Rémi Verschelde 1654810409 Merge pull request #67469 from anvilfolk/resource-load-clarification
Clarified reason why a resource cannot be preload()'ed
2022-10-17 17:31:32 +02:00
Rémi Verschelde c43ce5e341 Merge pull request #67485 from kdada/kdada/master
Fix peer visiblity in SceneReplicationInterface._update_sync_visibility
2022-10-17 17:31:20 +02:00
Rémi Verschelde f921409984 Merge pull request #67428 from aaronfranke/gltf-additional-data
Add a way to store additional data in GLTFState and GLTFNode
2022-10-17 17:30:49 +02:00
Fabio Alessandrelli adb3d2338e [WebSocket] Fix client failing to connect to direct IP.
The bug was caused by not checking the TCP CONNECTING state
appropriately during the client handshake, and not checking the TCP
CONNECTED state during connection (which is unlikely, but might still
happen).
2022-10-17 12:52:09 +02:00
Bastiaan Olij 1e7f009492 Fix two typos in tracker names and a bug in OpenXR haptic feedback 2022-10-17 20:29:19 +11:00
bruvzg 68ec84cded
[TextServer] Do not round glyph advances / coordinates if font oversampling or bitmap glyph scaling is used. 2022-10-17 10:57:49 +03:00
nikitalita 21341ddaed Speed up `find_texture_pos_for_glyph()` 2022-10-16 22:29:26 -07:00
Haoyu Qiu 6db8e79eed Fix memory leak when `_ensure_cache_for_size()` fails 2022-10-17 12:47:38 +08:00
Ignacio Roldán Etcheverry 9afc8337bd
Merge pull request #67440 from raulsntos/dotnet/bindings-conflicts
Guard against more potential conflicts in C# bindings generator
2022-10-17 00:28:07 +02:00
João Martins a0c4002520 Clarified reason why a resource cannot be loaded. 2022-10-16 17:27:00 -04:00
Wei Guo 972242d664 Fix MultiplayerSynchronizer peer visibility 2022-10-16 23:02:31 +08:00
Yuri Rubinsky 04f7207009 Add a `Plane(Vector3, Vector3)` constructor for C# 2022-10-16 14:10:58 +03:00
Aaron Franke a70dce893f
Add a way to store additional data in GLTFState and GLTFNode 2022-10-15 12:04:36 -05:00
Rémi Verschelde dc4b616596 Merge pull request #63332 from KoBeWi/static_images_aka_photos
Make some Image methods static
2022-10-15 12:56:57 +02:00
Rémi Verschelde 96ec73f3ee Merge pull request #65281 from MisterMX/zip-module
Expose minizip API to allow creating zips using scripts
2022-10-15 12:56:26 +02:00
Raul Santos 333f88dc49
Guard against more potential conflicts in C# bindings generator 2022-10-15 12:47:10 +02:00
Marcelo Fernandez ea6cc3e260 Expose minizip API to allow creating zips using scripts
Co-authored-by: Marcelo Fernandez <marcelofg55@gmail.com>
Co-authored-by: James Westman <flyingpimonster@gmail.commail>
Co-authored-by: MisterMX <mbxd12@web.de>

Signed-off-by: MisterMX <mbxd12@web.de>
2022-10-14 21:51:38 +02:00
clayjohn 0a51bb4ca5 Add STATIC_CALLED_ON_INSTANCE warning to highlight
when static functions are called directly from objects
2022-10-14 10:43:42 -07:00