From e0db1d21b1d0a08e32b5796d170cd6af9b2f5c9f Mon Sep 17 00:00:00 2001 From: realtradam Date: Tue, 6 Jun 2023 07:07:58 -0400 Subject: initialize collision vectors with reasonable sizes --- src/wall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wall.c') diff --git a/src/wall.c b/src/wall.c index a815fb6..68642b1 100644 --- a/src/wall.c +++ b/src/wall.c @@ -16,7 +16,6 @@ init_wall(void) logo_texture = rodeo_gfx_texture_2d_create_from_path(cstr_lit("assets/tojam2023_tagline_header_clear.png")); uint16_t window_width = 1600; uint16_t window_height = 900; - collision_wall_world = rodeo_collision_2d_collection_create(); float walls[][4] = { {0, -10, window_width, 10}, {0, window_height, window_width, 10}, @@ -33,12 +32,13 @@ init_wall(void) {764,200,72,500}, {550,414,501,72} }; - int numwalls = sizeof(walls)/sizeof(walls[0]); + int32_t numwalls = sizeof(walls)/sizeof(walls[0]); + collision_wall_world = rodeo_collision_2d_collection_create(numwalls + 4); new_wall(0, -10, window_width, 10); new_wall(0, window_height, window_width, 10); new_wall(-10, 0, 10, window_height); new_wall(window_width, 0, 10, window_height); - for (int i = 0; i < numwalls; ++i) { + for (int32_t i = 0; i < numwalls; ++i) { new_wall(walls[i][0], walls[i][1], walls[i][2], walls[i][3]); } } -- cgit v1.2.3