diff --git a/inc/cub3d.h b/inc/cub3d.h index 9dfb676..ea7991f 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ -/* cub3d.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: qmennen +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/04/15 12:22:29 by qmennen #+# #+# */ -/* Updated: 2025/06/10 15:48:20 by qmennen ### ########.fr */ +/* :::::::: */ +/* cub3d.h :+: :+: */ +/* +:+ */ +/* By: qmennen +#+ */ +/* +#+ */ +/* Created: 2025/04/15 12:22:29 by qmennen #+# #+# */ +/* Updated: 2025/06/10 19:29:49 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -20,13 +20,13 @@ # define HEIGHT 1080 # define TITLE "Cub3D" -#ifndef FULLSCREEN -# define FULLSCREEN 1 -#endif +# ifndef FULLSCREEN +# define FULLSCREEN 1 +# endif -#ifndef START_STATE -# define START_STATE GAME_STATE_MENU -#endif +# ifndef START_STATE +# define START_STATE GAME_STATE_MENU +# endif # ifndef M_PI # define M_PI 3.14159265358979323846 @@ -71,7 +71,7 @@ # include "monster.h" int initialize_cub3d(t_game **game, const char *mapfile); -int shader_init(void); +int shader_init(void); void set_uniforms(t_game *game); int load_uniforms(t_game **game); void count_scores(t_game *game); diff --git a/inc/game_menu.h b/inc/game_menu.h index a7229c8..cf49288 100644 --- a/inc/game_menu.h +++ b/inc/game_menu.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ -/* game_menu.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: qmennen +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/05/27 15:07:48 by qmennen #+# #+# */ -/* Updated: 2025/06/10 15:20:30 by qmennen ### ########.fr */ +/* :::::::: */ +/* game_menu.h :+: :+: */ +/* +:+ */ +/* By: qmennen +#+ */ +/* +#+ */ +/* Created: 2025/05/27 15:07:48 by qmennen #+# #+# */ +/* Updated: 2025/06/10 19:30:12 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -22,16 +22,15 @@ mlx_image_t *menu_load_background(mlx_t *mlx, char *background_path); void menu_set_background(t_menu *menu, mlx_t *mlx, char *b_path); t_menu *create_main_menu(t_game_manager *manager); t_menu *menu_create(t_game_manager *manager, char *b_path, - const t_menu_item *options[]); + const t_menu_item *options[]); t_menu_item *menu_item_create(t_screen *screen, const char *text, - void (*act)(struct s_menu_item *item, t_game_manager *manager)); + void (*act)(struct s_menu_item *item, t_game_manager *manager)); void menu_free(t_menu *menu, t_screen *screen); void menu_toggle(t_menu *menu); char *get_score_prefix(int index); char *get_score_suffix(int index); void draw_score_line( - mlx_t *mlx, mlx_image_t **img, char *text, t_vec2_int pos -); + mlx_t *mlx, mlx_image_t **img, char *text, t_vec2_int pos); char *get_score_text(char *prefix, char *suffix, int score); #endif \ No newline at end of file diff --git a/inc/parser.h b/inc/parser.h index 4179ba9..0fd3f74 100644 --- a/inc/parser.h +++ b/inc/parser.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ -/* parser.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: qmennen +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/04/19 14:41:55 by whaffman #+# #+# */ -/* Updated: 2025/06/10 15:49:46 by qmennen ### ########.fr */ +/* :::::::: */ +/* parser.h :+: :+: */ +/* +:+ */ +/* By: qmennen +#+ */ +/* +#+ */ +/* Created: 2025/04/19 14:41:55 by whaffman #+# #+# */ +/* Updated: 2025/06/10 18:41:08 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -22,7 +22,7 @@ int is_map_line(const char *line); unsigned int parse_color(const char *color_str); int parse_config_line(char *line, t_map *map); int map_width(char **lines); -int parse_tile(char c); +int parse_tile(t_game *game, char c); int parse_map(char **lines, t_game *game); int parse_file(char *buffer, t_game *game); void print_config(t_map *map); @@ -30,7 +30,7 @@ int parse_map_line(char **lines, t_game *game, int i); t_tile **copy_map(t_tile **grid, int width, int height); char **pointer_lines(char *buffer, char c); int valid_arguments(int argc, char **argv); -int map_entries_present(t_game *game); +int map_entries_present(t_game *game); int handle_wall(char *token, t_map *map); int handle_fc_color(char *token, t_map *map); int handle_fc_texture(char *token, t_map *map); diff --git a/inc/player.h b/inc/player.h index 4054091..557cd7c 100644 --- a/inc/player.h +++ b/inc/player.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ -/* player.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: qmennen +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/04/15 18:53:27 by qmennen #+# #+# */ -/* Updated: 2025/06/04 18:42:25 by qmennen ### ########.fr */ +/* :::::::: */ +/* player.h :+: :+: */ +/* +:+ */ +/* By: qmennen +#+ */ +/* +#+ */ +/* Created: 2025/04/15 18:53:27 by qmennen #+# #+# */ +/* Updated: 2025/06/10 19:29:24 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -18,7 +18,7 @@ int player_create(t_game **game); void player_update(t_game *game, double delta_time); void visit_area(t_game *game); -void rotate(t_player *player, double rot_speed, double delta); +void rotate(t_player *player, double rot_speed, double delta); void interact_door(t_game *game); #endif diff --git a/inc/render.h b/inc/render.h index 2e7030e..4547dc5 100644 --- a/inc/render.h +++ b/inc/render.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ -/* render.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: qmennen +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/04/15 16:28:16 by qmennen #+# #+# */ -/* Updated: 2025/06/10 14:30:30 by qmennen ### ########.fr */ +/* :::::::: */ +/* render.h :+: :+: */ +/* +:+ */ +/* By: qmennen +#+ */ +/* +#+ */ +/* Created: 2025/04/15 16:28:16 by qmennen #+# #+# */ +/* Updated: 2025/06/10 19:30:21 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -15,6 +15,7 @@ # include "cub3d.h" # define MIN_SPRITE_DIST 0.1 + void render_map(t_game *game); t_render cast_ray(t_game *game, int x); void cast_rays(t_game *game); diff --git a/inc/types.h b/inc/types.h index 9690a7f..318aae7 100644 --- a/inc/types.h +++ b/inc/types.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ -/* types.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: qmennen +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/04/15 15:52:44 by qmennen #+# #+# */ -/* Updated: 2025/06/10 15:06:16 by qmennen ### ########.fr */ +/* :::::::: */ +/* types.h :+: :+: */ +/* +:+ */ +/* By: qmennen +#+ */ +/* +#+ */ +/* Created: 2025/04/15 15:52:44 by qmennen #+# #+# */ +/* Updated: 2025/06/10 19:30:40 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -202,7 +202,7 @@ typedef struct s_menu_item void (*act)(struct s_menu_item *item, t_game_manager *manager); } t_menu_item; -typedef struct s_menu +typedef struct s_menu { int selected_option; int num_options; diff --git a/src/manager/game_manager.c b/src/manager/game_manager.c index f6e9557..1b313b2 100644 --- a/src/manager/game_manager.c +++ b/src/manager/game_manager.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* ::: :::::::: */ -/* game_manager.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: qmennen +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2025/05/27 13:48:18 by qmennen #+# #+# */ -/* Updated: 2025/06/10 15:19:59 by qmennen ### ########.fr */ +/* :::::::: */ +/* game_manager.c :+: :+: */ +/* +:+ */ +/* By: qmennen +#+ */ +/* +#+ */ +/* Created: 2025/05/27 13:48:18 by qmennen #+# #+# */ +/* Updated: 2025/06/10 19:16:24 by whaffman ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -59,7 +59,6 @@ void game_manager_destroy(t_game_manager *manager) menu_free(manager->menu, manager->game->screen); if (manager->end_screen) menu_free(manager->end_screen, manager->game->screen); - print_scores(manager->game); if (manager->game) game_free(manager->game); mlx_close_window(manager->game->screen->mlx);