Format files using updated file_format.sh

This commit is contained in:
Aaron Franke
2020-10-01 14:23:54 -04:00
parent fe9fd7d7e4
commit 918a289ee2
79 changed files with 512 additions and 512 deletions

View File

@@ -12,9 +12,9 @@ func _thread_load(path):
var total = ril.get_stage_count()
# Call deferred to configure max load steps.
progress.call_deferred("set_max", total)
var res = null
while true: #iterate until we have a resource
# Update progress bar, use call deferred, which routes to main thread.
progress.call_deferred("set_value", ril.get_stage())
@@ -31,20 +31,20 @@ func _thread_load(path):
# Not OK, there was an error.
print("There was an error loading")
break
# Send whathever we did (or did not) get.
call_deferred("_thread_done", res)
func _thread_done(resource):
assert(resource)
# Always wait for threads to finish, this is required on Windows.
thread.wait_to_finish()
# Hide the progress bar.
progress.hide()
# Instantiate new scene.
var new_scene = resource.instance()
# Free current scene.
@@ -54,7 +54,7 @@ func _thread_done(resource):
get_tree().root.add_child(new_scene)
# Set as current scene.
get_tree().current_scene = new_scene
progress.visible = false
func load_scene(path):

View File

@@ -98,7 +98,7 @@ func get_resource(path):
var pos = queue.find(res)
queue.remove(pos)
queue.insert(0, res)
res = _wait_for_resource(res, path)
pending.erase(path)
_unlock("return")
@@ -116,13 +116,13 @@ func get_resource(path):
func thread_process():
_wait("thread_process")
_lock("process")
while queue.size() > 0:
var res = queue[0]
_unlock("process_poll")
var ret = res.poll()
_lock("process_check_queue")
if ret == ERR_FILE_EOF || ret != OK:
var path = res.get_meta("path")
if path in pending: # Else, it was already retrieved.