New folder structure
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/25 19:47:02 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/11 20:02:51 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/15 10:27:21 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -89,7 +89,7 @@ typedef struct s_data
|
||||
int fd;
|
||||
char *line;
|
||||
char *ture;
|
||||
char **ture2d;
|
||||
char **texture2d;
|
||||
char *map;
|
||||
char **map2d;
|
||||
char **sq_map;
|
||||
@@ -138,8 +138,8 @@ int read_map_(t_data *map, int count);
|
||||
void process_map(t_data *map, int *count);
|
||||
|
||||
// read_map_utils.c
|
||||
int check_tures_space_tab(char **ture2d, int count);
|
||||
int parse_rgb(char **ture2d);
|
||||
int check_tures_space_tab(char **texture2d, int count);
|
||||
int parse_rgb(char **texture2d);
|
||||
int check_dup(t_data *m);
|
||||
int check_first_last_line(char **map);
|
||||
int surrounded_by_one(char **map);
|
||||
|
||||
@@ -3839,9 +3839,9 @@ GLAPI PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GLAPI PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D;
|
||||
#define glFramebufferTexture1D glad_glFramebufferTexture1D
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GLAPI PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
|
||||
#define glFramebufferTexture2D glad_glFramebufferTexture2D
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXtexture2dPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GLAPI PFNGLFRAMEBUFFERTEXtexture2dPROC glad_glFramebufferTextexture2d;
|
||||
#define glFramebufferTextexture2d glad_glFramebufferTextexture2d
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
GLAPI PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D;
|
||||
#define glFramebufferTexture3D glad_glFramebufferTexture3D
|
||||
|
||||
@@ -523,7 +523,7 @@ PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri = NULL;
|
||||
PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
|
||||
PFNGLFRAMEBUFFERTEXtexture2dPROC glad_glFramebufferTextexture2d = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL;
|
||||
PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
|
||||
@@ -1969,7 +1969,7 @@ static void load_GL_VERSION_3_0(GLADloadproc load) {
|
||||
glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers");
|
||||
glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus");
|
||||
glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D");
|
||||
glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D");
|
||||
glad_glFramebufferTextexture2d = (PFNGLFRAMEBUFFERTEXtexture2dPROC)load("glFramebufferTextexture2d");
|
||||
glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D");
|
||||
glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer");
|
||||
glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv");
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* frees.c :+: :+: :+: */
|
||||
/* clean.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/28 20:03:22 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/11 19:57:55 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/15 10:27:21 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -26,7 +26,7 @@ void free_map(t_data *data)
|
||||
{
|
||||
free2d(data->sq_map);
|
||||
free2d(data->map2d);
|
||||
free2d(data->ture2d);
|
||||
free2d(data->texture2d);
|
||||
if (data->ff)
|
||||
free2d(data->ff);
|
||||
if (data->cc)
|
||||
@@ -39,8 +39,8 @@ void free_m(t_mlx *mlx)
|
||||
free2d(mlx->dt->sq_map);
|
||||
if (mlx->dt->map2d)
|
||||
free2d(mlx->dt->map2d);
|
||||
if (mlx->dt->ture2d)
|
||||
free2d(mlx->dt->ture2d);
|
||||
if (mlx->dt->texture2d)
|
||||
free2d(mlx->dt->texture2d);
|
||||
if (mlx->dt->ff)
|
||||
free2d(mlx->dt->ff);
|
||||
if (mlx->dt->cc)
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/04 09:28:05 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/09 19:52:54 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/15 10:27:21 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -67,7 +67,7 @@ int read_map_(t_data *map, int count)
|
||||
if (!map->map2d)
|
||||
return (ft_memfree(map->map), 0);
|
||||
ft_memfree(map->map);
|
||||
if (!check_tures_space_tab(map->ture2d, count) || !parse_rgb(map->ture2d)
|
||||
if (!check_tures_space_tab(map->texture2d, count) || !parse_rgb(map->texture2d)
|
||||
|| !check_dup(map) || !check_first_last_line(map->map2d)
|
||||
|| !surrounded_by_one(map->map2d))
|
||||
return (free2d(map->map2d), 0);
|
||||
@@ -6,13 +6,13 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/04 10:07:52 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/09 19:51:28 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/15 10:27:21 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../../includes/cub3d.h"
|
||||
|
||||
int check_tures_space_tab(char **ture2d, int count)
|
||||
int check_tures_space_tab(char **texture2d, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -20,20 +20,20 @@ int check_tures_space_tab(char **ture2d, int count)
|
||||
if (count != 6)
|
||||
return (0);
|
||||
while (++i < count)
|
||||
if (!is_valid_texture(ture2d[i]))
|
||||
if (!is_valid_texture(texture2d[i]))
|
||||
return (ft_putstr_fd("texture error\n", 2), 0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
int parse_rgb(char **ture2d)
|
||||
int parse_rgb(char **texture2d)
|
||||
{
|
||||
int i;
|
||||
char *ptr;
|
||||
|
||||
i = 0;
|
||||
while (ture2d[i])
|
||||
while (texture2d[i])
|
||||
{
|
||||
ptr = ture2d[i];
|
||||
ptr = texture2d[i];
|
||||
while (ft_isspace(*ptr))
|
||||
ptr++;
|
||||
if (ptr[0] == 'F' || ptr[0] == 'C')
|
||||
@@ -50,12 +50,12 @@ int check_dup(t_data *m)
|
||||
int j;
|
||||
|
||||
i = 0;
|
||||
while (m->ture2d[i])
|
||||
while (m->texture2d[i])
|
||||
{
|
||||
j = i + 1;
|
||||
while (m->ture2d[j])
|
||||
while (m->texture2d[j])
|
||||
{
|
||||
if (!ft_strncmp(m->ture2d[i], m->ture2d[j], 2))
|
||||
if (!ft_strncmp(m->texture2d[i], m->texture2d[j], 2))
|
||||
return (ft_putstr_fd(ERR_MAP_DUP, 2), 0);
|
||||
j++;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/05 16:30:33 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/10 12:25:34 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/15 10:27:21 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -109,6 +109,6 @@ int valid_map(t_data *m)
|
||||
m->h_map = ft_arraylen(m->sq_map);
|
||||
m->w_map = ft_strlen(m->sq_map[0]);
|
||||
if (!h_map(m->sq_map) || !v_map(m->sq_map))
|
||||
return (free2d(m->sq_map), free2d(m->map2d), free2d(m->ture2d), 0);
|
||||
return (free2d(m->sq_map), free2d(m->map2d), free2d(m->texture2d), 0);
|
||||
return (1);
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/01 08:48:55 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/11 19:57:55 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/15 10:27:21 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -64,9 +64,9 @@ int lst_ture(t_data *m, t_texture_list **l_ture)
|
||||
t_texture_list *tmp;
|
||||
|
||||
i = 0;
|
||||
while (m->ture2d[i])
|
||||
while (m->texture2d[i])
|
||||
{
|
||||
tmp = new_texture(m->ture2d[i++]);
|
||||
tmp = new_texture(m->texture2d[i++]);
|
||||
if (!tmp)
|
||||
return (0);
|
||||
lst_back_ture(l_ture, tmp);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/25 19:47:38 by aortigos #+# #+# */
|
||||
/* Updated: 2025/12/09 19:47:13 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/12/15 10:27:21 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -24,11 +24,11 @@ int read_map(char *av, t_data *map, int *count)
|
||||
process_map(map, count);
|
||||
if (!check_count_textures(map, *count))
|
||||
return (freetl(map->ture, map->line, map->fd), 0);
|
||||
map->ture2d = ft_split(map->ture, '\n');
|
||||
if (!map->ture2d)
|
||||
map->texture2d = ft_split(map->ture, '\n');
|
||||
if (!map->texture2d)
|
||||
return (freetl(map->ture, map->line, map->fd), 0);
|
||||
if (!read_map_(map, *count))
|
||||
return (freetl(map->ture, map->line, map->fd), free2d(map->ture2d), 0);
|
||||
return (freetl(map->ture, map->line, map->fd), free2d(map->texture2d), 0);
|
||||
return (freetl(map->ture, map->line, map->fd), 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user