verif norm ok

This commit is contained in:
hugogogo
2021-07-27 14:17:42 +02:00
parent 463ce19ce3
commit 6c5f1ea217
9 changed files with 12 additions and 13 deletions

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);