From acdcaa8f9fb44e88a8a4bc228f14499d26680067 Mon Sep 17 00:00:00 2001 From: Iipal Date: Fri, 15 Mar 2019 12:28:09 +0200 Subject: [PATCH] fixed start xy for different sizes --- srcs/wolf_init_textures.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/srcs/wolf_init_textures.c b/srcs/wolf_init_textures.c index 700bb54..8d28a62 100644 --- a/srcs/wolf_init_textures.c +++ b/srcs/wolf_init_textures.c @@ -6,7 +6,7 @@ /* By: tmaluh +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/15 10:38:52 by tmaluh #+# #+# */ -/* Updated: 2019/03/15 11:52:00 by tmaluh ### ########.fr */ +/* Updated: 2019/03/15 12:26:51 by tmaluh ### ########.fr */ /* */ /* ************************************************************************** */ @@ -33,10 +33,9 @@ static bool add_init_textures_map(t_env *env) while (++i < env->walls->max_textures) { env->walls->start[i] = (point){p.y, p.x}; - if (i + 1 == env->walls->max_textures / env->walls->in_column) + p.x += WALLS_BLOCK_SIZE; + if (!((i + 1) % (env->walls->max_textures / env->walls->in_column))) p = (point){p.y + WALLS_BLOCK_SIZE, 0}; - else - p.x += WALLS_BLOCK_SIZE; } return (true); }