better struct and files organization, and still only half raycast on map but no view created

This commit is contained in:
hugogogo
2022-04-22 17:38:29 +02:00
parent 00c9dfd6b8
commit fac1f78230
17 changed files with 602 additions and 505 deletions

View File

@@ -27,17 +27,16 @@ void init_parsing(int ac, char **av, t_game *game);
// SRC/HOOK
// -------------------------------
// keyhook.c
int keypress(int keycode, t_game *game);
int keyrelease(int keycode, t_game *game);
// key_do_action.c
void keypress_do_action(t_game *game);
// key_is_action_1.c
int keypress(int keycode, t_game *game);
int keyrelease(int keycode, t_game *game);
int hook_action(t_game *game);
// key_action_1.c
int is_esc(int *k_hook, int *is_action);
int is_go_left(int *k_hook, int *is_action);
int is_go_right(int *k_hook, int *is_action);
int is_go_forward(int *k_hook, int *is_action);
int is_go_backward(int *k_hook, int *is_action);
// key_is_action_2.c
// key_action_2.c
int is_turn_left(int *k_hook, int *is_action);
int is_turn_right(int *k_hook, int *is_action);
@@ -46,13 +45,15 @@ int is_turn_right(int *k_hook, int *is_action);
// SRC/PLAYER
// -------------------------------
// player_moves.c
void plr_posx_decrement(t_game *game);
void plr_posy_decrement(t_game *game);
void plr_posx_increment(t_game *game);
void plr_posy_increment(t_game *game);
void plr_posx_decrement(t_game *game, t_plr *plr);
void plr_posy_decrement(t_game *game, t_plr *plr);
void plr_posx_increment(t_game *game, t_plr *plr);
void plr_posy_increment(t_game *game, t_plr *plr);
// player_rotates.c
void plr_turn_right(t_game *game);
void plr_turn_left(t_game *game);
void rotate(t_plr *plr, t_coord *coord);
void rotate_double(t_plr *plr, t_d_coord *coord);
void plr_turn_right(t_plr *plr);
void plr_turn_left(t_plr *plr);
// player_limits.c
int plr_out_limits(t_game *game, int x, int y);
int is_wall(t_game *game, int cell_x, int cell_y);
@@ -62,12 +63,11 @@ int is_wall(t_game *game, int cell_x, int cell_y);
// -------------------------------
// draw.c
void draw_pixel(t_game *game, int x, int y, int color);
void rotate(t_game *game, int *x, int *y);
void rotate_double(t_game *game, double *x, double *y);
void draw_line(t_game *game, int start_x, int start_y, int end_x, int end_y, int color);
void draw_line(t_game *game, t_vec vec, int color);
void draw(t_game *game);
// draw_window.c
void draw_rays(t_game *game);
void draw_map(t_game *game);
// raycast.c
void raycast(t_game *game, t_rcast *rcast);
// ray_intersect.c
void ray_intersect(t_game *game, t_rcast *rcast, t_vec *ray);
#endif