commit e8a45e744e5ee4adcbd8aa9b62ba329d4c5ea20c
parent 8e09eb976a0b3d7d1ae73151fdea536557408679
Author: amin <dev@aminmesbah.com>
Date: Sun, 9 Jun 2019 20:24:03 +0000
Comment scopes
FossilOrigin-Name: 2879649e4abca177c897d60a5ddd11d136d26f52993d7007435e763548e5b07f
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/game.c b/src/game.c
@@ -170,6 +170,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga
rect viewport = {0};
f32 ppm = 0.0f;
+ // game_update_viewport
{
f32 screen_aspect_ratio = (f32)framebuffer.width / (f32)framebuffer.height;
if (screen_aspect_ratio < ROOM_ASPECT_RATIO)
@@ -220,6 +221,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga
assert(r);
+ // game_print_player_chunk
{
v2i c_i = world_room_get_chunk_index(current_room_i);
struct WorldChunk *c = world_chunk_get(game_state->world, c_i);
@@ -237,7 +239,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga
u32 *tiles = r->tiles;
- // render tiles
+ // game_render_tiles
{
shader_use(&game_state->renderer.shader);
@@ -306,7 +308,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga
}
}
- // update player
+ // game_update_player
{
struct Entity *player = &game_state->player;
f32 dt = game_input->dt;
@@ -357,6 +359,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga
math_clamp(&player->velocity.x, -max_meters_per_second, max_meters_per_second);
math_clamp(&player->velocity.y, -max_meters_per_second, max_meters_per_second);
+ // game_detect_collisions
{
#define RENDER_COLLISION_DEBUG_QUAD(r, c) render_debug_quad(game_state, (r), (c), &view, &projection);
v2 player_delta = math_v2f_m(player->velocity, dt);
@@ -546,7 +549,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga
player->pos = world_pos_recanonicalize(player->pos);
}
- // render player
+ // game_render_player
{
shader_use(&game_state->renderer.shader);
struct Entity player = game_state->player;