From e589bae3b0511dee91c6ecfa4472de342b1414be Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 18 Dec 2021 13:36:06 -0800 Subject: [PATCH] latest zig support --- zig-ecs/examples/group_sort.zig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zig-ecs/examples/group_sort.zig b/zig-ecs/examples/group_sort.zig index 3097b72..16cdeb5 100644 --- a/zig-ecs/examples/group_sort.zig +++ b/zig-ecs/examples/group_sort.zig @@ -14,8 +14,6 @@ pub fn main() !void { var reg = ecs.Registry.init(std.heap.c_allocator); defer reg.deinit(); - var timer = try std.time.Timer.start(); - createEntities(®); owningGroup(®); } @@ -27,8 +25,8 @@ fn createEntities(reg: *ecs.Registry) void { var i: usize = 0; while (i < total_entities) : (i += 1) { var e1 = reg.create(); - reg.add(e1, Position{ .x = 1, .y = r.random.float(f32) * 100 }); - reg.add(e1, Velocity{ .x = 1, .y = r.random.float(f32) * 100 }); + reg.add(e1, Position{ .x = 1, .y = r.random().float(f32) * 100 }); + reg.add(e1, Velocity{ .x = 1, .y = r.random().float(f32) * 100 }); } var end = timer.lap(); @@ -44,7 +42,7 @@ fn owningGroup(reg: *ecs.Registry) void { // } const SortContext = struct { - fn sort(this: void, a: Position, b: Position) bool { + fn sort(_: void, a: Position, b: Position) bool { return a.y < b.y; } };