33 lines
521 B
C
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);
|
|
}
|