diff --git a/engine/core/src/core.zig b/engine/core/src/core.zig index 22baa50..c32fbb4 100644 --- a/engine/core/src/core.zig +++ b/engine/core/src/core.zig @@ -299,11 +299,12 @@ pub fn start_module_(map: *SpecVariantMap, args: anytype, allocator: std.mem.All gEngine.* = try Engine.init(allocator); staticsInitialized = true; - _ = try createObject(ModuleLoader, .{}); try console.start(); const engineName = try std.fmt.allocPrint(allocator, "{s}Engine.ini", .{name}); defer allocator.free(engineName); + try algorithm.string_pool.setup(allocator); + gEngine.stringContext = algorithm.string_pool.gStringContext; try configVars.setupConfigs(engineName); @@ -311,15 +312,11 @@ pub fn start_module_(map: *SpecVariantMap, args: anytype, allocator: std.mem.All try logging.setupLogging(gEngine); } - try ecs.setup(allocator); - + _ = try createObject(ModuleLoader, .{}); + _ = try gEngine.createObject(ecs.EcsRegistry, .{ .can_tick = true, .isCore = true }); _ = try gEngine.createObject(scene.SceneSystem, .{ .can_tick = true }); - - try algorithm.string_pool.setup(allocator); - gEngine.stringContext = algorithm.string_pool.gStringContext; - - _ = try createObject(GameObjectSystem, .{ .can_tick = true }); - _ = try inputs.initInputStack(); + _ = try gEngine.createObject(scene.SceneSystem, .{ .can_tick = true }); + _ = try gEngine.createObject(inputs.InputStack, .{}); // components define try ecs.defineComponentList(ComponentList, allocator); diff --git a/engine/modulelaunch.zig b/engine/modulelaunch.zig index 4ada2ea..fd442ed 100644 --- a/engine/modulelaunch.zig +++ b/engine/modulelaunch.zig @@ -29,14 +29,6 @@ pub export fn startup_module(p_allocator: *anyopaque, p_a: ?*anyopaque) bool { const moduleArgs = core.startup_getArgs(p_a.?); - // firstLoad: bool, - // engine: *core.Engine, - // nameRegistry: *p2.NameRegistry, - // packerFS: *core.PackerFS, - // // luaState: *anyopaque, - // // luaAllocator: *anyopaque, - // debugDrawInterface: ?*debug.DebugDrawInterface, - if (moduleArgs.firstLoad) { inline for (backlog.moduleList) |feature| { if (@hasDecl(backlog, feature) and !std.mem.eql(u8, "core", feature)) {