This commit is contained in:
Leo Firmin
2025-10-08 17:07:41 +02:00
parent a3e025e6b9
commit 2fa3015af4
29 changed files with 744 additions and 584 deletions
+18 -17
View File
@@ -6,29 +6,30 @@
/* By: lfirmin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/08/22 18:57:21 by lfirmin #+# #+# */
/* Updated: 2025/08/22 18:57:21 by lfirmin ### ########.fr */
/* Updated: 2025/10/08 16:21:46 by lfirmin ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub.h"
int init_data(t_data *data, char *path)
int init_data(t_data *data, char *path)
{
if (!data)
return (ft_error(ERROR_INIT_DATA), 1);
data->texture = malloc(sizeof(t_textures));
if (!data->texture)
return (ft_error(ERROR_INIT_TEX), 1);
init_parsing(&data->parsing);
init_textures(data->texture);
data->map = NULL;
data->map_path = path;
return (0);
if (!data)
return (ft_error(ERROR_INIT_DATA), 1);
data->texture = malloc(sizeof(t_textures));
if (!data->texture)
return (ft_error(ERROR_INIT_TEX), 1);
init_parsing(&data->parsing);
init_textures(data->texture);
data->map = NULL;
data->map_path = path;
return (0);
}
void free_data(t_data *data)
void free_data(t_data *data)
{
if (!data)
return;
if (data->texture)
free(data->texture);
if (!data)
return ;
if (data->texture)
free(data->texture);
free_char_array(data->map);
}