aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-03 14:31:45 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-03 14:31:45 +0200
commitd9e1ad0691e29f8f79836a41ce9b1b42080fb441 (patch)
tree0ffb3cb56672f3966ec3c61c51f09fd74e920a60 /src
parentStill sprites, still revert maybe (diff)
download42-cub3d-d9e1ad0691e29f8f79836a41ce9b1b42080fb441.tar.gz
42-cub3d-d9e1ad0691e29f8f79836a41ce9b1b42080fb441.tar.bz2
42-cub3d-d9e1ad0691e29f8f79836a41ce9b1b42080fb441.tar.xz
42-cub3d-d9e1ad0691e29f8f79836a41ce9b1b42080fb441.tar.zst
42-cub3d-d9e1ad0691e29f8f79836a41ce9b1b42080fb441.zip
Sprites still bad, fixed player spawn, still revert if needed
Diffstat (limited to 'src')
-rw-r--r--src/ft_get_player_spawn.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ft_get_player_spawn.c b/src/ft_get_player_spawn.c
index 25f9b75..8642096 100644
--- a/src/ft_get_player_spawn.c
+++ b/src/ft_get_player_spawn.c
@@ -16,6 +16,15 @@
#include <stdint.h>
static void
+ ft_get_s_dir(t_player *pl)
+{
+ pl->dir_y = -pl->dir_y;
+ pl->dir_x = -pl->dir_x;
+ pl->plane_x = -pl->plane_x;
+ pl->plane_y = -pl->plane_y;
+}
+
+static void
ft_get_e_dir(t_player *pl)
{
float sav_dir_y;
@@ -23,22 +32,13 @@ static void
sav_dir_y = pl->dir_y;
pl->dir_y = -pl->dir_x;
- pl->dir_x = sav_dir_y;
+ pl->dir_x = -sav_dir_y;
sav_plane_x = pl->plane_x;
pl->plane_x = -pl->plane_y;
pl->plane_y = sav_plane_x;
}
static void
- ft_get_s_dir(t_player *pl)
-{
- pl->dir_y = -pl->dir_y;
- pl->dir_x = -pl->dir_x;
- pl->plane_x = -pl->plane_x;
- pl->plane_y = -pl->plane_y;
-}
-
-static void
ft_get_w_dir(t_player *pl)
{
float sav_dir_y;
@@ -46,7 +46,7 @@ static void
sav_dir_y = pl->dir_y;
pl->dir_y = pl->dir_x;
- pl->dir_x = -sav_dir_y;
+ pl->dir_x = sav_dir_y;
sav_plane_x = pl->plane_x;
pl->plane_x = pl->plane_y;
pl->plane_y = -sav_plane_x;