-
Notifications
You must be signed in to change notification settings - Fork 0
/
cub3d_sprite_default.c
executable file
·52 lines (47 loc) · 1.45 KB
/
cub3d_sprite_default.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cub3d_sprite_default.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mg <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/09/27 18:37:30 by mg #+# #+# */
/* Updated: 2020/10/06 15:58:58 by mg ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void c3d_sprite_grid_default(t_param *cub3d)
{
int i;
int j;
i = 0;
while (i < cub3d->map.row)
{
j = 0;
while (j < cub3d->map.column)
{
cub3d->sprite.grid[i][j].visible = 0;
++j;
}
++i;
}
}
void c3d_sprite_grid_coordinate(t_param *cub3d)
{
int i;
int j;
i = 0;
while (i < cub3d->map.row)
{
j = 0;
while (j < cub3d->map.column)
{
cub3d->sprite.grid[i][j].y =
i * cub3d->map.tile_size + cub3d->map.tile_size / 2;
cub3d->sprite.grid[i][j].x =
j * cub3d->map.tile_size + cub3d->map.tile_size / 2;
++j;
}
++i;
}
}