From b5982b835d46ba6ae7363b60254ebfa2c3439a4d Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 26 Mar 2020 14:58:02 +0100 Subject: Solved 9th sprite problem --- src/ft_init_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index d252f2e..fb03bfd 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -64,7 +64,7 @@ int8_t mlist->sprite_var = 0; mlist->weapon_var = 0; mlist->topsp = 0; - ft_bzero(mlist->sprite_nbr, 4096); + ft_bzero(mlist->sprite_nbr, 8); ft_bzero(mlist->sprite_order, 4096); ft_bzero(mlist->st_o, 4096); ft_bzero(mlist->traps_order, 512); -- cgit v1.2.3 From 7f57c427d26d8b0c63feac5d0e7b8249707913eb Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 26 Mar 2020 16:11:56 +0100 Subject: Stack overflow fix --- src/ft_init_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index fb03bfd..b3bfa46 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -45,7 +45,7 @@ static int8_t uint8_t i; i = 0; - while (i < 9) + while (i < 8) { if (!(mlist->sprite_path[i] = (char*)ft_calloc(1, sizeof(char)))) return (-1); @@ -65,8 +65,8 @@ int8_t mlist->weapon_var = 0; mlist->topsp = 0; ft_bzero(mlist->sprite_nbr, 8); - ft_bzero(mlist->sprite_order, 4096); - ft_bzero(mlist->st_o, 4096); + ft_bzero(mlist->sprite_order, 8); + ft_bzero(mlist->st_o, 8); ft_bzero(mlist->traps_order, 512); ft_bzero(mlist->heals_order, 64); mlist->weaps_nbr[0] = 0; -- cgit v1.2.3 From fe1ebcad396caed49253df48ad87ccd9261246bf Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 26 Mar 2020 16:26:01 +0100 Subject: Better parse --- src/ft_init_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index b3bfa46..f2f2d94 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -45,7 +45,7 @@ static int8_t uint8_t i; i = 0; - while (i < 8) + while (i < 9) { if (!(mlist->sprite_path[i] = (char*)ft_calloc(1, sizeof(char)))) return (-1); -- cgit v1.2.3 From b626f171f26f709b27e790911b48f7a4272dc707 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 27 Mar 2020 13:55:24 +0100 Subject: In progress --- src/ft_init_map.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index f2f2d94..e85c6a6 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -57,6 +57,8 @@ static int8_t int8_t ft_init_map_norme(t_map *mlist) { + int8_t i; + mlist->darklvl = 0; mlist->scale = 0; mlist->nlx = 0; @@ -64,10 +66,12 @@ int8_t mlist->sprite_var = 0; mlist->weapon_var = 0; mlist->topsp = 0; - ft_bzero(mlist->sprite_nbr, 8); - ft_bzero(mlist->sprite_order, 8); - ft_bzero(mlist->st_o, 8); - ft_bzero(mlist->traps_order, 512); + ft_bzero(mlist->sprite_nbr, FT_TOTAL_SPRT); + ft_bzero(mlist->sprite_order, FT_TOTAL_SPRT); + i = -1; + while (++i < FT_TOTAL_SPRT) + ft_bzero(mlist->sprite_order[i], 4096); + ft_bzero(mlist->st_o, FT_TOTAL_SPRT); ft_bzero(mlist->heals_order, 64); mlist->weaps_nbr[0] = 0; mlist->weaps_nbr[1] = 0; @@ -99,7 +103,6 @@ int8_t mlist->isskybox = 0; mlist->istraps = 0; mlist->isheals = 0; - mlist->traps_nbr = 0; mlist->heals_nbr = 0; return (ft_init_map_norme(mlist)); } -- cgit v1.2.3 From a713e118950f62700a43d21aa33fd2e3d7673af9 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 27 Mar 2020 15:07:32 +0100 Subject: Problem --- src/ft_init_map.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index e85c6a6..72a02fd 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -67,7 +67,6 @@ int8_t mlist->weapon_var = 0; mlist->topsp = 0; ft_bzero(mlist->sprite_nbr, FT_TOTAL_SPRT); - ft_bzero(mlist->sprite_order, FT_TOTAL_SPRT); i = -1; while (++i < FT_TOTAL_SPRT) ft_bzero(mlist->sprite_order[i], 4096); -- cgit v1.2.3 From 44d5f7f4da8465f4829de1232e4cf2c6c2bf76bc Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 27 Mar 2020 16:44:30 +0100 Subject: Segv fix --- src/ft_init_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index 72a02fd..1859afe 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -70,7 +70,7 @@ int8_t i = -1; while (++i < FT_TOTAL_SPRT) ft_bzero(mlist->sprite_order[i], 4096); - ft_bzero(mlist->st_o, FT_TOTAL_SPRT); + ft_bzero(mlist->st_o, FT_TOTAL_SPRT + 1); ft_bzero(mlist->heals_order, 64); mlist->weaps_nbr[0] = 0; mlist->weaps_nbr[1] = 0; -- cgit v1.2.3 From b3aecb150f55ebc9dde7c1b09559d1566e9e92a6 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 28 Mar 2020 16:46:40 +0100 Subject: All in sprites --- src/ft_init_map.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index 1859afe..a7f82f5 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -64,18 +64,12 @@ int8_t mlist->nlx = 0; mlist->nly = 0; mlist->sprite_var = 0; - mlist->weapon_var = 0; mlist->topsp = 0; ft_bzero(mlist->sprite_nbr, FT_TOTAL_SPRT); i = -1; while (++i < FT_TOTAL_SPRT) ft_bzero(mlist->sprite_order[i], 4096); ft_bzero(mlist->st_o, FT_TOTAL_SPRT + 1); - ft_bzero(mlist->heals_order, 64); - mlist->weaps_nbr[0] = 0; - mlist->weaps_nbr[1] = 0; - mlist->weaps_nbr[2] = 0; - ft_bzero(mlist->weaps_order, 1); return (0); } @@ -102,6 +96,5 @@ int8_t mlist->isskybox = 0; mlist->istraps = 0; mlist->isheals = 0; - mlist->heals_nbr = 0; return (ft_init_map_norme(mlist)); } -- cgit v1.2.3 From 76cefdc4dc3efa6eb410574a0f5ec42188ba11bd Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 29 Mar 2020 15:42:37 +0200 Subject: Almost --- src/ft_init_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index a7f82f5..0abfcb1 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -65,7 +65,7 @@ int8_t mlist->nly = 0; mlist->sprite_var = 0; mlist->topsp = 0; - ft_bzero(mlist->sprite_nbr, FT_TOTAL_SPRT); + ft_bzero(mlist->sprite_nbr, FT_TOTAL_SPRT * sizeof(int16_t)); i = -1; while (++i < FT_TOTAL_SPRT) ft_bzero(mlist->sprite_order[i], 4096); -- cgit v1.2.3