|
|
|
@ -173,7 +173,7 @@ pub const OwningGroup = struct {
|
|
|
|
|
|
|
|
|
|
var component_ptrs: [component_info.fields.len][*]u8 = undefined;
|
|
|
|
|
inline for (component_info.fields) |field, i| {
|
|
|
|
|
const storage = self.registry.assure(field.field_type.Child);
|
|
|
|
|
const storage = self.registry.assure(std.meta.Child(field.field_type));
|
|
|
|
|
component_ptrs[i] = @ptrCast([*]u8, storage.instances.items.ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -181,7 +181,7 @@ pub const OwningGroup = struct {
|
|
|
|
|
const index = self.firstOwnedStorage().set.index(entity);
|
|
|
|
|
var comps: Components = undefined;
|
|
|
|
|
inline for (component_info.fields) |field, i| {
|
|
|
|
|
const typed_ptr = @ptrCast([*]field.field_type.Child, @alignCast(@alignOf(field.field_type.Child), component_ptrs[i]));
|
|
|
|
|
const typed_ptr = @ptrCast([*]std.meta.Child(field.field_type), @alignCast(@alignOf(std.meta.Child(field.field_type)), component_ptrs[i]));
|
|
|
|
|
@field(comps, field.name) = &typed_ptr[index];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|