Files
42_INT_10_cube3d/srcs/init/init_struct.c
2022-05-02 16:11:54 +02:00

33 lines
521 B
C

#include "cube3d.h"
static void init_map(t_map *map)
{
map->content = NULL;
map->tmp_str = NULL;
map->cell = CELL;
map->size_x = 0;
map->size_y = 0;
map->plr_x = 0;
map->plr_y = 0;
}
static void init_txt(t_txt *txt)
{
txt->txt_north = NULL;
txt->txt_south = NULL;
txt->txt_east = NULL;
txt->txt_west = NULL;
}
t_game *init_struct(void)
{
t_game *game;
game = mb_alloc(sizeof(t_game));
// map
init_map(&(game->map));
// init textures and floor/ceiling colors
init_txt(&(game->txt));
return (game);
}