some norminette and some cleaning
This commit is contained in:
parent
02ff526212
commit
fd4fb3c93f
12 changed files with 102 additions and 79 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mc <mc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/17 14:43:09 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/11/07 17:13:28 by mc ### ########.fr */
|
||||
/* Updated: 2024/11/07 19:03:25 by mc ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -30,18 +30,6 @@ typedef struct s_input_actions
|
|||
/// when the user presses the corresponding key.
|
||||
extern t_input_actions g_input_actions;
|
||||
|
||||
/// @brief To call when a specific key is newly pressed.
|
||||
///
|
||||
/// @param keycode Key pressed.
|
||||
/// @return Unused.
|
||||
int hook_keypress(int keycode);
|
||||
|
||||
/// @brief To call when a specific key is released.
|
||||
///
|
||||
/// @param keycode Key released.
|
||||
/// @return Unused.
|
||||
int hook_keyrelease(int keycode);
|
||||
|
||||
/// @brief To handle the input of a window.
|
||||
///
|
||||
/// @param mlx_ptr mlx connection identifier
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mc <mc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/31 17:04:08 by mc #+# #+# */
|
||||
/* Updated: 2024/10/31 17:28:09 by mc ### ########.fr */
|
||||
/* Updated: 2024/11/07 19:07:25 by mc ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -40,8 +40,8 @@ typedef struct s_ray
|
|||
{
|
||||
// pos player on map (cases)
|
||||
t_point_double dir;
|
||||
bool side;
|
||||
double wallx;
|
||||
bool side;
|
||||
double wallx;
|
||||
} t_ray;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mc <mc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/15 16:56:47 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/11/01 20:55:00 by mc ### ########.fr */
|
||||
/* Updated: 2024/11/07 19:07:03 by mc ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -15,21 +15,19 @@
|
|||
|
||||
# include "include.h"
|
||||
|
||||
typedef uint32_t u_int32_t;
|
||||
|
||||
/// @brief Represents a point of double type.
|
||||
typedef struct s_point_double
|
||||
{
|
||||
double x;
|
||||
double y;
|
||||
} t_point_double;
|
||||
} t_point_double;
|
||||
|
||||
/// @brief Represents a point of int type.
|
||||
typedef struct s_point_int
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
} t_point_int;
|
||||
} t_point_int;
|
||||
|
||||
// TODO Must the transparency be 0 or 255?
|
||||
/// @brief Represents an TRGB color in 0xTTRRGGBB format.
|
||||
|
|
@ -60,7 +58,7 @@ void timedloop(void (*f)(void));
|
|||
///
|
||||
/// @param img_ptr mlx image to use.
|
||||
/// @return Address to the data, or NULL if error.
|
||||
u_int32_t *get_data_addr(void *img_ptr);
|
||||
uint32_t *get_data_addr(void *img_ptr);
|
||||
|
||||
/// @brief Create a vector according to the angle with a specific norm.
|
||||
/// (0 rad returns (0;-1) / pi/2 rad returns (1;0))
|
||||
|
|
@ -68,7 +66,8 @@ u_int32_t *get_data_addr(void *img_ptr);
|
|||
/// @param vec This will be set to the result.
|
||||
/// @param angle Angle to use in radians.
|
||||
/// @param norm Norm the vector must have.
|
||||
void vector_from_rotation(t_point_double *vec, double angle, double norm);
|
||||
void vector_from_rotation(t_point_double *vec, double angle,
|
||||
double norm);
|
||||
|
||||
/// @brief Size of buffer used in read_all_text().
|
||||
# define READ_ALL_TEXT_BUFFER_SIZE 1000
|
||||
|
|
@ -81,6 +80,6 @@ void vector_from_rotation(t_point_double *vec, double angle, double norm);
|
|||
///
|
||||
/// @param fd File descriptor of the file.
|
||||
/// @return Alloc'd string of the file content. NULL if error.
|
||||
char *read_all_text(int fd);
|
||||
char *read_all_text(int fd);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue