41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* init.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/04/27 14:50:22 by erey-bet #+# #+# */
|
|
/* Updated: 2023/05/03 12:44:19 by erey-bet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "game.h"
|
|
|
|
void init_ply(t_map *map, t_ply *ply)
|
|
{
|
|
ply->pos_x = map->ply_x;
|
|
ply->pos_y = map->ply_y;
|
|
}
|
|
|
|
void init_ray(t_ray *ray)
|
|
{
|
|
ray->dir_x = 0;
|
|
ray->dir_y = 0;
|
|
}
|
|
|
|
void init(t_map *map, t_game *game)
|
|
{
|
|
t_ply ply;
|
|
t_ray ray;
|
|
|
|
game->mlx = mlx_init(WIDTH, HEIGHT, "jan lili", true);
|
|
if (!game->mlx)
|
|
return ;
|
|
game->map = map;
|
|
init_ply(map, &ply);
|
|
game->ply = &ply;
|
|
init_ray(&ray);
|
|
game->ray = &ray;
|
|
}
|