From 2875f205e24f19964d44ddce2470659d21fe902d Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 19 Nov 2019 17:51:40 +0100 Subject: Removed duplicate man, modify window buffer instead of writting each pixels --- cub3d.h | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'cub3d.h') diff --git a/cub3d.h b/cub3d.h index dfc40a1..2ea4fe8 100644 --- a/cub3d.h +++ b/cub3d.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/11/15 06:40:37 by cacharle #+# #+# */ -/* Updated: 2019/11/18 19:00:20 by cacharle ### ########.fr */ +/* Updated: 2019/11/19 17:38:22 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include @@ -87,7 +87,16 @@ typedef struct int map_height; } t_parsing; -typedef unsigned int* t_image; +typedef struct +{ + int width; + int height; + void *id; + char *data; + int depth; + int size_line; + int endian; +} t_image; typedef struct s_state { @@ -104,10 +113,11 @@ typedef struct s_state int map_height; t_color ceilling_color; t_color floor_color; - t_image window_buf; - int window_img_depth; - int window_img_line_size; - int window_img_endian; + t_image window_img; + t_image north_texture; + t_image south_texture; + t_image west_texture; + t_image east_texture; } t_state; typedef t_bool (*t_option_parser_func)(t_parsing *parsing, char *line); @@ -118,6 +128,12 @@ typedef struct s_option_parser t_option_parser_func func; } t_option_parser; +typedef enum +{ + SIDE_NORTH_SOUTH, + SIDE_WEST_EAST +} t_side; + /* ** parse.c */ @@ -152,10 +168,9 @@ int handle_key(int key, void *param); */ t_state *create_state(void *mlx_ptr, void *window_ptr, t_parsing *parsing); -int graphics_update(void *param); -void draw_column(t_state *state, int x); -t_vector vector_add(t_vector a, t_vector b); -t_vector vector_scale(t_vector v, double scalar); +int graphics_update(void *param); +void draw_column(t_state *state, int x); +void write_color(char *data, int y, int x, t_color color); /* ** render.c -- cgit