aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite_extra.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_draw_sprite_extra.c')
-rw-r--r--src/ft_draw_sprite_extra.c9
1 files changed, 5 insertions, 4 deletions
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)
{