From bbfc3069847144b0ee38ef5f7c364c3edacf3e6e Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Mon, 6 Oct 2025 23:23:35 +0200 Subject: [PATCH] sort cmd queue --- lib/ugui.c3l/src/core.c3 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ugui.c3l/src/core.c3 b/lib/ugui.c3l/src/core.c3 index ea7a635..ef89ea0 100644 --- a/lib/ugui.c3l/src/core.c3 +++ b/lib/ugui.c3l/src/core.c3 @@ -8,6 +8,7 @@ import std::io; import std::core::string; import std::core::mem::allocator; import std::collections::pair; +import std::sort; macro println(...) @@ -313,7 +314,7 @@ $endif // sort the command buffer by the z-index // FIXME: sorting the buffer fucks with scissor commands that have to be kept in place // TODO: instead of sorting at the end perform ordered inserts into the command buffer - //ctx.cmd_queue.sort()!; + sort::countingsort(ctx.cmd_queue, fn uint(Cmd c) => c.z_index+1); // foreach (i, c: ctx.cmd_queue) { // io::printf("[%d]: ", i);