aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_wall_threads.c
blob: 4855da6f2b9f75a2ce3a2f3ccbe1e939442db4dc (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_wall_threads.c                                  :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: rbousset <marvin@42.fr>                    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/02/14 17:22:23 by rbousset          #+#    #+#             */
/*   Updated: 2020/02/14 17:23:42 by rbousset         ###   ########lyon.fr   */
/*                                                                            */
/* ************************************************************************** */

#include <cub3d.h>
#include <stdint.h>
#include <pthread.h>

void
	*ft_wall_one(void *vargp)
{
	t_cub		*cl;
	uint16_t	i;

	cl = (t_cub *)vargp;
	i = 0;
	while (i < cl->wlist.x_size / 5)
	{
		ft_draw_verline(cl, i,
			cl->rlist.wall_t_tab[i], cl->rlist.wall_b_tab[i]);
		i++;
	}
	pthread_exit(0x0);
	return (0x0);
}

void
	*ft_wall_two(void *vargp)
{
	t_cub		*cl;
	uint16_t	i;

	cl = (t_cub *)vargp;
	i = cl->wlist.x_size / 5;
	while (i < 2 * (cl->wlist.x_size / 5))
	{
		ft_draw_verline(cl, i,
			cl->rlist.wall_t_tab[i], cl->rlist.wall_b_tab[i]);
		i++;
	}
	pthread_exit(0x0);
	return (0x0);
}

void
	*ft_wall_three(void *vargp)
{
	t_cub		*cl;
	uint16_t	i;

	cl = (t_cub *)vargp;
	i = 2 * (cl->wlist.x_size / 5);
	while (i < 3 * (cl->wlist.x_size / 5))
	{
		ft_draw_verline(cl, i,
			cl->rlist.wall_t_tab[i], cl->rlist.wall_b_tab[i]);
		i++;
	}
	pthread_exit(0x0);
	return (0x0);
}

void
	*ft_wall_four(void *vargp)
{
	t_cub		*cl;
	uint16_t	i;

	cl = (t_cub *)vargp;
	i = 3 * (cl->wlist.x_size / 5);
	while (i < 4 * (cl->wlist.x_size / 5))
	{
		ft_draw_verline(cl, i,
			cl->rlist.wall_t_tab[i], cl->rlist.wall_b_tab[i]);
		i++;
	}
	pthread_exit(0x0);
	return (0x0);
}

void
	*ft_wall_five(void *vargp)
{
	t_cub		*cl;
	uint16_t	i;

	cl = (t_cub *)vargp;
	i = 4 * (cl->wlist.x_size / 5);
	while (i < 5 * (cl->wlist.x_size / 5))
	{
		ft_draw_verline(cl, i,
			cl->rlist.wall_t_tab[i],cl->rlist.wall_b_tab[i]);
		i++;
	}
	pthread_exit(0x0);
	return (0x0);
}