something broke with core

This commit is contained in:
peterino2 2026-01-08 09:40:02 -08:00
parent a518a89798
commit 6300ef0e35
2 changed files with 11 additions and 6 deletions

View File

@ -299,12 +299,11 @@ 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);
@ -312,11 +311,15 @@ pub fn start_module_(map: *SpecVariantMap, args: anytype, allocator: std.mem.All
try logging.setupLogging(gEngine);
}
_ = try createObject(ModuleLoader, .{});
_ = try gEngine.createObject(ecs.EcsRegistry, .{ .can_tick = true, .isCore = true });
try ecs.setup(allocator);
_ = try gEngine.createObject(scene.SceneSystem, .{ .can_tick = true });
_ = try gEngine.createObject(scene.SceneSystem, .{ .can_tick = true });
_ = try gEngine.createObject(inputs.InputStack, .{});
try algorithm.string_pool.setup(allocator);
gEngine.stringContext = algorithm.string_pool.gStringContext;
_ = try createObject(GameObjectSystem, .{ .can_tick = true });
_ = try inputs.initInputStack();
// components define
try ecs.defineComponentList(ComponentList, allocator);

View File

@ -92,11 +92,13 @@ pub fn startEngine(spec: *core.SpecVariantMap) bool {
const moduleName = spec.get("moduleName").?.string;
if (comptime core.BuildOption("static_build")) {
core.engine_logs("static build");
const modlaunch = @import("modulelaunch.zig");
var modargs = core.externModule.getModuleLoaderArgs(true);
var modalloc = allocator;
_ = modlaunch.startup_module(&modalloc, &modargs);
} else {
core.engine_logs("using hot reloading");
const platform = @import("platform").module;
platform.watchModules();