Commit graph

342 commits

Author SHA1 Message Date
FireForge
84431bd782 Use integer types in Image and ImageTexture methods
- Image.blit_rect()
- Image.blit_rect_mask()
- Image.blend_rect()
- Image.blend_rect_mask()
- Image.fill_rect()
- Image.get_used_rect()
- Image.get_rect()
- ImageTexture.set_size_override()
2022-07-18 19:43:32 -05:00
Marcel Admiraal
438b706d43 Fix TextEdit test dependency on SceneTree's initial process time > 0 2022-07-17 08:50:12 +01:00
Rémi Verschelde
1e553e34fb
Merge pull request #62108 from bruvzg/font_config_v3 2022-07-07 12:22:49 +02:00
bruvzg
0c5431644d
Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose. 2022-07-07 11:07:18 +03:00
bruvzg
344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
reduz
5ac42cf576 Implement a BitField hint
Allows to specify the binder that an enum must be treated as a bitfield.
2022-07-05 22:13:37 +02:00
cabinboy1031
7730001390 Implemented tests for Plane getters and setters.
Added tests for intersection and plane-point methods.
2022-07-05 12:55:05 +02:00
bruvzg
860e24683f
Make enum/constant binds 64-bit. 2022-06-17 16:36:26 +03:00
Yuri Rubinsky
7da2a21425 Make AStar to use 64-bit logic 2022-06-16 16:43:41 +03: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
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
Rémi Verschelde
eb9fd57f76 doctest: Update to 2.4.8 2022-05-17 21:53:32 +02:00
Haoyu Qiu
3094e739f5 Create onready variables when dropping nodes and holding Ctrl 2022-05-17 11:51:22 +08: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
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
afc49732ba
Merge pull request #59643 from kneejuicer/geometry2D-tests
Add extra unit tests for Geometry2D
2022-05-10 14:45:36 +02:00
Paweł Fertyk
d1aed90976 Fix backspace when selection reaches left edge
Fixes #60866.
2022-05-09 14:16:28 +02:00
Nicholas Huelin
8409d92282 Fix inconsistent naming in Time 2022-05-05 16:00:37 +02:00
Aaron Franke
fa7a7795f0
Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05: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
5c52b30471
Merge pull request #60529 from timothyqiu/theme-validation 2022-05-02 10:49:14 +02:00
Haoyu Qiu
ad1a8777bd Fix left aligned integer sign in string formatting 2022-05-01 12:42:48 +08:00
Rémi Verschelde
65aacd6b0a
Merge pull request #60519 from nathanfranke/fix-newline-indent
fix lines with ':' that end in comments causing auto indent
2022-04-29 14:08:31 +02:00
Nathan Franke
bdd7b558b6
remove escapes in gdscript test output 2022-04-28 22:21:26 -05:00
Nathan Franke
925e54ad65
fix lines ending in comments causing auto indent 2022-04-28 20:07:10 -05:00
bruvzg
6ab672d1ef Implement text-to-speech support on Android, iOS, HTML5, Linux, macOS and Windows.
Implement TextServer word break method.
2022-04-28 14:35:41 +03:00
Aaron Franke
0ae00a07d6
Rename variable names for some singletons 2022-04-26 22:53:50 -05:00
Rémi Verschelde
e9e2aaf812
Merge pull request #60513 from Calinou/default-font-add-msdf-mipmap
Add MSDF and mipmap generation project settings for the default font
2022-04-26 22:39:55 +02:00
Haoyu Qiu
d8c04cda3a Validate theme type/item names 2022-04-26 19:54:43 +08:00
Hugo Locurcio
43c34bf611
Add MSDF and mipmap generation project settings for the default font
This can be used to improve Label3D and scaled Control appearance
in prototypes.
2022-04-25 16:47:44 +02:00
Paulb23
c1d445f1e5 Add inital TextEdit UnitTests 2022-04-22 21:09:48 +01:00
Paulb23
5e4e4967fe Use Input::push_input for tests plus extra mouse testing 2022-04-22 17:39:12 +01:00
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
bruvzg
9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
Rémi Verschelde
c99a1af0fb Remove unused legacy tests
They haven't been updated for years and still use the old MainLoop
basic framework instead of the new doctest one.

They're of dubious quality and best redone from scratch using the
new framework.
2022-04-07 00:38:44 +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
kneejuicer
113579cec8 Add extra unit tests for Geometry2D 2022-03-29 00:58:55 +02:00
Hugo Locurcio
1c343cd54d Expose Color's to_linear() and to_srgb() to scripting 2022-03-28 12:17:55 +02: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
Yuri Roubinsky
7913e04950 Rename AStar to AStar3D 2022-03-20 17:34:40 +03:00
Rémi Verschelde
5c8bd6fd71
Merge pull request #58233 from bruvzg/gde_ts 2022-03-18 14:29:58 +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
Aaron Franke
89c4990274
Fix Slerp C# docs and add test cases for vectors in the same direction 2022-03-12 13:20:55 -06:00
Rémi Verschelde
26fd6fe2b2
Merge pull request #58485 from aaronfranke/time-offset 2022-03-10 21:13:29 +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
Rémi Verschelde
9b05f29894 Remove unused GDNative code
This has been superseded by GDExtension so this code is no longer useful
nor usable.

There's still some GDNative-related stuff in platform export code which
needs to be adapted for GDExtension (e.g. to include GDExtension libraries
in exports).
2022-03-09 13:59:03 +01: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
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
bruvzg
29199579f7
Add sub-pixel glyph positioning support. 2022-02-12 19:55:52 +02:00