a-game

2D platformer written from scratch.
git clone git://git.amin.space/a-game.git
Log | Files | Refs | README | LICENSE

commit 816d59eda82961bb36c8df99f9826f14a21e9d14
parent 5777b526116d9eb8a349e82423d5230453dd9da0
Author: amin <dev@aminmesbah.com>
Date:   Sun,  2 Jun 2019 01:27:16 +0000

Remove unused param

FossilOrigin-Name: cb8884c294bae27343036a74bc06fac644e05bcf6b1d39480231a9c9efd27f46
Diffstat:
Msrc/game.c | 8++++----
Msrc/world.c | 4+---
2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/game.c b/src/game.c @@ -419,7 +419,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga v2 norm_l = {-1.0f, 0.0f}; v2 norm_r = {1.0f, 0.0f}; - if (!wall_is_screen_edge(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_BOTTOM)) && !wall_is_internal(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_BOTTOM))) + if (!wall_is_screen_edge(math_rect_get_edge(tile_aabb, RECT_EDGE_BOTTOM)) && !wall_is_internal(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_BOTTOM))) { struct WallCollision bottom = get_wall_collision(player->pos.local, new_p, tile_sum_b, norm_b); if (bottom.collision_occurred) @@ -436,7 +436,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga RENDER_COLLISION_DEBUG_QUAD(collision, ((v3) {1.0f, 0.0f, 0.0f})); } } - if (!wall_is_screen_edge(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_TOP)) && !wall_is_internal(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_TOP))) + if (!wall_is_screen_edge(math_rect_get_edge(tile_aabb, RECT_EDGE_TOP)) && !wall_is_internal(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_TOP))) { struct WallCollision top = get_wall_collision(player->pos.local, new_p, tile_sum_t, norm_t); if (top.collision_occurred) @@ -453,7 +453,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga RENDER_COLLISION_DEBUG_QUAD(collision, ((v3) {0.0f, 1.0f, 0.0f})); } } - if (!wall_is_screen_edge(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_LEFT)) && !wall_is_internal(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_LEFT))) + if (!wall_is_screen_edge(math_rect_get_edge(tile_aabb, RECT_EDGE_LEFT)) && !wall_is_internal(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_LEFT))) { struct WallCollision left = get_wall_collision(player->pos.local, new_p, tile_sum_l, norm_l); if (left.collision_occurred) @@ -470,7 +470,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga RENDER_COLLISION_DEBUG_QUAD(collision, ((v3) {0.0f, 0.0f, 1.0f})); } } - if (!wall_is_screen_edge(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_RIGHT)) && !wall_is_internal(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_RIGHT))) + if (!wall_is_screen_edge(math_rect_get_edge(tile_aabb, RECT_EDGE_RIGHT)) && !wall_is_internal(tiles, math_rect_get_edge(tile_aabb, RECT_EDGE_RIGHT))) { struct WallCollision right = get_wall_collision(player->pos.local, new_p, tile_sum_r, norm_r); if (right.collision_occurred) diff --git a/src/world.c b/src/world.c @@ -223,10 +223,8 @@ internal bool tile_is_solid(u32 *tiles, v2 tile_pos) return is_solid; } -internal bool wall_is_screen_edge(u32 *tiles, segment wall) +internal bool wall_is_screen_edge(segment wall) { - assert(tiles); - bool is_screen_edge = false; bool wall_is_horizontal = wall.min.y == wall.max.y; bool wall_is_vertical = wall.min.x == wall.max.x;