Commit graph

5500 commits

Author SHA1 Message Date
Rémi Verschelde
14e1f36e61 Merge pull request #66492 from bruvzg/gde_ts_underscr
[GDExtension] Use function names with underscore for TextServer extension, add macros to generate wrappers for module functions.
2022-09-28 12:12:29 +02:00
bruvzg
8f5d56e04a
[GDExtension] Use function names with underscore for TextServer extension, add macros to generate wrappers for module functions. 2022-09-28 10:04:11 +03:00
kobewi
52b20ce909 Use 64bit integers in utility methods 2022-09-28 02:26:37 +02:00
Rémi Verschelde
92bcd3c01d Merge pull request #66505 from KoBeWi/floor()_and_int()_are_not_the_same_I_guess🤔
Fix wrong `floori()` behavior
2022-09-28 00:16:24 +02:00
Rémi Verschelde
9dc5684fab Merge pull request #66504 from KoBeWi/hermit_method
Make some File/Dir methods private
2022-09-28 00:16:16 +02:00
Rémi Verschelde
b33460c6ca Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@81ddc73d17
2022-09-27 23:48:25 +02:00
kobewi
7499f41264 Fix wrong floori() behavior 2022-09-27 19:09:34 +02:00
kobewi
a316401b99 Make some File/Dir methods private 2022-09-27 17:35:52 +02:00
Rémi Verschelde
52aae6d4f1 Merge pull request #66447 from akien-mga/gcc-ubsan-silence-Wmaybe-uninitialized
Silence GCC `-Wmaybe-uninitialized` caused by UBSAN
2022-09-27 10:04:19 +02:00
nikitalita
af548ee8e9 Fix FileAccessZip() causing a stack overflow 2022-09-26 20:47:00 -07:00
Rémi Verschelde
39facb35a0 SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.

New `target` presets
====================

The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:

- `editor`: Replaces `tools=yes target=release_debug`.
  * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
  * Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
  * Defines: `-O3`/`/O2`

New `dev_build` option
======================

The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:

- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
  enables generating debug symbols, does not define `NDEBUG` so `assert()`
  works in thirdparty libraries, adds a `.dev` suffix to the binary name.

Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.

Changed binary names
====================

The name of generated binaries and object files are changed too, to follow
this format:

`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`

Be sure to update your links/scripts/IDE config accordingly.

More flexible `optimize` and `debug_symbols` options
====================================================

The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:

`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-26 16:31:46 +02:00
Rémi Verschelde
f8b0b17634 MethodBind: Silence GCC -Wmaybe-uninitialized caused by UBSAN
A priori this doesn't appear to be an actual bug, but a known consequence of
using UBSAN. We silence this one to still have the possibility to get more
warnings raised by UBSAN, in case they are useful.

Works around and closes #66343.
2022-09-26 16:05:40 +02:00
Rémi Verschelde
926c1127e9 Merge pull request #66435 from akien-mga/style-header-guards-cleanup
Cleanup header guards for consistency
2022-09-26 15:48:56 +02:00
Rémi Verschelde
49fcf4ffad Style: Cleanup header guards for consistency
Fix file names for {Static,Lightmap}RaycasterEmbree.
2022-09-26 13:51:17 +02:00
Yuri Rubinsky
e7e1f84854 Fix processing of some types in math_fieldwise.cpp/fieldwise_assign 2022-09-26 13:22:49 +03:00
Rémi Verschelde
f3d763011f Merge pull request #63109 from OverloadedOrama/fix-input-event-action
Fix `InputEventAction`'s `is_match` method ignoring `exact_match` parameter
2022-09-25 11:06:38 +02:00
Andy Maloney
49ff3d5489 Remove unused includes & move some includes to top of file 2022-09-23 19:06:31 -04:00
Rémi Verschelde
26e9145c26 SCons: Cleanup DEBUG, _DEBUG and NDEBUG defines
- `_DEBUG` is MSVC specific so it didn't make much sense to define for
  Android and iOS builds.
- iOS was the only platform to define `DEBUG`. We don't use it anywhere
  outside thirdparty code, which we usually don't intend to debug, so it
  seems better to be consistent with other platforms.
- Consistently define `NDEBUG` to disable assert behavior in both `release`
  and `release_debug` targets. This used to be set for `release` for all
  platforms, and `release_debug` for Android and iOS only.
- Due to the above, I removed the only use we made of `assert()` in Godot
  code, which was only implemented for Unix anyway, should have been
  `DEV_ENABLED`, and is in PoolAllocator which we don't actually use.
- The denoise and recast modules keep defining `NDEBUG` even for the `debug`
  target as we don't want OIDN and Embree asserting all over the place.
2022-09-23 15:21:26 +02:00
Rémi Verschelde
006e345695
Merge pull request #65817 from bruvzg/typed_array 2022-09-23 10:24:46 +02:00
Rémi Verschelde
ee95cc0b79 Merge pull request #66177 from rburing/callable_callv
add `callv` method
2022-09-23 09:45:02 +02:00
Rémi Verschelde
300ea8602c Merge pull request #66260 from lawnjelly/fix_bvh_array_warning
Fix array-bounds warning in BVH
2022-09-23 09:42:58 +02:00
Rémi Verschelde
ca88b23a3b Merge pull request #66248 from akien-mga/warnings-gcc-Wmaybe-uninitialized
Fix various -Wmaybe-uninitialized warnings from GCC 12.2.1
2022-09-23 09:42:53 +02:00
Rémi Verschelde
414dd3a257 Merge pull request #66246 from Jummit/fix-dir-crash
Fix crash when listing files in nonexistent directory
2022-09-23 09:41:59 +02:00
bruvzg
163257d51b
[GDExtension] Implement support for typed arrays. 2022-09-22 23:31:27 +03:00
lawnjelly
91d252c697 Fix array-bounds warning in BVH
Provides a workaround to prevent tripping a compiler warning.
2022-09-22 16:06:25 +01:00
Rémi Verschelde
d1a155e3cd Fix various -Wmaybe-uninitialized warnings from GCC 12.2.1
Not sure why I didn't get those before, it may be due to upstream
changes (12.2.1 is a moving target, it's basically 12.3-dev), or simply
rebuilding Godot from scratch with different options.
2022-09-22 11:29:48 +02:00
Jummit
2175e38dfb Fix crash when listing files in nonexistent directory 2022-09-22 09:54:19 +02:00
Rémi Verschelde
d96b7d767a Merge pull request #66110 from Zylann/reference_get_count
get_reference_count()`
2022-09-22 08:26:29 +02:00
Marc Gilleron
474cee7daf Rename and expose RefCounted::get_reference_count() 2022-09-21 21:18:54 +01:00
Rémi Verschelde
0b06f8b0bd Merge pull request #65816 from bruvzg/proj_settings_missing_flags
Add missing initial window flags and window mode to the project settings.
2022-09-21 18:56:31 +02:00
Rémi Verschelde
85a46d36b5 Merge pull request #66096 from 4d49/decompose-polygon-in-convex
Add method bind for `Geometry2D.decompose_polygon_in_convex`
2022-09-21 13:26:08 +02:00
Rémi Verschelde
5408af1407 Style: Ensure consistent formatting with clang-format 15
When going from version 14 to 15 it would introduce a tiny change in
`websocket_macros.h` just before the comment re-enabling clang-format,
but this can be solved by just letting it do its work.

Bonus cosmetic change in `math_fieldwise.cpp` where clang-format isn't
used, and bump recommended versions for pre-commit hook to [13; 15].
2022-09-21 12:48:58 +02:00
Rémi Verschelde
e9ad0fd190 Merge pull request #66181 from touilleMan/extension_api_dump-correct-keyed
Fix is_keyed param in extension_api.json
2022-09-21 11:06:20 +02:00
Ricardo Buring
0c2055d15d Callable: add callv method
This method can be called from GDExtension.
2022-09-21 08:25:48 +02:00
Mansur Isaev
623e23c625 Add method bind for Geometry2D.decompose_polygon_in_convex 2022-09-21 09:40:03 +04:00
Clay John
c8a0912f36
Merge pull request #66184 from touilleMan/gdnative_interface-fix-hash-mismatch-error-print
Fix hash mismatch error print in gdextension's gdnative_classdb_get_method_bind
2022-09-20 20:27:04 -07:00
Emmanuel Leblond
2ee951cef5
Fix hash mismatch error print in gdextension's gdnative_classdb_get_method_bind 2022-09-21 00:41:48 +02:00
Rémi Verschelde
160e0a45b7
Merge pull request #66117 from RedMser/json-parse-recursion
Add recursion depth check to `JSON.stringify/parse`
2022-09-21 00:19:32 +02:00
Emmanuel Leblond
b7c3bbc627
Fix is_keyed param in extension_api.json 2022-09-21 00:14:53 +02:00
Rémi Verschelde
ae2d9be0fe
Merge pull request #63740 from Faless/net/4.x_http_request_decompress
[HTTP] Implement streaming decompression.
2022-09-20 22:29:16 +02:00
Fabio Alessandrelli
273ba0794f [IO] Add StreamPeerGZIP for streaming compression/decompression.
Putting data results in writing the compressed/decompressed output into
a RingBuffer.
You can retrieve the content of the RingBuffer via get_data.

Support both gzip and deflate.
2022-09-20 18:39:10 +02:00
Rémi Verschelde
d8d10c30d0 Merge pull request #60408 from KoBeWi/statically_typed_directories
Introduce more static methods to directory API
2022-09-20 15:36:49 +02:00
Rémi Verschelde
a23ba42f98 Merge pull request #63594 from Faless/img/4.x_loader_ext
[Core] Make ImageFormatLoader extensible.
2022-09-20 15:36:32 +02:00
kobewi
cad1d27a6f Introduce more static methods to directory API 2022-09-20 14:22:45 +02:00
Rémi Verschelde
7da532275b Merge pull request #65541 from clayjohn/renderer-setting
Split rendering driver project setting into renderer_name and rendering_driver
2022-09-20 09:43:59 +02:00
Fabio Alessandrelli
e8fc6bfeb5 [Core] Make ImageFormatLoader extensible. 2022-09-20 02:01:57 +02:00
Aaron Franke
50fb0220ca
Define AXIS_COUNT in all vector types 2022-09-19 17:50:35 -05:00
Aaron Franke
436dcb3286
Remove set_all methods from Vector2/3/4 2022-09-19 15:08:50 -05:00
Aaron Franke
fd8bd27657
Remove set_axis and get_axis methods from Vector2/2i/3/3i/4/4i 2022-09-19 15:08:50 -05:00
clayjohn
4a1c7de57c Split rendering driver project setting into renderer_name and rendering_driver. To differentiate between a driver (e.g. Vulkan or D3D12) and a renderer (e.g. clustered or mobile renderer). 2022-09-19 10:26:10 -07:00
RedMser
de3b1c3fca Add recursion depth check to JSON stringify/parse 2022-09-19 18:22:55 +02:00
Rémi Verschelde
ec60c4ee9e Merge pull request #65271 from KoBeWi/FirAccess🌲
Replace File/Directory with FileAccess/DirAccess
2022-09-19 15:33:24 +02:00
Rémi Verschelde
4ebf7d14ac Merge pull request #66079 from Zylann/project_settings_restart
Expose ProjectSettings.set_restart_if_changed(name, restart)
2022-09-19 15:33:11 +02:00
Rémi Verschelde
2d01768618 Merge pull request #66097 from Zylann/make_atlas_vec2i
make_atlas`
2022-09-19 15:32:28 +02:00
Rémi Verschelde
1be4f4b69f Merge pull request #66081 from aaronfranke/math-funcs-spacing
Spacing changes in math_funcs.h
2022-09-19 15:31:53 +02:00
Marc Gilleron
2a8aeddc93 Expose ProjectSettings.set_restart_if_changed(name, restart) 2022-09-19 13:57:07 +01:00
Marc Gilleron
700bb066e0 Use Vector2i when returning atlas size in Geometry2D::make_atlas 2022-09-19 11:37:02 +01:00
bruvzg
d104a4cdbd
Add missing initial window flags and window mode to the project settings. 2022-09-19 12:30:10 +03:00
kobewi
9f2dc68279 Replace File/Directory with FileAccess/DirAccess 2022-09-19 11:03:31 +02:00
Aaron Franke
300fc5e39a
Spacing changes in math_funcs.h 2022-09-19 02:22:50 -05:00
kobewi
b3997191d8 Change UndoRedo to use Callables 2022-09-18 23:52:50 +02:00
Rémi Verschelde
c6e5c76536 Merge pull request #65561 from ryburnj/inconsistent-cap-scene-file-name
Fix inconsistent scene file name casing
2022-09-18 10:49:00 +02:00
ryburnj
9d6af9323a Fix inconsistent scene file name casing by moving existing Name_Casing code to separate function in editor_node, and adding a call from both editor_node and scene_tree_dock. 2022-09-18 11:17:22 +10:00
bruvzg
ec8084d87f
HarfBuzz: Update to version 5.2.0, add new Unicode 15 blocks and scripts. 2022-09-17 23:19:11 +03:00
MJacred
ac9786c525 Add get_distribution_name() and get_version() to OS
supports: LinuxBSD, Windows, macOS, iOS, Android, UWP

Co-authored-by: bruvzg
2022-09-16 11:17:36 +02:00
Rémi Verschelde
d1b2a191ab
Merge pull request #65295 from reduz/json-as-resource 2022-09-16 10:58:01 +02:00
Rémi Verschelde
a981a8061f Merge pull request #65325 from TokageItLab/refactor-variant-for-anim
Move some static methods to `Animation` from `Variant` for refactoring `Animation` and `Tween`
2022-09-16 09:20:50 +02:00
Rémi Verschelde
dbd757f479 Merge pull request #65760 from Mickeon/try-vformat-var-args
Use variadic template in `vformat()` (allow more than 5 arguments)
2022-09-15 20:11:19 +02:00
Micky
0715250ae4 Use variadic template in vformat()
Allows `vformat()` to take more than 5 arguments. as well as being a general optimisation that avoids redundant empty Variant checks.
2022-09-14 23:55:34 +02:00
Silc Renew
9d47e079b7 Move some methods to Animation from Variant for refactoring 2022-09-15 04:52:43 +09:00
fabriceci
9f1a57d48b Test, refactor and fix a bug in Basis.get_axis_angle 2022-09-14 12:05:22 +02:00
Fabio Alessandrelli
8b5bb7eeea [OS] Expose get_stdin_string to Scripting.
Exposed as read_string_from_stdin so it's clear it's not retrieving a
property.
The method is kept with the block parameter, but a note is added to the
docs specifying that is not implemented on any platform (should we just
remove it?).
2022-09-13 18:37:11 +02:00
Rémi Verschelde
ff824b6f9d Merge pull request #65509 from gotnospirit/master-os-get_datetime
get_datetime_* functions can return wrong values
2022-09-13 11:01:12 +02:00
Rémi Verschelde
fefa3e9419
Merge pull request #65688 from Chaosus/fix_astargrid_heuristic 2022-09-12 13:26:20 +02:00
Yuri Rubinsky
533e3669e7 Fix incorrect heuristic order in AStarGrid2D 2022-09-12 13:16:46 +03:00
SaracenOne
cc4bda8500 Add ability to flag classes as experimental or deprecated. 2022-09-11 00:11:33 +01:00
James
0aecfc9254 Fixes #65377: get_datetime_* functions can return wrong values 2022-09-10 07:58:38 +08:00
Rémi Verschelde
24ce46e2a1
Merge pull request #64938 from YuriSizov/editor-scaled-icons 2022-09-09 16:52:32 +02:00
Haoyu Qiu
f5760ed65d Fix parsing of XML CDATA and add test cases 2022-09-09 09:42:24 +08:00
Rémi Verschelde
69233093d7 Merge pull request #65241 from bruvzg/no_keymap_ambiguity
Fix key mapping changes when moving from macOS to other platform.
2022-09-08 09:24:24 +02:00
Fabio Alessandrelli
a95d792420 [Net] Rename "ssl" references to "tls" in methods and members. 2022-09-08 03:24:23 +02:00
Yuri Sizov
817d4db21f Allow images to be imported "for editor use" and respect editor settings 2022-09-07 23:31:31 +03:00
bruvzg
6f4d233062
Fix key mapping changes when moving from macOS to other platform
Removes separate `Command` key (use `Meta` instead).
Adds an event flag to automatically remap `Command` <-> `Control` (cannot be set alongside `Control` or `Meta`).
2022-09-07 18:45:35 +02:00
Rémi Verschelde
61644f1dbe Merge pull request #65447 from Faless/net/4.x_ssl_to_tls
[Net] Rename StreamPeerSSL to StreamPeerTLS.
2022-09-07 09:19:46 +02:00
Rémi Verschelde
5c5079b398 Merge pull request #65197 from Mickeon/rename-connect-one-shot
Rename CONNECT_ONESHOT to CONNECT_ONE_SHOT
2022-09-07 08:51:10 +02:00
Fabio Alessandrelli
528e791a5f [Net] Rename StreamPeerSSL to StreamPeerTLS.
SSL has been deprectated almost 10 years ago.
2022-09-07 07:38:50 +02:00
Micky
9e284f68ec Prevent HTTPRequest from polling invalid client 2022-09-06 20:49:49 +02:00
Micky
dd26ecdd31 Rename CONNECT_ONESHOT TO CONNECT_ONE_SHOT
For consistency. Every other exposed `one_shot` is spaced out like this.
2022-09-06 19:00:33 +02:00
Rémi Verschelde
5062aafc2d Merge pull request #64417 from aaronfranke/has-space
Replace AABB/Rect2/Rect2i has_no_* methods with has_* methods
2022-09-06 17:00:44 +02:00
Rémi Verschelde
f40755383e Merge pull request #65361 from Mickeon/rename-range-lerp
Rename `range_lerp` to `remap`
2022-09-06 17:00:37 +02:00
Micky
b6daad8d4b Rename range_lerp to remap 2022-09-06 07:19:20 +02:00
Andres Hernandez
9054399900 Updated gamecontrollerdb.txt to latest to include new mappings for various controllers, including Xbox One, Nintendo Switch, Steam Deck, and 8BitDo 2022-09-05 22:14:59 -07:00
Rémi Verschelde
48cfa0da70
Merge pull request #65282 from Faless/fix/4.x_arm32_detect 2022-09-05 14:11:21 +02:00
Rémi Verschelde
9f2e907bac Merge pull request #65323 from timothyqiu/variant-wild
Fix crash when encoding freed object in `ConfigFile`
2022-09-05 08:27:50 +02:00
Aaron Franke
995b9f94e8
Replace Rect2(i) has_no_area with has_area 2022-09-04 23:03:36 -05:00
Aaron Franke
817ae95667
Replace AABB has_no_volume with has_volume
Also replace has_no_surface with has_surface
2022-09-04 23:03:36 -05:00
Aaron Franke
058ac331b0
Minor fixes to Vector4 2022-09-04 20:38:44 -05:00
Juan Linietsky
2b428daf2b Treat JSON as resource files.
This makes the files ended in ".json" be treated as Godot resources.
This solves two problems:
* Avoid extensions to implement their own handling, which results in conflicts (all must use this one).
* Allow code to still work opening it as a file (since it will not be imported).
2022-09-04 14:01:41 +02:00
Haoyu Qiu
3c0759608a Fix crash when encoding freed object in ConfigFile 2022-09-04 19:56:37 +08:00
Fabio Alessandrelli
6baf530bcb Fix arm32 detection in Engine.
The `__ARM_ARCH_7A__` and `__ARM_ARCH_7S__` are not enough, since they
do not cover e.g. `__ARM_ARCH_8A__` in 32 bit mode, so instead of trying
to cover any possible ARM version that can work in 32 bit mode, we
can replace it with the `__arm__` macro which is defined for arm32 only
(arm64 uses `__aarch64__`).
2022-09-03 13:41:59 +02:00