aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsalad <salad@saladesk.desktop>2020-03-28 15:55:53 +0100
committersalad <salad@saladesk.desktop>2020-03-28 15:55:53 +0100
commit25020e81ba926f3dbcae8feaf0ac1c558177e6cf (patch)
treeb218c95f1cf2f83a234dcffc775966d6a8142c5c /src
parentez (diff)
download42-cub3d-25020e81ba926f3dbcae8feaf0ac1c558177e6cf.tar.gz
42-cub3d-25020e81ba926f3dbcae8feaf0ac1c558177e6cf.tar.bz2
42-cub3d-25020e81ba926f3dbcae8feaf0ac1c558177e6cf.tar.xz
42-cub3d-25020e81ba926f3dbcae8feaf0ac1c558177e6cf.tar.zst
42-cub3d-25020e81ba926f3dbcae8feaf0ac1c558177e6cf.zip
normed
Diffstat (limited to 'src')
-rw-r--r--src/ft_draw_sprite_extra.c26
-rw-r--r--src/ft_sort_s_t.c26
2 files changed, 22 insertions, 30 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c
index 4599ff4..57b0b86 100644
--- a/src/ft_draw_sprite_extra.c
+++ b/src/ft_draw_sprite_extra.c
@@ -12,7 +12,6 @@
#include <cub3d.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
void
@@ -73,19 +72,18 @@ void
j = -1;
ft_sort_sprites(cl, -1, -1);
while (++j < 9)
- {
- while (++i < cl->mlist.sprite_nbr[cl->mlist.st_o[j]] && cl->mlist.st_o[j] != -1 )
- {
- /* printf("j : %d tab : [%d]\n", j, cl->mlist.st_o[j]); */
- sprite =
- cl->sprites[cl->mlist.st_o[j]][cl->mlist.sprite_order[
- cl->mlist.st_o[j]][i]];
- sprite.current_sprite = ft_set_current_sprite(cl, j);
- sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5);
- sprite.spritex = sprite.s_pos_y - (cl->plist.pos_y - 0.5);
- ft_init_sprite(cl, &sprite);
- ft_sprite_h_w(cl, &sprite);
- ft_draw_sprite(cl, &sprite);
+ {
+ while (++i < cl->mlist.sprite_nbr[cl->mlist.st_o[j]] && cl->mlist.st_o[j] != -1 )
+ {
+ sprite =
+ cl->sprites[cl->mlist.st_o[j]][cl->mlist.sprite_order[
+ cl->mlist.st_o[j]][i]];
+ sprite.current_sprite = ft_set_current_sprite(cl, j);
+ sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5);
+ sprite.spritex = sprite.s_pos_y - (cl->plist.pos_y - 0.5);
+ ft_init_sprite(cl, &sprite);
+ ft_sprite_h_w(cl, &sprite);
+ ft_draw_sprite(cl, &sprite);
}
i = -1;
}
diff --git a/src/ft_sort_s_t.c b/src/ft_sort_s_t.c
index 0f87e9f..28a372d 100644
--- a/src/ft_sort_s_t.c
+++ b/src/ft_sort_s_t.c
@@ -34,26 +34,24 @@ float
}
static void
-ft_init_st(t_cub *cl, int32_t *st_o, float **dist_tab)
+ ft_init_st(t_cub *cl, int32_t *st_o, float **dist_tab)
{
int8_t i;
int8_t j;
j = 0;
- i = -1;
+ i = -1;
while (++i < FT_TOTAL_SPRT)
- {
- st_o[i] = -1;
- }
- i = -1;
+ st_o[i] = -1;
+ i = -1;
while (++i < FT_TOTAL_SPRT)
{
- if (cl->sprites[i][0].exists == 1)
- {
- st_o[j] = i;
- ft_memcpy(dist_tab[j], dist_tab[i], 4096);
- j++;
- }
+ if (cl->sprites[i][0].exists == 1)
+ {
+ st_o[j] = i;
+ ft_memcpy(dist_tab[j], dist_tab[i], 4096);
+ j++;
+ }
}
}
@@ -88,10 +86,6 @@ void
}
}
i = -1;
- ft_printf("------------------------------\n");
- while (++i < FT_TOTAL_SPRT + 1)
- ft_printf("%d\n", cl->mlist.st_o[i]);
- i = -1;
while (++i < FT_TOTAL_SPRT + 1)
ft_memdel((void*)&dist_tab[i]);
ft_memdel((void*)&dist_tab);