-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtools.c
58 lines (47 loc) · 1.9 KB
/
tools.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
53
54
55
56
57
58
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tools.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aqadil <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/12 13:25:13 by aqadil #+# #+# */
/* Updated: 2022/06/07 20:53:08 by aqadil ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void my_mlx_pixel_put2(t_player *data, int x, int y, int color)
{
char *dst;
dst = data->addr + (y * data->line_length
+ x * (data->bits_per_pixel / 8));
*(unsigned int *)dst = color;
}
void my_mlx_pixel_put(t_data *data, int x, int y, int color)
{
char *dst;
dst = data->addr + (y * data->line_length
+ x * (data->bits_per_pixel / 8));
*(unsigned int *)dst = color;
}
void my_mlx_pixel_put_cast(t_data *data, int x, int y, int color)
{
char *dst;
dst = data->cast_addr + (y * data->cast_line_length
+ x * (data->cast_bits_per_pixel / 8));
*(unsigned int *)dst = color;
}
void my_mlx_pixel_put_player(t_data *data, int x, int y, int color)
{
char *dst;
dst = data->player_addr + (y * data->player_line_length
+ x * (data->player_bits_per_pixel / 8));
*(unsigned int *)dst = color;
}
void my_mlx_pixel_put_loading(t_data *data, int x, int y, int color)
{
char *dst;
dst = data->loading_addr + (y * data->loading_line_length
+ x * (data->loading_bits_per_pixel / 8));
*(unsigned int *)dst = color;
}