86 lines
1.9 KiB
C
86 lines
1.9 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* so_long.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/12/10 17:59:18 by erey-bet #+# #+# */
|
|
/* Updated: 2022/12/14 16:12:41 by erey-bet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef SO_LONG_H
|
|
# define SO_LONG_H
|
|
|
|
# include <X11/X.h>
|
|
# include "minilibx-linux/mlx.h"
|
|
# include "key.h"
|
|
# include <stdlib.h>
|
|
# include "libft/libft.h"
|
|
# include "get_next_line/get_next_line.h"
|
|
# include <fcntl.h>
|
|
# include <math.h>
|
|
|
|
|
|
# include <stdio.h>
|
|
|
|
|
|
typedef struct s_img
|
|
{
|
|
void **ply;
|
|
void *bg;
|
|
void **wall;
|
|
void **col;
|
|
void **exit;
|
|
void *ene;
|
|
} t_img;
|
|
|
|
typedef struct s_data
|
|
{
|
|
void *mlx;
|
|
void *mlx_win;
|
|
char **map;
|
|
t_img imgs;
|
|
int tick;
|
|
int h_map;
|
|
int w_map;
|
|
int update;
|
|
int size;
|
|
int x_player;
|
|
int y_player;
|
|
int x_ene;
|
|
int y_ene;
|
|
int h_screen;
|
|
int w_screen;
|
|
int move;
|
|
} t_data;
|
|
|
|
typedef struct s_xy
|
|
{
|
|
int x;
|
|
int y;
|
|
} t_xy;
|
|
|
|
// Map
|
|
void *get_map(char *argv[], t_data *data);
|
|
|
|
// Render
|
|
int render(t_data *data);
|
|
void draw(t_data *data);
|
|
|
|
// Player
|
|
void move(t_data *data, int x, int y);
|
|
void *set_position_player(t_data *data, t_xy *xy);
|
|
|
|
// Position
|
|
t_xy *get_position(char **map, char c);
|
|
int has_element(char **map, char c);
|
|
char get_element(t_data *data, t_xy xy);
|
|
|
|
// Quit
|
|
int quit(t_data *data);
|
|
int end(t_data *data);
|
|
|
|
#endif
|