Skip to content

Commit

Permalink
minor code cleanup, update sokol-zig
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Aug 17, 2024
1 parent ff73289 commit 2440a20
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
.dependencies = .{
// sokol only needed for the actual emulators
.sokol = .{
.url = "git+https://github.com/floooh/sokol-zig.git#afd2c467a6049f89edd7282749478c9bc2b57078",
.hash = "122098e53bf5cb223cde8f123d81680932d66e9ec971e99b5f20a1b7ba0a9ca7ad4c",
.url = "git+https://github.com/floooh/sokol-zig.git#9e4eabae83c74df29b24cdba7b31e985a2d8c33f",
.hash = "12209706d64fa2127cc2d48134c22790d70f561c40bdeb4589fa7f9c41c4f53fe9da",
},
},
.paths = .{
Expand Down
9 changes: 5 additions & 4 deletions emus/bombjack/bombjack.zig
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ fn keyToInput(key: sapp.Keycode) Bombjack.Input {
};
}

export fn input(ev: [*c]const sapp.Event) void {
switch (ev.*.type) {
.KEY_DOWN => sys.setInput(keyToInput(ev.*.key_code)),
.KEY_UP => sys.clearInput(keyToInput(ev.*.key_code)),
export fn input(event: ?*const sapp.Event) void {
const ev = event.?;
switch (ev.type) {
.KEY_DOWN => sys.setInput(keyToInput(ev.key_code)),
.KEY_UP => sys.clearInput(keyToInput(ev.key_code)),
else => {},
}
}
Expand Down
9 changes: 5 additions & 4 deletions emus/namco/namco.zig
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ fn keyToInput(key: sapp.Keycode) Namco.Input {
};
}

export fn input(ev: [*c]const sapp.Event) void {
switch (ev.*.type) {
.KEY_DOWN => sys.setInput(keyToInput(ev.*.key_code)),
.KEY_UP => sys.clearInput(keyToInput(ev.*.key_code)),
export fn input(event: ?*const sapp.Event) void {
const ev = event.?;
switch (ev.type) {
.KEY_DOWN => sys.setInput(keyToInput(ev.key_code)),
.KEY_UP => sys.clearInput(keyToInput(ev.key_code)),
else => {},
}
}
Expand Down

0 comments on commit 2440a20

Please sign in to comment.