/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* algo.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mcolonna +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/30 15:45:59 by grobledo #+# #+# */ /* Updated: 2024/10/17 15:07:14 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef ALGO_H # define ALGO_H # include # include # include # include # include "Minilibx/mlx.h" # include "Minilibx/mlx_int.h" # include "Libft/libft.h" # include "stream.h" # include "read_all_text.h" # include "map.h" # include "map_mapping.h" # define MAP_WIDTH 24 // cases (TODO test) # define MAP_HEIGHT 24 // cases (TODO test) # define TEX_WIDTH 64 # define TEX_HEIGHT 64 # define MOVE_SPEED 0.05 // cases # define PI 3.1415926535 # define ROT_SPEED_DIVIDE_PI 64 // pi/n rad # define COLOR_WALL 0xFF0000 // 0xRRGGBB # define COLOR_CEILING 0x29f8ff // 0xRRGGBB # define COLOR_FLOOR 0xFF985C // 0xRRGGBB # define SCREEN_WIDTH 640 // px # define SCREEN_HEIGHT 480 // px # define FOV 0.66 // ? TODO unit # define HITBOX 0.25 // cases. should be more than MOVE_SPEED extern void *g_mlx; extern void *g_win; extern t_player g_player; extern t_map g_map; typedef struct s_tex { void *tex_north; void *tex_south; void *tex_east; void *tex_west; void *current_tex; } t_tex; /// @brief Write an error message on stderr. /// /// @param str... All the strings to write. The last parameter MUST BE NULL. void write_err(const char *str, ...); void vector_from_rotation(t_point_double *vec, double angle, double norm); int render(u_int32_t *img_data); void draw_screen(void); void move(void); #endif