diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-14 01:06:59 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-14 01:06:59 +0100 |
commit | a383bde7d29293919eb635aeb14760a7a55e12b3 (patch) | |
tree | 76000460117d1ab1348d98a03e2c92215755fde8 /src/ft_sfx_new_level.c | |
parent | Fuck threads and forks (diff) | |
download | 42-cub3d-a383bde7d29293919eb635aeb14760a7a55e12b3.tar.gz 42-cub3d-a383bde7d29293919eb635aeb14760a7a55e12b3.tar.bz2 42-cub3d-a383bde7d29293919eb635aeb14760a7a55e12b3.tar.xz 42-cub3d-a383bde7d29293919eb635aeb14760a7a55e12b3.tar.zst 42-cub3d-a383bde7d29293919eb635aeb14760a7a55e12b3.zip |
Removed footsteps, in progress
Diffstat (limited to '')
-rw-r--r-- | src/ft_sfx_new_level.c (renamed from src/ft_sfx_footstep.c) | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/ft_sfx_footstep.c b/src/ft_sfx_new_level.c index e629a7b..05e9059 100644 --- a/src/ft_sfx_footstep.c +++ b/src/ft_sfx_new_level.c @@ -1,7 +1,7 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* ft_sfx_trap.c :+: :+: :+: */ +/* ft_sfx_new_level.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ @@ -12,25 +12,13 @@ #include <cub3d.h> #include <unistd.h> -#include <stdint.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <unistd.h> void - ft_sfx_footstep(t_cub *cl) + ft_sfx_new_level(t_cub *cl) { - static uint8_t ref = 0; - - cl->sfx.footstep_pid = fork(); - if (cl->sfx.footstep_pid == 0) + cl->sfx.new_lvl_pid = fork(); + if (cl->sfx.new_lvl_pid == 0) { - ref = (ref > 201) ? (0) : (ref + 1); - if (ref % 2) - execve(*(cl->sfx.footstep_one + 0), - cl->sfx.footstep_one, cl->envp); - else - execve(*(cl->sfx.footstep_two + 0), - cl->sfx.footstep_two, cl->envp); + execve(*(cl->sfx.new_lvl + 0), cl->sfx.new_lvl, cl->envp); } } |