verif norm ok

This commit is contained in:
hugogogo
2021-07-27 14:18:04 +02:00
parent 463ce19ce3
commit 6c5f1ea217
9 changed files with 12 additions and 13 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -32,7 +32,7 @@ typedef struct s_fdf
double rad_y;
int mov_x;
int mov_y;
int zoom;
double zoom;
int img_bpp;
int img_sizel;
int img_endian;
+3 -2
View File
@@ -43,14 +43,15 @@ void init_offset(t_fdf *fdf)
{
int diagonal;
int x;
int y;
x = (fdf->map_width) * (fdf->map_width);
x += (fdf->map_height) * (fdf->map_height);
y = (fdf->map_height) * (fdf->map_height);
fdf->offset = 1;
diagonal = 1;
while (diagonal < fdf->win_size_x)
{
diagonal = x * (fdf->offset * fdf->offset);
diagonal = (x + y) * (fdf->offset * fdf->offset);
diagonal = ft_sqrt(diagonal);
fdf->offset++;
}
+8 -10
View File
@@ -10,9 +10,11 @@
*/
void keypress_more(int keycode, t_fdf *fdf)
{
if (keycode == ESCAPE)
shut_down(fdf);
if (keycode == U)
if (keycode == A)
fdf->zoom += 1;
else if (keycode == W)
fdf->zoom -= 1;
else if (keycode == U)
{
fdf->rot_x = 0;
fdf->rot_y = 0;
@@ -28,10 +30,8 @@ void keypress_more(int keycode, t_fdf *fdf)
else if (keycode == O)
fdf->altitude++;
else if (keycode == P)
{
if (fdf->altitude > 1)
fdf->altitude--;
}
}
/*
@@ -44,7 +44,9 @@ void keypress_more(int keycode, t_fdf *fdf)
*/
int keypress(int keycode, t_fdf *fdf)
{
if (keycode == LEFT)
if (keycode == ESCAPE)
shut_down(fdf);
else if (keycode == LEFT)
fdf->rot_x += 1;
else if (keycode == RIGHT)
fdf->rot_x -= 1;
@@ -60,10 +62,6 @@ int keypress(int keycode, t_fdf *fdf)
fdf->mov_y -= 6;
else if (keycode == S)
fdf->mov_y += 6;
else if (keycode == A)
fdf->zoom += 6;
else if (keycode == W)
fdf->zoom -= 6;
else
keypress_more(keycode, fdf);
draw_image(fdf);