Skip to content

Commit

Permalink
style: fix Norme
Browse files Browse the repository at this point in the history
  • Loading branch information
leogaudin committed Jun 17, 2023
1 parent f626d28 commit edc5089
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
11 changes: 5 additions & 6 deletions include/fractol.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
/* By: lgaudin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 <math.h>

# define SIZE 700
# define MAX_ITERATIONS 142

// KEYCODES
# define ESC 53
Expand Down Expand Up @@ -56,10 +59,6 @@ typedef struct s_fractal
int max_iterations;
} t_fractal;

# include "libft/libft.h"
# include "minilibx/mlx.h"
# include <math.h>

// utils.c
void put_color_to_pixel(t_fractal *fractal, int x, int y, int colour);
int exit_fractal(t_fractal *fractal);
Expand Down
4 changes: 2 additions & 2 deletions src/burning_ship.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: lgaudin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -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));
}
4 changes: 2 additions & 2 deletions src/julia.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: lgaudin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -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)));
}
8 changes: 4 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: lgaudin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -35,16 +35,16 @@ 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++;
}
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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/mandelbrot.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: lgaudin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -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));
}
4 changes: 3 additions & 1 deletion src/mouse_and_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: lgaudin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: lgaudin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit edc5089

Please sign in to comment.