diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2025-10-12 19:18:04 -0500 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2025-10-12 19:18:04 -0500 |
| commit | a22bf34ccdb9ba063438f27a8f9bdb6d5bffb28c (patch) | |
| tree | 23b9eab54d787553a4df8f7a4bc410fef41cdc50 /src/imgui.zig | |
| parent | ae555d16a0a355563c7da3d95c8ebbd192f52cf2 (diff) | |
| download | particle-sim-a22bf34ccdb9ba063438f27a8f9bdb6d5bffb28c.tar.gz | |
Quadtree optimization complete
Diffstat (limited to 'src/imgui.zig')
| -rw-r--r-- | src/imgui.zig | 10 |
1 files changed, 5 insertions, 5 deletions
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 }); |
