aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite_extra.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-03 15:13:14 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-03 15:13:14 +0200
commit51b0cc28d4d7fc8a7433f492f234882a52b18b96 (patch)
tree0dde7ff64466921c0bfc8035f3ab5652cb1395aa /src/ft_draw_sprite_extra.c
parentSprites still bad, fixed player spawn, still revert if needed (diff)
download42-cub3d-51b0cc28d4d7fc8a7433f492f234882a52b18b96.tar.gz
42-cub3d-51b0cc28d4d7fc8a7433f492f234882a52b18b96.tar.bz2
42-cub3d-51b0cc28d4d7fc8a7433f492f234882a52b18b96.tar.xz
42-cub3d-51b0cc28d4d7fc8a7433f492f234882a52b18b96.tar.zst
42-cub3d-51b0cc28d4d7fc8a7433f492f234882a52b18b96.zip
Sprites fixed, shoot to fix
Diffstat (limited to '')
-rw-r--r--src/ft_draw_sprite_extra.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c
index de02f86..00e295e 100644
--- a/src/ft_draw_sprite_extra.c
+++ b/src/ft_draw_sprite_extra.c
@@ -39,9 +39,9 @@ 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.plane_x * -cl->plist.dir_x
- cl->plist.dir_y * cl->plist.plane_y);
- sprite->transformx = sprite->invdet * (cl->plist.dir_x * sprite->spritex
+ 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
- cl->plist.plane_x * sprite->spritey);