feat: testing how to play with textures

This commit is contained in:
Raphael 2024-12-09 14:33:53 +01:00
parent badd6534f4
commit e581c72b02
14 changed files with 598 additions and 313 deletions

View file

@ -6,7 +6,7 @@
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/12 06:02:54 by bgoulard #+# #+# */
/* Updated: 2024/12/05 16:30:56 by rparodi ### ########.fr */
/* Updated: 2024/12/05 16:44:04 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -91,23 +91,6 @@ void column_handler(t_ipoint pos_i, t_dpoint ray_dir, t_info *data, int x)
draw_(side, perp_wall_dist, step, x, data);
}
void draw_floor(t_info *data)
{
t_ipoint temp;
temp.y = data->screen_size.y / 2;
while (temp.y < data->screen_size.y)
{
temp.x = 0;
while (temp.x < data->screen_size.x)
{
my_mlx_pixel_put(data, temp.x, temp.y, 0xFFFFFF);
temp.x++;
}
temp.y++;
}
}
int render_frame(t_info *data)
{
double camera_x;

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 18:55:11 by rparodi #+# #+# */
/* Updated: 2024/12/01 18:57:21 by rparodi ### ########.fr */
/* Updated: 2024/12/05 16:43:53 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -20,6 +20,23 @@
#include <math.h>
#include <unistd.h>
void draw_floor(t_info *data)
{
t_ipoint temp;
temp.y = data->screen_size.y / 2;
while (temp.y < data->screen_size.y)
{
temp.x = 0;
while (temp.x < data->screen_size.x)
{
my_mlx_pixel_put(data, temp.x, temp.y, 0xFFFFFF);
temp.x++;
}
temp.y++;
}
}
void set_step(t_ipoint *step, t_dpoint raydir)
{
if (raydir.x < 0)