aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite_extra.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-02 14:24:57 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-02 14:24:57 +0200
commit8a695d62dcb9b8783918263f962b986df20310f2 (patch)
tree37e3c4e286abcec481bbc8169c7297e1ec07b578 /src/ft_draw_sprite_extra.c
parentLater (diff)
download42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.tar.gz
42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.tar.bz2
42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.tar.xz
42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.tar.zst
42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.zip
Correct dir_x dir_y sqy sqx
Diffstat (limited to 'src/ft_draw_sprite_extra.c')
-rw-r--r--src/ft_draw_sprite_extra.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c
index d85540d..bb26cc2 100644
--- a/src/ft_draw_sprite_extra.c
+++ b/src/ft_draw_sprite_extra.c
@@ -38,10 +38,10 @@ void
static void
ft_init_sprite(t_cub *cl, t_sprite *sprite)
{
- sprite->invdet = 1.0 / (cl->plist.plane_x * cl->plist.dir_y
- - cl->plist.dir_x * cl->plist.plane_y);
- sprite->transformx = sprite->invdet * (cl->plist.dir_y * sprite->spritex
- - cl->plist.dir_x * sprite->spritey);
+ sprite->invdet = 1.0 / (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
+ - cl->plist.dir_y * sprite->spritey);
sprite->transformy = sprite->invdet * (-cl->plist.plane_y * sprite->spritex
+ cl->plist.plane_x * sprite->spritey);
sprite->spritescreenx = (int)(cl->wlist.x_size / 2) *