-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdraw_floor_ceiling.c
More file actions
38 lines (33 loc) · 1.38 KB
/
Copy pathdraw_floor_ceiling.c
File metadata and controls
38 lines (33 loc) · 1.38 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* draw_floor_ceiling.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aqadil <aqadil@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/02 17:49:27 by aqadil #+# #+# */
/* Updated: 2022/06/11 10:21:23 by aqadil ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void draw_floors(float x, float y, t_data *mlx)
{
my_mlx_pixel_put_cast(mlx, (int)(x), (int)y, mlx->floor_color);
}
void draw_ceiling(float x, float y, t_data *mlx)
{
my_mlx_pixel_put_cast(mlx, (int)(x), (int)y, mlx->cieling_color);
}
void draw_floor_and_ceiling(t_vars *var, t_data *mlx)
{
int y123;
int counter;
y123 = var->line_offset + var->line_h;
counter = 0;
while (y123 < mlx->win_y)
{
draw_floors(var->r, y123, mlx);
draw_ceiling(var->r, mlx->win_y - y123, mlx);
y123++;
}
}