diff options
| author | realtradam <[email protected]> | 2023-06-06 07:07:58 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-06-06 07:07:58 -0400 |
| commit | e0db1d21b1d0a08e32b5796d170cd6af9b2f5c9f (patch) | |
| tree | 557d9fa8ee925b8259ec8b785063e898a093c67e /src/wall.c | |
| parent | 6c2a5968c27bffe4233be55d13ce01c63ab292ef (diff) | |
| download | rodeo_sample_game-e0db1d21b1d0a08e32b5796d170cd6af9b2f5c9f.tar.gz rodeo_sample_game-e0db1d21b1d0a08e32b5796d170cd6af9b2f5c9f.zip | |
initialize collision vectors with reasonable sizes
Diffstat (limited to 'src/wall.c')
| -rw-r--r-- | src/wall.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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]); } } |
