summaryrefslogtreecommitdiffstats
path: root/core/io/resource.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@711c725cf1b641d05d6cc988a64601622e48fe4aSpartan3222024-11-151-11/+11
|\
| * ResourceLoader: Add thread-aware resource changed mechanismPedro J. Estébanez2024-09-231-11/+11
| | | | | | | | (cherry picked from commit 0f3ee922e07fd4d16d9ef6dac150beb9c84ac527)
* | Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
| |
* | Rebrand preambles to RedotSpartan3222024-10-131-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e8542b06acca3c1bdeee4b528411771f0819f084) Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Re-add resource thread-safety measuresPedro J. Estébanez2024-07-151-1/+16
| | | | | | These deferring measures were added to aid threaded resource loading in being safe. They were removed as seemingly unneeded, but it seems they are needed so resources involved in threaded loading interact with others only after "sync points".
* Remove no longer needed thread safety measuresPedro J. Estébanez2024-06-121-16/+1
| | | | This is basically a revertion of commit 84b85d894c47cf5d680992fcae1d9af48eee0d3f.
* Merge pull request #91897 from RandomShaper/res_unreg_if_trueRémi Verschelde2024-05-161-4/+11
|\ | | | | | | Add an identity check to resource unregistration from cache
| * Add an identity check to resource unregistration from cachePedro J. Estébanez2024-05-131-4/+11
| | | | | | | | This is needed because resources loaded with CACHE_MODE_IGNORE still have path_cache set.
* | Use Core/Scene stringnames consistentlykobewi2024-05-131-1/+0
| |
* | Add shorthand for using singleton string nameskobewi2024-05-111-6/+6
|/
* Add PackedVector4Array Variant typeK. S. Ernest (iFire) Lee2024-05-031-1/+2
| | | | | Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Fix Resource::get_rid override not working in GDExtensionPylgos2024-04-061-2/+1
|
* Merge pull request #89261 from ↵Rémi Verschelde2024-03-241-0/+1
|\ | | | | | | | | | | paulloz/core/fix-script-reloading-outside-script-editor Fix how scripts reload outside of ScriptEditor
| * Fix how scripts reload outside of ScriptEditorPaul Joannon2024-03-181-0/+1
| |
* | Merge pull request #89251 from KoBeWi/fastpectorRémi Verschelde2024-03-091-2/+2
|\ \ | | | | | | | | | Speed up inspector updates for TileMap
| * | Speed up inspector updates for TileMapkobewi2024-03-071-2/+2
| |/
* / Expose scene unique id functionality in ResourceRyan2024-03-071-0/+15
|/
* Improve thread safety of resource loadingPedro J. Estébanez2024-02-281-1/+16
|
* Fix recursive resource local to sceneRedMser2024-01-111-25/+93
| | | | | | | | 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.
* Improve message about resources in use at exitkobewi2023-11-281-2/+4
|
* Assign temporary path to preloaded resourceskobewi2023-11-101-0/+4
|
* Reimplement Resource.`_local_to_scene_setup` & remove workaroundMicky2023-09-091-1/+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/+5
| | | | | | | 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-21/+15
|
* Make `ResourceCache::get_cached_resources` thread-safevoidedWarranties2023-02-201-1/+18
|
* Fix `Resource::duplicate()` missing packed arraysAdam Scott2023-01-281-8/+28
|
* Add PROPERTY_USAGE_NEVER_DUPLICATE flag and use for scriptAaron Franke2023-01-241-1/+1
| | | | Co-authored-by: Yakov Borevich <j.borevich@gmail.com>
* PropertyUsage: Rename "DO_NOT_SHARE_ON_DUPLICATE" to "ALWAYS_DUPLICATE"Aaron Franke2023-01-241-1/+1
|
* Cleanup unused engine code v2kobewi2023-01-191-7/+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".
* [Core] Fix Resource.resource_name type.Fabio Alessandrelli2022-11-291-1/+1
| | | | | | | | The methods returns a String, but the Variant was bound as a StringName. We could alternatively change the method return type but that's a breaking change which will requires code changes in other parts of the engine.
* Rename and expose `RefCounted::get_reference_count()`Marc Gilleron2022-09-211-1/+1
|
* Fixes #65377: get_datetime_* functions can return wrong valuesJames2022-09-101-8/+7
|
* Drop obsolete resource usage debug methods from OS classRémi Verschelde2022-08-291-40/+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-40/+56
| | | | | | | | * 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
* Clean up Hash Functionsreduz2022-06-201-10/+10
| | | | | | | Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
* Use range iterators for RBSet in most casesAaron Record2022-05-191-2/+2
|
* Replace most uses of Map by HashMapreduz2022-05-161-4/+4
| | | | | | | | | | | | * 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!
* Add a new HashMap implementationreduz2022-05-121-11/+6
| | | | | | | | | | | | | | | | | 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<>
* Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio2022-05-031-6/+6
| | | | | | These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
* Fix more issues found by cppcheck.bruvzg2022-04-201-1/+1
|
* Make FileAccess and DirAccess classes reference counted.bruvzg2022-04-111-8/+4
|
* Discern between virtual and abstract class bindingsreduz2022-03-101-0/+20
| | | | | | | | | | | | | | * Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract". * Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions. * Converted a large amount of classes from "abstract" to "virtual" where it makes sense. Most classes that make sense have been converted. Missing: * Physics servers * VideoStream * Script* classes. which will go in a separate PR due to the complexity involved.
* Fix multiple missing UTF-8 decoding.bruvzg2022-01-061-2/+2
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Replace String comparisons with "", String() to is_empty()Nathan Franke2021-12-091-4/+4
| | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* Add a name to TileSet sourcesGilles Roudière2021-10-141-0/+1
|
* Use range iterators for `Map`Lightning_A2021-09-301-2/+2
|
* Replace BIND_VMETHOD by new GDVIRTUAL syntaxreduz2021-08-221-5/+4
| | | | | | | | | | | * New syntax is type safe. * New syntax allows for type safe virtuals in native extensions. * New syntax permits extremely fast calling. Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`. These will require API rework on a separate PR as they work different than the rest of the functions. Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
* OS: Fix used resource debug printsRémi Verschelde2021-08-061-0/+2
| | | | | | These methods were broken by 22419082d9bedbc9dc060ea5784bb0871f8710a3 5 years ago and nobody complained, so maybe they're not so useful... But at least this should restore them to a working state.