diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2024-06-28 14:43:01 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-06-28 14:43:01 +0200 |
| commit | e052a53bb6a810ca5c01b037fc8993a52bd4e338 (patch) | |
| tree | 314fa10119a9f10832c2a0649911d1509ce93406 /core/io/resource_loader.h | |
| parent | a365cf59c8687689805a71748e0b7cef9df9b636 (diff) | |
| parent | ec61c5064c0abe760795a37d852e7bfc02d3fdb6 (diff) | |
| download | redot-engine-e052a53bb6a810ca5c01b037fc8993a52bd4e338.tar.gz | |
Merge pull request #93695 from RandomShaper/res_load_main_th
`ResourceLoader`: Support polling and get-before-complete on the main thread
Diffstat (limited to 'core/io/resource_loader.h')
| -rw-r--r-- | core/io/resource_loader.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index c48f39b5cc..46df79ea22 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -174,6 +174,7 @@ private: String type_hint; float progress = 0.0f; float max_reported_progress = 0.0f; + uint64_t last_progress_check_main_thread_frame = UINT64_MAX; ThreadLoadStatus status = THREAD_LOAD_IN_PROGRESS; ResourceFormatLoader::CacheMode cache_mode = ResourceFormatLoader::CACHE_MODE_REUSE; Error error = OK; @@ -197,6 +198,8 @@ private: static float _dependency_get_progress(const String &p_path); + static bool _ensure_load_progress(); + public: static Error load_threaded_request(const String &p_path, const String &p_type_hint = "", bool p_use_sub_threads = false, ResourceFormatLoader::CacheMode p_cache_mode = ResourceFormatLoader::CACHE_MODE_REUSE); static ThreadLoadStatus load_threaded_get_status(const String &p_path, float *r_progress = nullptr); |
