diff options
author | Jordan Halase <jordan@halase.me> | 2019-09-27 17:05:05 -0500 |
---|---|---|
committer | Jordan Halase <jordan@halase.me> | 2019-09-27 17:05:05 -0500 |
commit | a9798702ddb7e4bcb7b9154db08579ed07faadfb (patch) | |
tree | e63bd30fd9f464695a6b8a367a1a85122076b31c | |
parent | f754a990d27369e1c21f5d3314770ebd5a2bf1aa (diff) |
Do not export functions in single compilation unit
-rw-r--r-- | main.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -32,7 +32,7 @@ #define PIOVER2 1.570796327f #define INVSQRT2 0.707106781f -void fatal_sdl() +static void fatal_sdl() { fprintf(stderr, "%s\n", SDL_GetError()); SDL_ShowSimpleMessageBox( @@ -83,7 +83,7 @@ struct BulletPool { struct BulletPool player_bullets; -bool bullets_shoot(struct BulletPool *pool, const vec2 position, const vec2 velocity) +static bool bullets_shoot(struct BulletPool *pool, const vec2 position, const vec2 velocity) { if (pool->used >= MAX_BULLETS) { return false; @@ -117,7 +117,7 @@ static bool is_point_in_screen(const vec2 position) return true; } -void bullets_integrate(struct BulletPool *pool) +static void bullets_integrate(struct BulletPool *pool) { for (uint32_t i = 0; i < MAX_BULLETS; ++i) { if (!viszero(pool->bullets[i].velocity)) { @@ -131,7 +131,7 @@ void bullets_integrate(struct BulletPool *pool) } } -void bullets_draw(const struct BulletPool *pool, SDL_Renderer *ren) +static void bullets_draw(const struct BulletPool *pool, SDL_Renderer *ren) { uint32_t num_bullets = 0; SDL_Point points[MAX_BULLETS]; @@ -171,7 +171,7 @@ struct Player { #define PLAYER_RENDER_RADIUS INVSQRT2 -void player_create(struct Player *player, const vec2 position, const float update_rate) +static void player_create(struct Player *player, const vec2 position, const float update_rate) { *player = (struct Player){ .body = { @@ -187,7 +187,7 @@ void player_create(struct Player *player, const vec2 position, const float updat }; } -void player_input(struct Player *player, const Uint8 *keys) +static void player_input(struct Player *player, const Uint8 *keys) { struct KinematicBody *body = &player->body; bool update_direction = false; @@ -226,7 +226,7 @@ void player_input(struct Player *player, const Uint8 *keys) } } -void kinematic_integrate(struct KinematicBody *body) +static void kinematic_integrate(struct KinematicBody *body) { body->angle += body->angular_velocity; while (body->angle < 0.0f) body->angle += TWOPI; @@ -246,7 +246,7 @@ void kinematic_integrate(struct KinematicBody *body) body->position = vadd(body->position, body->velocity); } -void kinematic_wrap(struct KinematicBody *body) +static void kinematic_wrap(struct KinematicBody *body) { while (body->position.x > SCREEN_WIDTH_F + body->collision_radius) { body->position.x -= SCREEN_WIDTH_F; |