Commit graph

5395 commits

Author SHA1 Message Date
Rémi Verschelde
5ca09b322c
Merge pull request #63593 from TokageItLab/improve-exp-map 2022-07-29 20:27:13 +02:00
kobewi
c3606cb5f3 Swap arguments of ResourceSaver.save() 2022-07-29 19:53:09 +02:00
Rémi Verschelde
7199314eb3
Merge pull request #63595 from reduz/remove-signal-connect-binds
Remove Signal connect binds
2022-07-29 18:10:39 +02:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
kobewi
ee6fd704b5 Fix Vector4 serialization 2022-07-29 12:09:03 +02:00
Silc Renew
90dc2f961e Make spherical_cubic_interpolate() more stable 2022-07-29 17:39:22 +09:00
Rémi Verschelde
14d021287b
Merge pull request #63049 from Faless/mp/4.x_as_module 2022-07-28 20:46:31 +02:00
Rémi Verschelde
a5f12f9c21
Merge pull request #63532 from TokageItLab/rename-cubic-slerp 2022-07-28 10:39:33 +02:00
Rémi Verschelde
199ea349f5
Merge pull request #57698 from bluenote10/feature/rename_translated_to_translated_local 2022-07-28 10:03:07 +02:00
Rémi Verschelde
13a9d5e3c0
Merge pull request #63378 from nathanfranke/t3d-errors
Add equal checks to Transform3D::looking_at and Transform3D::set_look_at, fixes misleading error.
2022-07-28 09:25:25 +02:00
Rémi Verschelde
1e4b38fc5d
Merge pull request #62414 from Calinou/movie-maker-add-quit-on-end 2022-07-28 01:05:19 +02:00
pattlebass
130e715ab9 HTML5: Add support for Input.vibrate_handheld() 2022-07-27 22:54:41 +03:00
Hugo Locurcio
aaeb60eafc
Add a Movie Quit On Finish property to AnimationPlayer
This quits the project when an animation is done playing in the
given AnimationPlayer, but only in Movie Maker mode.
When this happens, a message is printed with the absolute path of the
AnimationPlayer node that caused the engine to quit.

This can be used to create videos that stop at a specified time
without having to write any script.

A report is now also printed to the console when the video is done
recording (as long as the engine was exited properly).
This report is unfortunately not always visible in the editor's
Output panel, as it's printed too late.

A method was also added to get the path to the output file from the
scripting API.
2022-07-27 18:50:28 +02:00
kobewi
fdf7441015 Split ceil(), floor() and round() method 2022-07-27 16:58:56 +02:00
Silc Renew
4211e68d80 rename and unify notation for spherical interpolation 2022-07-27 23:22:50 +09:00
Rémi Verschelde
cc5135959b
Merge pull request #62973 from bruvzg/sysfont_support 2022-07-27 13:38:30 +02:00
Rémi Verschelde
89527db8d3
Merge pull request #63380 from V-Sekai/fix-cubic-slerp-dot 2022-07-27 13:20:02 +02:00
Rémi Verschelde
1c57d90e85
Merge pull request #63463 from KoBeWi/Vector5
Add some missing Vector4 methods
2022-07-27 10:45:39 +02:00
Rémi Verschelde
3647024dc5
Merge pull request #63494 from akien-mga/color-fix-set-hsv 2022-07-27 09:25:33 +02:00
Rémi Verschelde
835da447da
Merge pull request #63481 from m4gr3d/fix_remaining_scoped_storage_regressions_main
Address remaining scoped storage regressions
2022-07-26 18:17:03 +02:00
Fredia Huya-Kouadio
9679c67904 Address remaining scoped storage regressions
- Accelerate common path used to check the storage scope for a given path
- Update the logic for the `get_as_text()` method - previous logic loads the content of a text file one byte at a time
2022-07-26 07:44:08 -07:00
Rémi Verschelde
cda723d201 Color: Fix resetting alpha when setting H/S/V separately
Fixes #63487.
2022-07-26 15:43:49 +02:00
Fabio Alessandrelli
ca7d572908 [Net] Modularize multiplayer, expose MultiplayerAPI to extensions.
- RPC configurations are now dictionaries.
- Script.get_rpc_methods renamed to Script.get_rpc_config.
- Node.rpc[_id] and Callable.rpc now return an Error.
- Refactor MultiplayerAPI to allow extension.
- New MultiplayerAPI.rpc method with Array argument (for scripts).
- Move the default MultiplayerAPI implementation to a module.
2022-07-26 09:31:12 +02:00
bruvzg
36ef8f29dc
Implement support for loading system fonts on Linux, macOS / iOS and Windows. 2022-07-26 08:38:05 +03:00
Aaron Franke
9403173994
Allow loading override.cfg from PCK files 2022-07-25 22:34:54 -05:00
kobewi
7006f7d693 Add some missing Vector4 methods 2022-07-26 02:35:42 +02:00
Rémi Verschelde
25a7cdc97f
Merge pull request #63443 from rburing/bvh_debug_fixup 2022-07-25 23:08:06 +02:00
Nathan Franke
4b13a6dcb8
add equal checks to Transform3D::looking_at and Transform3D::set_look_at 2022-07-25 13:39:40 -05:00
Ricardo Buring
178405f7cb Fixup BVH debugging statements 2022-07-25 18:21:53 +02:00
Silc 'Tokage' Renew
e252d4e6fe Fix cubic_slerp
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
Co-authored-by: Pasi Nuutinmaki <gnssstylist@sci.fi>
2022-07-25 22:44:39 +09:00
Juan Linietsky
c7255388e1 Remove ThreadWorkPool, replace by WorkerThreadPool
The former needs to be allocated once per usage. The later is shared for all threads, which is more efficient.
It can also be better debugged.
2022-07-25 15:39:50 +02:00
Rémi Verschelde
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
Rémi Verschelde
3084a48ace
Merge pull request #63219 from reduz/implement-vector4-projection 2022-07-25 11:13:27 +02:00
Rémi Verschelde
b7a47bfc09
Merge pull request #63098 from Xwdit/fix_qualifiers_script_doc 2022-07-24 23:26:30 +02:00
Xwdit
5d49df8d97 Fix missing method qualifiers in script doc
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-07-24 23:00:19 +02:00
Jcrespo
1a3d57f319 Solve discrepancy between code and class reference for Plane
On #43310, class reference was automatically updated from source,
causing xml documentation to disagree with parameter naming
description on Plane.intersects_segment().

Weirdly, it also changed the parameter for Plane.is_point_over()
from point to plane, when only the first has sense (and it is
defined on math.Plane as "const Vector3 &p_point"). Manual
mistake?

* Update begin/end to from/to on Plane.intersects_segment(...)
  docs description to match source
* Update Plane bindings to use points instread of plane for
  is_point_over(...)
* Change Plane.is_point_over(plane) to Plane.is_point_over(point)
  AND its description on docs

Fixes godotengine/godot-docs#5976
2022-07-24 18:21:25 +02:00
Fabio Alessandrelli
75f93167f7
Merge pull request #63262 from dsnopek/multiplayer-peer-custom-4.x
[4.x] Allow extending MultiplayerPeerExtension from GDScript
2022-07-24 01:24:22 +02:00
reduz
455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
Rémi Verschelde
d2fa9cbdfd
Merge pull request #63141 from reduz/implement-thread-runner 2022-07-22 13:25:31 +02:00
Rémi Verschelde
653f95282c
Merge pull request #62996 from reduz/feature-build-profiles 2022-07-22 12:50:20 +02:00
reduz
67a260d63f Implement a Worker ThreadPool
This PR implements a worked thread pool. It uses a fixed amount of threads in a pool and allows scheduling tasks
that can be run on threads (and then waited for). It satisfies the following use cases:

* HTML5 thread count is fixed (and similar restrictions are known in consoles) so we need to reuse threads.
* Thread spawning is slow in general, so reusing threads is faster anyway.
* This implementation supports recursive waiting for tasks, making it less prone to deadlocks if threads from the pool also run tasks.

After this is approved and merged, subsequent PRs will be needed to replace the ThreadWorkPool usage by this class.
2022-07-22 11:46:48 +02:00
reduz
6236a688b7 Implement Feature Build Profiles
This PR is a continuation of #50381 (which was implemented exactly a year ago!)

* Add a visual interface to select which classes should not be built into Godot (well, they are built if something else uses them, but if not used the optimizer will remove them out).
* Add a detection system to scan the project and figure out the actual classes used.
* Added the ability for SCons to load build profiles.

Obligatory Screen:

A simple test with a couple of nodes in the scene resulted in a 25% reduction for the final binary size

TODO:

* Script languages need to implement used class detection (left for another PR).
* Options to disable servers or server functionalities (like 2D or 3D physics, navigation, etc). Are missing, that should also greatly aid in reducing binary size.
* Options to disable some modules would be desired.
* More options to disable drivers (OpenGL, Vulkan, etc) would be desired.

In general this PR is a starting point for more contributors to improve and enhance this functionality.
2022-07-22 10:53:23 +02:00
Rémi Verschelde
19db9ed863
Merge pull request #63286 from RandomShaper/fix_debugger_focus 2022-07-22 00:48:06 +02:00
Rémi Verschelde
9b782b7573
Merge pull request #63242 from m4gr3d/fix_slow_copy_main
Address slow copy performance when using the `FileAccessFilesystemJAndroid` implementation
2022-07-22 00:22:30 +02:00
Pedro J. Estébanez
033001375f Fix editor re-focus on debugger break on Windows 2022-07-21 21:47:05 +02:00
Yuri Rubinsky
ccc56cc6d4 Rename epsilon to tolerance in the Plane::has_point method 2022-07-21 20:15:15 +03:00
Fredia Huya-Kouadio
31712cc9e7 Address slow copy performance when using the FileAccessFilesystemJAndroid implementation.
Read/write ops for this implementation are done through the java layer via jni, and so for good performance, it's key to avoid numerous repeated small read/write ops due the jni overhead.

The alternative is to allocate a (conversatively-sized) large buffer to reduce the number of read/write ops over the jni boundary.
2022-07-21 09:06:29 -07:00
Rémi Verschelde
d6b1dd4854
Merge pull request #63128 from cdemirer/fix-callable-comparator-error-message-argcount 2022-07-21 16:50:39 +02:00
bruvzg
8823eae328
Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
David Snopek
f8137ce6c1 Allow extending MultiplayerPeerExtension from GDScript 2022-07-20 18:19:05 -05:00
Fabio Alessandrelli
ddee5f6050 Add peer visibility to MultiplayerSynchronizer.
MultiplayerSynchronizers can now be configured to limit their visibility
to a subset of the connected peers, if the synchronized node was spawned
by a MultiplayerSpawner (either automatically or via custom spawn) the
given node will also be despawned remotely.

The replication system doesn't have the logic to handle subspawn
directly, but it is possible to handle them appropriately by manually
updating the visibility of the parent before changing the one of the
nested spawns via the "update_visibility" function.

The visibility of each MultiplayerSynchronizer can be controlled by
adding or remove filters via "[add|remove]_visibility_filter(callable)".

To further optimize the network code, visibility filters can be configured
to be automatically updated during idle or physics frame, or set to always
require manual update (via the "update_visibility" function).
2022-07-20 19:08:35 +02:00
Rémi Verschelde
e37525896e
Merge pull request #63190 from fabriceci/fix-calculation-angular-velocity 2022-07-19 17:14:20 +02:00
Rémi Verschelde
cce330bda5
Merge pull request #63187 from RandomShaper/fix_atomic_cmp_exchange 2022-07-19 17:09:59 +02:00
Rémi Verschelde
eea14a0edc
Merge pull request #63005 from Chaosus/image_rotate
Implement `rotate_90/rotate_180` functions to `Image`
2022-07-19 15:21:16 +02:00
fabriceci
db7c91e0ad Fix the calculation of the angular velocity when the rotation speed is not high. 2022-07-19 10:27:13 +02:00
Pedro J. Estébanez
02a584d8e6 Use the right memory ordering in SafeNumeric operations 2022-07-19 10:04:59 +02:00
FireForge
84431bd782 Use integer types in Image and ImageTexture methods
- Image.blit_rect()
- Image.blit_rect_mask()
- Image.blend_rect()
- Image.blend_rect_mask()
- Image.fill_rect()
- Image.get_used_rect()
- Image.get_rect()
- ImageTexture.set_size_override()
2022-07-18 19:43:32 -05:00
Rémi Verschelde
b70e4fc0f3 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@880abd09c9
2022-07-18 15:42:48 +02:00
cdemirer
dae5edf41c Fix the argcount when generating error message for CallableComparator 2022-07-18 00:57:20 +03:00
basta
3e664b4e29 Changed bool to GdNativeBool 2022-07-16 18:09:36 +02:00
Fabian Keller
2bf9e6090c rename translate(d) to translate(d)_local in Transform 2D/3D 2022-07-16 11:47:54 +02:00
Yuri Rubinsky
7e66903d56 Implement rotate_90/rotate_180 functions to Image 2022-07-15 11:50:42 +03:00
bruvzg
cbe3a2dcb7
Use BitField hint for the TextServer enums. Add missing parts for BitField support to the GDextension API. 2022-07-15 08:49:50 +03:00
kobewi
2f777b9a1e Remove unused hints 2022-07-12 00:44:13 +02:00
Samuele Zolfanelli
e27c5acedd Make Image.get_size() return a Vector2i instead of a Vector2 2022-07-09 22:05:58 +02:00
kobewi
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
Rémi Verschelde
95ddc8cccc
Merge pull request #62808 from bruvzg/macos_file_url_handle 2022-07-07 12:57:36 +02:00
Rémi Verschelde
1e553e34fb
Merge pull request #62108 from bruvzg/font_config_v3 2022-07-07 12:22:49 +02:00
bruvzg
238ac2fdd5
[macOS] Improve file association handling, and allow URL schema handling. 2022-07-07 12:11:31 +03:00
bruvzg
0c5431644d
Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose. 2022-07-07 11:07:18 +03:00
Rémi Verschelde
e004412edd
Merge pull request #62776 from lawnjelly/remove_octree 2022-07-06 15:40:26 +02:00
Rémi Verschelde
635d447a69
Merge pull request #62713 from YuriSizov/docs-scripting-annotations 2022-07-06 15:31:19 +02:00
lawnjelly
1f69666209 Remove Octree
Octree is no longer used in 4.x.
2022-07-06 14:10:05 +01:00
bruvzg
344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
reduz
5ac42cf576 Implement a BitField hint
Allows to specify the binder that an enum must be treated as a bitfield.
2022-07-05 22:13:37 +02:00
Rémi Verschelde
4e7223ce49
Merge pull request #62459 from m4gr3d/refactor_android_storage_handling_main 2022-07-05 12:44:55 +02:00
Fredia Huya-Kouadio
f9c19298ce Add full support for Android scoped storage.
This was done by refactoring directory and file access handling for the Android platform so that any general filesystem access type go through the Android layer.
This allows us to validate whether the access is unrestricted, or whether it falls under scoped storage and thus act appropriately.
2022-07-05 03:00:37 -07:00
kobewi
415c7dda37 Implement XMLParser.get_current_line() 2022-07-05 01:23:04 +02:00
Rémi Verschelde
344b42703b
Merge pull request #62212 from hansemro/eraser-detect-4
Add inversion/eraser-end property for tablet pens
2022-07-04 21:48:19 +02:00
Hansem Ro
6dcc9d1131 [macOS, Windows, X11] Add stylus inverted/eraser support to
InputEventMouseMotion event
2022-07-04 10:36:53 -07:00
Yuri Sizov
a9098e6147 Add support for documenting built-in annotations 2022-07-04 20:21:39 +03:00
lawnjelly
b221eab426 Variant memory pools
Memory pools via PagedAllocator for Transform2D, Transform3D, Basis and AABB.
2022-07-04 12:01:46 +01:00
cdemirer
0ccde38668 Expression built-in functions can also be considered as identifiers in subscripts 2022-07-04 13:25:43 +03:00
bruvzg
329923c6ac
Use custom key structs, instead of raw hashes for the Label3D and TextMesh, to avoid potential hash collisions. 2022-07-04 09:47:49 +03:00
Rémi Verschelde
00b3822306 Input: Re-enable input accumulation by default
I turned it off by mistake in #38697.
See also #62664 for details on this boolean's complex history :)
2022-07-03 12:16:16 +02:00
Rémi Verschelde
a2459c7d35
Merge pull request #61610 from TokageItLab/importer-retarget-registered-gdhumanoid 2022-07-02 00:17:21 +02:00
Rémi Verschelde
56e50f91d3
Merge pull request #62589 from KoBeWi/custom_threads 2022-07-01 13:46:50 +02:00
kobewi
7d5c943202 Handle custom Callables in Thread.start() 2022-07-01 13:11:31 +02:00
bruvzg
b767d2e0fd
Add arch flag to assembler to fix build on ARM64 macOS / iOS. 2022-07-01 12:44:23 +03:00
Rémi Verschelde
88192269a8
Merge pull request #62477 from lyuma/packedbytearray
Prevent out-of-bounds write in array conversion; avoid logspam on empty arrays.
2022-07-01 09:03:20 +02:00
Lyuma
33fd7c63e1 Prevent out-of-bounds write in array conversion; avoid logspam on empty arrays. 2022-06-30 18:04:33 -07:00
Rémi Verschelde
0800d475a4
Merge pull request #62540 from MinusKube/debugger-array-crash
Add/fix support for RID, Callable and Signal in editor properties
2022-06-30 23:04:08 +02:00
Voylin
cebdfd1bbd Fixing Print_rich which only displays correctly in terminal
There was an issue that the type was not passed through correctly. These couple of lines fix this issue and make print_rich work as expected.
2022-07-01 04:34:19 +09:00
Silc Renew
dc43cfc830 implement bone renamer in importer 2022-07-01 03:55:28 +09:00
MinusKube
f67891fcd1 Add serialization for RID and Signal 2022-06-30 17:39:01 +02:00
Rémi Verschelde
c83084fccb Errors: Fallback to fprintf if OS singleton doesn't exist
Otherwise we would crash if something prints an error before init or
after destruction of the `OS` singleton which handles printing/logging.
2022-06-30 16:00:30 +02:00
Rémi Verschelde
daa055d479
Merge pull request #61867 from Bromeon/refactor/property-info 2022-06-30 15:45:31 +02:00
Rémi Verschelde
c5ad34d6cd
Merge pull request #61096 from leogeier/expose-adding-resource-loaders-savers 2022-06-30 15:02:05 +02:00
TechnoPorg
9961881b98 Remove SceneTree dependency from LocalDebugger
Core classes should not have dependencies on scene classes.
2022-06-29 19:49:27 -06:00
leogeier
359f7fc51f Exposes methods for adding and removing ResourceFormatLoaders and -Savers in the ClassDB 2022-06-29 21:38:20 +02:00
Jan Haller
60ffadd133 GDExtension: reuse code with constructor PropertyInfo(const GDNativePropertyInfo&) 2022-06-29 19:30:01 +02:00
Rémi Verschelde
b730d2ee09
Merge pull request #60675 from voylin/Add-BBCode-support-for-printing-output
Adding print_rich() for printing with BBCode
2022-06-28 23:35:53 +02:00
Rémi Verschelde
8cd6127cb8
Merge pull request #59167 from akien-mga/zstd-1.5.2
zstd: Update to upstream version 1.5.2
2022-06-28 19:13:17 +02:00
Voylin
c6291bcd8a Adding print_rich for printing with BBCode 2022-06-29 00:41:29 +09:00
Rémi Verschelde
622b656c40
Merge pull request #53135 from briansemrau/fix-ref-leak 2022-06-28 17:26:44 +02:00
Marco F
0efa5d4cbd Input: Make get_action_raw_strength print error when the action doesn't exist 2022-06-28 15:58:26 +02:00
Rémi Verschelde
39ed39900e zstd: Update to upstream version 1.5.2
Release notes:
- https://github.com/facebook/zstd/releases/tag/v1.5.1
- https://github.com/facebook/zstd/releases/tag/v1.5.2
2022-06-28 14:10:07 +02:00
Pedro J. Estébanez
a82352c7e3 Avoid manual memory management of certain arrays in Vulkan RD 2022-06-28 10:01:46 +02:00
Rémi Verschelde
b863c40356
Merge pull request #62468 from V-Sekai/core-const-expressions
Add a const call mode to Object, Variant and Script.
2022-06-28 01:08:24 +02:00
Rémi Verschelde
8fd0b4d1f8
Merge pull request #62449 from Chaosus/wrap_func
Add generalized version of `wrap` function
2022-06-27 23:28:37 +02:00
Rémi Verschelde
c4a426d6ec
Merge pull request #62462 from vnen/gdscript-setter-chaining
GDScript: Fix setter being called in chains for shared types
2022-06-27 23:25:53 +02:00
Rémi Verschelde
25baa32db0
Merge pull request #62458 from Geometror/interpolation-function-cleanup
Refactor Bezier interpolation functions
2022-06-27 23:25:33 +02:00
K. S. Ernest (iFire) Lee
9ddebc0c22 Add a const call mode to Object, Variant and Script.
For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script).

This mode ensures only const functions can be called, making it safe to use from the editor.

Co-Authored-By: reduz <reduzio@gmail.com>
2022-06-27 13:33:06 -07:00
Rémi Verschelde
c79aad0257
Merge pull request #62396 from reduz/fix-local-vector-transitions-in-node3d
Fix VECTOR/LOCAL transitions in Node3D
2022-06-27 21:45:02 +02:00
Hendrik Brucker
99ce0df3b1 Refactor bezier interpolation functions 2022-06-27 19:42:43 +02:00
George Marques
511a4b761c
GDScript: Fix setter being called in chains for shared types
When a type is shared (i.e. passed by reference) it doesn't need to be
called in a setter chain (e.g. `a.b.c = 0`) since it will be updated in
place.

This commit adds an instruction that jumps when the value is shared so
it can be used to skip those cases and avoid redundant calls of setters.
It also solves issues when assigning to sub-properties of read-only
properties.
2022-06-27 12:09:51 -03:00
Yuri Rubinsky
2476c50a66 Add generalized version of wrap function 2022-06-27 16:11:21 +03:00
reduz
7acf697479 Fix VECTOR/LOCAL transitions in Node3D
Fixes #62225, supersedes #62227
2022-06-27 13:45:35 +02:00
Rémi Verschelde
fbc3777467
Merge pull request #62185 from reduz/export-node-pointer-path
Add ability to export Node pointers as NodePaths
2022-06-27 11:14:36 +02:00
reduz
b7c41f9ba1 Add ability to export Node pointers as NodePaths
This PR implements:
* A new hint: PROPERTY_HINT_NODE_TYPE for variant type OBJECT, which can take specific node types as hint string.
* The editor will show it as a node path, but will set it as a pointer to a node from the current scene if you select a path.
* When scene is saved, the node path is saved, then restored as a pointer.

NOTE: This is a proof of concept and this approach will most likely not work. The reason if that, if the node referenced is deleted, then when trying to edit this the node will become invalid.

Potential workarounds: Since this uses the Variant API, it should obtain the pointer from the Variant object ID. Yet, this would either only really work in GDScript or it would need to be implemented with workarounds in every language.
Alternative ways to make this work: Nodes could export an additional property with a node path (like for which_node, it could be which_node_path).
Another alternative: Path editing could happen as a hidden metadata (ignoring the pointer).
2022-06-25 15:50:15 +02:00
Rémi Verschelde
b192073001
Merge pull request #62309 from reduz/remake-resource-thread-safety
Remake ResourceCache thread safety code and API
2022-06-25 14:09:28 +02:00
Marcus Elg
6c1ac9f3be Rename export_range's noslider option to no_slider 2022-06-24 10:45:34 +02:00
K. S. Ernest (iFire) Lee
42f7f0894e Restore the openexr grayscale property. 2022-06-23 21:10:59 -07:00
Rémi Verschelde
ecf187705e
Merge pull request #62238 from V-Sekai/openexr-buffer
For in-engine processing allow saving openexr to a buffer.
2022-06-24 00:12:16 +02:00
Rémi Verschelde
2a0393e222
Merge pull request #60356 from piiertho/feature/add-core-types-enum-description-to-extention-api-json
Add core types enums description to extension api json
2022-06-23 22:52:03 +02:00
Rémi Verschelde
7e075fc482
Merge pull request #62327 from Geometror/hash-containers-fastmod-optimization
HashMap/HashSet optimization: fast modulo
2022-06-23 22:50:19 +02:00
Rémi Verschelde
471050e6a7
Merge pull request #62342 from reduz/methodinfo-varargs
Implement varargs in Methodinfo
2022-06-23 22:49:16 +02:00
Pierre-Thomas Meisels
c28936ba6d Add core types enums description to extension api json 2022-06-23 19:19:22 +02:00
Hendrik Brucker
fddafed919 Optimize HashMap/HashSet using fastmod 2022-06-23 18:08:52 +02:00
K. S. Ernest (iFire) Lee
ce42ee790c For in-engine processing allow saving openexr to a buffer. 2022-06-23 08:53:15 -07:00
Rémi Verschelde
1c54057933
Merge pull request #62326 from KoBeWi/userbind 2022-06-23 15:15:41 +02:00
reduz
dd8c0522a6 Implement varargs in Methodinfo
Variadic templates are an awful thing. Implements #62233 using them in MethodInfo so less changes are required.
2022-06-23 14:50:38 +02:00
kobewi
a6f0aba43d Remove userdata from Thread.start() 2022-06-23 12:50:28 +02:00
reduz
3d1ab570b9 Add surface indices to TriangleMesh
Helps unblock #56597
2022-06-22 21:48:23 +02:00
reduz
e772b65d92 Remake resource thread safety and API
* Ensures thread safety when resources are destroyed.
* Simplified API by always forcing `ResourceCache::get_ref`, which needs less hacks and is fully thread safe.
* Removed RWLock for resources because its not possible to use for the new logic. Should not be a problem.

Supersedes #57533
2022-06-22 13:46:46 +02:00
Aaron Franke
8f05bd97b5
Add support for saving WebP images 2022-06-21 08:27:51 -05:00
Rémi Verschelde
40c360b870
Merge pull request #62122 from reduz/implement-movie-writer
Implement a Movie Maker mode
2022-06-21 14:24:14 +02:00
reduz
5786516d4d Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.

This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).

**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).

Usage:

$ godot --write-movie movie.avi [scene_file.tscn]

Missing:

* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-21 11:28:47 +02:00
Juan Linietsky
15837ec191
Revert "Disable VRAM compression by default for small textures in Detect 3D" 2022-06-20 15:30:19 +02:00
reduz
141c375581 Clean up Hash Functions
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934
* Clean up usage of murmur3
* Fixed usages of binary murmur3 on floats (this is invalid)
* Changed DJB2 to use xor (which seems to be better)
2022-06-20 12:54:19 +02:00
Yuri Rubinsky
747ff071cd
Merge pull request #62210 from MarcusElg/autocomplete-noslider 2022-06-19 19:30:50 +03:00
Marcus Elg
46bbbd9770 Allow autocompletion of "noslider" in export_range 2022-06-19 17:11:49 +02:00
Jan Haller
d2dba74bae GDExtension: print error messages for different error paths during loading 2022-06-19 10:14:41 +02:00
Rémi Verschelde
d572d3d2ab
Merge pull request #62156 from madmiraal/fix-61457
Ensure AudioFrame variables l and r are always initialised
2022-06-17 22:38:57 +02:00
Rémi Verschelde
0daa868ab4
Merge pull request #62023 from Calinou/detect-3d-small-textures-no-vram-compress
Disable VRAM compression by default for small textures in Detect 3D
2022-06-17 21:07:04 +02:00
Rémi Verschelde
dd93ae63fa
Merge pull request #61991 from bruvzg/property_shortcut
Make enum/constant binds 64-bit.
2022-06-17 21:05:51 +02:00
Marcel Admiraal
d3f0994572 Ensure AudioFrame variables l and r are always initialised 2022-06-17 17:36:11 +01:00
bruvzg
860e24683f
Make enum/constant binds 64-bit. 2022-06-17 16:36:26 +03:00
Ellen Poe
d384d84f45 Audio: Expose 2D/3D panning strength parameters 2022-06-17 13:08:48 +02:00
gregcsokas
42e619c01e Adding function key support from F17 to F35
OSX supports everything by default,
Linux is also capable of supporting every function key,
Windows as I know support only up to F24
2022-06-16 19:38:21 +02:00
Yuri Rubinsky
4be41a9a97 Remove redundand header from a_star.h 2022-06-16 17:23:08 +03:00
Yuri Rubinsky
7da2a21425 Make AStar to use 64-bit logic 2022-06-16 16:43:41 +03:00
Rémi Verschelde
1ad6fade00
Merge pull request #58669 from theraot/ASar2Dbidirectional
AStar2D bidirectional
2022-06-16 12:46:51 +02:00
Pedro J. Estébanez
fb86430770 Validate every source element separately Array::append_array() 2022-06-15 20:36:20 +02:00
Rémi Verschelde
cc6b2f4287
Merge pull request #61812 from Chaosus/fix_wrapf 2022-06-15 15:27:57 +02:00
Rémi Verschelde
632b933a03
Merge pull request #61934 from Geometror/hashfuncs
Hash function improvements
2022-06-15 07:34:43 +02:00
Hendrik Brucker
8c61470fa9 Hash function improvements 2022-06-15 00:32:10 +02:00
Rémi Verschelde
5b759ff160
Merge pull request #62030 from KoBeWi/SetName/GetName 2022-06-14 18:23:39 +02:00
kobewi
a3a029d4c6 Change set/get binding to use StringName 2022-06-14 16:27:33 +02:00
kobewi
5553e27fe8 Add vector value linking
Co-authored-by: redlamp <244062+redlamp@users.noreply.github.com>
2022-06-14 14:58:44 +02:00
Hugo Locurcio
04d5626bc0
Disable VRAM compression by default for small textures in Detect 3D
This is done to prevent reducing texture quality when it doesn't save
much video memory, especially for pixel art.

The size threshold can be adjusted in the project settings.
To get the previous behavior where textures detected to be used in 3D
had their compression mode always set to VRAM, set this to the lowest value
(16).
2022-06-14 13:08:20 +02:00
Haoyu Qiu
6f38c21253 Fix parameter name for String.left and String.right 2022-06-12 16:34:44 +08:00
Rémi Verschelde
d4235f51b1
Merge pull request #61949 from touilleMan/native_extension_open_library_handle_initialization_error
Fix NativeExtension::open_library return value when the undelying lib fails to initialize
2022-06-12 08:49:19 +02:00
Emmanuel Leblond
228ce1d2b6
Fix NativeExtension::open_library return value when the undelying lib fails to initialize 2022-06-12 00:18:08 +02:00
FireForge
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
Yuri Rubinsky
09418afbc0 Fix wrapf to correct wrap values with 0.1 stepping 2022-06-08 17:11:55 +03:00
xutaxkamay
bcdfa89ca5 Fix (again) loading binary resources with float=64
I had an error while importing my GLB file from 32-bit precision
floating point,
I guess this was forgotten while implementing 64-bit precision floating
point.
I'm not sure if there's any other left to do though.
2022-06-08 15:02:12 +02:00
Rémi Verschelde
c8ce7e34e2 i18n: Misc fixes translation strings
Adds some translator comments to solve some questions raised on Weblate.
2022-06-08 12:57:54 +02:00
Rémi Verschelde
5ebdfc31b2
Merge pull request #61319 from JFonS/taa_wip
Initial TAA implementation
2022-06-07 20:53:55 +02:00
Rémi Verschelde
e136f4741c
Merge pull request #41568 from dalexeev/config_file_empty_sect
Fix saving section-less keys in `ConfigFile`
2022-06-07 20:53:38 +02:00
Rémi Verschelde
d52a79ad22
Merge pull request #59786 from V-Sekai/ok_color
Allow picking similar colours using OKHSL.
2022-06-07 20:52:32 +02:00
sps1112
1f361b0367 Bind vararg method flag in core constants 2022-06-07 17:06:34 +02:00
Danil Alexeev
1ca227af1d
Fix saving section-less keys in ConfigFile 2022-06-07 18:05:49 +03:00
Rémi Verschelde
e24e4935ff
Merge pull request #61751 from KoBeWi/🐱👤 2022-06-07 16:02:16 +02:00
Rémi Verschelde
3f8d86b076
Merge pull request #50349 from Calinou/array-add-some-every
Add `any()` and `all()` methods to Array
2022-06-07 15:15:22 +02:00
K. S. Ernest (iFire) Lee
1b776a6e7a Allow picking similar colours using OKHSL. 2022-06-07 05:53:27 -07:00
kobewi
83014f8901 Add GLOBAL_DEF_INTERNAL to hide specific settings 2022-06-07 14:14:03 +02:00
jfons
ba832d83b2 Initial TAA implementation
Initial TAA support based on the implementation in Spartan Engine.

Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
2022-06-07 13:14:44 +02:00
Rémi Verschelde
83421cd06f
Merge pull request #59883 from KoBeWi/merge_this 2022-06-06 23:38:29 +02:00
Aaron Franke
357af68e03
Improve architectures in OS::has_feature and make them work on MSVC 2022-06-06 10:11:00 -05:00
bruvzg
b3bbf3db47
[GDExtension] Expose Variant, NodePath and StringName hash functions. 2022-06-06 12:19:56 +03:00
Rémi Verschelde
ecde7ce834
Merge pull request #61669 from fire-forge/input
Make Input `mouse_mode` and `use_accumulated_input` properties
2022-06-04 15:52:34 +02:00
FireForge
f16c33fff6 Make Input mouse_mode and use_accumulated_input properties 2022-06-03 14:19:38 -05:00
Raul Santos
3e53afd52c
Add array element type to get_connected_joypads 2022-06-03 20:37:46 +02:00
George Marques
887e292210
Add StringName explicitly to Variant::hash_compare
This makes equality comparisons to StringName more performant
2022-06-03 11:51:46 +02:00
Haoyu Qiu
83990c2161 Fix String.uri_encode on Windows 2022-06-03 13:58:57 +08:00
Fabio Alessandrelli
70c2b4bebd
Merge pull request #60711 from nathanfranke/rpc-server
network - finish renaming AUTH to AUTHORITY
2022-06-02 11:07:41 +02:00
Rémi Verschelde
6cd730ea98
Merge pull request #61339 from lyuma/streampeerssl_get_stream 2022-06-02 00:27:07 +02:00
kobewi
a0915e6dee Add Dictionary.merge() 2022-05-31 21:05:56 +02:00
Lyuma
7e28385948 Add StreamPeerSSL.get_stream() accessor. 2022-05-25 12:43:19 -07:00
Nathan Franke
f464caf214
finish renaming AUTH to AUTHORITY 2022-05-25 14:31:46 -05:00
Nathan Franke
77c8f271e7
use ERR_FAIL_INDEX when preferred 2022-05-25 13:36:45 -05:00
Hugo Locurcio
a98e31aa3a
Add any() and all() methods to Array
These can be used as faster, more convenient shorthands to
using `filter()` + `size()`.
2022-05-25 16:09:10 +02:00
Rémi Verschelde
3555b970bf
Merge pull request #61256 from reduz/callable-mp-static
Add callable_mp_static
2022-05-24 08:08:27 +02:00
Rémi Verschelde
9923851370 Fix typos with codespell
Using codespell 2.2-dev from current git.
2022-05-23 21:32:19 +02:00
reduz
4177e5c7c7 Add callable_mp_static
Allows using a static (C) function as a callable.
2022-05-22 15:36:34 +02:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
Hugo Locurcio
7b5bf3af19
Tweak 64-bit integer overflow message to mention that it's a signed type 2022-05-20 14:12:09 +02:00
Aaron Record
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
Haoyu Qiu
fc3b845c07 Add dedicated macros for property name extraction
* Replace case-by-case extraction with PNAME & GNAME
* Fix group handling when group hint begins with property name
* Exclude properties that are PROPERTY_USAGE_NO_EDITOR
* Extract missing ADD_ARRAY*, ADD_SUBGROUP* macros
2022-05-19 14:08:47 +08:00
George Marques
023b1d7f5a
Implement read-only arrays
Arrays can be set as read-only and thus cannot be modified. Assigning
the array will create an editable copy.

Similar to is already done to read-only dictionaries.
2022-05-17 14:14:42 -03:00
Rémi Verschelde
7ea8cde983
Merge pull request #61110 from rburing/project_settings_use_rbmap 2022-05-17 16:20:41 +02:00
Rémi Verschelde
35004aea48
Merge pull request #61087 from reduz/readonly-dictionary
Implement read-only dictionaries.
2022-05-17 15:11:48 +02:00
Ricardo Buring
9d9b50855c ProjectSettings: use RBMap again instead of HashMap
This fixes corruption of project.godot and failure to load global classes.
2022-05-17 14:49:58 +02:00
Haoyu Qiu
3094e739f5 Create onready variables when dropping nodes and holding Ctrl 2022-05-17 11:51:22 +08:00
reduz
e6c443a353 Implement read-only dictionaries.
* Add ability to set them read only.
* If read-only, it can't be modified.

This is added in order to optionally make const dictionaries (and eventually arrays) properly read-only in GDScript.
2022-05-16 23:31:46 +02:00
Rémi Verschelde
d6edc6d18a
Merge pull request #60126 from Calinou/image-improve-error-messages 2022-05-16 15:02:49 +02:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Hugo Locurcio
a581908ea0
Add documentation comments for internationalization C++ macros 2022-05-12 22:50:28 +02:00
Rémi Verschelde
ff30a09993
Merge pull request #60643 from clayjohn/GLES3-3D 2022-05-12 21:08:02 +02:00
clayjohn
652adcd5bf Basic 3D rendering 2022-05-12 10:37:27 -07:00
Rémi Verschelde
f5978f4d97
Merge pull request #60972 from KoBeWi/display_port 2022-05-12 18:13:09 +02:00
kobewi
739242dd04 Move Display settings higher in the list 2022-05-12 16:38:59 +02:00
Yuri Rubinsky
a439832035 Fix signal completion in GDScript editor 2022-05-12 16:10:48 +03:00
reduz
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
Rémi Verschelde
2fd73bd32e
Merge pull request #60943 from bruvzg/fix_zipio 2022-05-11 16:59:31 +02:00
Rémi Verschelde
d68c355145
Merge pull request #58873 from Chaosus/power_op
Implement exponential operator (**) to GDScript/Expressions
2022-05-11 16:58:33 +02:00
Rémi Verschelde
0b0beae097
Merge pull request #60941 from timothyqiu/image-convert
Fix invalid memory usage when using `Image.convert`
2022-05-11 16:54:13 +02:00
Rémi Verschelde
b5689309f6
Merge pull request #56167 from cdemirer/constructor-toarray-fix 2022-05-11 15:47:06 +02:00
Yuri Roubinsky
dbd7a31507 Implement exponential operator (**) to GDScript/Expressions 2022-05-11 16:30:37 +03:00
bruvzg
d36c5514d3
Fix ZipIO crash when reused (and possible leaks). 2022-05-11 16:08:17 +03:00
Haoyu Qiu
34c1a2beaa Fix invalid memory usage when using Image.convert 2022-05-11 17:39:27 +08:00
Rémi Verschelde
edf61c077c
Merge pull request #60917 from akien-mga/ci-emscripten-3.1.10 2022-05-10 15:08:32 +02:00
Rémi Verschelde
cc66d5e173
Merge pull request #60855 from timothyqiu/packed-array-find
Add search methods for packed arrays
2022-05-10 13:39:55 +02:00
Rémi Verschelde
b9b78fdaee
Merge pull request #55876 from bradc6/feature/AllowForAbsoluteLibraryPaths 2022-05-10 13:38:41 +02:00
Rémi Verschelde
d8935b27a9 Fix warnings found by Emscripten 3.1.10
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.
2022-05-10 13:03:13 +02:00
Rémi Verschelde
943b509952
Merge pull request #60886 from touilleMan/gdextension-header-duplicated-GDNativeExtensionClassGetPropertyList
Fix duplication of GDNativeExtensionClassGetPropertyList definition in gdnative_interface.h
2022-05-08 19:54:12 +02:00
Emmanuel Leblond
f3a8574ede
Fix duplication of GDNativeExtensionClassGetPropertyList definition in gdnative_interface.h 2022-05-08 14:41:31 +02:00
Emmanuel Leblond
2bdeed156f
Fix extension_api.json builtin_class_member_offsets member names for Color 2022-05-08 11:33:43 +02:00
Haoyu Qiu
380a53f02f Add search methods for packed arrays
* count()
* find()
* rfind()
2022-05-07 20:16:11 +08:00
bruvzg
70755d873b
[GDExtension] Fix static method binds and default arguments. 2022-05-06 10:06:12 +03:00
Rémi Verschelde
f4ece7e736
Merge pull request #60609 from nathanfranke/string-quotes 2022-05-06 08:59:08 +02:00
Rémi Verschelde
f70dd61a49
Merge pull request #60811 from smix8/astar_zero_point_weight_4.x 2022-05-06 08:40:12 +02:00
Rémi Verschelde
f70085a942
Merge pull request #60802 from Calinou/profiler-idle-time-rename 2022-05-06 08:28:59 +02:00
smix8
868fe4942c Allow AStar2D/AStar3D zero point weight
Allow AStar2D/AStar3D zero point weight.

Limit was set to 1 which seemed like an arbitrary value as lower values down to zero can be useful for common gameplay navigation elements like teleports.
2022-05-06 02:33:10 +02:00
kobewi
1dc7bcc83c Cleanup metadata usage 2022-05-06 00:27:10 +02:00
Hugo Locurcio
79be2c7b75
Rename profiler "Idle Time" to "Process Time"
References to "idle time" are progressively being replaced by
"process time" throughout the engine to avoid confusion.
2022-05-05 20:23:47 +02:00
Nicholas Huelin
8409d92282 Fix inconsistent naming in Time 2022-05-05 16:00:37 +02:00
Rémi Verschelde
71e41eb395
Merge pull request #60597 from reduz/missing-node-resource-placeholders 2022-05-05 15:57:50 +02:00
Rémi Verschelde
ccef98441e
Merge pull request #60784 from akien-mga/faire-phi-des-anglois 2022-05-05 15:25:30 +02:00
Rémi Verschelde
e7a58a7eb6 Core: Rename math 'phi' arguments to 'angle' 2022-05-05 14:17:39 +02:00
Rémi Verschelde
30fbb8964d Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@b7d126eb71
2022-05-05 14:12:55 +02:00
Rémi Verschelde
192499c743
Merge pull request #48989 from MarioLiebisch/variant-comment-line-breaks
Properly increase line counter when parsing comments
2022-05-05 13:41:08 +02:00
Fabio Alessandrelli
e5137fafbe [Net] Fix StreamPeerTCP accepted status. 2022-05-04 20:13:32 +02:00
Rémi Verschelde
84f64ddde9
Merge pull request #60723 from reduz/refactor-module-initialization 2022-05-04 19:08:43 +02:00
reduz
de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
mdavisprog
f3c1232c59 Add OS::is_process_running function.
Adds the is_process_running function to the native OS class and exposes it to script.

This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function.

Documentation is updated to reflect new API function.
2022-05-03 17:27:17 -07:00
Nathan Franke
58fcad20ef
quote strings inside arrays and dictionaries 2022-05-03 13:37:13 -05:00
reduz
0a57f964a3 Implement missing Node & Resource placeholders
Implemented by request of @neikeq to advance in the GDExtension version of Mono.

* If a Resource type is missing upon load, it will be remembered together with its data (Unless manually overriden).
* If a Node type is missing upon load, it will be also be remembered together with its data (unless deleted).

This feature makes working with GDExtension much easier, as it ensures that missing types no longer cause data loss.
2022-05-03 17:08:09 +02:00
Aaron Franke
fa7a7795f0
Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05:00