From 9e7508d8baeee1695cb99a98a2ed0c020f7a41e1 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 14 Apr 2020 19:25:00 +0200 Subject: Some more norms --- src/ft_draw_sprite_extra.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/ft_draw_sprite_extra.c') diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c index 45833c8..57cd143 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -35,13 +35,12 @@ void sprite->drawendx = cl->wlist.x_size - 1; } - static void ft_init_sprite(t_cub *cl, t_sprite *sprite) { sprite->invdet = 1.0 / (cl->plist.plane_x * -cl->plist.dir_x - - cl->plist.dir_y * cl->plist.plane_y); + - cl->plist.dir_y * cl->plist.plane_y); sprite->transformx = sprite->invdet * (-cl->plist.dir_x * sprite->spritex - cl->plist.dir_y * sprite->spritey); sprite->transformy = sprite->invdet * (cl->plist.plane_y * sprite->spritex @@ -61,8 +60,10 @@ void while (++i < cl->big_t_val) { sprite = cl->sprites[(int8_t)cl->big_t[i][2]][(int32_t)cl->big_t[i][3]]; - if (((cl->plist.pos_x > sprite.s_pos_x - 0.01 && cl->plist.pos_x < sprite.s_pos_x + 0.99) && - (cl->plist.pos_y > sprite.s_pos_y - 0.01 && cl->plist.pos_y < sprite.s_pos_y + 0.99))) + if (((cl->plist.pos_x > sprite.s_pos_x - 0.01 && + cl->plist.pos_x < sprite.s_pos_x + 0.99) && + (cl->plist.pos_y > sprite.s_pos_y - 0.01 && + cl->plist.pos_y < sprite.s_pos_y + 0.99))) return ; if (sprite.s_pos_x != 0) { -- cgit v1.2.3