diff --git a/zig-ecs/examples/view_vs_group.zig b/zig-ecs/examples/view_vs_group.zig index 94eaf8c..4b50f07 100644 --- a/zig-ecs/examples/view_vs_group.zig +++ b/zig-ecs/examples/view_vs_group.zig @@ -12,7 +12,7 @@ pub fn main() !void { var reg = ecs.Registry.init(std.heap.c_allocator); defer reg.deinit(); - var timer = try std.time.Timer.start(); + // var timer = try std.time.Timer.start(); createEntities(®); iterateView(®); @@ -96,8 +96,8 @@ fn owningGroup(reg: *ecs.Registry) void { timer.reset(); - var storage = reg.assure(Velocity); - var vel = storage.instances.items; + // var storage = reg.assure(Velocity); + // var vel = storage.instances.items; var pos = reg.assure(Position).instances.items; var index: usize = group.group_data.current; diff --git a/zig-ecs/src/ecs/component_storage.zig b/zig-ecs/src/ecs/component_storage.zig index e1b070a..a2eb783 100644 --- a/zig-ecs/src/ecs/component_storage.zig +++ b/zig-ecs/src/ecs/component_storage.zig @@ -145,7 +145,7 @@ pub fn ComponentStorage(comptime Component: type, comptime Entity: type) type { pub fn reserve(self: *Self, cap: usize) void { self.set.reserve(cap); if (!is_empty_struct) { - elf.instances.items.reserve(cap); + self.instances.items.reserve(cap); } } diff --git a/zig-ecs/src/ecs/registry.zig b/zig-ecs/src/ecs/registry.zig index 5a64402..4d94f32 100644 --- a/zig-ecs/src/ecs/registry.zig +++ b/zig-ecs/src/ecs/registry.zig @@ -236,7 +236,7 @@ pub const Registry = struct { } /// Increases the capacity of the registry or of the pools for the given component - pub fn reserve(self: *Self, comptime T: type, cap: usize) void { + pub fn reserve(self: *Registry, comptime T: type, cap: usize) void { self.assure(T).reserve(cap); }