From 61422a21b526c5c892e78ac7959ae083517f2643 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 17 Apr 2026 16:48:47 +1000 Subject: [PATCH] update libraries and fix for new compiler version --- build.sh | 2 +- dub.json | 4 ++-- src/VulkanRenderer | 2 +- src/dlib | 2 +- src/editor/ui.d | 15 ++++++++------- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index ad641c1..9aaa32a 100755 --- a/build.sh +++ b/build.sh @@ -26,6 +26,6 @@ for shader in src/shaders/*.glsl; do $shader_compiler $shader_flags $shader_stage $shader "${shader_out}${base_name}.spv" done -/bin/bash src/VulkanRenderer/build.sh build +#/bin/bash src/VulkanRenderer/build.sh build /bin/bash src/dlib/build.sh build diff --git a/dub.json b/dub.json index bcc9682..5556082 100644 --- a/dub.json +++ b/dub.json @@ -13,10 +13,10 @@ "sourcePaths": ["src/editor", "src/dlib", "src/dlib/external/xxhash", "src/VulkanRenderer"], "libs-linux": ["X11", "vulkan", "stdc++", "xfixes", "freetype"], "libs-windows": [], - "versions": ["VULKAN_DEBUG", "ENABLE_RENDERER", "NO_STBI"], + "versions": ["VULKAN_DEBUG", "ENABLE_RENDERER", "DLIB"], "preGenerateCommands-linux": ["./build.sh"], "preGenerateCommands-windows": [], - "dflags": ["-P-I/usr/include/freetype2", "-Jbuild", "-Jassets", "-Xcc=-DNO_STBI"], + "dflags": ["-P-I/usr/include/freetype2", "-Jbuild", "-Jassets", "-P-DDLIB_INCLUDE_VULKAN"], "dflags-ldc2": ["-link-debuglib"], "dflags-dmd": [] }, diff --git a/src/VulkanRenderer b/src/VulkanRenderer index 0c55211..b7674e4 160000 --- a/src/VulkanRenderer +++ b/src/VulkanRenderer @@ -1 +1 @@ -Subproject commit 0c5521153f63001273170b09b15a5eaabb289885 +Subproject commit b7674e43bde4661dac2a11092826079c57a4d66c diff --git a/src/dlib b/src/dlib index 53dbb8b..8690e93 160000 --- a/src/dlib +++ b/src/dlib @@ -1 +1 @@ -Subproject commit 53dbb8bf3492f99418f129d54184d8eddc895338 +Subproject commit 8690e93b41ffe7bba528b76dfa749ee4bb6f28d5 diff --git a/src/editor/ui.d b/src/editor/ui.d index 28e4aaa..0e89ac4 100644 --- a/src/editor/ui.d +++ b/src/editor/ui.d @@ -409,6 +409,8 @@ InitUI(Ctx* ctx) alpha_op: BO.Add, }; + CreateGraphicsPipeline(&ctx.pipeline, &ui_info); + for(u32 i = 0; i < ctx.font_descs.length; i += 1) { CreateDescriptor(&ctx.font_descs[i], DescInfo( @@ -425,7 +427,6 @@ InitUI(Ctx* ctx) ctx.font_sets[i].index = i; } - CreateGraphicsPipeline(&ctx.pipeline, &ui_info); CreateDescriptor(&ctx.sampler, DescInfo( type: DT.Sampler, mipmap_mode: MipmapMode.Nearest, @@ -1740,8 +1741,8 @@ SetNil(Args...)(Args args) void Clamp(Ctx* ctx, Vertex* v) { - v.dst_start = Clamp(v.dst_start, Vec2(0.0), Vec2(ctx.res)); - v.dst_end = Clamp(v.dst_end, Vec2(0.0), Vec2(ctx.res)); + v.dst_start = Clamp(v.dst_start, Vec2(0.0), cast(Vec2)ctx.res); + v.dst_end = Clamp(v.dst_end, Vec2(0.0), cast(Vec2)ctx.res); } bool @@ -1756,11 +1757,11 @@ UpdateState(f32* v, bool cond) { *v += g_ctx.animation_rate * (cast(f32)(cond) - *v); f32 diff = fabsf((*v)-1.0); - if(diff < 0.00009) + if(cond && diff < 0.00009) { *v = 1.0; } - else if(diff > 0.99998) + else if(!cond && diff > 0.99998) { *v = 0.0; } @@ -2193,7 +2194,7 @@ SetReady(UIItem* item, bool ready) { item.ready_t = 1.0; } - else if(item.ready_t < 0.0009) + else if(!ready && item.ready_t < 0.0009) { item.ready_t = 0.0; } @@ -2208,7 +2209,7 @@ SetHot(UIItem* item, bool hot) { item.hot_t = 1.0; } - else if(item.hot_t < 0.0009) + else if(!hot && item.hot_t < 0.0009) { item.hot_t = 0.0; }