Fix some mysterious warnings when using enqueue.

This commit is contained in:
Alberto Torres 2024-09-10 01:00:11 +02:00
parent 67f009c157
commit 7b54183f31

View file

@ -898,14 +898,15 @@ type BlendLoader* = ref object of Loader
(string, seq[Varying], OrderedTable[string, string], OrderedTable[string, TexturePixels])] ## private (string, seq[Varying], OrderedTable[string, string], OrderedTable[string, TexturePixels])] ## private
resource*: LoadableResource resource*: LoadableResource
template enqueue*(renderer: RenderManager, fun: proc()) = template enqueue*(renderer: RenderManager, fun: untyped) =
## Run a proc after the renderer has been initialized. ## Run a proc after the renderer has been initialized.
## ##
## If it was already initialized, it runs it immediately. ## If it was already initialized, it runs it immediately.
let f = fun
if renderer.initialized: if renderer.initialized:
fun() f()
else: else:
renderer.queue.add fun renderer.queue.add f
when not defined(release): when not defined(release):
from sugar import dump from sugar import dump