|
|
@ -2,6 +2,7 @@ const std = @import("std"); |
|
|
|
const Allocator = std.mem.Allocator; |
|
|
|
const Allocator = std.mem.Allocator; |
|
|
|
|
|
|
|
|
|
|
|
const meta = @import("./meta.zig"); |
|
|
|
const meta = @import("./meta.zig"); |
|
|
|
|
|
|
|
const errors = @import("./errors.zig"); |
|
|
|
const flecszigble = @import("./main.zig"); |
|
|
|
const flecszigble = @import("./main.zig"); |
|
|
|
const Path = flecszigble.Path; |
|
|
|
const Path = flecszigble.Path; |
|
|
|
const c = flecszigble.c; |
|
|
|
const c = flecszigble.c; |
|
|
@ -133,7 +134,7 @@ pub fn Entity(comptime ctx: anytype) type { |
|
|
|
var desc = std.mem.zeroInit(c.ecs_entity_desc_t, .{ .sep = "".ptr, .name = n.ptr }); |
|
|
|
var desc = std.mem.zeroInit(c.ecs_entity_desc_t, .{ .sep = "".ptr, .name = n.ptr }); |
|
|
|
desc.add[0] = c.ecs_pair(c.EcsChildOf, parent_); |
|
|
|
desc.add[0] = c.ecs_pair(c.EcsChildOf, parent_); |
|
|
|
scope = c.ecs_entity_init(world.raw, &desc); |
|
|
|
scope = c.ecs_entity_init(world.raw, &desc); |
|
|
|
if (scope == 0) return flecszigble.getLastErrorOrUnknown(); |
|
|
|
if (scope == 0) return errors.getLastErrorOrUnknown(); |
|
|
|
} else scope = found; |
|
|
|
} else scope = found; |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
@ -162,7 +163,7 @@ pub fn Entity(comptime ctx: anytype) type { |
|
|
|
return error.FoundChildOf; |
|
|
|
return error.FoundChildOf; |
|
|
|
|
|
|
|
|
|
|
|
const result = c.ecs_entity_init(world.raw, &desc); |
|
|
|
const result = c.ecs_entity_init(world.raw, &desc); |
|
|
|
if (result == 0) return flecszigble.getLastErrorOrUnknown(); |
|
|
|
if (result == 0) return errors.getLastErrorOrUnknown(); |
|
|
|
return Self.fromRaw(world, result); |
|
|
|
return Self.fromRaw(world, result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|