mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-18 01:06:47 +01:00
Now the render can be cancelled.
This commit is contained in:
parent
ccc0a59a58
commit
2a2918ddb7
@ -13,6 +13,7 @@ export(Array) var nodes : Array
|
||||
var initialized : bool = false
|
||||
var rendering : bool = false
|
||||
var queued_render : bool = false
|
||||
var render_cancelled : bool = false
|
||||
|
||||
func initialize():
|
||||
if !initialized:
|
||||
@ -78,7 +79,12 @@ func render_threaded() -> void:
|
||||
ThreadPool.add_job(j)
|
||||
|
||||
func _thread_func() -> void:
|
||||
if render_cancelled:
|
||||
rendering = false
|
||||
return
|
||||
|
||||
rendering = true
|
||||
render_cancelled = false
|
||||
|
||||
var did_render : bool = true
|
||||
|
||||
@ -89,6 +95,10 @@ func _thread_func() -> void:
|
||||
if n && n.render(self):
|
||||
did_render = true
|
||||
|
||||
if render_cancelled:
|
||||
rendering = false
|
||||
return
|
||||
|
||||
rendering = false
|
||||
|
||||
if queued_render:
|
||||
|
Loading…
Reference in New Issue
Block a user