14# define CUB3D_RENDER_H
220int max(
int a,
int b);
229double mind(
double a,
double b);
void hitwall_loop(const t_data *data, t_raydata *rdata)
Check which wall will be hit.
Definition hitwall.c:15
t_data * cub_init(t_data *data)
Initialize map and backbuffer for rendering.
Definition init.c:36
void cub_player_update(t_data *data)
Updates player based on input.
Definition player.c:89
t_img * hitside_texture(t_textures *tex, int hitside, const t_pos2 *step)
Function to select the texture based on the hit side and step direction.
Definition hitside.c:15
void draw_column(t_data *data, int x, const t_raydata *rdata)
Draw a column of pixels from a raycast result.
Definition draw_column.c:109
void cub_loop(t_data *data)
Main loop function. Handles player update logic and rendering.
Definition loop.c:41
int cub_translate_map(t_data *data)
Convert 2d map string to int vector.
Definition map_translate.c:78
void cub_render(t_data *data)
Main rendering function.
Definition render.c:20
void raycalc(const t_pos2 win_size, int x, float cam_angle, t_raydata *rdata)
Function to calculate rays using window size and camera angle.
Definition render_more.c:19
int cub3d_init_render(t_data *data)
Init cub for rendering.
Definition cub3d_raoul.c:20
void cub_render_minimap(t_data *data)
Render the minimap.
Definition minimap.c:81
Header file for all the types and structures of the project.
struct s_data t_data
Definition data_structure.h:32
struct s_vec2 t_vec2
Definition data_structure.h:37
struct s_pos2 t_pos2
Definition data_structure.h:36
struct s_raydata t_raydata
Definition data_structure.h:41
struct s_img t_img
Definition data_structure.h:26
struct s_mlx t_mlx
Definition data_structure.h:29
struct s_textures t_textures
Definition data_structure.h:27
void cubmlx_clear(t_mlx *mlx, unsigned int color)
Clear the backbuffer with a specific color.
Definition ft_mlx_render.c:15
void cubmlx_putvertline(t_data *data, t_pos2 pos, int len, unsigned int color)
Puts a vertical line on the backbuffer. Optimized for vertical lines.
Definition ft_mlx_render.c:42
void cubmlx_putrect(t_data *data, t_pos2 pos, t_pos2 size, unsigned int color)
Puts a rectangle onto the backbuffer.
Definition ft_mlx_render.c:65
void cubmlx_putpixel(t_data *data, int x, int y, unsigned int color)
Puts a pixel onto the backbuffer.
Definition ft_mlx_render.c:30
void cubmlx_putline(t_data *data, t_pos2 p1, t_pos2 p2, unsigned int color)
Puts a line onto the backbuffer.
Definition ft_mlx_render.c:84
void resolve_collision_steps(t_data *data, float vel_x, float vel_y)
Solver of collision on x and y using steps smaller than 1 unit, To use only when moving faster than 1...
Definition player_utils.c:62
void solve_collision_x(t_data *data, float x_vel)
Solver of collision on x axis.
Definition player_utils.c:16
void solve_collision_y(t_data *data, float y_vel)
Solver of collision on y axis.
Definition player_utils.c:39
float absf(float n)
Returns the absolute value of a float.
Definition utils.c:13
double mind(double a, double b)
Returns the lowest value between doubles a and b.
Definition utils.c:34
t_vec2 vec2rotate(t_vec2 vec, float angle)
Returns a new vector rotated according to the angle.
Definition vec2.c:16
int max(int a, int b)
Returns the highest value between a and b.
Definition utils.c:27
int abs(int n)
Returns the absolute value of an int.
Definition utils.c:20