From a22bf34ccdb9ba063438f27a8f9bdb6d5bffb28c Mon Sep 17 00:00:00 2001 From: Nic Gaffney Date: Sun, 12 Oct 2025 19:18:04 -0500 Subject: Quadtree optimization complete --- src/imgui.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/imgui.zig') diff --git a/src/imgui.zig b/src/imgui.zig index bcc6b32..688e935 100644 --- a/src/imgui.zig +++ b/src/imgui.zig @@ -26,17 +26,17 @@ pub fn update(alloc: std.mem.Allocator, buf: [:0]u8) !void { _ = z.sliderInt("Particles", .{ .v = &cfg.particleCount, .min = 1, .max = cfg.particleMax }); _ = z.sliderFloat("Friction", .{ .v = &cfg.friction, .min = 0, .max = 1 }); // _ = z.sliderFloat("Radius", .{ .v = &cfg.radius, .min = cfg.minDistance, .max = 500 }); - _ = z.sliderFloat("Minimum Distance", .{ .v = &cfg.minDistance, .min = 1.0, .max = 500 }); + _ = z.sliderInt("Minimum Distance", .{ .v = &cfg.minDistance, .min = 1.0, .max = 500 }); } if (z.collapsingHeader("Radius", .{ .default_open = true })) { for (&cfg.radius, 0..) |*r, i| { - const str = try std.fmt.allocPrintZ(alloc, "{s} Radius", .{rul.colorToString(i)}); - _ = z.sliderFloat(str, .{ .v = r, .min = cfg.minDistance, .max = 500 }); + const str = rul.colorToStringZ(i); + _ = z.sliderInt(str, .{ .v = r, .min = cfg.minDistance, .max = 500 }); } } if (z.collapsingHeader("Speed", .{ .default_open = true })) { for (&cfg.speed, 0..) |*s, i| { - const str = try std.fmt.allocPrintZ(alloc, "{s} Speed", .{rul.colorToString(i)}); + const str = rul.colorToStringZ(i); _ = z.sliderInt(str, .{ .v = s, .min = 1, .max = 1000 }); } } @@ -72,7 +72,7 @@ pub fn update(alloc: std.mem.Allocator, buf: [:0]u8) !void { } z.endTable(); if (z.button("Randomize", .{})) - cfg.rules = rul.ruleMatrix(); + cfg.rules = rul.ruleMatrix(false, false); } if (z.collapsingHeader("Load / Save", .{ .default_open = true })) { _ = z.inputText("Save Path", .{ .buf = buf }); -- cgit v1.2.3