Commit Graph

82 Commits

Author SHA1 Message Date
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
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 5c52b30471
Merge pull request #60529 from timothyqiu/theme-validation 2022-05-02 10:49:14 +02: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 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
bruvzg 29199579f7
Add sub-pixel glyph positioning support. 2022-02-12 19:55:52 +02:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Hugo Locurcio a6e8cdae66
Add a unit test suite for Animation 2022-02-06 21:33:22 +01:00
Rémi Verschelde 5f56d385b0
Core: Move Rect2i to its own `rect2i.h` header
And take the opportunity to improve interdependencies a bit with forward
declares where possible.
2022-02-04 14:17:30 +01:00
Hugo Locurcio 84a69d7429 Improve the default project theme
The new default project theme uses StyleBoxFlat extensively for
a more modern design and better scalability to multiple resolutions.

SVG icons are now used in place of PNG icons. While this does not
allow for true vector-based icon drawing (icons are still rasterized
at load-time), this makes the design work easier for contributors
and opens the door to vector drawing in the future (e.g. with polygons
or SDFs).

Like for editor icons, the SVG header file is now built automatically
when a SVG file is changed. This removing the need for running
`make_header.py` manually (TODO).

The "Use Hidpi" project setting has been removed in favor of a
"Default Theme Scale" project setting, which allows creating the
default theme at a higher/lower scale than the default.
This can be used when designing GUIs with a high base resolution
to ensure crisp visuals.

Co-authored-by: Yuri Sizov <yuris@humnom.net>
2022-01-19 18:46:01 +03:00
Aaron Franke d9506cade1
Add tests for Vector2/Vector2i/Vector3/Vector3i 2022-01-14 01:59:55 -06:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Aaron Franke 99a282f631
Move and organize tests into subfolders 2021-11-07 00:43:31 -06:00
bruvzg 0c0b5c84b0 Implement TextServer GDExtension interface, remove TextServer GDNative interface. 2021-10-01 15:13:29 +03:00
Paulb23 ce064348fa Add CodeEdit breakpoint unit tests 2021-09-01 16:46:04 +01:00
Paulb23 55a20129d6 Create framework for testing Signals 2021-09-01 16:46:04 +01:00
Paulb23 427d3d7207 Allow unit testing SceneTree Ojects 2021-09-01 16:46:04 +01:00
Aaron Franke f64fea1b23
Add Time singleton 2021-06-11 09:32:39 -04:00
jfons f8e34209af Fix some warnings raised by GCC-11.1 2021-05-25 17:23:53 +02:00
Hugo Locurcio 114d556a42
Add a test suite for Vector
This test suite is based on the LocalVector test suite with significant
changes made.
2021-05-19 16:37:39 +02:00
Hugo Locurcio dd51fc77b5
Add a test suite for Translation 2021-05-17 02:02:17 +02:00
Hugo Locurcio 217f1f891b
Add a test suite for Dictionary
Co-authored-by: Sarav Noor Singh <saravnoorsingh@Saravs-MBP.T-mobile.com>
2021-03-31 01:14:18 +02:00
Daniel Kříž f07552ba92 add tests for path3d 2021-03-29 10:13:53 +02:00
Maximilian Mayer f12d205c1f Add unit tests for HashingContext 2021-03-07 20:33:08 +01:00
James Gordon a26d4b1727 Added test file and test cases 2021-02-27 13:16:04 +00:00
Rémi Verschelde 5a10f52ee8
Merge pull request #45914 from HenryWConklin/45841-xml-entities
Add support for numeric XML entities to XMLParser
2021-02-24 13:03:46 +01:00
Hugo Locurcio efd122a99a
Add a test suite for Resource 2021-02-20 19:47:20 +01:00
Sarav Noor Singh dd9c8d85fa
Add a test suite for Array 2021-02-19 17:40:57 +01:00
Henry Conklin c6a911f037 Add support for numeric XML entities to XMLParser
* Add support for decimal numeric entities to String::xml_unescape
* Add more error checks to String::xml_unescape
* Refactor XMLParser to use String::xml_unescape instead of an internal
implementation
2021-02-14 11:00:25 -06:00
Manolis Papadeas 7a918bacca Add a test suite for the Image class 2021-02-06 01:09:02 +02:00
Rémi Verschelde 6ddfc8e718
Merge pull request #44797 from a-ivanov/marshall-core-unit-tests
Marshall core unit tests
2021-01-24 20:41:57 +01:00
Anton Ivanov 8aed1ee8f7
Unit tests for encoding/decoding of base types 2021-01-24 17:15:07 +03:00
AndreaCatania 5ba60c17dd Add function `LocalVector::remove_unordered`
Added LocalVector unit tests.
2021-01-11 13:47:31 +01:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Marcus Brummer e455ca2f2f Added Geometry2D unit tests 2020-12-30 21:11:09 +01:00
reduz 37c6434e16 Add a paged array template
Used for reusable stacks, or filling arrays from multiple threads efficiently.
2020-12-21 15:06:50 -03:00
Andrii Doroshenko (Xrayez) ed7014c67a Add test suite for `FileAccess` 2020-12-11 16:05:18 +02:00
Andrii Doroshenko (Xrayez) 932acad53f Add test suite for `RandomNumberGenerator` 2020-12-07 13:51:03 +02:00
Fabio Alessandrelli 502ff74fee
Merge pull request #43536 from jonbonazza/hmac
feat: HMAC support in Crypto APIs
2020-12-03 11:08:16 +01:00
Jon Bonazza d5925fd522 feat: HMAC support in Crypto APIs 2020-11-26 18:39:56 -08:00
bruvzg 493da99269
[Complex Text Layouts] Implement TextServer interface. Implement Fallback TextServer. 2020-11-26 13:55:26 +02:00
Rémi Verschelde 6221210c6c
Merge pull request #43727 from Calinou/test-add-aabb
Add a test suite for AABB
2020-11-23 09:30:44 +01:00
Hugo Locurcio 6f24bc3e47
Add a test suite for AABB 2020-11-20 19:44:08 +01:00
Rémi Verschelde 34895e7b28
Merge pull request #43583 from Calinou/test-add-object
Add a test suite for Object
2020-11-20 14:03:12 +01:00