You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 19:41:11 +00:00
Text resource loader fixes
* Moved the order of progress update to after the actual resource loading to give better % numbers. * Fix a bug introduced by #67714, which broke cache ignoring.
This commit is contained in:
@@ -601,14 +601,14 @@ Error ResourceLoaderText::load() {
|
|||||||
|
|
||||||
resource_current++;
|
resource_current++;
|
||||||
|
|
||||||
|
if (progress && resources_total > 0) {
|
||||||
|
*progress = resource_current / float(resources_total);
|
||||||
|
}
|
||||||
|
|
||||||
int_resources[id] = res; //always assign int resources
|
int_resources[id] = res; //always assign int resources
|
||||||
if (do_assign) {
|
if (do_assign && cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) {
|
||||||
if (cache_mode == ResourceFormatLoader::CACHE_MODE_IGNORE) {
|
res->set_path(path, cache_mode == ResourceFormatLoader::CACHE_MODE_REPLACE);
|
||||||
res->set_path(path);
|
res->set_scene_unique_id(id);
|
||||||
} else {
|
|
||||||
res->set_path(path, cache_mode == ResourceFormatLoader::CACHE_MODE_REPLACE);
|
|
||||||
res->set_scene_unique_id(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary missing_resource_properties;
|
Dictionary missing_resource_properties;
|
||||||
@@ -663,10 +663,6 @@ Error ResourceLoaderText::load() {
|
|||||||
if (!missing_resource_properties.is_empty()) {
|
if (!missing_resource_properties.is_empty()) {
|
||||||
res->set_meta(META_MISSING_RESOURCES, missing_resource_properties);
|
res->set_meta(META_MISSING_RESOURCES, missing_resource_properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (progress && resources_total > 0) {
|
|
||||||
*progress = resource_current / float(resources_total);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -716,8 +712,6 @@ Error ResourceLoaderText::load() {
|
|||||||
resource = Ref<Resource>(r);
|
resource = Ref<Resource>(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
resource_current++;
|
|
||||||
|
|
||||||
Dictionary missing_resource_properties;
|
Dictionary missing_resource_properties;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -770,6 +764,12 @@ Error ResourceLoaderText::load() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource_current++;
|
||||||
|
|
||||||
|
if (progress && resources_total > 0) {
|
||||||
|
*progress = resource_current / float(resources_total);
|
||||||
|
}
|
||||||
|
|
||||||
if (missing_resource) {
|
if (missing_resource) {
|
||||||
missing_resource->set_recording_properties(false);
|
missing_resource->set_recording_properties(false);
|
||||||
}
|
}
|
||||||
@@ -779,9 +779,6 @@ Error ResourceLoaderText::load() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
error = OK;
|
error = OK;
|
||||||
if (progress && resources_total > 0) {
|
|
||||||
*progress = resource_current / float(resources_total);
|
|
||||||
}
|
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user