Commit Graph

7695 Commits

Author SHA1 Message Date
bruvzg
76164c2aa9
[OS] Add functions to determine standard I/O device type. 2024-11-06 13:33:38 +02:00
nikitalita
95d2909474 Fix missing resource properties being dropped on save 2024-11-05 11:53:29 -06:00
Danil Alexeev
e379cc76e5
Core: Fix Callable.get_bound_arguments{,_count}() return incorrect data 2024-11-04 22:41:56 +03:00
Thaddeus Crews
bb5f390fb9
Style: Apply clang-tidy fixes (superficial)
• `modernize-use-bool-literals`, `modernize-use-nullptr`, and `readability-braces-around-statements`
2024-11-04 12:11:14 -06:00
Thaddeus Crews
89a311205f
Style: Apply clang-tidy fixes
• `modernize-use-default-member-init` and `readability-redundant-member-init`
• Minor adjustments to `.clang-tidy` to improve syntax & remove redundancies
2024-11-04 12:11:06 -06:00
Pedro J. Estébanez
fe21913ee8 ResourceLoader: Report error if resource type unrecognized
Co-authored-by: Summersay415 <summersay415@gmail.com>
2024-11-04 09:49:37 +01:00
bruvzg
2d66988f99
[GDExtension] Improve macOS library loading/export. 2024-11-04 09:28:30 +02:00
BlueCube3310
80a9c0d569 Clean up Image 2024-11-01 21:32:16 +01:00
Thaddeus Crews
c6c464cf9a
Merge pull request #98679 from Bromeon/qol/rename-static-call
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
🔗 GHA / 🪲 Godot CPP (push) Has been cancelled
Rename `ClassDB::class_call_static_method` -> `class_call_static`
2024-10-31 20:14:44 -05:00
Thaddeus Crews
363c0b5fec
Merge pull request #47502 from KoBeWi/add_0
Always add decimal when converting float to string
2024-10-31 20:14:39 -05:00
Thaddeus Crews
163bf94d04
Merge pull request #98091 from AThousandShips/improve_err_prints_core
[Core] Improve error messages with `vformat`
2024-10-31 20:14:36 -05:00
Nazarii
d1dc7afdd5 Fix capture_cache.animation was not cached 2024-10-31 19:26:02 +02:00
Jan Haller
a025ceddc0 Rename ClassDB::class_call_static_method -> class_call_static 2024-10-30 19:07:28 +01:00
A Thousand Ships
38f9769bc6
[Core] Improve error messages with vformat 2024-10-30 15:55:51 +01:00
Michael Alexsander
16524a8a01
Add "Game" editor for better runtime debugging 2024-10-30 11:42:17 -03:00
Thaddeus Crews
a8931f1aa9
Merge pull request #98652 from stuartcarnie/2d_texture_state_fixes
2D: Fix various issues and minor performance optimisations
2024-10-29 19:25:54 -05:00
Thaddeus Crews
b8f626a0e1
Merge pull request #65962 from 4d49/format-object
Add `Object` support for `String.format`
2024-10-29 19:25:45 -05:00
Thaddeus Crews
b7a0971ad2
Merge pull request #97934 from adamscott/give-AThousandShips-a-break
[Codestyle] Set clang-format `RemoveSemicolon` rule to `true`
2024-10-29 19:25:36 -05:00
Stuart Carnie
0d1d945727
2D: Fix various issues and minor performance optimisations 2024-10-30 08:36:45 +11:00
Mansur Isaev
98c89f17c4 Add Object support for String.format 2024-10-29 22:27:33 +01:00
Clay John
748f4079e3
Merge pull request #96439 from darksylinc/matias-TheForge-pr03-rebased
Add Swappy & Pre-Transformed Swapchain
2024-10-29 12:34:40 -07:00
Matias N. Goldberg
aaa0e2fddf Add Swappy & Pre-Transformed Swapchain
- Adds Swappy for Android for stable frame pacing
- Implements pre-transformed Swapchain so that Godot's compositor is in
charge of rotating the screen instead of Android's compositor
(performance optimization for phones that don't have HW rotator)

============================

The work was performed by collaboration of TheForge and Google. I am
merely splitting it up into smaller PRs and cleaning it up.

Changes from original PR:

- Removed "display/window/frame_pacing/android/target_frame_rate" option
to use Engine::get_max_fps instead.
- Target framerate can be changed at runtime using Engine::set_max_fps.
- Swappy is enabled by default.
- Added documentation.
- enable_auto_swap setting is replaced with swappy_mode.
2024-10-28 18:55:37 -03:00
Adam Johnston
3ac043c508 Add fuzzy string matching to quick open search
Co-authored-by: sam <samsface@gmail.com>
2024-10-28 11:24:36 -07:00
Haoyu Qiu
f451997666 Fix duplicated entries in TranslationServer::get_loaded_locales() 2024-10-26 15:10:43 +08:00
Thaddeus Crews
edad871a2d
Merge pull request #98425 from darksylinc/matias-breadcrumbs-race-fix
Fix race conditions in breadcrumbs
2024-10-25 13:04:12 -05:00
Thaddeus Crews
d3298fe738
Merge pull request #98395 from Repiteo/core/char-range-utils-update
Core: Update `char_range.inc` to Unicode 16
2024-10-25 13:04:07 -05:00
Thaddeus Crews
02088ab44c
Merge pull request #74714 from dalexeev/expose-bresenham-line
Expose `Geometry2D.bresenham_line()` method
2024-10-25 13:04:05 -05:00
Thaddeus Crews
6e9907d483
Merge pull request #92554 from Nazarwadim/implement_a_hash_map
Implement array based hash map `AHashMap`
2024-10-25 13:03:45 -05:00
Adam Scott
0d350e7108
Set clang-format RemoveSemicolon rule to true
- Set clang-format `Standard` rule to `c++20`
2024-10-25 13:49:43 -04:00
Danil Alexeev
9f0ae21095
Expose Geometry2D.bresenham_line() method
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-10-25 10:27:55 +03:00
Clay John
f83a27353f
Merge pull request #98318 from alexkar598/mouse_emulation
Fix mouse emulation always sending events to the main window
2024-10-24 20:37:55 -07:00
Clay John
33db590947
Merge pull request #98357 from yeojunh/valid-base-check-num-int64-uint64
Core: Fix String::num_int64(), uint64 for valid base check
2024-10-24 19:41:43 -07:00
Clay John
b4ba0f983a
Merge pull request #98363 from dustdfg/rid_in_operator_fix
Allow using RID with `in` operator for Arrays and Dictionaries
2024-10-24 19:04:41 -07:00
Clay John
a9e5850681
Merge pull request #98493 from KoBeWi/tfw_you_trade_CLASH_for_a_CRASH
Fix InputEvent crash when opening project
2024-10-24 18:38:58 -07:00
nazarii
76208f7155 Implement array based hash map 2024-10-24 21:34:12 +03:00
Thaddeus Crews
d8aa32dccd
Merge pull request #97868 from timothyqiu/po-loader
Fix "No loader found" error after editing PO file
2024-10-24 13:22:54 -05:00
kobewi
abb9c0f171 Fix InputEvent crash when opening project 2024-10-24 17:05:05 +02:00
Haoyu Qiu
1b4f6f6bfa DirAccessPack: Fix file_exists and dir_exists in exported projects 2024-10-24 14:26:36 +08:00
kobewi
5c0f2414cd Always add decimal when printing float 2024-10-23 15:00:21 +02:00
Matias N. Goldberg
668c9b74e2 Fix race conditions in breadcrumbs
Adds "--accurate-breadcrumbs" CLI command

Additionally, leave out breadcrumbs code in non-debug, non-dev builds.
Fix regression introduced in #98388 where command_insert_breadcrumb() is
called even in non-debug builds.

Fixes #98338
2024-10-22 22:08:46 -03:00
Thaddeus Crews
a4ed24acef
Merge pull request #98041 from Hilderin/fix-lost-gdextensions-on-startup
Fix loss of gdextension on editor startup
2024-10-21 16:39:30 -05:00
Thaddeus Crews
7dbea98c49
Merge pull request #97005 from Repiteo/core/window-corner-style
Core: Add `DisplayServer` flag for sharp corners
2024-10-21 16:39:25 -05:00
Thaddeus Crews
291e4b78e2
Merge pull request #98237 from dustdfg/os_transitive_image_headers_refactor
Don't include `core/io/image.h` in `core/os/os.h`
2024-10-21 16:39:15 -05:00
Thaddeus Crews
b6547b0d06
Merge pull request #98236 from timothyqiu/locale-compare-cache-4.x
Cache results for `TranslationServer.compare_locales()`
2024-10-21 16:39:14 -05:00
Thaddeus Crews
ecc2eb73fc
Merge pull request #97707 from Sauermann/fix-input-device-clash
Fix `InputEvent` device id clash
2024-10-21 16:39:10 -05:00
Thaddeus Crews
5fb22327ee
Merge pull request #97542 from AThousandShips/dict_sort_fix
[Core] Fix sorting of `Dictionary` keys
2024-10-21 16:39:05 -05:00
Thaddeus Crews
ab72082fa2
Core: Update char_range.inc to Unicode 16 2024-10-21 14:54:19 -05:00
Yevhen Babiichuk (DustDFG)
ee5d90853f Allow use RID with in operator for Arrays and Dictionaries
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2024-10-21 11:50:41 +03:00
Hilderin
fbd1643176 Fix lost of gdextension on editor startup.
Co-authored-by: NetroScript <noreply@enostrion.com>"
2024-10-20 18:39:31 -04:00
Markus Sauermann
916d480686 Fix InputEvent device id clash
`InputMap::ALL_DEVICES` and `InputEvent::DEVICE_ID_EMULATION` have the
same value `-1`.

Change value of `InputMap::All_DEVICES` so that it's different from
`InputEvent::DEVICE_ID_EMULATION`. `InputEvent::DEVICE_ID_EMULATION`
is part of the API and can't be changed without potentially breaking
projects.

Gather all special device constants in a single location inside
`InputEvent`.

Add a converter to project settings, that takes care of adjusting
project files during loading.
2024-10-20 21:56:41 +02:00
yeojunh
b3b24ded19 Add checks for valid base in String::num_int64, uint64().
- Ensure String::num_int64, uint64 returns an empty string for bases less than 2 or greater than 36.
- Added corresponding test cases to verify the behavior.
- Error messages are printed when invalid bases are encountered. These messages are suppressed in the test output.
2024-10-20 00:22:08 -07:00
alexkar598
fd6138ed7e Fixes window_id being erased when emulating mouse events from touch events 2024-10-18 15:37:39 -04:00
Thaddeus Crews
f8c4a683d7
Core: Add DisplayServer flag for sharp corners 2024-10-18 11:20:21 -05:00
Yevhen Babiichuk (DustDFG)
af6d260c17 Don't include core/io/image.h in core/os/os.h
`core/os/os.h` doesn't use `core/io/image.h`. It just brings
transitive dependencies. Lots of dependencies because `core/os/os.h`
is transitively included in almost every file of godot

Also added `core/io/image.h` into files^1 where `Ref<Image>` and `core/os/os.h`
were used to prevent obscure errors involving `Ref<Image>`

^1 except those which include `core/io/image_loader.h` or `core/io/image.h` by
corresponding .h file with the same name

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-10-18 19:04:19 +03:00
A Thousand Ships
79f654ced5
[Core] Fix sorting of Dictionary keys
`StringName` keys were sorted as `StringName` which is unstable.
2024-10-18 08:47:05 +02:00
Haoyu Qiu
f61fe2799c Don't pseudolocalize empty strings 2024-10-17 10:30:17 +08:00
Haoyu Qiu
acab2d6c1c Cache results for TranslationServer.compare_locales() 2024-10-16 20:54:56 +08:00
Hunter Loftis
bbb8c1703b Fix freeze on non-thread-safe custom importers 2024-10-15 11:46:14 -04:00
Thaddeus Crews
a1e768c508
Merge pull request #97295 from BlueCube3310/betsy-bc4
Betsy: Implement BC4 compression
2024-10-14 14:09:56 -05:00
Thaddeus Crews
9d5a7321a5
Merge pull request #95175 from KoBeWi/bruh_can_revert
Fix implementation of `property_can_revert()` in various classes
2024-10-10 18:13:16 -05:00
Ricardo Buring
9652695f6f Restore arc_tolerance value when using Clipper2's InflatePaths
This was missed when upgrading from Clipper to Clipper2.
2024-10-09 14:13:23 +02:00
Gergely Kis
257633c354 Make TranslationServer singleton variable inline.
This change avoids the problem known as 'Static Initialization Order Fiasco' (SIOF).

See the following PR for more explanation: https://github.com/godotengine/godot/pull/94683

Co-authored-by: Gabor Koncz <gabor.koncz@migeran.com>
2024-10-07 13:47:42 +02:00
Juan
e05d5b8813 Provide a reliable way to see original resources in a directory
When exporting a project, resources are often moved, converted or
remapped (source import files are gone, text scenes are converted to binary,
etc).

This new function allows to list a directory and obtain the actual original
resource files.

Example

```GDScript
var resources = ResourceLoader.list_directory("res://images")
print(resources)
```
Result will be something like:
```
["image1.png","image2.png","image3.png"]
```
instead of
```
["image1.png.import","image2.png.import","image3.png.import"]
```
2024-10-07 09:47:22 +02:00
Haoyu Qiu
33d9b40386 Fix "No loader found" error after editing PO file
PO files used to be loaded as simple `Translation` resources. We later
added a dedicated `TranslationPO` resource for it. But the loader still
thinks it can only handle `Translation` resources, so it refuses to load
the updated `TranslationPO` resource.
2024-10-06 12:22:20 +08:00
kobewi
b9d25580ce Fix implementation of property_can_revert() in various classes 2024-10-04 23:02:04 +02:00
bruvzg
794920b1ff
Partially revert 96780, remove warnings from project/editor settings _get. 2024-10-04 19:13:03 +03:00
Rémi Verschelde
6c15d59154
Merge pull request #97362 from reduz/make-unique-scene-id-deterministic
Make internal unique scene resource ID deterministic
2024-10-04 17:18:10 +02:00
Rémi Verschelde
4dd812f2ed
Merge pull request #97119 from dsnopek/gdextension-object-instance-id
GDExtension: Allow directly getting `ObjectID` from `Variant`
2024-10-04 17:18:06 +02:00
Rémi Verschelde
8e6ade8708
Merge pull request #97465 from DarioSamo/lock-free-rid
Make `RID_Owner` lock-free for fetching.
2024-10-04 11:21:38 +02:00
Rémi Verschelde
05b519fafb
Merge pull request #96230 from timothyqiu/per-domain-pseudolocalization
Move pseudolocalization into `TranslationDomain`
2024-10-04 11:21:18 +02:00
Aaron Franke
a7f6ec0e4c
Add a sort method to Dictionary and HashMap 2024-10-02 14:26:33 -07:00
Rémi Verschelde
86b1514bf5
Merge pull request #97550 from AThousandShips/hash_fix
[Core] Add missing `HashMapComparatorDefault` cases
2024-10-02 15:01:09 +02:00
Rémi Verschelde
336d91551d
Merge pull request #97281 from reptofrog/deadzone-new-default
Input: Change the default deadzone value for new actions from 0.5 to 0.2
2024-10-02 15:01:02 +02:00
Rémi Verschelde
9ce149c7a3
Merge pull request #93299 from rune-scape/fix-ref
Fix RefCounted releasing early and not clearing reference
2024-10-02 15:00:47 +02:00
Rémi Verschelde
79804a8e77
Merge pull request #97647 from KoBeWi/yearly_REPL_pull_request
Add expression evaluater to debugger (REPL)
2024-10-01 17:31:31 +02:00
Rémi Verschelde
3b17e3470a
Merge pull request #97532 from kisg/use_loader_library_check
GDExtension: Use loader to check if the library exists.
2024-10-01 17:31:14 +02:00
Rémi Verschelde
cf1d910e10
Merge pull request #92237 from timothyqiu/url-fragment
String: Parse fragment from URL
2024-10-01 17:30:16 +02:00
kobewi
645abdbb80 Add expression evaluater to debugger (REPL)
Co-authored-by: rohanrhu <rohanrhu2@gmail.com>
2024-10-01 15:36:09 +02:00
Roman Morozov
d532eecc81 Changed the default deadzone value for new actions from 0.5 to 0.2 2024-10-01 16:47:44 +04:00
Gergely Kis
8a41b1d90f GDExtension: Use loader to check if the library exists. 2024-09-29 07:38:45 +02:00
Wenqiang
9a94353fa3 Added support for 'print' command in local (command line -d) debugger 2024-09-28 13:28:07 -07:00
A Thousand Ships
75cb3539b1
[Core] Add missing HashMapComparatorDefault cases
Added for:
* `AABB`
* `Basis`
* `Color`
* `Plane`
* `Projection`
* `Quaternion`
* `Rect2`
* `Transform2D`
* `Transform3D`
* `Vector4`

Ensures these handles `NaN` correctly
2024-09-28 17:58:49 +02:00
Danil Alexeev
85dfd89653 Add @export_tool_button annotation for easily creating inspector buttons
Co-authored-by: jordi <creptthrust@gmail.com>
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
Co-authored-by: Mack <86566939+Macksaur@users.noreply.github.com>
2024-09-27 22:24:15 +01:00
Rémi Verschelde
83b2ca3107
Merge pull request #95930 from aaronfranke/bind-array-set
Bind Array and Packed*Array `get` and `set` functions
2024-09-27 13:53:19 +02:00
Rémi Verschelde
8a9a26ef19
Merge pull request #93311 from dsnopek/gdextension-required-virtuals
GDExtension: Mark virtual function as `is_required` in `extension_api.json`
2024-09-27 13:53:16 +02:00
Haoyu Qiu
6516ca6b11 Parse fragment from URL 2024-09-27 19:42:30 +08:00
Aaron Franke
cc9f2b58a0
Bind Array get and set functions 2024-09-26 13:00:17 -07:00
Lukas Tenbrink
e117ed9cd4
Rename Vector4.components -> coord 2024-09-26 14:02:00 +02:00
Rémi Verschelde
a4c1804cab
Merge pull request #97483 from akien-mga/clang-format-19.1.0
CI: Update `clang-format` pre-commit hook to 19.1.0
2024-09-26 12:46:04 +02:00
Rémi Verschelde
2912cb9975
Merge pull request #97118 from mihe/patch-exports
Add ability to export patch packs
2024-09-26 12:45:42 +02:00
Rémi Verschelde
991e6c92ab
Merge pull request #96923 from Repiteo/style/warning-admonition
Style: Add `WARNING:` as new comment admonition
2024-09-26 12:45:38 +02:00
Rémi Verschelde
ef7547384c
Merge pull request #95678 from Hilderin/fix-slow-load-on-large-project-v2
Fix slow editor load on large projects (v2)
2024-09-26 12:45:31 +02:00
Rémi Verschelde
9d5b59b2ae
Merge pull request #94864 from rune-scape/add-missing-method-bind
Add missing CallableCustomMethodPointer for const methods
2024-09-26 12:45:27 +02:00
Rémi Verschelde
c92a6c7e27
CI: Update clang-format pre-commit hook to 19.1.0 2024-09-26 11:46:12 +02:00
Hilderin
21f7c8a25f Fix slow editor load on large projects (v2) 2024-09-25 17:36:39 -04:00
Juan Linietsky
08947d366f Make RID_Owner lock-free for fetching.
This PR makes RID_Owner lock free for fetching values, this should give a very
significant peformance boost where used.

Some considerations:

* A maximum number of elements to alocate must be given (by default 256k).
* Access to the RID structure is still safe given they are independent from addition/removals.
* RID access was never really thread-safe in the sense that the contents of the data are not protected anyway. Each server needs to implement locking as it sees fit.
2024-09-25 15:05:24 -03:00
Mikael Hermansson
d3be030ea6 Add ability to export patch packs
Co-authored-by: Poq Xert <poqxert@poqxert.ru>
2024-09-25 17:07:28 +02:00
Thaddeus Crews
32c83a228d
Style: Add WARNING: as new comment admonition 2024-09-25 09:44:42 -05:00
Thaddeus Crews
9f9ee0c813
SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
kobewi
7aef30c2a8 Discard additional redo on commiting actions 2024-09-24 15:47:55 +02:00