diff --git a/include/collide.h b/include/collide.h index c7c9b49..2534393 100644 --- a/include/collide.h +++ b/include/collide.h @@ -10,10 +10,10 @@ /* return tile at the given position * -1 is out of bound */ uint8_t collide_point(Vec point, const Level *level, uint layer); -_Bool collide_right(Player *player, Vec position, const Level *level, uint layer_id); -_Bool collide_left(Player *player, Vec position, const Level *level, uint layer_id); -_Bool collide_down(Player *player, Vec position, const Level *level, uint layer_id); -_Bool collide_up(Player *player, Vec position, const Level *level, uint layer_id); -_Bool collide_full(Player *player, Vec position, const Level *level, uint layer_id); +bool collide_right(Player *player, Vec position, const Level *level, uint layer_id); +bool collide_left(Player *player, Vec position, const Level *level, uint layer_id); +bool collide_down(Player *player, Vec position, const Level *level, uint layer_id); +bool collide_up(Player *player, Vec position, const Level *level, uint layer_id); +bool collide_full(Player *player, Vec position, const Level *level, uint layer_id); #endif /* _DEF_PLAYER_COLLIDE */ diff --git a/include/input.h b/include/input.h index b63164b..818b379 100644 --- a/include/input.h +++ b/include/input.h @@ -2,6 +2,7 @@ #define _DEF_INPUT #include +#include #define KEYS_COUNT 5 @@ -35,9 +36,9 @@ void input_init(Input *input); /* display all keys states and information */ void input_draw_debug(Input *input); -_Bool input_is_pressed(Input *input, uint8_t key); -_Bool input_is_down(Input *input, uint8_t key); -_Bool input_is_released(Input *input, uint8_t key); -_Bool input_is_up(Input *input, uint8_t key); +bool input_is_pressed(Input *input, uint8_t key); +bool input_is_down(Input *input, uint8_t key); +bool input_is_released(Input *input, uint8_t key); +bool input_is_up(Input *input, uint8_t key); #endif /* _DEF_INPUT */ diff --git a/src/collide.c b/src/collide.c index 245f5a9..fe66488 100644 --- a/src/collide.c +++ b/src/collide.c @@ -21,7 +21,7 @@ uint8_t collide_point(Vec point, const Level *level, uint layer_id) } } -_Bool collide_right(Player *player, Vec position, const Level *level, uint layer_id) +bool collide_right(Player *player, Vec position, const Level *level, uint layer_id) { Vec pos; vec_cpy(&pos, position); @@ -39,7 +39,7 @@ _Bool collide_right(Player *player, Vec position, const Level *level, uint layer return false; } -_Bool collide_left(Player *player, Vec position, const Level *level, uint layer_id) +bool collide_left(Player *player, Vec position, const Level *level, uint layer_id) { Vec pos; vec_cpy(&pos, position); @@ -56,7 +56,7 @@ _Bool collide_left(Player *player, Vec position, const Level *level, uint layer_ return false; } -_Bool collide_down(Player *player, Vec position, const Level *level, uint layer_id) +bool collide_down(Player *player, Vec position, const Level *level, uint layer_id) { Vec pos; vec_cpy(&pos, position); @@ -74,7 +74,7 @@ _Bool collide_down(Player *player, Vec position, const Level *level, uint layer_ return false; } -_Bool collide_up(Player *player, Vec position, const Level *level, uint layer_id) +bool collide_up(Player *player, Vec position, const Level *level, uint layer_id) { Vec pos; vec_cpy(&pos, position); @@ -91,7 +91,7 @@ _Bool collide_up(Player *player, Vec position, const Level *level, uint layer_id return false; } -_Bool collide_full(Player *player, Vec position, const Level *level, uint layer_id) +bool collide_full(Player *player, Vec position, const Level *level, uint layer_id) { return collide_up(player, position, level, layer_id) || collide_down(player, position, level, layer_id); diff --git a/src/input.c b/src/input.c index 283be83..d582b9c 100644 --- a/src/input.c +++ b/src/input.c @@ -13,7 +13,7 @@ void input_step(Input *input) uint8_t *state = &input->states[i]; uint8_t key = input->keys[i]; /* get if the key is pressed */ - _Bool pressed = keydown(key); + bool pressed = keydown(key); /* update input status */ if (pressed) { @@ -53,22 +53,22 @@ void input_draw_debug(Input *input) } } -_Bool input_is_pressed(Input *input, uint8_t key) +bool input_is_pressed(Input *input, uint8_t key) { return input->states[key] == S_PRESSED; } -_Bool input_is_down(Input *input, uint8_t key) +bool input_is_down(Input *input, uint8_t key) { return (input->states[key] == S_DOWN) || (input->states[key] == S_PRESSED); } -_Bool input_is_released(Input *input, uint8_t key) +bool input_is_released(Input *input, uint8_t key) { return input->states[key] == S_RELEASED; } -_Bool input_is_up(Input *input, uint8_t key) +bool input_is_up(Input *input, uint8_t key) { return (input->states[key] == S_UP) || (input->states[key] == S_RELEASED); }