Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ const Options = struct {
pub fn build(b: *Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const opt_use_gles3 = b.option(bool, "gles3", "Force OpenGL ES3 (default: false)") orelse false;
const opt_use_wayland = b.option(bool, "wayland", "Force Wayland (default: false, Linux only, not supported in main-line headers)") orelse false;
const dep_sokol = b.dependency("sokol", .{
.target = target,
.optimize = optimize,
.gles3 = opt_use_gles3,
.wayland = opt_use_wayland,
});
const mod_pacman = b.createModule(.{
.root_source_file = b.path("src/pacman.zig"),
Expand Down
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
.fingerprint = 0xa1c2e4b869826271,
.dependencies = .{
.sokol = .{
.url = "git+https://github.com/floooh/sokol-zig.git#baa842af7081c0d26d94847c5ecb398d8c5005cb",
.hash = "sokol-0.1.0-pb1HK_-oNgARi7JDvtvcu9fo8-5ArHCZ3u2bcBsFsu0y",
.url = "git+https://github.com/floooh/sokol-zig.git#6ca71321c91e842fb32a8140802a546e50d8a086",
.hash = "sokol-0.1.0-pb1HK9lgNwAAB5SLJlpJQ09PZ2CVydxkNs0KaptLaTUD",
},
},
}
6 changes: 3 additions & 3 deletions src/pacman.zig
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const SoundFunc = *const fn (usize) void;
const SoundDesc = struct {
func: ?SoundFunc = null, // optional pointer to sound effect callback if this is a procedural sound
dump: ?[]const u32 = null, // optional register dump data slice
voice: [NumVoices]bool = .{false} ** NumVoices,
voice: [NumVoices]bool = @splat(false),
};

// a sound 'hardware voice' (of a Namco WSG emulation)
Expand All @@ -285,7 +285,7 @@ const Sound = struct {
dump: ?[]const u32 = null, // optional register dump data
num_ticks: u32 = 0, // sound effect length in ticks (only for register dump sounds)
stride: u32 = 0, // register data stride for multivoice dumps (1,2 or 3)
voice: [NumVoices]bool = .{false} ** NumVoices,
voice: [NumVoices]bool = @splat(false),
};

// all mutable state is in a single nested global
Expand Down Expand Up @@ -1493,7 +1493,7 @@ fn gameInitPlayfield() void {
\\2BBBBBBBBBBBBBBBBBBBBBBBBBB3
;
// map ASCII to tile codes
var t = [_]u8{TileCodeDot} ** 128;
var t: [128]u8 = @splat(TileCodeDot);
t['_'] = 0x40;
t['0'] = 0xD1;
t['1'] = 0xD0;
Expand Down
Loading