Merge pull request #19 from locriacyber/master

Fix compile errors for zig 0.9
master
prime31 3 years ago committed by GitHub
commit 2bc293066a

@ -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(&reg);
iterateView(&reg);
@ -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;

@ -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);
}
}

@ -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);
}

Loading…
Cancel
Save