clang-format sur src/* (+ hook clang-format ?)

This commit is contained in:
attilavs2 2024-08-01 00:01:34 +02:00
parent 7eaea821b6
commit 3f03c37bd2

View file

@ -86,12 +86,12 @@ void game_render_indicator(Game *game) {
dimage(5, 5, &SignAction_img); dimage(5, 5, &SignAction_img);
int i; int i;
Player *player = &game->player; Player *player = &game->player;
for(i=0;i<game->map_level->nbPortal;i++){ for(i = 0; i < game->map_level->nbPortal; i++) {
Portal *portal = &game->map_level->portals[i]; Portal *portal = &game->map_level->portals[i];
if(player->x >= portal->collider.x1*PXSIZE && if(player->x >= portal->collider.x1 * PXSIZE &&
player->x < portal->collider.x2*PXSIZE && player->x < portal->collider.x2 * PXSIZE &&
player->y >= portal->collider.y1*PXSIZE && player->y >= portal->collider.y1 * PXSIZE &&
player->y < portal->collider.y2*PXSIZE){ player->y < portal->collider.y2 * PXSIZE) {
dimage(5, 5, &SignAction_img); dimage(5, 5, &SignAction_img);
break; break;
} }
@ -144,19 +144,19 @@ void game_get_inputs(Game *game) {
} }
} }
Player *player = &game->player; Player *player = &game->player;
if(keydown(KEY_SHIFT)){ if(keydown(KEY_SHIFT)) {
int i; int i;
for(i=0;i<game->map_level->nbPortal;i++){ for(i = 0; i < game->map_level->nbPortal; i++) {
Portal *portal = &game->map_level->portals[i]; Portal *portal = &game->map_level->portals[i];
if(player->x >= portal->collider.x1*PXSIZE && if(player->x >= portal->collider.x1 * PXSIZE &&
player->x < portal->collider.x2*PXSIZE && player->x < portal->collider.x2 * PXSIZE &&
player->y >= portal->collider.y1*PXSIZE && player->y >= portal->collider.y1 * PXSIZE &&
player->y < portal->collider.y2*PXSIZE){ player->y < portal->collider.y2 * PXSIZE) {
Portal *dest_portal = (Portal*)portal->portal; Portal *dest_portal = (Portal *)portal->portal;
Collider dest_collider = dest_portal->collider; Collider dest_collider = dest_portal->collider;
Map *dest_map = (Map*)portal->map; Map *dest_map = (Map *)portal->map;
player->x = (dest_collider.x1+dest_collider.x2)/2*PXSIZE; player->x = (dest_collider.x1 + dest_collider.x2) / 2 * PXSIZE;
player->y = (dest_collider.y1+dest_collider.y2)/2*PXSIZE; player->y = (dest_collider.y1 + dest_collider.y2) / 2 * PXSIZE;
game->map_level = dest_map; game->map_level = dest_map;
/* TODO: Make something cleaner */ /* TODO: Make something cleaner */
while(keydown(KEY_SHIFT)) { while(keydown(KEY_SHIFT)) {