From f8f2487db0eab95063e1e478abd14a605c5fb90d Mon Sep 17 00:00:00 2001 From: Dylan Langston Date: Mon, 25 Dec 2023 11:41:48 -0500 Subject: [PATCH] Fixes --- src/Models/Starscape.zig | 8 +++----- src/Shared.zig | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Models/Starscape.zig b/src/Models/Starscape.zig index 2096de9..84bf399 100644 --- a/src/Models/Starscape.zig +++ b/src/Models/Starscape.zig @@ -4,16 +4,14 @@ const Shared = @import("../Shared.zig").Shared; pub const Starscape = struct { const STAR_COUNT = 500; - const MIN_STAR_SIZE: f32 = 0.1; + const MIN_STAR_SIZE: f32 = 0.25; const MAX_STAR_SIZE: f32 = 2.0; starTexture: raylib.Texture, pub fn init(screenSize: raylib.Vector2) Starscape { - @setEvalBranchQuota(5000); - var stars: [STAR_COUNT]raylib.Vector3 = undefined; - inline for (0..STAR_COUNT) |i| { + for (0..STAR_COUNT) |i| { stars[i] = raylib.Vector3.init( Shared.Random.Get().float(f32) * screenSize.x, Shared.Random.Get().float(f32) * screenSize.y, @@ -24,7 +22,7 @@ pub const Starscape = struct { { raylib.beginTextureMode(renderTexture); raylib.clearBackground(Shared.Color.Transparent); - inline for (stars) |star| { + for (stars) |star| { raylib.drawCircleGradient( @intFromFloat(star.x), @intFromFloat(star.y), diff --git a/src/Shared.zig b/src/Shared.zig index cfca5e7..578835f 100644 --- a/src/Shared.zig +++ b/src/Shared.zig @@ -173,7 +173,7 @@ pub const Shared = struct { pub inline fn Play(sound: AssetManager.Sounds) void { const s = Get(sound); - if (s != null and !raylib.isSoundPlaying(s.?)) { + if (s != null) { raylib.playSound(s.?); } }