-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcardinal_handler.c
33 lines (31 loc) · 1.28 KB
/
cardinal_handler.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cardinal_handler.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vilibert <vilibert@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 12:27:43 by vilibert #+# #+# */
/* Updated: 2024/03/15 12:29:07 by vilibert ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void get_tex_ptr(t_data *data, t_raycast *rc)
{
if (rc->ipos.x >= data->player->pos.x && rc->side == 0)
{
rc->t = data->map->ea;
}
if (rc->ipos.x < data->player->pos.x && rc->side == 0)
{
rc->t = data->map->we;
}
if (rc->ipos.y >= data->player->pos.y && rc->side == 1)
{
rc->t = data->map->no;
}
if (rc->ipos.y < data->player->pos.y && rc->side == 1)
{
rc->t = data->map->so;
}
}