Commit graph

5395 commits

Author SHA1 Message Date
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
Rémi Verschelde
931838b330
Merge pull request #60627 from aaronfranke/rename-elements
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-03 14:40:01 +02:00
Rémi Verschelde
297241f368
Merge pull request #60714 from Calinou/typedef-remove-ref
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
2022-05-03 14:28:18 +02:00
Rémi Verschelde
c9ce4069a3
Merge pull request #60601 from touilleMan/gdextension_get_library_path
Add GDNativeInterface::get_library_path to GDExtension
2022-05-03 08:13:34 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Rémi Verschelde
78193788d0
Merge pull request #59895 from akien-mga/clang-tidy 2022-05-02 17:45:13 +02:00
Rémi Verschelde
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
bruvzg
7b18c35ab2 Fix resource dependence renaming. 2022-05-02 16:38:09 +03:00
Haoyu Qiu
ad1a8777bd Fix left aligned integer sign in string formatting 2022-05-01 12:42:48 +08:00
Rémi Verschelde
db29d7753b
Merge pull request #60556 from KoBeWi/D_METHOD1,D_METHOD2,D_METHOD3,D_METHOD4,D_METHOD5,D_METHOD6,D_METHOD7,D_METHOD8,D_METHOD9,D_METHOD10 2022-04-30 18:51:30 +02:00
kobewi
6f0b63f794 Change D_METHOD to variadic template 2022-04-30 17:30:33 +02:00
kobewi
7f0bc91844 Simplify Callable error text methods 2022-04-30 13:42:26 +02:00
Aaron Franke
1bf94dff3a
Rename Basis "elements" to "rows" 2022-04-29 08:02:56 -05:00
Aaron Franke
b831fb0a54
Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 -05:00
Emmanuel Leblond
80f61352fb
Add GDNativeInterface::get_library_path to GDExtension 2022-04-29 00:51:04 +02:00
Rémi Verschelde
504708ae21
Merge pull request #56093 from bruvzg/pck_section_load
Improve embedded PCK loading and exporting.
2022-04-27 14:29:21 +02:00
Rémi Verschelde
6e6fe2b025
Merge pull request #59582 from Faless/net/4.x_tcp_explicit_poll 2022-04-27 13:56:58 +02:00
Rémi Verschelde
add5163224
Merge pull request #59932 from vnen/remove-arg-names-release 2022-04-27 13:07:53 +02:00
Rémi Verschelde
8dfa12cae7
Merge pull request #59979 from bruvzg/cpp_check2 2022-04-27 10:08:26 +02:00
kobewi
b80e52f048 Expose move_to_trash() 2022-04-27 01:02:11 +02:00
Rémi Verschelde
2116ecc46a
Merge pull request #60420 from AndreaCatania/fix_looup_ptr_const
Add mutable OAHashMap::lookup_ptr function to fix mutability.
2022-04-26 18:31:17 +02:00
Rémi Verschelde
8c2b9801fd
Merge pull request #60438 from Paulb23/text-edit-tests
Add TextEdit unit tests and multiple fixes.
2022-04-25 23:39:30 +02:00
Rémi Verschelde
68ee730774
Merge pull request #60424 from timothyqiu/fa-unref
Close `FileAccess` before accessing it with `DirAccess`
2022-04-25 16:21:09 +02:00
Rémi Verschelde
7c7ce7dcd7
Merge pull request #60298 from reduz/scene-unique-paths 2022-04-25 13:38:08 +02:00
reduz
8580f377a3 Implement Scene Unique Nodes
Implements https://github.com/godotengine/godot-proposals/issues/4096

* Nodes can be marked unique to the scene in the editor (or via code).
* Unique nodes can be accessed via the **%** prefix at any point in the path. From that point in the path (depending on whether the scene of the path is), the unique node will be fetched.
* Implementation is very optimal, as these nodes are cached.
2022-04-25 12:19:17 +02:00
Aaron Franke
7d6f87899e
Merge pull request #60201 from laws65/datetime-string-message-fix
Proper (in)validation of negative values in datetime strings and datetime dicts
2022-04-22 19:21:31 -05:00
Paulb23
5e4e4967fe Use Input::push_input for tests plus extra mouse testing 2022-04-22 17:39:12 +01:00
Haoyu Qiu
caf8e5e339 Close FileAccess before accessing it with DirAccess 2022-04-22 18:15:31 +08:00
AndreaCatania
4066349488 Add mutable OAHashMap::lookup_ptr function to fix mutability. 2022-04-22 09:20:15 +02:00
bruvzg
c0cc41d6c1
Improve embedded PCK loading and exporting.
Windows export process:
  Limit size of executable with embedded PCK to 4 GB.
  Use "rcedit" before embedding PCK.
  Capture and process "rcedit" errors.

Windows, Linux:
  Add support for PCK loading from executable "pck" section.
2022-04-20 11:09:59 +03:00
bruvzg
de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
Hugo Locurcio
3ca4514866
Merge pull request #50175 from kleonc/image-blit-blend-fix-rects
`Image.blit_rect/blend_rect` Fix rects calculations for negative arguments
2022-04-19 16:30:08 +02:00
laws65
cf9fc0b936 Proper validation of negative values in datetime strings and datetime dicts 2022-04-17 19:12:18 +09:30
Oğuzhan Eroğlu
2b8eb126b4 Quick fix: Crash when parsing invalid datetime string #60189 2022-04-15 23:30:34 +03:00
Rémi Verschelde
c7922af4e5
Merge pull request #60203 from RedHeadphone/master
Fix Time.get_datetime_string_from_dict() does not validate input
2022-04-14 00:14:32 +02:00
Rémi Verschelde
bd9ba4bd10
Merge pull request #60208 from Magorx/input-set-custom-mouse-cursor-fix
Added p_shape check to avoid engine crash in DisplayServer
2022-04-14 00:12:51 +02:00
Rémi Verschelde
8ada85ef1d
Merge pull request #60093 from TokageItLab/reset-blend
Make blend animation to use ResetTrack as default value
2022-04-13 22:46:45 +02:00
Rémi Verschelde
d999116054
Merge pull request #60191 from novaplusplus/file-open-fix 2022-04-13 17:42:41 +02:00
nova++
1a3cb23955 Fix "File must be opened" error with File.open() 2022-04-13 08:51:07 -04:00
KingCakeTheFruity
29a2809d21 Added p_shape check to avoid engine crush 2022-04-13 14:50:30 +03:00
RedHeadphone
7e35af3dc3 validate input in Time.get_datetime_string_from_dict()
format fix

better fix to handle ERR_FAIL_COND_V_MSG return data type
2022-04-13 16:24:32 +05:30
Rémi Verschelde
46ef52162e Color: Rename to_srgb/to_linear to include base color space
This helps reduce confusion around sRGB <> Linear conversions by making
both input and output color spaces explicit.
2022-04-13 11:45:52 +02:00
Rémi Verschelde
8432bf18e2
Merge pull request #60097 from V-Sekai/fix_triangle_mesh_selection
Rearrange TriangleMesh function to workaround MSVC compiler bug
2022-04-13 08:27:08 +02:00
SaracenOne
8fbed3d582 Rearrange TriangleMesh stack level incrementation to fix MSVC compiler optimization bug 2022-04-13 05:48:49 +01:00
Rémi Verschelde
c3cf4d4974
Merge pull request #60078 from Pineapple/cowdata-get-data
Remove get_data() from CowData
2022-04-12 14:27:48 +02:00
bruvzg
d2ebac3a30
Remove or make private FileAccess close() methods. 2022-04-12 14:50:14 +03:00
bruvzg
4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
Rémi Verschelde
f62f36cd91
Merge pull request #53573 from Klowner/53568-safelist-leak-fix 2022-04-11 17:55:35 +02:00
Rémi Verschelde
df51e5fab0
Merge pull request #60046 from Zylann/print_line_function 2022-04-11 17:51:10 +02:00
bruvzg
9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
Hugo Locurcio
18e9e6a81a
Improve error messages when creating Images from code
The rationale behind the expected number of bytes is now displayed
in clear (width, height, format, number of mipmaps expected if any).
2022-04-11 01:13:50 +02:00
Silc 'Tokage' Renew
860fac4e6f Make blend animation to use ResetTrack as default value 2022-04-10 13:00:00 +09:00
Bartłomiej T. Listwon
6dfcfecd3d Remove get_data() from CowData 2022-04-09 21:25:31 +02:00
Marc Gilleron
cc29d39800 Changed print_line macro to a function 2022-04-09 00:45:34 +01:00
Mark Riedesel
4f3769fd75 add SafeList destructor which calls maybe_cleanup() to prevent mem leak 2022-04-08 09:50:49 -04:00
Rémi Verschelde
bf153b82c7
Merge pull request #59324 from Zylann/fix_fvec_array_binary_load
Fix loading binary resources with float=64
2022-04-08 09:06:04 +02:00
Marc Gilleron
0b108f159a Fix loading binary resources with float=64
- PackedVector2Array
- PackedVector3Array
- PackedColorArray
2022-04-08 00:29:44 +01:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
George Marques
62ad18a3a1
Remove argument name strings from release builds
They are not needed in release, so we can remove them to reduce the
binary size.
2022-04-05 20:40:07 -03:00
Rémi Verschelde
099b024a2b Fix DynamicBVH crash after #59867
I made a wrong assumption that initialization the other pointer in the
union would properly initialize the `childs` array.
2022-04-05 02:17:34 +02:00
Rémi Verschelde
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
Rainer Deyke
5583bab9d4 Fixed indents 2022-04-04 15:07:29 +02:00
Rainer Deyke
56ae5bbafb Fixed unsafe casts 2022-04-04 14:57:04 +02:00
Rainer Deyke
2907ca3a41 Made Key operators constexpr
Made operators on Key and KeyModifierMask constexpr, allowing them to
be used in switch cases.
2022-04-04 14:56:37 +02:00
Rémi Verschelde
c630c2001d
Merge pull request #59633 from EricEzaM/better-code-complete-update
Improve sorting of Code Completion options.
2022-04-03 12:34:00 +02:00
Eric M
4ab605d14d Improve sorting of Code Completion options.
Done by ordering options by their location in the code - e.g. local, parent class, global, etc.
2022-04-01 20:39:09 +10:00
bruvzg
947d7c8329
Fix some issues found by clang sanitizers. 2022-03-31 18:35:56 +03:00
Rémi Verschelde
a647fb3e62 Fix typos with codespell
Using codespell 2.2-dev from current git.

Fix a couple incorrect uses of gendered pronouns.
2022-03-31 14:07:29 +02:00
Rémi Verschelde
03c58954c0
Merge pull request #58436 from piiertho/feature/typed-vararg-method-bind 2022-03-30 13:47:35 +02:00
Pierre-Thomas Meisels
63f7f44ccb Make vararg method bind no return and return
Type emit_signal exposed method return type

set UndoRedo add_do_method and add_undo_method exposed return void

Set TreeItem::_call_recursive_bind returns void

Set _rpc_bind and _rpc_id_bind returns void in Node

Set _call_group and _call_group_flags method returns void in SceneTree

Set godot-cpp-test CI flag to false
2022-03-30 11:43:12 +02:00
reduz
45f74ceb85 Add PortableCompressedTexture
* Resource that allows saving textures embedded in scenes or standalone.
* Supports only formats that are portable: Lossy, Lossles or BasisUniversal

This is something I wanted to add for a long time. I made it now because @fire
requires it for importing GLTF2 files with embedded textures, but also this
will allow saving Godot scenes as standalone binary files that will run
in all platforms (because textures will load everywhere).

This is ideal when you want to distribute individual standalone assets online
in games that can be built from Godot scenes.
2022-03-30 10:39:41 +02:00
Rémi Verschelde
482cdeaf71
Merge pull request #58608 from KoBeWi/metadefault 2022-03-29 16:14:28 +02:00
Rémi Verschelde
7119d355eb String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
2022-03-28 20:26:35 +02:00
Rémi Verschelde
abbb0dc082
Merge pull request #59548 from akien-mga/obj-remove-unused-categories 2022-03-28 14:17:24 +02:00
Rémi Verschelde
41d075de58
Merge pull request #59456 from Calinou/color-expose-to-linear-srgb 2022-03-28 13:36:19 +02:00
Rémi Verschelde
143d13717b
Merge pull request #59553 from reduz/script-extension-support 2022-03-28 13:35:21 +02:00
Juan Linietsky
ed14ff5a08
Revert "Sort autocomplete/code completion options in a better way" 2022-03-28 13:31:32 +02:00
Hugo Locurcio
1c343cd54d Expose Color's to_linear() and to_srgb() to scripting 2022-03-28 12:17:55 +02:00
Rémi Verschelde
097b81f147
Merge pull request #59611 from mashumafi/const-ref-callable
Const Ref Callable for custom sort/search
2022-03-28 09:13:19 +02:00
Rémi Verschelde
7fe5bece45
Merge pull request #58931 from EricEzaM/proposals/4189-better-code-completion
Sort autocomplete/code completion options in a better way
2022-03-28 08:56:27 +02:00
Rémi Verschelde
6a74d81e02
Merge pull request #59600 from Bromeon/feature/extension_to_string
GDExtension: change to_string signature to accept `GDNativeStringPtr` instead of returning `const char*`
2022-03-28 08:53:40 +02:00
mashumafi
9c2bfeb2fb Const Ref Callable for custom sort/search 2022-03-27 22:10:36 -04:00
Jan Haller
f88bdac403 GDExtension: change to_string signature to accept GDNativeStringPtr instead of returning const char* 2022-03-27 21:31:00 +02:00
Fabio Alessandrelli
331f1662df [Net] Drop is_connected_to_host for TCP and UDP.
The UDP method is now called `is_socket_connected` to limit confusion
with the actual host connection status which doesn't make sense in UDP.

The TCP method is completly dropped, use get_status instead.

The only one left is the WebSocketPeer one, which should be fine as is
for now.
2022-03-27 16:36:44 +02:00
Fabio Alessandrelli
0e52867668 [Net] Make StreamPeerTCP::_poll_connection explicit.
No longer hacked into `get_status` and renamed to `poll`.

The old `poll` (for *nix `poll`, win `select`) is now called `wait`.
2022-03-27 16:36:44 +02:00
reduz
360dea5348 Add GDExtension support to Script
* Ability to create script languages from GDExtension
* Some additions to gdnative_extension.h to make this happen
* Moved the GDExtension binder to core

This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x.
Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
2022-03-27 16:13:00 +02:00
Markus Sauermann
0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
Rémi Verschelde
5371009d8e Object: Remove unused category boilerplate
We might want to re-add something like this if/when we find a good use case
for it and do the effort to categorize all objects in the API properly.

Until then, it's better to remove that boilerplate since it's not needed.

Closes #18711.
2022-03-26 15:46:01 +01:00
Rémi Verschelde
283246a9fe
Merge pull request #59452 from reduz/refactor-metadata 2022-03-25 12:30:45 +01:00
reduz
09b951b99b Refactor Object metadata
* API kept the same (Although functions could be renamed to set_metadata/get_metadata in a later PR), so not much should change.
* Metadata now exposed as individual properties.
* Properties are editable in inspector (unless metadata name begins with _) under the metadata/ namespace.
* Added the ability to Add/Remove metadata properties to the inspector.

This is a functionality that was requested very often, that makes metadata work a bit more similar to custom properties in Blender.
2022-03-24 14:21:52 +01:00
Eric M
f9e1c094a2 Improve sorting of Code Completion options.
Done by ordering options by their location in the code - e.g. local, parent class, global, etc.
2022-03-24 22:24:14 +10:00
Hugo Locurcio
7d8b344f01
Increase the maximum number of concurrent DNS queries from 32 to 256
This makes the following error message less likely to be printed
when performing many concurrent HTTP requests:

    Condition ' resolving == IP::RESOLVER_INVALID_ID ' is true. returned: ERR_BUG
2022-03-23 18:18:23 +01:00
Rémi Verschelde
6b131b7d4b
Merge pull request #59437 from lawnjelly/bvh_check_invalid_handles 2022-03-23 11:37:53 +01:00
lawnjelly
109d08c84a Add protective checks for invalid handle use in BVH
Adds DEV_ASSERTS that will halt at runtime if the BVH is misused with invalid IDs, and adds ERR_FAIL macros to prevent calling with invalid IDs.

Any such misuse is a bug in the physics, but this should flag any errors quickly.
2022-03-23 09:19:26 +00:00
Haoyu Qiu
680bcef825 Fix crash when exporting projects with shared libraries 2022-03-23 13:53:32 +08:00
Rémi Verschelde
9162f27836
Merge pull request #59314 from reduz/add-static-methods-to-classdb 2022-03-22 19:22:46 +01:00
reduz
2f651277da Add static method support to ClassDB
* Based on the work done for Variant in the past.
* Added `ClassDB::bind_static_method`
* Cleaned up ClassDB::bind_method to use variadic templates.

This adds support for having static methods in Object derived classes.
Note that this does not make it work yet in GDScript or Mono and, while it works for GDExtension, GodotCPP needs to be updated.
2022-03-22 16:27:34 +01:00
kobewi
3eb7fc4bfd Add optional 'default' argument to get_meta() 2022-03-22 15:50:47 +01:00
Rémi Verschelde
4c55a6529a
Merge pull request #59354 from Chaosus/astar3d 2022-03-22 13:15:21 +01:00
Rémi Verschelde
44267327a9
Merge pull request #59276 from bruvzg/mo_trans 2022-03-22 12:48:14 +01:00
Yuri Roubinsky
7913e04950 Rename AStar to AStar3D 2022-03-20 17:34:40 +03:00
Marcel Admiraal
ea20049afc Ensure minimum modifiers are pressed when matching actions 2022-03-20 08:02:54 +00:00
bruvzg
35e8fd4d04
Add binary MO translation file support. 2022-03-18 23:23:32 +02:00
Rémi Verschelde
46472ea78e
Merge pull request #59257 from Calinou/key-name-backspace
Rename the "BackSpace" and "BackTab" key strings to "Backspace"/"Backtab"
2022-03-18 19:23:21 +01:00
Hugo Locurcio
03841bd8da
Rename the "BackSpace" and "BackTab" key strings to "Backspace"/"Backtab" 2022-03-18 18:09:21 +01:00
Rémi Verschelde
5c8bd6fd71
Merge pull request #58233 from bruvzg/gde_ts 2022-03-18 14:29:58 +01:00
Rémi Verschelde
5c4de463fe
Merge pull request #59229 from taigi100/Bugfix-#59215-Standard-color-name-returns-non-standard-color-code 2022-03-17 11:38:06 +01:00
Rémi Verschelde
bc576af969
Merge pull request #57675 from TokageItLab/fix-blending 2022-03-17 10:49:34 +01:00
taigi100
bd247fa315 Update color constants to use HEX codes 2022-03-17 11:36:23 +02:00
bruvzg
f19cd44346
Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
Rémi Verschelde
c9d764e14a
Merge pull request #59140 from reduz/physics-server-extension 2022-03-16 17:11:40 +01:00
Silc 'Tokage' Renew
b06d253920 Fix blend animation to solve TRS track bug & blend order inconsistency 2022-03-16 05:11:55 +09:00
Rémi Verschelde
fb28025785
Merge pull request #59153 from Calinou/debug-stringnames-improve
Improve `--debug-stringnames` to be more useful
2022-03-15 20:26:18 +01:00
Hugo Locurcio
38995961df
Improve --debug-stringnames to be more useful
- Print all StringNames, not just the top 100.
- Print statistics at the end of the list of StringNames,
  with unreferenced and rarely referenced StringNames.
- List the CLI argument in `--help` and shell completion.
2022-03-15 18:54:51 +01:00
reduz
8b547331be Create GDExtension clases for PhysicsServer3D
* Allows creating a GDExtension based 3D Physics Server (for Bullet, PhysX, etc. support)
* Some changes on native struct binding for PhysicsServer

This allows a 3D Physics server created entirely from GDExtension. Once it works, the idea is to port the 2D one to it.
2022-03-15 18:39:31 +01:00
Rémi Verschelde
51bbcbdec2
Merge pull request #45263 from KoBeWi/😕 2022-03-15 13:18:27 +01:00
Bartłomiej T. Listwon
6c6291b84f Include platform_config.h in thread.cpp and thread.h 2022-03-14 12:36:06 +01:00
Rémi Verschelde
2724e57288
Merge pull request #58772 from keptsecret/fix_filedialog_user_data_access
Fix unable to change directory in user access mode
2022-03-12 20:53:43 +01:00
Rémi Verschelde
015fdfc28d
Merge pull request #58986 from akien-mga/diraccessref 2022-03-11 12:51:22 +01:00
Rémi Verschelde
952b71a425
Merge pull request #58751 from bruvzg/loc_str_props 2022-03-11 10:45:02 +01:00
Rémi Verschelde
768f9422bc Convert uses of DirAccess * to DirAccessRef to prevent memleaks
`DirAccess *` needs to be deleted manually, and this is often forgotten
especially when doing early returns with `ERR_FAIL_COND`.
`DirAccessRef` is deleted automatically when it goes out of scope.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-03-11 09:13:11 +01:00
Rémi Verschelde
26fd6fe2b2
Merge pull request #58485 from aaronfranke/time-offset 2022-03-10 21:13:29 +01:00
reduz
6f51eca1e3 Discern between virtual and abstract class bindings
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.

Most classes that make sense have been converted. Missing:

* Physics servers
* VideoStream
* Script* classes.

which will go in a separate PR due to the complexity involved.
2022-03-10 12:28:11 +01:00
Rémi Verschelde
741bbb9d7c
Merge pull request #58690 from elmordo/bugfix-57553-gdextension-inheritance-fix 2022-03-10 11:23:18 +01:00
Rémi Verschelde
e19da63009
Merge pull request #58946 from akien-mga/remove-unused-bullet-code
Remove unused Bullet module and thirdparty code
2022-03-10 08:01:04 +01:00
keptsecret
664c461d28 fixed unable to change directory in user access mode 2022-03-09 19:33:56 -05:00
Rémi Verschelde
b85e5d51b2 Fix UndoRedo method call argument count after #58929 2022-03-09 22:21:00 +01:00
Rémi Verschelde
3d7f155586 Remove unused Bullet module and thirdparty code
It has been disabled in `master` since one year (#45852) and our plan
is for Bullet, and possibly other thirdparty physics engines, to be
implemented via GDExtension so that they can be selected by the users
who need them.
2022-03-09 21:45:47 +01:00
reduz
21637dfc25 Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created.
* Limited arguments to 5 (then later changed to 8) in many places.
* They were replaced by C++11 Variadic Templates.
* Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard.
* Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-09 18:39:13 +01:00
kobewi
39d429e497 Change some math macros to constexpr
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
2022-03-09 16:24:32 +01:00
Rémi Verschelde
4e3d5a9a2c VariantUtility: Unexpose Math::range_step_decimals
This method was meant only as a convenience for editor code
to allow using a step of 0 to disable snapping.

It was exposed by mistake when refactoring GlobalScope.
2022-03-07 22:13:49 +01:00
Rémi Verschelde
95e6db09d0
Merge pull request #58859 from godotengine/revert-57972-fix_has_setting4 2022-03-07 14:32:25 +01:00
Rémi Verschelde
78bf9926f8
Revert "Fix ProjectSettings has_setting() when used on a overriden setting with feature tags" 2022-03-07 12:33:07 +01:00
lawnjelly
0565676893 Protection for array operator for Vector2 / 3 in DEV builds
A previous PR had changed the array operator to give unbounded access. This could cause crashes where old code depended on this previous safe behaviour.

This PR adds DEV_ASSERT macros for out of bound access to DEV builds, allowing us to quickly identify bugs in calling code, without affecting performance in release or release_debug editor builds.
2022-03-07 11:15:45 +00:00
Rémi Verschelde
6c3170e875
Merge pull request #57930 from piiertho/bugfix/add-none-flag-to-resource-saver 2022-03-07 12:05:35 +01:00
Pierre-Thomas Meisels
f9d4f08090 Fix ResourceSaver::save method exposition flag parameter
enh: Add FLAG_NONE to SaverFlags in ResourceSaver to fix api inconsistency
fix: flags parameter of ResourceSaver::save is now uint32_t to allow flag composition in scripts
2022-03-07 10:39:51 +01:00
Rémi Verschelde
a51f724b8b
Merge pull request #57812 from piiertho/bugfix/add-none-enum-global-constants 2022-03-07 10:23:25 +01:00
Pierre-Thomas Meisels
a41fb2fa3c bugfix: bind core enums' none values 2022-03-07 09:16:25 +01:00
reduz
b0ca03b0a2 Add a UniformSet cache
* Changed syntax usage for RD::Uniform to create faster with a single RID
* Converted render pass setup to use this in clustered renderer to test.

This is the first step into creating a proper uniform set cache system to simplify large parts of the codebase.
2022-03-06 13:03:33 +01:00
Rémi Verschelde
0d1e3893d9
Merge pull request #57630 from lawnjelly/bvh4_templated_checks
[4.x] BVH - Sync BVH with 3.x
2022-03-04 23:29:38 +01:00
bruvzg
12cb6386f6
Improve app name and system permission message localization.
Add localizable string (Dictionary<Lang Code, String>) property editor and property hint.
Add localized "app name" property to the project settings.
Add localized permission and copyright properties to the macOS and iOS export settings.
Remove some duplicated ("app name") and deprecated ("info") macOS and iOS export properties.
2022-03-04 18:11:31 +02:00
Rémi Verschelde
0ff45dd3a7
Merge pull request #58673 from Calinou/smooth-trimesh-collision-always-setting 2022-03-04 12:25:36 +01:00
Ing. Petr Jindra
c4770e1605 fix of reading property list from custom nodes imported from GDExtension when inheritance between custom nodes is used 2022-03-02 18:50:00 +01:00
Hugo Locurcio
4219485a82
Always register the Smooth Trimesh Collision project setting
This ensures the project setting never disappears from the editor,
even if the current physics engine is GodotPhysics.

This also adds documentation for the Smooth Trimesh Collision
project setting.
2022-03-02 18:49:34 +01:00
Haoyu Qiu
d1ca29cd8c Remove TTRC() with empty string
Fixes "duplicate message definition" when extracting messages.
2022-03-02 17:02:10 +08:00
Theraot
3590cdfd34 Added missing p_bidirectional to AStar2D methods
The methods disconnect_points and are_points_connected  now have an optional p_bidirectional parameter matching AStar.
2022-03-01 17:01:32 -05:00
Haoyu Qiu
b00b7f9b7c Fix UndoRedo::create_action() invalid memory usage 2022-03-01 18:20:46 +08:00
Rémi Verschelde
feee9d0aa5
Merge pull request #58629 from groud/fix_native_extion_init_order 2022-03-01 01:33:48 +01:00
Rémi Verschelde
de9446186d
Merge pull request #58488 from lawnjelly/float_literals_casts 2022-03-01 01:32:07 +01:00
Gilles Roudière
ce512b35c1 Reorder native extension types initialization, initializing editor last 2022-02-28 16:03:26 +01:00
Aaron Franke
061ab30051
Use is_zero_approx and fix spelling in CameraMatrix invert 2022-02-26 12:19:54 -06:00
Hugo Locurcio
8e57e5dc6a
Print every file exported with PCKPacker.flush()s verbose parameter
Previously, only one line per 100 files was printed.

This also refactors the print statement to use Godot methods and
make it more informative overall.
2022-02-25 02:42:58 +01:00
Bartłomiej T. Listwon
3f7f780a4c Optimize String concatenation and copy functions 2022-02-24 09:47:15 +01:00
lawnjelly
1485924a2b Float literals - fix main primitives to use real_t casting
Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
2022-02-24 08:15:10 +00:00
Aaron Franke
55aabb8b06
Add offset string from minutes conversion method to Time singleton 2022-02-23 22:12:02 -06:00
Rémi Verschelde
e6c11e4dfd
Merge pull request #58331 from poiati/fix-extension-registration-order-2 2022-02-22 09:07:28 +01:00
Rémi Verschelde
3000a3076b
Merge pull request #58350 from kidrigger/patch-1 2022-02-21 12:44:32 +01:00
Paulo Poiati
fe95aa2c90 Fix extension registration order. 2022-02-20 10:58:46 -03:00
Anish Bhobe
b7ff421b55
Resolving suggestions on comment formatting. 2022-02-20 14:56:58 +01:00
Rémi Verschelde
e3d89a76f7 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@94b76208bc
2022-02-20 12:20:17 +01:00
Rémi Verschelde
91a57b5b6a
Merge pull request #58329 from Powerbyte7/patch-1 2022-02-20 12:11:53 +01:00
Anish Bhobe
102d9fc1b3
Fixing iteration for extension level loading.
Extensions are not getting instantiating properly due to iteration calling the wrong levels for loading.
2022-02-20 11:41:39 +01:00
Powerbyte7
b8a7ea034c
[HTML5] Add Stadia controller to database
Add web support for the Stadia controller.
2022-02-19 23:01:41 +01:00
Rémi Verschelde
e031aa06ee Core: Use forward declares for Vector3/Vector3i
Add add Vector3 operator in Vector3i.
2022-02-19 16:47:24 +01:00
Rémi Verschelde
719762d4dc
Merge pull request #58166 from Zylann/fix_binary_resource_with_doubles
Fix loading of binary resources with 64-bit floats
2022-02-19 08:22:42 +01:00
Rémi Verschelde
420ad25348
Merge pull request #58205 from Zylann/fix_variant_encode_with_doubles
Add missing flag when encode_variant writes math types with doubles
2022-02-19 08:22:05 +01:00
bruvzg
759ca45820
[Editor] Fix "en" editor translation detection. 2022-02-18 22:15:02 +02:00
Rémi Verschelde
0217d44dfd
Merge pull request #58278 from Ev1lbl0w/fix_decompress_retcode 2022-02-18 15:56:21 +01:00
Ricardo Subtil
61790a03f5 Fix decompression functions not returning errcodes 2022-02-18 13:50:25 +00:00
Rémi Verschelde
e1c303fa79 Revert "Fix extension registration order."
This reverts commit 94ef200bab.

This broke extension loading.
Fixes #58273.
2022-02-18 14:18:24 +01:00
Rémi Verschelde
b4dc2e91e6
Merge pull request #58196 from poiati/fix-extension-registration-order 2022-02-18 09:07:21 +01:00
Marc Gilleron
c69d303ba9 Add missing flag when encode_variant writes math types with doubles 2022-02-16 20:47:36 +00:00
Paulo Poiati
94ef200bab Fix extension registration order. 2022-02-16 14:46:33 -03:00
Rémi Verschelde
51a00c2855
Merge pull request #58182 from akien-mga/style-cleanup-if-semicolons-deadcode 2022-02-16 16:55:07 +01:00
Rémi Verschelde
b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
jmb462
dcd2a92af3 Port existing _notification code to use switch statements (part 1/3) 2022-02-16 11:38:24 +01:00
Rémi Verschelde
f5b9cbaff6
Merge pull request #58176 from timothyqiu/find-nearest 2022-02-16 11:01:13 +01:00
Haoyu Qiu
3057b19daa Make VMap::find_nearest return -1 when empty 2022-02-16 16:12:30 +08:00
Marc Gilleron
722945be61 Fix loading of binary resources with 64-bit floats 2022-02-16 00:55:13 +00:00
Hugo Locurcio
ee7cd9a3a1
Add an OS.get_processor_name() method
This method can be used to get the CPU model name.
It can be used in conjunction with
`RenderingServer.get_video_adapter_name()` and
`RenderingServer.get_video_adapter_vendor()` for annotating benchmarks
and automatic graphics quality configuration.
2022-02-15 20:55:53 +01:00
Max
6aede992a9 Fixed variant decoding Segmentation Fault 2022-02-14 23:04:05 +03:00
Fabio Alessandrelli
f72bd67068 [ResourceUID] Use CryptoCore::RandomGenerator for IDs. 2022-02-14 10:45:50 +01:00
Fabio Alessandrelli
ee7b67e135 [Crypto] Implement CryptoCore::RandomGenerator.
As a cryptographically secure random generator.

Internally it uses mbedTLS CTR-DRBG implementation which gets re-seeded
with entropy from OS::get_entropy when needed.

CryptoCore now additionally depends on `ctr_drbg.c` and `entropy.c`
thirdparty mbedtls files.
2022-02-14 10:45:50 +01:00
Fabio Alessandrelli
6b5634b96a [OS/Crypto] Add get_entropy to OS.
Implemented via `BCryptGenRandom` on Windows.
Implemented via `getentropy` syscall when available.
Implemented via `/dev/urandom` device as a fallback.

The `/dev/urandom` fallback can be disabled via the `NO_URANDOM` build
flag.

Note: The HTML5 version relies on emscripten file system urandom
device which itself uses the Crypto API when available or the plain
old not crypto-safe `Math.random()` otherwise.

Restore get_entropy.
2022-02-14 10:45:50 +01:00
Rémi Verschelde
7224389468
Merge pull request #57954 from TokageItLab/refactor-cubic-interpolate
Implement `cubic_interpolate()` as MathFunc for refactoring
2022-02-13 10:34:13 +01:00
Rémi Verschelde
7d0b9ec21a
Merge pull request #52742 from Geometror/improve-project-manager-file-dialog 2022-02-12 15:28:09 +01:00
Hendrik Brucker
77fb65debf Use EditorFileDialog instead of FileDialog in the project manager 2022-02-12 12:06:51 +01:00
reduz
97feafd0ea Fix resource reuse in binary loader
* Reuse was not setting the internal index.
* Supersedes #52599, without re-reading all properties.
2022-02-12 10:57:51 +01:00
Silc 'Tokage' Renew
865da09871 Implement cubic_interpolate() as MathFunc for refactoring 2022-02-12 18:11:17 +09:00
Rémi Verschelde
daf9729b92
Merge pull request #57703 from lawnjelly/float_literals_math_funcs 2022-02-12 10:01:48 +01:00
Rémi Verschelde
7a7fabe4f6
Merge pull request #57641 from Geometror/compilation-time-improvements-1 2022-02-12 09:46:02 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde
ea0337909c
Merge pull request #57972 from BimDav/fix_has_setting4 2022-02-11 15:31:12 +01:00
BimDav
d39e416c61 has_setting now correctly returns true when the setting is present due to a feature tag 2022-02-11 14:35:30 +01:00
reduz
3ad3a43063 Fix Variant Ref<> assignment.
-Creating from object pointer via funcptr API was missing reference initialization.
-Supersedes https://github.com/godotengine/godot-cpp/pull/662
-Fixes several crashes in GDExtension
2022-02-11 12:30:49 +01:00
lawnjelly
5298e16e80 Float literals - fix main primitives to use .f
Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
2022-02-10 18:43:19 +00:00
Yuri Sizov
107b6f299c Reorganize inspector layout workflow for Control nodes 2022-02-10 20:29:34 +03:00
Rémi Verschelde
1bdb82c64e
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.
2022-02-10 12:30:19 +01:00
Rémi Verschelde
d22ac13bc2
Merge pull request #57715 from Faless/debugger/4.x_core_includes_and_servers
[Debugger] Move most profilers to ServersDebugger, fix core includes.
2022-02-09 21:57:32 +01:00
Rémi Verschelde
85610588d1
Merge pull request #57843 from Pineapple/vector2-brackets-operator-master 2022-02-09 13:25:18 +01:00
Rémi Verschelde
90162851a7
Core: Move generated VERSION_HASH to a .cpp file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.
2022-02-09 09:20:17 +01:00