Zig 0.15
I'm new to Zig and am welcome to suggestions on how to improve this PR.
With zig build run -Doptimize=ReleaseFast I get similar performance than on 0.14, but with the default (Debug) optimize I get less than half of the FPS. That's why I updated the README to use ReleaseFast.
Fixes #30
Works for me on macOS 14.7.8 with zig 0.15.1
gh repo clone gh repo clone const-void/DOOM-fire-zig
cd DOOM-fire-zig
git checkout zig-0.15
gh pr checkout 31
zig build run
Code built and ran successfully
I assume the checkout to the zig-0.15 branch is necessary, as we don't want PR 31 to affect users with Zip 0.14
Works for me on macOS 14.7.8 with zig 0.15.1
gh repo clone gh repo clone const-void/DOOM-fire-zig
cd DOOM-fire-zig
git checkout zig-0.15
Unfortunately this fails for me:
dyld[37837]: segment '__CONST_ZIG' vm address out of order in /Users/henry/Projects/DOOM-fire-zig/.zig-cache/o/33c225141b98d5becddbdfd80e8021f9/build dyld[37837]: segment '__CONST_ZIG' vm address out of order error: the following build command crashed: .zig-cache/o/33c225141b98d5becddbdfd80e8021f9/build /usr/local/Cellar/zig/0.15.1/bin/zig /usr/local/Cellar/zig/0.15.1/lib/zig /Users/henry/Projects/DOOM-fire-zig .zig-cache /Users/henry/.cache/zig --seed 0xd8d2a250 -Ze09a6b67631250b1 run
@hencomb After upgrading to macOS 26, I reproduce the problem. I already encountered it with Zig 0.13 so I don't think it's related to the OS version.
I think it's related to this issue and I modified the code to initialize the PRNG inside the only function that needs it. Alternatively we could allocate the PRNG on the heap to make sure it's not destroyed when the initRNG function goes out of scope.