diff options
Diffstat (limited to 'src/ft_init_sfx.c')
-rw-r--r-- | src/ft_init_sfx.c | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/src/ft_init_sfx.c b/src/ft_init_sfx.c index 6fc8504..9b58656 100644 --- a/src/ft_init_sfx.c +++ b/src/ft_init_sfx.c @@ -22,16 +22,19 @@ /* ** sfx[] index summary ** ------------------- -** 0: death -** 1: footstep | double -** 2: new level -** 3: pain | double -** 4: trap -** 5: heal -** 6: weapon one load -** 7: weapon one fire -** 8: weapon two load -** 9: weapon two fire +** 0: death +** 1: footstep | double +** 2: new level +** 3: pain | double +** 4: trap +** 5: heal +** 6: weapon one load +** 7: weapon one fire +** 8: weapon two load +** 9: weapon two fire +** 10: weapon three load +** 11: weapon three fire +** 12: out of ammunitions */ static int8_t @@ -56,10 +59,20 @@ static void pthread_create(&cl->sfx[3].tid, NULL, ft_sfx_pain_thread, &cl->sfx); pthread_create(&cl->sfx[4].tid, NULL, ft_sfx_trap_thread, &cl->sfx); pthread_create(&cl->sfx[5].tid, NULL, ft_sfx_heal_thread, &cl->sfx); - pthread_create(&cl->sfx[6].tid, NULL, ft_sfx_weapon_one_load_thread, &cl->sfx); - pthread_create(&cl->sfx[7].tid, NULL, ft_sfx_weapon_one_fire_thread, &cl->sfx); - pthread_create(&cl->sfx[8].tid, NULL, ft_sfx_weapon_two_load_thread, &cl->sfx); - pthread_create(&cl->sfx[9].tid, NULL, ft_sfx_weapon_two_fire_thread, &cl->sfx); + pthread_create(&cl->sfx[6].tid, NULL, + ft_sfx_weapon_one_load_thread, &cl->sfx); + pthread_create(&cl->sfx[7].tid, NULL, + ft_sfx_weapon_one_fire_thread, &cl->sfx); + pthread_create(&cl->sfx[8].tid, NULL, + ft_sfx_weapon_two_load_thread, &cl->sfx); + pthread_create(&cl->sfx[9].tid, NULL, + ft_sfx_weapon_two_fire_thread, &cl->sfx); + pthread_create(&cl->sfx[10].tid, NULL, + ft_sfx_weapon_three_load_thread, &cl->sfx); + pthread_create(&cl->sfx[11].tid, NULL, + ft_sfx_weapon_three_fire_thread, &cl->sfx); + pthread_create(&cl->sfx[12].tid, NULL, + ft_sfx_ooa_thread, &cl->sfx); } static void @@ -75,6 +88,9 @@ static void cl->sfx[7].sfx_play = ft_sfx_weapon_one_fire; cl->sfx[8].sfx_play = ft_sfx_weapon_two_load; cl->sfx[9].sfx_play = ft_sfx_weapon_two_fire; + cl->sfx[10].sfx_play = ft_sfx_weapon_three_load; + cl->sfx[11].sfx_play = ft_sfx_weapon_three_fire; + cl->sfx[12].sfx_play = ft_sfx_ooa; } int8_t @@ -92,10 +108,13 @@ int8_t ft_init_sfx_cmd(&cl->sfx[6].cmd, FT_SFX_W_ONE_LOAD_PATH) < 0 || ft_init_sfx_cmd(&cl->sfx[7].cmd, FT_SFX_W_ONE_FIRE_PATH) < 0 || ft_init_sfx_cmd(&cl->sfx[8].cmd, FT_SFX_W_TWO_LOAD_PATH) < 0 || - ft_init_sfx_cmd(&cl->sfx[9].cmd, FT_SFX_W_TWO_FIRE_PATH) < 0) + ft_init_sfx_cmd(&cl->sfx[9].cmd, FT_SFX_W_TWO_FIRE_PATH) < 0 || + ft_init_sfx_cmd(&cl->sfx[10].cmd, FT_SFX_W_THREE_LOAD_PATH) < 0 || + ft_init_sfx_cmd(&cl->sfx[11].cmd, FT_SFX_W_THREE_FIRE_PATH) < 0 || + ft_init_sfx_cmd(&cl->sfx[12].cmd, FT_SFX_OOA_PATH) < 0) return (-1); i = -1; - while (++i < 10) + while (++i < 13) pthread_mutex_init(&cl->sfx[i].mutex, NULL); ft_init_sfx_pthreads(cl); ft_init_sfx_funptr(cl); |