diff --git a/.gitignore b/.gitignore index 53550e5..615bf3d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .vscode/ obj/ app +cub3D app.dSYM compile_commands.json libft/build/libft.a diff --git a/include/meta.h b/include/meta.h index f95ec17..54dabb8 100644 --- a/include/meta.h +++ b/include/meta.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* :::::::: */ -/* meta.h :+: :+: */ +/* meta.h :+: :+: */ /* +:+ */ /* By: joppe +#+ */ /* +#+ */ /* Created: 2024/02/05 14:01:44 by joppe #+# #+# */ -/* Updated: 2024/03/06 15:02:35 by yzaim ######## odam.nl */ +/* Updated: 2024/03/06 15:11:10 by yzaim ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -56,7 +56,7 @@ # define MINIMAP_COLOR_PLAYER 0xd32a04FF # define MINIMAP_PLAYER_SIZE 7 # define MINIMAP_DEFAULT_ZOOM 24 -# define MINIMAP_ZOOM_MOD 1.2 +# define MINIMAP_ZOOM_MOD 2 # define VIEWPORT_COLOR_CEILING 0x000000FF # define VIEWPORT_COLOR_FLOOR 0xFFFFFFFF # define VIEWPORT_COLOR_WALL_NS 0x4B0082FF diff --git a/src/renderer/minimap_interact.c b/src/renderer/minimap_interact.c index 6aabca0..73c9106 100644 --- a/src/renderer/minimap_interact.c +++ b/src/renderer/minimap_interact.c @@ -6,7 +6,7 @@ /* By: jboeve +#+ */ /* +#+ */ /* Created: 2024/03/04 17:37:55 by jboeve #+# #+# */ -/* Updated: 2024/03/04 17:41:13 by jboeve ######## odam.nl */ +/* Updated: 2024/03/06 15:10:52 by yzaim ######## odam.nl */ /* */ /* ************************************************************************** */ @@ -14,22 +14,22 @@ void minimap_zoom(t_minimap *m, t_minimap_zoom dir) { - size_t tmp; + int32_t tmp; if (dir == ZOOM_IN) { - tmp = m->tile_size; - m->tile_size *= MINIMAP_ZOOM_MOD; - if (m->tile_size < tmp) - m->tile_size = tmp; + tmp = m->tile_size * MINIMAP_ZOOM_MOD; + if (tmp > 96) + tmp = 96; } else { - tmp = m->tile_size; - m->tile_size /= MINIMAP_ZOOM_MOD; - if (m->tile_size > tmp) - m->tile_size = tmp; + tmp = m->tile_size / MINIMAP_ZOOM_MOD; + if (tmp < 2) + tmp = 2; } + m->tile_size = (size_t) tmp; + printf("zoom [%ld]\n", m->tile_size); } void minimap_init(t_minimap *map)