42_cube3D/game/init.c

38 lines
1.2 KiB
C
Raw Normal View History

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* init.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/27 14:50:22 by erey-bet #+# #+# */
2023-05-02 09:39:16 -04:00
/* Updated: 2023/05/02 15:18:05 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
#include "game.h"
2023-05-02 09:39:16 -04:00
void init_ply(t_map *map, t_ply *ply)
{
2023-05-02 09:39:16 -04:00
ply->pos_x = map->ply_x;
ply->pos_y = map->ply_y;
}
2023-05-02 09:39:16 -04:00
void init_ray(t_ray *ray)
{
2023-05-02 09:39:16 -04:00
ray->x = 0;
ray->y = 0;
}
2023-05-02 09:39:16 -04:00
void init(t_map *map, t_game &game)
{
2023-05-02 09:39:16 -04:00
t_ply ply;
t_ray ray;
2023-05-02 09:39:16 -04:00
game.mlx = mlx_init(WIDTH, HEIGHT, "jan lili", true);
if (!game.mlx)
return (NULL);
2023-05-02 09:39:16 -04:00
game.map = map;
init_ply(map, &ply);
}