-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathso_long.h
More file actions
78 lines (62 loc) · 1.7 KB
/
Copy pathso_long.h
File metadata and controls
78 lines (62 loc) · 1.7 KB
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
68
69
70
71
72
73
74
75
76
77
78
#ifndef SO_LONG_H
#define SO_LONG_H
#include "Libft/libft.h"
#include "get_next_line/get_next_line.h"
#include "mlx/mlx.h"
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>
typedef struct
{
int columns;
int rows;
char **map;
int player_pos[2];
int colls;
int moves;
} data_map;
typedef struct
{
void *player;
void *coll;
void *exit;
void *free;
void *wall;
int widht;
int height;
} images_game;
typedef struct so_long_game
{
void *mlx;
void *win;
data_map map_data;
images_game game_images;
} t_vars;
void no_surrounding_wall(char a);
void non_rectangular_map(void);
void check_interior(char a);
void check_rectangular_shape(char **map, int rows, int columns);
void check_amount_of_extra_fields(int *different_tiles);
void check_all_necessities(char **map, int rows, int columns);
void check_validity(char **map, int rows, int columns);
void check_arg_number(int argc);
int is_ber_file(char *map);
void check_file(char *file);
char **check_input(int argc, char **argv, data_map *map_data);
int open_fd(char *file);
int get_columns(char *file);
int get_rows(char *file);
char **create_map(char *file, int rows, int columns);
int move_up(t_vars *vars);
int move_left(t_vars *vars);
int move_down(t_vars *vars);
int move_right(t_vars *vars);
int close_game(t_vars *vars);
void game_function(t_vars vars);
void check_same_picture_size(images_game *game_images, int width, int height,
t_vars *vars);
void get_images(images_game *game_images, void *mlx, t_vars *vars);
void sl_put_image(t_vars *vars, int x, int y, char c);
int render_map(t_vars *vars);
void free_and_exit(t_vars *vars);
#endif