diff --git a/build.zig b/build.zig index e5b006f..99f30b6 100644 --- a/build.zig +++ b/build.zig @@ -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"), diff --git a/build.zig.zon b/build.zig.zon index f1bf0bb..f6d763f 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -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", }, }, } diff --git a/src/pacman.zig b/src/pacman.zig index cc35e10..37e66d2 100644 --- a/src/pacman.zig +++ b/src/pacman.zig @@ -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) @@ -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 @@ -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;