aboutsummaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-02-02 19:07:38 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-02-02 19:07:38 +0100
commit8c3b79c41048539d01f689d2fd3262b9b08ed00b (patch)
tree8caf2d580961f59d35dd7df70a7825c79f1a6706 /inc
parentAdded player list (diff)
download42-cub3d-8c3b79c41048539d01f689d2fd3262b9b08ed00b.tar.gz
42-cub3d-8c3b79c41048539d01f689d2fd3262b9b08ed00b.tar.bz2
42-cub3d-8c3b79c41048539d01f689d2fd3262b9b08ed00b.tar.xz
42-cub3d-8c3b79c41048539d01f689d2fd3262b9b08ed00b.tar.zst
42-cub3d-8c3b79c41048539d01f689d2fd3262b9b08ed00b.zip
Parsed player spawn
Diffstat (limited to 'inc')
-rw-r--r--inc/cub3d.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/inc/cub3d.h b/inc/cub3d.h
index 923e877..54973e8 100644
--- a/inc/cub3d.h
+++ b/inc/cub3d.h
@@ -42,6 +42,21 @@ typedef struct s_win
int16_t y_size;
} t_win;
+/*
+** view_side:
+** 1: North
+** 2: South
+** 3: East
+** 4: West
+*/
+
+typedef struct s_player
+{
+ size_t pos_x;
+ size_t pos_y;
+ uint8_t view_side;
+} t_player;
+
typedef struct s_cub
{
char *no_tex_path;
@@ -55,17 +70,12 @@ typedef struct s_cub
char **map;
size_t map_w;
size_t line_chk;
+ size_t map_start;
uint8_t isspawn;
struct s_win *wlist;
struct s_player *plist;
} t_cub;
-typedef struct s_player
-{
- size_t pos_x;
- size_t pos_y;
-} t_player;
-
t_win *ft_init_win(void);
t_cub *ft_init_cub(void);
int ft_key_event(int keycode, void *param);
@@ -83,6 +93,7 @@ int ft_get_f_color(char **words, t_cub *clist);
int ft_get_c_color(char **words, t_cub *clist);
int ft_get_map_first_line(char *line, t_cub *clist);
int ft_get_map_core(int fd, t_cub *clist);
+void ft_get_player_spawn(t_player *plist, t_cub *clist);
int ft_check_missing(t_cub *clist);
int8_t ft_check_map_line(char *line, uint8_t l, t_cub *clist);
size_t ft_get_line_len(char *line);