/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* algo.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mcolonna +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/30 15:45:59 by grobledo #+# #+# */ /* Updated: 2024/10/15 13:10:34 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef ALGO_H #define ALGO_H #include #include #include #include "Minilibx/mlx.h" #include "Minilibx/mlx_int.h" # include "Libft/libft.h" #define mapWidth 24 // cases (TODO test) #define mapHeight 24 // cases (TODO test) #define MOVE_SPEED 0.1 // cases #define PI 3.1415926535 #define ROT_SPEED (PI / 16) // 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 typedef struct s_ray { // pos player on map (cases) double posX; // pos player on map (cases) double posY; // player rotation (rad) double rot; } t_ray; extern void *g_mlx; extern void *g_win; extern t_ray g_ray; extern int worldMap[mapWidth][mapHeight]; void vector_from_rotation( double *vecX, double *vecY, double angle, double norm); int keypress(int keycode); int render(u_int32_t *img_data); void draw_screen(void); #endif