Skip to content

Commit

Permalink
fixed macos exit event handling, added norm check rule to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jwikiera committed Jan 6, 2023
1 parent 479a9f4 commit b9188a2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,6 @@ docker_clean:
docker system prune -a --volumes

re: fclean all

norm:
norminette includes/ sources/ libs/libft/ libs/libprintf/
Binary file added builds/fdf_macos
Binary file not shown.
7 changes: 2 additions & 5 deletions sources/keyhandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ void handle_keypress_2(int keycode, t_fdf *fdf)
else if (keycode == K_NUM_2)
fdf->screen_info->pos_y -= fdf->screen_info->mov_speed;
else if (keycode == K_NUM_8)
{
fdf->screen_info->pos_y += fdf->screen_info->mov_speed;
ft_printf("pressed k num 8!\n");
}
fdf->screen_info->pos_y += fdf->screen_info->mov_speed;
else if (keycode == K_MINUS || keycode == K_NUM_MINUS)
fdf->screen_info->pos_z += fdf->screen_info->zoom_speed;
else if (keycode == K_PLUS || keycode == K_NUM_PLUS)
Expand All @@ -40,7 +37,7 @@ void handle_keypress_2(int keycode, t_fdf *fdf)
int handle_keypress(int keycode, t_fdf *fdf)
{
if (keycode == K_ESC)
destroy(fdf);
mlx_destroy_window(fdf->mlx, fdf->win);
if (keycode == K_RIGHT)
add_angle_to_rotation_matrix(fdf->screen_info->rotation_matrix,
- fdf->screen_info->rotation_speed, axis_y, 0);
Expand Down
1 change: 0 additions & 1 deletion sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ int destroy(t_fdf *fdf)
free(fdf->screen_title);
if (fdf->screen_info)
free(fdf->screen_info);
mlx_destroy_window(fdf->mlx, fdf->win);
ft_printf("Exiting...\n");
exit(0);
}
Expand Down

0 comments on commit b9188a2

Please sign in to comment.