Commit graph

1077 commits

Author SHA1 Message Date
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
Juan Linietsky 1990721d1b
Revert "Add Node processing and physics processing cumulative (as opposed to delta) time" 2021-08-22 08:21:34 -03:00
Hugo Locurcio fb94b2e656
Merge pull request #41850 from MohammadKhashashneh/cumulative-time_issue_6999
Add Node processing and physics processing cumulative (as opposed to delta) time
2021-08-22 10:33:20 +02:00
Fabio Alessandrelli d4dd859991 [Net] MultiplayerReplicator with initial state.
Move the former "spawnables" functions to a dedicated
MultiplayerReplicator class.
Support custom overrides in replicator.
Spawn/despawn messages can now contain a state.
The state can be automatically encoded/decoded by passing the desired
object properties to `spawnable_config`.
You can use script properties to optimize the state representation.
2 Callables can be also specified to completely override the default
implementation for sending and receiving the spawn/despawn event.
(9 bytes overhead, and there's room for improvement here).
When using a custom implementation `spawn` and `despawn` can be called
with any Object, `send_spawn`/`send_despawn` can receive any Variant as
a state, and the path is not required.

Two new functions, `spawn` and `despawn`, convey the implementation
independent method for requesting a spawn/despawn of an Object, while
`send_spawn` and `send_despawn` represent the more low-level send event
for a Variant to be used by the custom implementations.
2021-08-18 10:21:29 +01:00
Mohammad Khashashneh 0c027ef0f1 Add Node processing and physics processing cumulative (as opposed to delta) time. 2021-08-17 21:34:50 +03:00
Jihyun Yu d40b7e2cfb fix bug on window notification propagation 2021-08-17 14:07:53 +09:00
Rémi Verschelde a96c96ca72
Merge pull request #50147 from aaronfranke/disable-node3d
Disable Node3D when compiling without 3D and fix disable_3d option
2021-08-14 11:59:06 +02:00
Rémi Verschelde 81512a3732
Style: Cleanup code using text_editor/completion/use_single_quotes 2021-08-13 21:27:57 +02:00
Aaron Franke 7094ccfbe9
Disable Node3D when compiling without 3D and fix disable_3d option 2021-08-13 08:59:48 -05:00
Rémi Verschelde 85e315d6e8
Merge pull request #51607 from aaronfranke/includes
Fix some unnecessary includes
2021-08-13 14:38:56 +02:00
Aaron Franke eb4902a455
Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
Hugo Locurcio 7612cff432
Use the Unicode multiplication symbol where relevant 2021-08-12 21:45:33 +02:00
Rémi Verschelde dce488d8f7
Merge pull request #49417 from Bhu1-V/gsoc-cmd-plt
Command Palette For Godot
2021-08-10 18:55:22 +02:00
Aaron Franke 339687e04f
Organize methods in Viewport and explicitly name 3D methods with 3D 2021-08-10 09:10:34 -05:00
Aaron Franke 84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Fabio Alessandrelli 9fcf3b5a9c [Net] Basic extensible MultiplayerAPI spawn/despawn.
`PackedScene`s can be configured to be spawnable via a new
`MultiplayerAPI.spawnable_config` method.
They can be configured either to be spawned automatically when coming
from the server or to always require verification.
Another method, `MultiplayerAPI.send_spawn` lets you request a spawn on
the remote peers.
When a peer receive a spawn request:
- If it comes from the server and the scene is configured as
  `SPAWN_MODE_SERVER`:
  - Spawn the scene (instantiate it, add it to tree).
  - Emit signal `network_spawn`.
- Else:
  - Emit signal `network_spawn_request`.

In a similar way, `despawn`s are handled automatically in
`SPAWN_MODE_SERVER`.

In `SPAWN_MODE_SERVER`, when a new client connects it will also receive,
from the server all the spawned (and not yet despawned) instances.
2021-08-09 16:34:40 +02:00
Bhuvan Vemula a0a019a998 Added EditorCommandPalette 2021-08-09 17:41:50 +05:30
Rémi Verschelde 57a5186b08
Merge pull request #51006 from foxydevloper/drag-drop-naming
Name nodes added when drag & dropping an image by `name_casing`
2021-08-03 09:38:03 +02:00
Michael Alexsander 94a64d557e Add auto_translate toggle for automatic translation 2021-07-29 18:30:34 -03:00
foxydevloper 07a8f0fe38 Name nodes added from drag & drop by name_casing 2021-07-29 00:29:24 -04:00
Michael Alexsander 79fc188fc4 Multiple cosmetic fixes for embedded windows 2021-07-27 23:55:06 -03:00
Rémi Verschelde fab3412139
Merge pull request #50899 from akien-mga/refref
Use Ref<T> references as iterators where relevant
2021-07-26 19:45:04 +02:00
Rémi Verschelde 92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02:00
Aaron Franke 4ecb6fba80
Use doubles for time everywhere in Timer/SceneTree 2021-07-26 02:00:48 -04:00
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
kobewi 8793ec4564 Show tooltips even when paused or time_scale is 0 2021-07-23 17:49:30 +02:00
Michael Alexsander a690cd9251 Make MenuButton's switch_on_hover work again 2021-07-22 14:27:30 -03:00
Hugo Locurcio 4bd5e4fd9b
Use the standard C INFINITY and NAN constants directly
The `Math_INF` and `Math_NAN` defines were just aliases for those
constants, so we might as well use them directly.

Some portions of the code were already using `INFINITY` directly.
2021-07-21 10:41:08 +02:00
Rémi Verschelde c82daaed48
Merge pull request #38317 from verdog/get-cam-2d-4.0
add viewport.get_camera_2d()
2021-07-20 22:19:06 +02:00
Rémi Verschelde 693f9b4e20
Merge pull request #50655 from JFonS/sname_opt
Editor StringName and Viewport optimizations
2021-07-20 21:49:32 +02:00
Joan Fons a6adb58493 Editor StringName and Viewport optimizations
* Added explicit return type to the SNAME macro.
* Add some extra SNAME usages.
* Change some ClassDB methods to use const StringName & arguments.
* Cache the Window parent in Control because it's used in
  is_layout_rtl(), which is called often.
* Only enable internal processing for viewports that need it.
* Change CanvasItem::group to be a StringName because it's only used as
  that.
2021-07-20 20:35:41 +02:00
Rémi Verschelde 394191c02f
Merge pull request #50605 from Calinou/tweak-shader-code-style
Use C++11 raw literals for shader code to improve readability
2021-07-20 10:05:13 +02:00
Rémi Verschelde b4baec08cf
Merge pull request #50206 from groud/undoredo_increase_args_count
Increase the number of arguments accepted by UndoRedo methods
2021-07-20 09:50:01 +02:00
Rémi Verschelde 855c7c7414
Merge pull request #50566 from reduz/optimize-stringname-usage
Optimize StringName usage
2021-07-19 15:20:25 +02:00
Rémi Verschelde 95def293a6
Merge pull request #48186 from EricEzaM/PR/tooltip-improvements
Made default tooltips (non-custom ones) disappear on mouse enter.
2021-07-19 09:02:06 +02:00
Hugo Locurcio abc38b8d66
Use C++11 raw literals for shader code to improve readability
In files that have lots of branching, `\t` was replaced with a
tab character instead.
2021-07-19 08:19:50 +02:00
reduz 6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Hugo Locurcio 523d6b2ae8
Merge pull request #47395 from sygi/shape_idx_collision
Add shape_idx to CollisionObject2D mouse_entered signal
2021-07-16 19:05:08 +02:00
Rémi Verschelde f79e79d479
Merge pull request #38819 from EricEzaM/improve-to_string-for-nodes
Added Node name to print() of all Nodes by making to_string() in Object virtual, so it can be overriden in C++.
2021-07-15 15:11:21 +02:00
Eric M 3ca25ffe8a Added Node name to print() when printing Nodes. 2021-07-15 21:48:58 +10:00
Rémi Verschelde 79137a0260
Merge pull request #50299 from YeldhamDev/window_wrap_controls_fix
Fix `Window`'s `wrap_controls` not actually doing anything
2021-07-13 18:04:33 +02:00
Yuri Sizov 4ee0e6ddf5 Add type variations to Theme 2021-07-13 02:26:28 +03:00
Fabio Alessandrelli 88d68346ee [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer. 2021-07-12 16:36:34 +02:00
Fabio Alessandrelli 31142ac3ee [Net] Remove most multiplayer hooks from SceneTree.
Use `multiplayer` or `get_multiplayer()` instead of `get_tree()`.
2021-07-12 15:28:01 +02:00
Hugo Locurcio a2d5f191d8
Merge pull request #48622 from Geometror/reimplement-disableable-vsync 2021-07-10 01:02:23 +02:00
Michael Alexsander fe5605334a Fix Window's wrap_controls not actually doing anything 2021-07-08 20:06:16 -03:00
Rémi Verschelde 48a5226829
Merge pull request #50193 from reduz/fix-command-queue-crash
Fix Command Queue Crash
2021-07-07 16:36:13 +02:00
reduz d41e3f9aeb Fix Command Queue Crash
* No longer allow sending an object (texture) to the server as material parameter
* Keep a parameter cache locally in ShaderMaterial
2021-07-07 10:57:56 -03:00
Rémi Verschelde f50a866335
Merge pull request #50215 from Calinou/improve-node-configuration-warning-display
Format node configuration warnings as a bullet point list
2021-07-06 23:07:16 +02:00