diff options
author | reduz <reduzio@gmail.com> | 2021-07-23 16:01:18 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2021-07-24 09:16:52 -0300 |
commit | 32b43cfeb38dc83ba8024acec32bdfc706c86a46 (patch) | |
tree | 1ccdbbe010073a37a382955a12f241a83cc384c7 /main | |
parent | c25fa02c1c242df0f256dd58af650f8c8806c066 (diff) |
Implement Resource UIDs
* 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.
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index b7f67e8f6c..0a8c814d51 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1089,6 +1089,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // Initialize user data dir. OS::get_singleton()->ensure_user_data_dir(); + ResourceUID::get_singleton()->load_from_cache(); // load UUIDs from cache. + GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60); ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/multithreaded_server/rid_pool_prealloc", PropertyInfo(Variant::INT, |