diff --git a/cub3d b/cub3d new file mode 100755 index 0000000..2c0b95f Binary files /dev/null and b/cub3d differ diff --git a/cub3d.h b/cub3d.h index 50fed06..3a926a4 100644 --- a/cub3d.h +++ b/cub3d.h @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/14 16:56:52 by fgras-ca #+# #+# */ -/* Updated: 2024/01/30 13:57:20 by fgras-ca ### ########.fr */ +/* Updated: 2024/01/30 15:14:01 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ @@ -472,6 +472,6 @@ bool check_for_multiple_players(bool found_player); int check_boundaries(t_point p, t_map_check *map_check); int is_space_surrounded_by_walls(t_map_check *map_check, t_point p); void *ft_calloc(size_t nmemb, size_t size); -void *ft_realloc(void *ptr, size_t size); +void *ft_realloc(void *ptr, size_t newsize, size_t oldsize); #endif diff --git a/draw/ft_2d_view.o b/draw/ft_2d_view.o new file mode 100644 index 0000000..524816d Binary files /dev/null and b/draw/ft_2d_view.o differ diff --git a/draw/ft_3d_view.o b/draw/ft_3d_view.o new file mode 100644 index 0000000..0c51fd5 Binary files /dev/null and b/draw/ft_3d_view.o differ diff --git a/draw/ft_3d_view_utils.o b/draw/ft_3d_view_utils.o new file mode 100644 index 0000000..27920f5 Binary files /dev/null and b/draw/ft_3d_view_utils.o differ diff --git a/draw/ft_background.o b/draw/ft_background.o new file mode 100644 index 0000000..62505a4 Binary files /dev/null and b/draw/ft_background.o differ diff --git a/draw/ft_draw.o b/draw/ft_draw.o new file mode 100644 index 0000000..da4b24b Binary files /dev/null and b/draw/ft_draw.o differ diff --git a/draw/ft_horizontal_ray.o b/draw/ft_horizontal_ray.o new file mode 100644 index 0000000..9b0d8be Binary files /dev/null and b/draw/ft_horizontal_ray.o differ diff --git a/draw/ft_load_textures.c b/draw/ft_load_textures.c index 6d979fc..746169f 100644 --- a/draw/ft_load_textures.c +++ b/draw/ft_load_textures.c @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/14 20:30:59 by fgras-ca #+# #+# */ -/* Updated: 2024/01/29 17:13:50 by fgras-ca ### ########.fr */ +/* Updated: 2024/01/30 15:05:11 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/draw/ft_load_textures.o b/draw/ft_load_textures.o new file mode 100644 index 0000000..76ae31d Binary files /dev/null and b/draw/ft_load_textures.o differ diff --git a/draw/ft_pixel.o b/draw/ft_pixel.o new file mode 100644 index 0000000..8e0ebd9 Binary files /dev/null and b/draw/ft_pixel.o differ diff --git a/draw/ft_ray_utils.o b/draw/ft_ray_utils.o new file mode 100644 index 0000000..71bf475 Binary files /dev/null and b/draw/ft_ray_utils.o differ diff --git a/draw/ft_textures.o b/draw/ft_textures.o new file mode 100644 index 0000000..717ec9c Binary files /dev/null and b/draw/ft_textures.o differ diff --git a/draw/ft_vertical_ray.o b/draw/ft_vertical_ray.o new file mode 100644 index 0000000..ea1d4c4 Binary files /dev/null and b/draw/ft_vertical_ray.o differ diff --git a/main.o b/main.o new file mode 100644 index 0000000..ac31836 Binary files /dev/null and b/main.o differ diff --git a/move/ft_collision.o b/move/ft_collision.o new file mode 100644 index 0000000..073fb86 Binary files /dev/null and b/move/ft_collision.o differ diff --git a/move/ft_key.o b/move/ft_key.o new file mode 100644 index 0000000..7905f05 Binary files /dev/null and b/move/ft_key.o differ diff --git a/move/ft_move.o b/move/ft_move.o new file mode 100644 index 0000000..04927d2 Binary files /dev/null and b/move/ft_move.o differ diff --git a/parsing/ft_find_map_start.o b/parsing/ft_find_map_start.o new file mode 100644 index 0000000..8f8c71d Binary files /dev/null and b/parsing/ft_find_map_start.o differ diff --git a/parsing/ft_find_player_position.o b/parsing/ft_find_player_position.o new file mode 100644 index 0000000..d9da9cc Binary files /dev/null and b/parsing/ft_find_player_position.o differ diff --git a/parsing/ft_find_player_utils.o b/parsing/ft_find_player_utils.o new file mode 100644 index 0000000..dd19f8c Binary files /dev/null and b/parsing/ft_find_player_utils.o differ diff --git a/parsing/ft_map_check.o b/parsing/ft_map_check.o new file mode 100644 index 0000000..4c79e96 Binary files /dev/null and b/parsing/ft_map_check.o differ diff --git a/parsing/ft_map_check_utils.o b/parsing/ft_map_check_utils.o new file mode 100644 index 0000000..fad3b31 Binary files /dev/null and b/parsing/ft_map_check_utils.o differ diff --git a/parsing/ft_map_dimensions.o b/parsing/ft_map_dimensions.o new file mode 100644 index 0000000..15615b0 Binary files /dev/null and b/parsing/ft_map_dimensions.o differ diff --git a/parsing/ft_parsing.o b/parsing/ft_parsing.o new file mode 100644 index 0000000..e2e2831 Binary files /dev/null and b/parsing/ft_parsing.o differ diff --git a/parsing/ft_text_and_col_utils.o b/parsing/ft_text_and_col_utils.o new file mode 100644 index 0000000..824d1fe Binary files /dev/null and b/parsing/ft_text_and_col_utils.o differ diff --git a/parsing/ft_textures_and_colors.c b/parsing/ft_textures_and_colors.c index 4caad8e..a4ec868 100644 --- a/parsing/ft_textures_and_colors.c +++ b/parsing/ft_textures_and_colors.c @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/16 16:19:13 by fgras-ca #+# #+# */ -/* Updated: 2024/01/30 13:55:56 by fgras-ca ### ########.fr */ +/* Updated: 2024/01/30 15:15:52 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,9 +24,11 @@ bool read_map_line(int fd, char *buffer, ssize_t *bytes_read) bool process_line(char **map_buffer, int *map_length, char *line) { ssize_t bytes_read; + size_t new_total_size; bytes_read = ft_strlen(line); - *map_buffer = ft_realloc(*map_buffer, *map_length + bytes_read + 1); + new_total_size = *map_length + bytes_read + 1; + *map_buffer = ft_realloc(*map_buffer, new_total_size, *map_length); if (!*map_buffer) { perror("Error reallocating memory for map buffer"); diff --git a/parsing/ft_textures_and_colors.o b/parsing/ft_textures_and_colors.o new file mode 100644 index 0000000..de64fd3 Binary files /dev/null and b/parsing/ft_textures_and_colors.o differ diff --git a/utils/ft_utils_convert.o b/utils/ft_utils_convert.o new file mode 100644 index 0000000..fd81d29 Binary files /dev/null and b/utils/ft_utils_convert.o differ diff --git a/utils/ft_utils_gnl.o b/utils/ft_utils_gnl.o new file mode 100644 index 0000000..be2598a Binary files /dev/null and b/utils/ft_utils_gnl.o differ diff --git a/utils/ft_utils_mem.c b/utils/ft_utils_mem.c index 9dcacf4..21c89a2 100644 --- a/utils/ft_utils_mem.c +++ b/utils/ft_utils_mem.c @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/30 12:33:22 by fgras-ca #+# #+# */ -/* Updated: 2024/01/30 13:58:28 by fgras-ca ### ########.fr */ +/* Updated: 2024/01/30 15:13:41 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,25 +39,24 @@ void *ft_calloc(size_t nmemb, size_t size) return (ptr); } -void *ft_realloc(void *ptr, size_t size) +void *ft_realloc(void *ptr, size_t newsize, size_t oldsize) { - void *new_ptr; + char *newptr; if (ptr == NULL) { - return (malloc(size)); + return (malloc(newsize)); } - if (size == 0) + if (newsize <= oldsize) { - free(ptr); - return (NULL); + return (ptr); } - new_ptr = malloc(size); - if (new_ptr == NULL) + newptr = malloc(newsize); + if (newptr == NULL) { return (NULL); } - ft_memcpy(new_ptr, ptr, size); + ft_memcpy(newptr, ptr, oldsize); free(ptr); - return (new_ptr); + return (newptr); } diff --git a/utils/ft_utils_mem.o b/utils/ft_utils_mem.o new file mode 100644 index 0000000..34d74a2 Binary files /dev/null and b/utils/ft_utils_mem.o differ diff --git a/utils/ft_utils_split.o b/utils/ft_utils_split.o new file mode 100644 index 0000000..c488bc5 Binary files /dev/null and b/utils/ft_utils_split.o differ diff --git a/utils/ft_utils_str_1.o b/utils/ft_utils_str_1.o new file mode 100644 index 0000000..6df0ec7 Binary files /dev/null and b/utils/ft_utils_str_1.o differ diff --git a/window/ft_map.o b/window/ft_map.o new file mode 100644 index 0000000..a6697c1 Binary files /dev/null and b/window/ft_map.o differ diff --git a/window/ft_player.o b/window/ft_player.o new file mode 100644 index 0000000..0552312 Binary files /dev/null and b/window/ft_player.o differ diff --git a/window/ft_refresh_window.o b/window/ft_refresh_window.o new file mode 100644 index 0000000..0857102 Binary files /dev/null and b/window/ft_refresh_window.o differ diff --git a/window/ft_rescale.o b/window/ft_rescale.o new file mode 100644 index 0000000..0f59071 Binary files /dev/null and b/window/ft_rescale.o differ diff --git a/window/ft_window.o b/window/ft_window.o new file mode 100644 index 0000000..6d448b4 Binary files /dev/null and b/window/ft_window.o differ