aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-12-24 01:14:14 -0700
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-12-24 01:14:14 -0700
commit26b988fa9192b6465173c5fc1bb8b05896eb53c7 (patch)
treee3d6abddfa7f67501d62ce890aeaddf2d0bbaafa /src
parenteaa5e39d906034b287a054b7587d5e4d08c6c729 (diff)
Fixed the stars on widows
Diffstat (limited to 'src')
-rw-r--r--src/stars.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stars.c b/src/stars.c
index 2a6b9fa..6e95455 100644
--- a/src/stars.c
+++ b/src/stars.c
@@ -10,8 +10,8 @@ void initStars(Stars * stars) {
stars->starsUsed[i] = false;
}
-Vector3 generateStar() {
- SetRandomSeed(clock());
+Vector3 generateStar(unsigned int seed) {
+ SetRandomSeed(seed);
// Get direction.
Vector3 star = (Vector3){
@@ -45,7 +45,7 @@ void drawStars(Game * game, Stars * stars) {
stars->starsUsed[i] = false;
} else { // Reset star.
stars->starsUsed[i] = true;
- stars->stars[i] = Vector3Add(player->position, generateStar());
+ stars->stars[i] = Vector3Add(player->position, generateStar(time(NULL) + i));
}
}
}