unify mach.Call and mach.Runner into one type
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
14ccd5a93c
commit
8054d03b4d
19 changed files with 125 additions and 97 deletions
|
|
@ -25,6 +25,7 @@ pub const mach_systems = .{ .start, .init, .deinit, .tick, .audio_state_change }
|
|||
// TODO: banish global allocator
|
||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||
|
||||
// TODO(object)
|
||||
pub const components = .{
|
||||
.play_after = .{ .type = f32 },
|
||||
};
|
||||
|
|
@ -41,12 +42,10 @@ fn init(
|
|||
core: *mach.Core,
|
||||
audio: *mach.Audio,
|
||||
app: *App,
|
||||
app_tick: mach.Call(App, .tick),
|
||||
app_deinit: mach.Call(App, .deinit),
|
||||
app_audio_state_change: mach.Call(App, .audio_state_change),
|
||||
app_mod: mach.Functions(App),
|
||||
) !void {
|
||||
core.on_tick = app_tick.id;
|
||||
core.on_exit = app_deinit.id;
|
||||
core.on_tick = app_mod.id.tick;
|
||||
core.on_exit = app_mod.id.deinit;
|
||||
|
||||
// Configure the audio module to send our app's .audio_state_change event when an entity's sound
|
||||
// finishes playing.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue