mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #113117 from DarioSamo/resource-load-threaded-skip-progress
Skip ResourceLoader's progress query if not requested.
This commit is contained in:
commit
f1de9c4845
1 changed files with 5 additions and 3 deletions
|
|
@ -53,10 +53,12 @@ Error ResourceLoader::load_threaded_request(const String &p_path, const String &
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const String &p_path, Array r_progress) {
|
ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const String &p_path, Array r_progress) {
|
||||||
float progress = 0;
|
// Progress being the default array indicates the user hasn't requested for it to be computed.
|
||||||
::ResourceLoader::ThreadLoadStatus tls = ::ResourceLoader::load_threaded_get_status(p_path, &progress);
|
|
||||||
// Default array should never be modified, it causes the hash of the method to change.
|
// Default array should never be modified, it causes the hash of the method to change.
|
||||||
if (!ClassDB::is_default_array_arg(r_progress)) {
|
const bool return_progress = !ClassDB::is_default_array_arg(r_progress);
|
||||||
|
float progress = 0;
|
||||||
|
::ResourceLoader::ThreadLoadStatus tls = ::ResourceLoader::load_threaded_get_status(p_path, return_progress ? &progress : nullptr);
|
||||||
|
if (return_progress) {
|
||||||
r_progress.resize(1);
|
r_progress.resize(1);
|
||||||
r_progress[0] = progress;
|
r_progress[0] = progress;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue