aboutsummaryrefslogtreecommitdiffstats
path: root/inc/cub3d.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/cub3d.h')
-rw-r--r--inc/cub3d.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/inc/cub3d.h b/inc/cub3d.h
index 7df93ad..9462035 100644
--- a/inc/cub3d.h
+++ b/inc/cub3d.h
@@ -2,6 +2,7 @@
#define CUB3D_H
#include <inttypes.h>
+#include <stddef.h>
#ifndef FT_W_KEY
#define FT_W_KEY 13
@@ -19,6 +20,14 @@
#define FT_ESC_KEY 53
#endif
+typedef struct s_win
+{
+ void *wlx;
+ void *winptr;
+ int x_size;
+ int y_size;
+} t_win;
+
typedef struct s_cub
{
char *no_tex_path;
@@ -29,34 +38,27 @@ typedef struct s_cub
int f_color;
int c_color;
char **map;
+ size_t map_width;
+ struct s_win *wlist;
} t_cub;
-typedef struct s_win
-{
- void *wlx;
- void *winptr;
- int x_size;
- int y_size;
- struct s_cub *clist;
-} t_win;
-
t_win *ft_init_win(void);
t_cub *ft_init_cub(void);
-void ft_parse_map(const char *map_path, t_win *wlist);
+void ft_parse_map(const char *map_path, t_cub *clist);
int ft_key_event(int keycode, void *param);
-int ft_exit(uint8_t exit_code, t_win *wlist);
-void ft_drawsquare(int a, int b, int rgb, t_win *wlist);
-int ft_get_res(int fd, t_win *wlist);
-int ft_get_tex(int fd, t_win *wlist);
-int ft_get_sprite_tex(int fd, t_win *wlist);
-int ft_get_colors(int fd, t_win *wlist);
-int ft_get_map(int fd, t_win *wlist);
+int ft_exit(uint8_t exit_code, t_cub *clist);
+void ft_drawsquare(int a, int b, int rgb, t_cub *clist);
+int ft_get_res(int fd, t_cub *clist);
+int ft_get_tex(int fd, t_cub *clist);
+int ft_get_sprite_tex(int fd, t_cub *clist);
+int ft_get_colors(int fd, t_cub *clist);
+int ft_get_map(int fd, t_cub *clist);
void ft_check_empty_line(int fd,
unsigned int linum,
- t_win *wlist);
+ t_cub *clist);
void ft_free_words(char **words, char *line);
-int ft_map_error(unsigned int linum, t_win *wlist);
-int ft_init_winlx(t_win *wlist);
-void ft_print_list(t_win *wlist);
+int ft_map_error(unsigned int linum, t_cub *clist);
+int ft_init_winlx(t_cub *clist);
+void ft_print_list(t_cub *clist);
#endif