32 lines
666 B
C
32 lines
666 B
C
#include "cube3d.h"
|
|
|
|
void draw_floor_ceiling(t_game *game, t_rcast *rcast)
|
|
{
|
|
t_vec plan;
|
|
|
|
plan.start.x = rcast->ray_nb;
|
|
plan.end.x = rcast->ray_nb;
|
|
if (rcast->wall.start.y > 0)
|
|
{
|
|
plan.start.y = rcast->screen_height;
|
|
plan.end.y = rcast->wall.start.y;
|
|
draw_line(&game->img, &plan, 0x00FF0000);
|
|
}
|
|
if (rcast->wall.start.y < rcast->screen_height)
|
|
{
|
|
plan.start.y = rcast->wall.end.y;
|
|
plan.end.y = 0;
|
|
draw_line(&game->img, &plan, 0x000000FF);
|
|
}
|
|
}
|
|
|
|
void draw_column(t_game *game, t_rcast *rcast)
|
|
{
|
|
int color;
|
|
draw_floor_ceiling(game, rcast);
|
|
color = 0x00FF00FF;
|
|
if (rcast->is_x)
|
|
color = 0x00EE00EE;
|
|
draw_line(&game->img, &rcast->wall, color);
|
|
}
|