-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathso_long.h
67 lines (57 loc) · 1.84 KB
/
so_long.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* so_long.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tnamir <tnamir@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/12 14:21:29 by tnamir #+# #+# */
/* Updated: 2022/02/14 14:04:13 by tnamir ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SO_LONG_H
# define SO_LONG_H
#include "mlx.h"
# include <fcntl.h>
# include <string.h>
# include "./gnl/get_next_line.h"
#define TILE_SIZE 50
typedef struct s_vector
{
int x;
int y;
} t_vector;
typedef struct player
{
t_vector pos;
} t_player;
typedef struct s_window {
void *reference;
t_vector size;
} t_window;
typedef struct s_image {
void *reference;
t_vector size;
char *pixels;
int bits_per_pixel;
int line_size;
int endian;
} t_image;
typedef struct s_program {
void *mlx;
t_window window;
t_image sprite;
t_vector sprite_position;
char **map;
t_player character;
char direction;
} t_program;
void playerposition(int x, int y);
t_window window(void *mlx, int widht, int height, char *name);
t_image sprite(void *mlx, char *path);
int keypress(int key, void *param);
void mapparsing(char **map, t_program *program,
int newx, int newy);
char *mapreader(char *path);
void putimage(t_program *program, char *path);
#endif