summaryrefslogtreecommitdiffstats
path: root/core/io/resource_loader.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/resource_loader.h')
-rw-r--r--core/io/resource_loader.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h
index 3c32a19066..5caf699d32 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -39,14 +39,19 @@
class ConditionVariable;
+template <int Tag>
+class SafeBinaryMutex;
+
class ResourceFormatLoader : public RefCounted {
GDCLASS(ResourceFormatLoader, RefCounted);
public:
enum CacheMode {
- CACHE_MODE_IGNORE, // Resource and subresources do not use path cache, no path is set into resource.
- CACHE_MODE_REUSE, // Resource and subresources use patch cache, reuse existing loaded resources instead of loading from disk when available.
- CACHE_MODE_REPLACE, // Resource and subresource use path cache, but replace existing loaded resources when available with information from disk.
+ CACHE_MODE_IGNORE,
+ CACHE_MODE_REUSE,
+ CACHE_MODE_REPLACE,
+ CACHE_MODE_IGNORE_DEEP,
+ CACHE_MODE_REPLACE_DEEP,
};
protected:
@@ -155,7 +160,7 @@ private:
static ResourceLoadedCallback _loaded_callback;
- static Ref<ResourceFormatLoader> _find_custom_resource_format_loader(String path);
+ static Ref<ResourceFormatLoader> _find_custom_resource_format_loader(const String &path);
struct ThreadLoadTask {
WorkerThreadPool::TaskID task_id = 0; // Used if run on a worker thread from the pool.
@@ -167,7 +172,8 @@ private:
String remapped_path;
String dependent_path;
String type_hint;
- float progress = 0.0;
+ float progress = 0.0f;
+ float max_reported_progress = 0.0f;
ThreadLoadStatus status = THREAD_LOAD_IN_PROGRESS;
ResourceFormatLoader::CacheMode cache_mode = ResourceFormatLoader::CACHE_MODE_REUSE;
Error error = OK;
@@ -259,7 +265,7 @@ public:
static void set_load_callback(ResourceLoadedCallback p_callback);
static ResourceLoaderImport import;
- static bool add_custom_resource_format_loader(String script_path);
+ static bool add_custom_resource_format_loader(const String &script_path);
static void add_custom_loaders();
static void remove_custom_loaders();