From edc5089b6bd1a9712eb87ea8efcb65aec41760c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Le=CC=81o?= Date: Sat, 17 Jun 2023 18:37:28 +0200 Subject: [PATCH] style: fix Norme --- include/fractol.h | 11 +++++------ src/burning_ship.c | 4 ++-- src/julia.c | 4 ++-- src/main.c | 8 ++++---- src/mandelbrot.c | 4 ++-- src/mouse_and_keys.c | 4 +++- src/utils.c | 3 ++- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/include/fractol.h b/include/fractol.h index 416fc87..4dd942e 100644 --- a/include/fractol.h +++ b/include/fractol.h @@ -6,15 +6,18 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/15 18:46:11 by lgaudin #+# #+# */ -/* Updated: 2023/06/17 18:30:16 by lgaudin ### ########.fr */ +/* Updated: 2023/06/17 18:37:17 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef FRACTOL_H # define FRACTOL_H +# include "libft/libft.h" +# include "minilibx/mlx.h" +# include + # define SIZE 700 -# define MAX_ITERATIONS 142 // KEYCODES # define ESC 53 @@ -56,10 +59,6 @@ typedef struct s_fractal int max_iterations; } t_fractal; -# include "libft/libft.h" -# include "minilibx/mlx.h" -# include - // utils.c void put_color_to_pixel(t_fractal *fractal, int x, int y, int colour); int exit_fractal(t_fractal *fractal); diff --git a/src/burning_ship.c b/src/burning_ship.c index 54c4121..ef3c19a 100644 --- a/src/burning_ship.c +++ b/src/burning_ship.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/16 13:55:52 by lgaudin #+# #+# */ -/* Updated: 2023/06/17 18:33:00 by lgaudin ### ########.fr */ +/* Updated: 2023/06/17 18:35:31 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -46,5 +46,5 @@ void calculate_burning_ship(t_fractal *fractal) put_color_to_pixel(fractal, fractal->x, fractal->y, 0x000000); else put_color_to_pixel(fractal, fractal->x, fractal->y, (fractal->color - * i)); + * i)); } diff --git a/src/julia.c b/src/julia.c index 4bd25a6..e7715fe 100644 --- a/src/julia.c +++ b/src/julia.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/16 13:55:52 by lgaudin #+# #+# */ -/* Updated: 2023/06/17 18:31:13 by lgaudin ### ########.fr */ +/* Updated: 2023/06/17 18:36:42 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -47,5 +47,5 @@ void calculate_julia(t_fractal *fractal, double cx, double cy) put_color_to_pixel(fractal, fractal->x, fractal->y, 0x000000); else put_color_to_pixel(fractal, fractal->x, fractal->y, (fractal->color * (i - % 255))); + % 255))); } diff --git a/src/main.c b/src/main.c index 94509d0..c686932 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/13 22:55:04 by lgaudin #+# #+# */ -/* Updated: 2023/06/17 18:29:37 by lgaudin ### ########.fr */ +/* Updated: 2023/06/17 18:36:32 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -35,7 +35,7 @@ int draw_fractal(t_fractal *fractal, char *query, double cx, double cy) calculate_burning_ship(fractal); else { - ft_putendl_fd("Available fractals: mandelbrot, julia, burningship", 1); + ft_putendl_fd("Available fractals: mandel, julia, ship", 1); exit_fractal(fractal); } fractal->y++; @@ -43,8 +43,8 @@ int draw_fractal(t_fractal *fractal, char *query, double cx, double cy) fractal->x++; fractal->y = 0; } - mlx_put_image_to_window(fractal->mlx, fractal->window, - fractal->image, 0, 0); + mlx_put_image_to_window(fractal->mlx, fractal->window, fractal->image, 0, + 0); return (0); } diff --git a/src/mandelbrot.c b/src/mandelbrot.c index 741d514..6dcf0e6 100644 --- a/src/mandelbrot.c +++ b/src/mandelbrot.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/16 13:27:23 by lgaudin #+# #+# */ -/* Updated: 2023/06/17 18:31:26 by lgaudin ### ########.fr */ +/* Updated: 2023/06/17 18:36:46 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -63,5 +63,5 @@ void calculate_mandelbrot(t_fractal *fractal) put_color_to_pixel(fractal, fractal->x, fractal->y, 0x000000); else put_color_to_pixel(fractal, fractal->x, fractal->y, (fractal->color - * i)); + * i)); } diff --git a/src/mouse_and_keys.c b/src/mouse_and_keys.c index 93a6c9b..40ba482 100644 --- a/src/mouse_and_keys.c +++ b/src/mouse_and_keys.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/16 18:11:08 by lgaudin #+# #+# */ -/* Updated: 2023/06/17 18:04:16 by lgaudin ### ########.fr */ +/* Updated: 2023/06/17 18:35:46 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -44,6 +44,7 @@ void zoom(t_fractal *fractal, int x, int y, int zoom) else return ; } + /** * @brief Sets the constants of Julia to random values. * @@ -100,6 +101,7 @@ int key_hook(int key_code, t_fractal *fractal) draw_fractal(fractal, fractal->name, cx, cy); return (0); } + /** * @brief The handler for mouse events. * SCROLL_UP: zoom in. diff --git a/src/utils.c b/src/utils.c index 5e1e022..e4af454 100644 --- a/src/utils.c +++ b/src/utils.c @@ -6,7 +6,7 @@ /* By: lgaudin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/16 13:27:37 by lgaudin #+# #+# */ -/* Updated: 2023/06/17 17:58:49 by lgaudin ### ########.fr */ +/* Updated: 2023/06/17 18:35:55 by lgaudin ### ########.fr */ /* */ /* ************************************************************************** */ @@ -42,6 +42,7 @@ int exit_fractal(t_fractal *fractal) exit(1); return (0); } + /** * @brief Generates a random double between -1.5 and 1.5. *