Refactor header files for consistency and clarity; update function signatures in parser.h and player.h

This commit is contained in:
whaffman 2025-06-10 19:33:05 +02:00
parent 555f2dc00c
commit c87ff10b57
7 changed files with 64 additions and 65 deletions

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* cub3d.h :+: :+: :+: */ /* cub3d.h :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/04/15 12:22:29 by qmennen #+# #+# */ /* Created: 2025/04/15 12:22:29 by qmennen #+# #+# */
/* Updated: 2025/06/10 15:48:20 by qmennen ### ########.fr */ /* Updated: 2025/06/10 19:29:49 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -20,13 +20,13 @@
# define HEIGHT 1080 # define HEIGHT 1080
# define TITLE "Cub3D" # define TITLE "Cub3D"
#ifndef FULLSCREEN # ifndef FULLSCREEN
# define FULLSCREEN 1 # define FULLSCREEN 1
#endif # endif
#ifndef START_STATE # ifndef START_STATE
# define START_STATE GAME_STATE_MENU # define START_STATE GAME_STATE_MENU
#endif # endif
# ifndef M_PI # ifndef M_PI
# define M_PI 3.14159265358979323846 # define M_PI 3.14159265358979323846

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* game_menu.h :+: :+: :+: */ /* game_menu.h :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/05/27 15:07:48 by qmennen #+# #+# */ /* Created: 2025/05/27 15:07:48 by qmennen #+# #+# */
/* Updated: 2025/06/10 15:20:30 by qmennen ### ########.fr */ /* Updated: 2025/06/10 19:30:12 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -30,8 +30,7 @@ void menu_toggle(t_menu *menu);
char *get_score_prefix(int index); char *get_score_prefix(int index);
char *get_score_suffix(int index); char *get_score_suffix(int index);
void draw_score_line( 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); char *get_score_text(char *prefix, char *suffix, int score);
#endif #endif

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* parser.h :+: :+: :+: */ /* parser.h :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/04/19 14:41:55 by whaffman #+# #+# */ /* Created: 2025/04/19 14:41:55 by whaffman #+# #+# */
/* Updated: 2025/06/10 15:49:46 by qmennen ### ########.fr */ /* 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); unsigned int parse_color(const char *color_str);
int parse_config_line(char *line, t_map *map); int parse_config_line(char *line, t_map *map);
int map_width(char **lines); 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_map(char **lines, t_game *game);
int parse_file(char *buffer, t_game *game); int parse_file(char *buffer, t_game *game);
void print_config(t_map *map); void print_config(t_map *map);

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* player.h :+: :+: :+: */ /* player.h :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/04/15 18:53:27 by qmennen #+# #+# */ /* Created: 2025/04/15 18:53:27 by qmennen #+# #+# */
/* Updated: 2025/06/04 18:42:25 by qmennen ### ########.fr */ /* Updated: 2025/06/10 19:29:24 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* render.h :+: :+: :+: */ /* render.h :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/04/15 16:28:16 by qmennen #+# #+# */ /* Created: 2025/04/15 16:28:16 by qmennen #+# #+# */
/* Updated: 2025/06/10 14:30:30 by qmennen ### ########.fr */ /* Updated: 2025/06/10 19:30:21 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -15,6 +15,7 @@
# include "cub3d.h" # include "cub3d.h"
# define MIN_SPRITE_DIST 0.1 # define MIN_SPRITE_DIST 0.1
void render_map(t_game *game); void render_map(t_game *game);
t_render cast_ray(t_game *game, int x); t_render cast_ray(t_game *game, int x);
void cast_rays(t_game *game); void cast_rays(t_game *game);

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* types.h :+: :+: :+: */ /* types.h :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/04/15 15:52:44 by qmennen #+# #+# */ /* Created: 2025/04/15 15:52:44 by qmennen #+# #+# */
/* Updated: 2025/06/10 15:06:16 by qmennen ### ########.fr */ /* Updated: 2025/06/10 19:30:40 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* :::::::: */
/* game_manager.c :+: :+: :+: */ /* game_manager.c :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+ */
/* Created: 2025/05/27 13:48:18 by qmennen #+# #+# */ /* Created: 2025/05/27 13:48:18 by qmennen #+# #+# */
/* Updated: 2025/06/10 15:19:59 by qmennen ### ########.fr */ /* 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); menu_free(manager->menu, manager->game->screen);
if (manager->end_screen) if (manager->end_screen)
menu_free(manager->end_screen, manager->game->screen); menu_free(manager->end_screen, manager->game->screen);
print_scores(manager->game);
if (manager->game) if (manager->game)
game_free(manager->game); game_free(manager->game);
mlx_close_window(manager->game->screen->mlx); mlx_close_window(manager->game->screen->mlx);