fdf/src/initialise_fdf.c
2024-12-16 17:54:39 +01:00

49 lines
1.6 KiB
C

/* ************************************************************************** */
/* */
/* ::: o_ :::::: ::: */
/* initialise_fdf.c :+: / :+::+: :+: */
/* +:+ > +:++:+ +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#++#++:++#++ */
/* +#+ +#+#+ +#++#+ +#+ \o/ */
/* Created: 2024/12/13 15:23:17 by whaffman #+#+# #+#+# #+# #+# | */
/* Updated: 2024/12/13 15:23:17 by whaffman ### ### ### ### / \ */
/* */
/* ************************************************************************** */
#include "fdf.h"
t_fdf *initialise_fdf(void)
{
t_map *map;
t_fdf *fdf;
fdf = malloc(sizeof(t_fdf));
if (!fdf)
handle_error(fdf, MALLOC_ERROR);
map = malloc(sizeof(t_map));
if (!map)
handle_error(fdf, MALLOC_ERROR);
fdf->map = map;
fdf->mlx = NULL;
fdf->img = NULL;
fdf->angle_x = 0;
fdf->angle_y = 0;
fdf->angle_z = 0;
fdf->zoom = 0;
fdf->animate_z = 0;
fdf->offset_x = WIDTH / 2;
fdf->offset_y = HEIGHT / 2;
fdf->z_scale = 0.1;
fdf->last_width = WIDTH;
fdf->last_height = HEIGHT;
fdf->colormode = COLOR_MODE_DEFAULT;
fdf->projection = PROJECTION_ISOMETRIC;
fdf->map->orig = NULL;
fdf->map->rot = NULL;
fdf->map->proj = NULL;
fdf->map->width = 0;
fdf->map->height = 0;
fdf->map->z_max = 0;
return (fdf);
}