mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
feat: Added new wall type (barricades)
This commit is contained in:
parent
d295c77360
commit
35b83e4ff7
6 changed files with 17 additions and 10 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/07/31 13:17:39 by kcolin #+# #+# */
|
||||
/* Updated: 2025/08/06 14:15:08 by tchampio ### ########.fr */
|
||||
/* Updated: 2025/09/09 09:59:45 by tchampio ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
#include "ray.h"
|
||||
#include "../renderer/render.h"
|
||||
#include "../draw/drawutils.h"
|
||||
#include "../../libft/includes/libft.h"
|
||||
|
||||
t_cardinal_dir get_cardinal(t_ray *ray)
|
||||
{
|
||||
|
|
@ -45,6 +46,8 @@ static int get_color(t_cub3d_data *data, t_ray *ray, int tex_y)
|
|||
|| (ray->side == SOUTH && ray->dir_y > 0))
|
||||
tex_x = TEXTURE_SIZE - tex_x - 1;
|
||||
dir = get_cardinal(ray);
|
||||
if (ft_strchr("2345678", data->map->map[ray->map_y][ray->map_x]))
|
||||
return (my_mlx_pixel_get(data->barricades_texture, tex_x, tex_y));
|
||||
if (dir == NORTH)
|
||||
texture = data->no_texture;
|
||||
else if (dir == SOUTH)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue