59 lines
1.9 KiB
C
59 lines
1.9 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: o_ :::::: ::: */
|
|
/* fdf.h :+: / :+::+: :+: */
|
|
/* +:+ > +:++:+ +:+ */
|
|
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#++#++:++#++ */
|
|
/* +#+ +#+#+ +#++#+ +#+ \o/ */
|
|
/* Created: 2024/12/06 11:07:39 by whaffman #+#+# #+#+# #+# #+# | */
|
|
/* Updated: 2024/12/06 11:11:56 by whaffman ### ### ### ### / \ */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef FDF_H
|
|
# define FDF_H
|
|
|
|
# include <stdlib.h>
|
|
# include <unistd.h>
|
|
# include <fcntl.h>
|
|
# include <stdbool.h>
|
|
# include <math.h>
|
|
# include <stdio.h>
|
|
# include "libft.h"
|
|
# include "MLX42.h"
|
|
|
|
#define WRONG_LINE_LENGTH "Error: wrong line length. Expected %d, got %d\n"
|
|
#define MALLOC_ERROR "Error: malloc failed\n"
|
|
#define FILE_ERROR "Error: could not open file %s\n"
|
|
#define USAGE_ERROR "Usage: %s <filename>\n"
|
|
|
|
#define WIDTH 1024
|
|
#define HEIGHT 1024
|
|
|
|
typedef struct s_point
|
|
{
|
|
float x;
|
|
float y;
|
|
float z;
|
|
} t_point;
|
|
|
|
typedef struct s_map
|
|
{
|
|
t_point *points;
|
|
int width;
|
|
int height;
|
|
int z_max;
|
|
} t_map;
|
|
|
|
int get_map_sizes(char *filename, t_map *map);
|
|
void free_line_and_split(char **line, char ***split);
|
|
int read_map(char *filename, t_map *map);
|
|
t_map *parse_map(char *filename);
|
|
void print_map(t_map *map);
|
|
void rotate_x(t_point **points, double angle, int size);
|
|
void rotate_y(t_point **points, double angle, int size);
|
|
void rotate_z(t_point **points, double angle, int size);
|
|
|
|
|
|
#endif
|