bump for new zig version

master
Mike Desaro 4 years ago
parent d6cfdbe671
commit a18a627f98

@ -5,8 +5,8 @@ pub fn build(b: *Builder) void {
const buildMode = b.standardReleaseOptions();
const examples = [_][2][]const u8{
[_][]const u8{ "group_sort", "examples/group_sort.zig" },
[_][]const u8{ "view_vs_group", "examples/view_vs_group.zig" },
[_][]const u8{ "group_sort", "examples/group_sort.zig" },
[_][]const u8{ "simple", "examples/simple.zig" },
};

@ -59,7 +59,6 @@ fn owningGroup(reg: *ecs.Registry) void {
end = timer.lap();
std.debug.warn("group (sort 2): {d}\n", .{@intToFloat(f64, end) / 1000000000});
// var group_iter2 = group.iterator(struct { vel: *Velocity, pos: *Position });
// while (group_iter2.next()) |e| {
// std.debug.warn("pos.y {d:.3}, ent: {}\n", .{e.pos.y, group_iter2.entity()});

@ -67,7 +67,7 @@ pub fn MultiView(comptime n_includes: usize, comptime n_excludes: usize) type {
entities: *const []Entity,
pub fn init(view: *Self) Iterator {
const ptr = view.registry.components.getValue(view.type_ids[0]).?;
const ptr = view.registry.components.get(view.type_ids[0]).?;
const entities = @intToPtr(*Storage(u8), ptr).dataPtr();
return .{
.view = view,
@ -85,7 +85,7 @@ pub fn MultiView(comptime n_includes: usize, comptime n_excludes: usize) type {
// entity must be in all other Storages
for (it.view.type_ids) |tid| {
const ptr = it.view.registry.components.getValue(tid).?;
const ptr = it.view.registry.components.get(tid).?;
if (!@intToPtr(*Storage(u1), ptr).contains(entity)) {
break :blk;
}
@ -93,7 +93,7 @@ pub fn MultiView(comptime n_includes: usize, comptime n_excludes: usize) type {
// entity must not be in all other excluded Storages
for (it.view.exclude_type_ids) |tid| {
const ptr = it.view.registry.components.getValue(tid).?;
const ptr = it.view.registry.components.get(tid).?;
if (@intToPtr(*Storage(u1), ptr).contains(entity)) {
break :blk;
}
@ -129,7 +129,7 @@ pub fn MultiView(comptime n_includes: usize, comptime n_excludes: usize) type {
// get our component counts in an array so we can sort the type_ids based on how many entities are in each
var sub_items: [n_includes]usize = undefined;
for (self.type_ids) |tid, i| {
const ptr = self.registry.components.getValue(tid).?;
const ptr = self.registry.components.get(tid).?;
const store = @intToPtr(*Storage(u8), ptr);
sub_items[i] = store.len();
}

@ -21,7 +21,6 @@ const Thing = struct {
}
};
test "Dispatcher" {
var thing = Thing{};

@ -13,7 +13,7 @@ const Transform = struct { x: f32 = 0 };
const Renderable = struct { x: f32 = 0 };
const Rotation = struct { x: f32 = 0 };
fn printStore(store: var, name: []const u8) void {
fn printStore(store: anytype, name: []const u8) void {
warn("--- {} ---\n", .{name});
for (store.set.dense.items) |e, i| {
warn("e[{}] s[{}]{}", .{ e, store.set.page(store.set.dense.items[i]), store.set.sparse.items[store.set.page(store.set.dense.items[i])] });

Loading…
Cancel
Save