From 3f03c37bd2a47f1ab17aae973a6bf5821146719e Mon Sep 17 00:00:00 2001 From: attilavs2 Date: Thu, 1 Aug 2024 00:01:34 +0200 Subject: [PATCH] clang-format sur src/* (+ hook clang-format ?) --- src/game.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/game.c b/src/game.c index 47a6be0..1b84b1f 100644 --- a/src/game.c +++ b/src/game.c @@ -86,12 +86,12 @@ void game_render_indicator(Game *game) { dimage(5, 5, &SignAction_img); int i; Player *player = &game->player; - for(i=0;imap_level->nbPortal;i++){ + for(i = 0; i < game->map_level->nbPortal; i++) { Portal *portal = &game->map_level->portals[i]; - if(player->x >= portal->collider.x1*PXSIZE && - player->x < portal->collider.x2*PXSIZE && - player->y >= portal->collider.y1*PXSIZE && - player->y < portal->collider.y2*PXSIZE){ + if(player->x >= portal->collider.x1 * PXSIZE && + player->x < portal->collider.x2 * PXSIZE && + player->y >= portal->collider.y1 * PXSIZE && + player->y < portal->collider.y2 * PXSIZE) { dimage(5, 5, &SignAction_img); break; } @@ -144,19 +144,19 @@ void game_get_inputs(Game *game) { } } Player *player = &game->player; - if(keydown(KEY_SHIFT)){ + if(keydown(KEY_SHIFT)) { int i; - for(i=0;imap_level->nbPortal;i++){ + for(i = 0; i < game->map_level->nbPortal; i++) { Portal *portal = &game->map_level->portals[i]; - if(player->x >= portal->collider.x1*PXSIZE && - player->x < portal->collider.x2*PXSIZE && - player->y >= portal->collider.y1*PXSIZE && - player->y < portal->collider.y2*PXSIZE){ - Portal *dest_portal = (Portal*)portal->portal; + if(player->x >= portal->collider.x1 * PXSIZE && + player->x < portal->collider.x2 * PXSIZE && + player->y >= portal->collider.y1 * PXSIZE && + player->y < portal->collider.y2 * PXSIZE) { + Portal *dest_portal = (Portal *)portal->portal; Collider dest_collider = dest_portal->collider; - Map *dest_map = (Map*)portal->map; - player->x = (dest_collider.x1+dest_collider.x2)/2*PXSIZE; - player->y = (dest_collider.y1+dest_collider.y2)/2*PXSIZE; + Map *dest_map = (Map *)portal->map; + player->x = (dest_collider.x1 + dest_collider.x2) / 2 * PXSIZE; + player->y = (dest_collider.y1 + dest_collider.y2) / 2 * PXSIZE; game->map_level = dest_map; /* TODO: Make something cleaner */ while(keydown(KEY_SHIFT)) {