put files into folders
This commit is contained in:
parent
e2df9c6f2c
commit
e530c856e8
@ -6,47 +6,12 @@
|
|||||||
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/02/13 23:37:02 by apommier #+# #+# */
|
/* Created: 2022/02/13 23:37:02 by apommier #+# #+# */
|
||||||
/* Updated: 2022/06/15 18:49:14 by apommier ### ########.fr */
|
/* Updated: 2022/06/15 18:52:18 by apommier ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "../../includes/Cub3D.h"
|
#include "../../includes/Cub3D.h"
|
||||||
|
|
||||||
// void free_texture(t_data *img)
|
|
||||||
// {
|
|
||||||
// if (img->map.texture.north)
|
|
||||||
// free(img->map.texture.north);
|
|
||||||
// if (img->map.texture.south)
|
|
||||||
// free(img->map.texture.south);
|
|
||||||
// if (img->map.texture.east)
|
|
||||||
// free(img->map.texture.east);
|
|
||||||
// if (img->map.texture.west)
|
|
||||||
// free(img->map.texture.west);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// int quit_game(t_data *img)
|
|
||||||
// {
|
|
||||||
// if (img->mlx)
|
|
||||||
// {
|
|
||||||
// if (img->mlx_win)
|
|
||||||
// mlx_destroy_window(img->mlx, img->mlx_win);
|
|
||||||
// mlx_destroy_display(img->mlx);
|
|
||||||
// free(img->mlx);
|
|
||||||
// }
|
|
||||||
// free_texture(img);
|
|
||||||
// if (img->map.simple_map)
|
|
||||||
// free(img->map.simple_map);
|
|
||||||
// if (img->to_be_free.tab)
|
|
||||||
// free_double(img->to_be_free.tab);
|
|
||||||
// if (img->to_be_free.tab_two)
|
|
||||||
// free_double(img->to_be_free.tab_two);
|
|
||||||
// if (img->to_be_free.str)
|
|
||||||
// free(img->to_be_free.str);
|
|
||||||
// if (img->to_be_free.fd != -1)
|
|
||||||
// close(img->to_be_free.fd);
|
|
||||||
// exit(1);
|
|
||||||
// }
|
|
||||||
|
|
||||||
double deg_to_rad(double angle)
|
double deg_to_rad(double angle)
|
||||||
{
|
{
|
||||||
return (angle * 3.14159265358979323846 / 180.0);
|
return (angle * 3.14159265358979323846 / 180.0);
|
||||||
@ -66,3 +31,22 @@ void ft_error(char *error_msg)
|
|||||||
ft_putendl_fd(error_msg, 2);
|
ft_putendl_fd(error_msg, 2);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ft_exit(char *str, t_data *img)
|
||||||
|
{
|
||||||
|
ft_putstr_fd(str, 2);
|
||||||
|
quit_game(img);
|
||||||
|
}
|
||||||
|
|
||||||
|
void check_dir(char *path, t_data *img)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
fd = open(path, O_DIRECTORY);
|
||||||
|
if (fd >= 0)
|
||||||
|
{
|
||||||
|
close(fd);
|
||||||
|
ft_exit("Error\nTexture path is a directory\n", img);
|
||||||
|
}
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
|||||||
@ -3,34 +3,15 @@
|
|||||||
/* ::: :::::::: */
|
/* ::: :::::::: */
|
||||||
/* parse_map.c :+: :+: :+: */
|
/* parse_map.c :+: :+: :+: */
|
||||||
/* +:+ +:+ +:+ */
|
/* +:+ +:+ +:+ */
|
||||||
/* By: sadjigui <sadjigui@student.42.fr> +#+ +:+ +#+ */
|
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/05/10 17:54:25 by sadjigui #+# #+# */
|
/* Created: 2022/05/10 17:54:25 by sadjigui #+# #+# */
|
||||||
/* Updated: 2022/06/15 17:24:27 by sadjigui ### ########.fr */
|
/* Updated: 2022/06/15 18:52:15 by apommier ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "../../includes/Cub3D.h"
|
#include "../../includes/Cub3D.h"
|
||||||
|
|
||||||
void check_dir(char *path, t_data *img)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
fd = open(path, O_DIRECTORY);
|
|
||||||
if (fd >= 0)
|
|
||||||
{
|
|
||||||
close(fd);
|
|
||||||
ft_exit("Error\nTexture path is a directory\n", img);
|
|
||||||
}
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ft_exit(char *str, t_data *img)
|
|
||||||
{
|
|
||||||
ft_putstr_fd(str, 2);
|
|
||||||
quit_game(img);
|
|
||||||
}
|
|
||||||
|
|
||||||
void verifie_texture_color(t_data *img)
|
void verifie_texture_color(t_data *img)
|
||||||
{
|
{
|
||||||
if (img->map.texture.north == NULL)
|
if (img->map.texture.north == NULL)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user