From 6bb09aa098e7419e66a24cdf9665f9c4c8dae1f7 Mon Sep 17 00:00:00 2001 From: Joppe Boeve Date: Thu, 18 Jan 2024 11:14:45 +0100 Subject: [PATCH] Window title is scene file name. --- include/meta.h | 5 ++--- src/cub3d.c | 4 ++-- src/game/raycaster.c | 2 +- src/game/render_viewport.c | 3 +-- src/parser/parser.c | 5 +++-- texture_examples/wood.png | Bin 0 -> 1388 bytes 6 files changed, 9 insertions(+), 10 deletions(-) create mode 100755 texture_examples/wood.png diff --git a/include/meta.h b/include/meta.h index ae70eaa..7c2a36f 100644 --- a/include/meta.h +++ b/include/meta.h @@ -6,7 +6,7 @@ /* By: jboeve +#+ */ /* +#+ */ /* Created: 2023/11/01 20:07:37 by jboeve#+##+# */ -/* Updated: 2024/01/17 23:56:13 by joppe ######## odam.nl */ +/* Updated: 2024/01/18 11:13:46 by jboeve ######## odam.nl */ /**/ /* ************************************************************************** */ @@ -56,8 +56,6 @@ #define WINDOW_WIDTH 1280 #define WINDOW_HEIGHT 720 -#define WINDOW_TITLE "Gammoe" - // Game @@ -199,6 +197,7 @@ typedef struct s_meta { uint32_t fps; t_map map; t_attr attributes; + const char *scene_name; char *map_element; } t_meta; diff --git a/src/cub3d.c b/src/cub3d.c index 16fd9bd..d1cdad1 100644 --- a/src/cub3d.c +++ b/src/cub3d.c @@ -6,7 +6,7 @@ /* By: yzaim +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/08 15:24:47 by yzaim #+# #+# */ -/* Updated: 2024/01/17 16:28:16 by jboeve ######## odam.nl */ +/* Updated: 2024/01/18 10:45:29 by jboeve ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -52,7 +52,7 @@ void leaks(void) // change to create a different image for the minimap vs. main viewport int init_mlx_images(t_meta *meta) { - meta->mlx = mlx_init(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE, true); + meta->mlx = mlx_init(WINDOW_WIDTH, WINDOW_HEIGHT, meta->scene_name, true); if (!meta->mlx) { ft_error(); diff --git a/src/game/raycaster.c b/src/game/raycaster.c index a9a5d60..103e16b 100644 --- a/src/game/raycaster.c +++ b/src/game/raycaster.c @@ -6,7 +6,7 @@ /* By: yzaim +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/08 15:27:33 by yzaim #+# #+# */ -/* Updated: 2024/01/17 16:27:30 by jboeve ######## odam.nl */ +/* Updated: 2024/01/18 11:13:21 by jboeve ######## odam.nl */ /* */ /* ************************************************************************** */ diff --git a/src/game/render_viewport.c b/src/game/render_viewport.c index 5872d51..7a87e8a 100644 --- a/src/game/render_viewport.c +++ b/src/game/render_viewport.c @@ -6,7 +6,7 @@ /* By: yzaim +#+ */ /* +#+ */ /* Created: 2024/01/08 15:28:08 by yzaim #+# #+# */ -/* Updated: 2024/01/17 23:59:00 by joppe ######## odam.nl */ +/* Updated: 2024/01/18 11:14:19 by jboeve ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -62,4 +62,3 @@ void render_viewport(mlx_image_t *image, t_player *p) col++; } } - diff --git a/src/parser/parser.c b/src/parser/parser.c index 90fcc4b..25622b4 100644 --- a/src/parser/parser.c +++ b/src/parser/parser.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /**/ /*::: :::::::: */ -/* parser.c :+::+: */ +/* parser.c :+: :+: */ /*+:+ +:+ +:+ */ /* By: yzaim +#+ +:+ +#+*/ /*+#+#+#+#+#+ +#+ */ /* Created: 2023/11/09 18:08:19 by yzaim #+##+# */ -/* Updated: 2024/01/02 18:57:56 by joppe ######## odam.nl */ +/* Updated: 2024/01/18 10:45:18 by jboeve ######## odam.nl */ /**/ /* ************************************************************************** */ @@ -91,6 +91,7 @@ int parser(t_meta *meta, char *map_file) { char *file = NULL; + meta->scene_name = map_file; file = parse_file(map_file); if (!file) return(EXIT_FAILURE); diff --git a/texture_examples/wood.png b/texture_examples/wood.png new file mode 100755 index 0000000000000000000000000000000000000000..c30c3174c37c936c13d925588fe428a5bfc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