summaryrefslogtreecommitdiffstats
path: root/core/io/resource.h
Commit message (Collapse)AuthorAgeFilesLines
* Speed up inspector updates for TileMapkobewi2024-03-071-1/+1
|
* Enhance cache modes in resource loadingPedro J. Estébanez2024-02-261-1/+1
| | | | | | | - Unify documentation, hoping to clear misconcepctions about about propagation of the cache mode across dependant loads. - Clarify in docs that `CACHE_MODE_REPLACE` now also works on the main resource (from #87008). - Add two recursive modes, counterparts of `CACHE_MODE_REPLACE` and `CACHE_MODE_IGNORE`, since it seems some need them (see #59669, #82830). - Let resources, even loaded with one of the ignore-cache modes, get a path, which is useful for tools.
* Fix recursive resource local to sceneRedMser2024-01-111-2/+5
| | | | | | | | Any resource that contains other local to scene resources inside of arrays or dictionaries will now be duplicated and configured. The case where a scene's node has an exported array/dictionary property containing local to scene resources is NOT handled here.
* Assign temporary path to preloaded resourceskobewi2023-11-101-0/+1
|
* Reimplement Resource.`_local_to_scene_setup` & remove workaroundMicky2023-09-091-0/+2
| | | | | | Reimplements the virtual method _setup_local_to_scene, lost in #51970 Also deprecates the redundant `setup_local_to_scene_requested` signal.
* Clear the previously set state when configuring for a new scene root nodeRindbee2023-08-081-0/+2
| | | | | | | Saving a subscene causes the main scene to be re-instantiated. And the resource instance in the main scene will be reused when the main scene is re-instantiated. So for resources with `resource_local_to_scene` enabled, resetting state may be necessary (at least for `ViewportTexture`).
* Unify and streamline connecting to Resource changeskobewi2023-07-171-8/+3
|
* Cleanup unused engine code v2kobewi2023-01-191-2/+0
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | 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".
* Drop obsolete resource usage debug methods from OS classRémi Verschelde2022-08-291-1/+0
| | | | | | | | | | | These methods exist since the dawn of (open source) Godot and have hardly been updated over time, so they barely work and I'm fairly sure nobody is using them. (See #46505 for details.) While some of the functionality they aimed to provide might be useful for optimization work and introspection, this should likely be redesigned from scratch with a cleaner and more modern interface (e.g. exposed via the Performance singleton, or ResourceLoader, and a better API overall).
* Remake resource thread safety and APIreduz2022-06-221-2/+2
| | | | | | | | * Ensures thread safety when resources are destroyed. * Simplified API by always forcing `ResourceCache::get_ref`, which needs less hacks and is fully thread safe. * Removed RWLock for resources because its not possible to use for the new logic. Should not be a problem. Supersedes #57533
* Add a new HashSet templatereduz2022-05-201-1/+1
| | | | | * Intended to replace RBSet in most cases. * Optimized for iteration speed
* Replace most uses of Map by HashMapreduz2022-05-161-3/+3
| | | | | | | | | | | | * 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!
* Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio2022-05-031-2/+0
| | | | | | These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
* Object: Remove unused category boilerplateRémi Verschelde2022-03-261-1/+0
| | | | | | | | | We might want to re-add something like this if/when we find a good use case for it and do the effort to categorize all objects in the API properly. Until then, it's better to remove that boilerplate since it's not needed. Closes #18711.
* String: Add contains().Anilforextra2022-02-041-1/+1
|
* Allow method binds to take Object subclasses as argumentsTechnoPorg2022-01-251-0/+2
| | | | | | This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object. This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary. A few small changes also had to be made to other files, due to the changes cascading down all the includes.
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Add is_built_in() method to Resourcekobewi2021-11-041-0/+1
|
* Resource: Remove unused `_use_builtin_script()` virtual methodRémi Verschelde2021-08-121-2/+0
| | | | And another piece of dead code found while searching for "use_builtin".
* Implement Resource UIDsreduz2021-07-241-0/+1
| | | | | | | | | | | | | | | | | | | | * Most resource types now have unique identifiers. * Applies to text, binary and imported resources. * File formats reference both by text and UID (when available). UID always has priority. * Resource UIDs are 64 bits for better compatibility with the engine. * Can be represented and used textually, example `uuid://dapwmgsmnl28u`. * A special binary cache file is used and exported, containing the mappings. Example of how it looks: ```GDScript [gd_scene load_steps=2 format=3 uid="uid://dw86wq31afig2"] [ext_resource type="PackedScene" uid="uid://bt36ojelx8q6c" path="res://subscene.scn" id="1_t56hs"] ``` GDScript, shaders and other special resource files can't currently provide UIDs, but this should be doable with special keywords on the files. This will be reserved for future PRs.
* Implement textual ext/subresource IDs.reduz2021-07-221-6/+7
| | | | | | | | | | | | | * Friendlier with version control. * Generates pseudo unique IDs, to minimize conflicts when merging, but still user readable (so, not UUID). * Eventually will also allow to have more precisely named sub-resources in imported files. * This will allow better reloading on changes (including resources already loaded) as well as better keeping track of changes on the DCC. * Keeps backward compatibility with the old formats. * Binary and text format version incremented to mark breakage in forward compatibility.
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-3/+3
|
* Implement Particle Trailsreduz2021-04-301-0/+2
| | | | | | | | | -Enable the trails and set the length in seconds -Provide a mesh with a skeleton and a skin -Or, alternatively use one of the built-in TubeTrailMesh/RibbonTrailMesh -Works deterministically -Fixed particle collisions (were broken) -Not working in 2D yet (that will happen next)
* Improve resource load cachereduz2021-02-111-0/+2
| | | | | | -Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
* Modernize RWLockPedro J. Estébanez2021-01-191-3/+2
| | | | | | | | - Based on C++14's `shared_time_mutex` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed - Simpler for `NO_THREADS`
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | 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 🎆
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-0/+172
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code