-
Notifications
You must be signed in to change notification settings - Fork 0
/
mouve_mouse.c
36 lines (33 loc) · 1.29 KB
/
mouve_mouse.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* mouve_mouse.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ahajji <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/03 12:39:17 by ahajji #+# #+# */
/* Updated: 2023/11/09 14:07:51 by ahajji ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void move_mouse(double xp, double yp, void *param)
{
t_cub3d *data;
data = (t_cub3d *)param;
if (xp >= 0 && xp <= WIDTH_WIN && yp >= 0 && yp <= HEIGHT_WIN)
{
if (xp > data->old_x)
{
data->angle += (SPEED_ROTATE + 0.1);
if (data->angle >= 360)
data->angle -= 360;
}
else
{
data->angle -= SPEED_ROTATE;
if (data->angle <= 0)
data->angle += 360;
}
data->old_x = xp;
}
}