Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanlangston committed Dec 25, 2023
1 parent 9b483a8 commit f8f2487
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/Models/Starscape.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/Shared.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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.?);
}
}
Expand Down

0 comments on commit f8f2487

Please sign in to comment.