aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite_extra.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-14 19:25:00 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-14 19:25:00 +0200
commit9e7508d8baeee1695cb99a98a2ed0c020f7a41e1 (patch)
tree61d3349646156203c9f79504e58253940850ecb3 /src/ft_draw_sprite_extra.c
parentRenorm (diff)
download42-cub3d-9e7508d8baeee1695cb99a98a2ed0c020f7a41e1.tar.gz
42-cub3d-9e7508d8baeee1695cb99a98a2ed0c020f7a41e1.tar.bz2
42-cub3d-9e7508d8baeee1695cb99a98a2ed0c020f7a41e1.tar.xz
42-cub3d-9e7508d8baeee1695cb99a98a2ed0c020f7a41e1.tar.zst
42-cub3d-9e7508d8baeee1695cb99a98a2ed0c020f7a41e1.zip
Some more norms
Diffstat (limited to '')
-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)
{