Commit Graph

117 Commits

Author SHA1 Message Date
jsjtxietian 3027b49943 Prevent generating preview for zero sized texture 2024-06-18 16:04:10 +08:00
A Thousand Ships 308dbb8c63
[Core] Add scalar versions of `Vector*` `min/max/clamp/snap(ped)`
Convenience for a number of cases operating on single values
2024-05-02 10:31:13 +02:00
kobewi 1fce8d8a91 Add tooltip plugin for AudioStream 2024-04-15 22:14:21 +02:00
A Thousand Ships 79ba22a73f
Use `Vector*` component-wise `min/max/clamp` functions where applicable 2024-03-20 13:47:42 +01:00
Pedro J. Estébanez 91f0a65fc9 Rework viewport capture in preview generation 2024-02-21 10:44:21 +01:00
A Thousand Ships d8b29efe66
Fix member names of `AudioFrame` to match extension 2024-02-13 15:37:09 +01:00
Yuri Sizov 9c919ea285 Generate script resource preview without parsing 2024-01-26 19:04:10 +01:00
Yuri Sizov 95b27fe8c7 Reorganize code related to editor theming
This change introduces a new EditorThemeManager class
to abstract theme generatio and its subroutines.

Logic related to EditorTheme, EditorColorMap, and editor
icons has been extracted into their respective files with
includes cleaned up.

All related files have been moved to a separate folder to
better scope them in the project. This includes relevant
generated files as well.
2024-01-16 11:57:45 +01:00
Yuri Sizov e90ea87b42 Abort threaded preview generators on exit 2023-11-10 15:31:43 +01:00
Danil Alexeev de7cbe8789
Highlight doc comments in a different color 2023-10-08 19:26:10 +03:00
Yuri Sizov d8ff69d53c Extract ScriptInstance to simplify includes
This allows to include script_instance.h directly in the
generated gdvirtual.gen.inc, and remove excessive includes
from the codebase.

This should also allow Resource to use GDVIRTUAL macros,
which wasn't possible previously due to a circular dependency.
2023-09-06 22:54:38 +02:00
Hendrik Brucker 7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
kobewi 04317e9ced Add metadata to resource previews 2023-05-10 14:03:10 +02:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Adam Scott ea33001b95 Add safety-checks before some servers `free()` 2022-12-29 16:23:38 -05:00
Micky ebf86c96e9 Rename Image's `get_rect` to `get_region`
Also renames its parameter to from "rect" to "region".
2022-11-01 23:35:48 +01:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
kobewi 072f6feaba Make some Image methods static 2022-10-14 14:34:15 +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
Hendrik Brucker ea0472fecf Refactor BitMap and add tests
Co-authored-by: Resul Çelik <resul_celik@hotmail.com>
2022-09-01 18:39:17 +02:00
clayjohn 385ee5c70b Implement Physical Light Units as an optional setting.
This allows light sources to be specified in physical light units in addition to the regular energy multiplier. In order to avoid loss of precision at high values, brightness values are premultiplied by an exposure normalization value.

In support of Physical Light Units this PR also renames CameraEffects to CameraAttributes.
2022-08-31 12:14:46 -07:00
Aaron Franke 10a56981dc
Rename String `plus_file` to `path_join` 2022-08-29 19:38:13 -05:00
Juan Linietsky d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
reduz d1ddee2258 Implement BPM support
Based on #62896, only implements the BPM support part.

* Implements BPM support in the AudioStreamOGG/MP3 importers.
* Can select BPM/Bar Size and total beats in a song file, as well as edit looping points.
* Looping is now BPM aware
* Added a special importer UI for configuring this.
* Added a special preview showing the audio waveform as well as the playback position in the resource picker.
* Renamed `AudioStream::instance` to `instantiate` for correctness.
2022-07-23 07:31:17 +02:00
kobewi d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
bruvzg 344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03: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
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 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
Hendrik Brucker a93834c819 Add gradient resource preview generator 2022-04-21 00:08:35 +02:00
Rémi Verschelde 11572c6e30
Editor: Cleanup some includes dependencies
Removes some unnecessary includes from `editor_node.h`, and instead add
those where they're used.

Removes unnecessary `editor_node.h` includes in various editor classes.

Renames `dynamicfont` to `dynamic_font` in a couple files.

Misc cleanup while jumping through that rabbit hole.
2022-02-15 14:54:15 +01:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde 317cd0b19a
Refactor some object type checking code with `cast_to`
Less stringly typed logic, and less String allocations and comparisons.
2022-02-08 10:08:34 +01:00
bruvzg 244db37508
Cleanup and move char functions to the `char_utils.h` header. 2022-02-04 11:35:01 +02:00
Anilforextra c9f5d88f3a Use fill() to fill an entire image instead of setting pixels individually. 2022-01-08 17:43:15 +05:45
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
Rémi Verschelde 9f5045f70f
Merge pull request #56041 from Zylann/null_checks2
Fix crash if font fails loading when generating a preview
2021-12-18 09:31:26 +01:00
Marc Gilleron ccb701f2f7 Fix crash if font fails loading when generating a preview
Historical crash log:

ERROR: No loader found for resource: res://addons/gdquest.mannequin/assets/theme/fonts/montserrat/Montserrat-Medium.ttf.
   at: (core\io\resource_loader.cpp:213)
ERROR: res://addons/gdquest.mannequin/assets/theme/fonts/default_font.tres:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://addons/gdquest.mannequin/assets/theme/fonts/montserrat/Montserrat-Medium.ttf
   at: ResourceLoaderText::_parse_ext_resource (scene\resources\resource_format_text.cpp:170)
ERROR: res://addons/gdquest.mannequin/assets/theme/fonts/default_font.tres:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://addons/gdquest.mannequin/assets/theme/fonts/montserrat/Montserrat-Medium.ttf
   at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:649)
ERROR: Failed loading resource: res://addons/gdquest.mannequin/assets/theme/fonts/default_font.tres. Make sure resources have been imported by opening the project in the editor at least once.
   at: (core\io\resource_loader.cpp:206)
2021-12-18 03:35:29 +00:00
Haoyu Qiu 1fb59d13c2 Fix font preview text color on light background 2021-12-18 00:34:28 +08:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Nathan Franke 41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
Brian Semrau a90e318a19 Fix previews sometimes displaying wrong/blank image 2021-11-05 12:58:14 -04:00
Brian Semrau ac24070056 Use Callable in RS::request_frame_drawn_callback 2021-11-05 01:59:38 -04:00
Anilforextra 90908cd67d Add Get Center Method for Rect2/Rect2i and AABB. 2021-09-21 21:14:17 +05:45
bruvzg 4c3f7d1290 Makes FontData importable resource.
Adds multi-channel SDF font texture generation and rendering support.
Adds per-font oversampling support.
Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading.
Adds BMFont binary format and outline support.
2021-08-27 15:43:18 +03:00
Paulb23 bcfc591f86 Reorganise text editor settings 2021-08-16 17:18:49 +01:00
Aaron Franke 430ad75963
Some work on double support 2021-08-09 17:43:48 -05:00
Aaron Franke dbad475fc7
Use real_t in editor plugins
Also use const more often and delete dead code in CanvasItemEditor
2021-08-01 21:48:34 -05:00
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00