better struct and files organization, and still only half raycast on map but no view created

This commit is contained in:
hugogogo
2022-04-22 17:38:29 +02:00
parent 00c9dfd6b8
commit fac1f78230
17 changed files with 602 additions and 505 deletions

61
srcs/hook/key_action_1.c Normal file
View File

@@ -0,0 +1,61 @@
#include "cube3d.h"
int is_esc(int *k_hook, int *is_action)
{
if (!ft_arrint(k_hook, KEY_ESC, MAX_NB_KEY))
{
*is_action = 1;
return 1;
}
return 0;
}
int is_go_left(int *k_hook, int *is_action)
{
if (!ft_arrint(k_hook, KEY_A, MAX_NB_KEY))
{
*is_action = 1;
return 1;
}
if (!ft_arrint(k_hook, KEY_Q, MAX_NB_KEY))
{
*is_action = 1;
return 1;
}
return 0;
}
int is_go_right(int *k_hook, int *is_action)
{
if (!ft_arrint(k_hook, KEY_D, MAX_NB_KEY))
{
*is_action = 1;
return 1;
}
return 0;
}
int is_go_forward(int *k_hook, int *is_action)
{
if (!ft_arrint(k_hook, KEY_W, MAX_NB_KEY))
{
*is_action = 1;
return 1;
}
if (!ft_arrint(k_hook, KEY_Z, MAX_NB_KEY))
{
*is_action = 1;
return 1;
}
return 0;
}
int is_go_backward(int *k_hook, int *is_action)
{
if (!ft_arrint(k_hook, KEY_S, MAX_NB_KEY))
{
*is_action = 1;
return 1;
}
return 0;
}