Ejemplo n.º 1
0
static void		init(t_param *p)
{
	p->YC = p->YC + 1;
	p->l.xb = find_x(p);
	p->l.yb = find_y(p);
	p->YC = p->YC - 1;
	p->l.xa = find_x(p);
	p->l.ya = find_y(p);
}
Ejemplo n.º 2
0
float	find_wall(t_env *env , int **map, float each_x, unsigned int *color)
{
  float	x1;
  float	y1;
  float	k_x;
  float	k_y;
  float	tmp;

  x1 = env->x + 0.5;
  y1 = env->y + each_x;
  tmp = x1;
  x1 = cos(RAD(env->angle)) * (tmp - env->x) - sin(RAD(env->angle))
    * (y1 - env->y);
  y1 = sin(RAD(env->angle)) * (tmp - env->x) + cos(RAD(env->angle))
    * (y1 - env->y);
  k_x = find_x(env, map, x1, y1);
  k_y = find_y(env, map, x1, y1);
  *color = 0;
  (x1 > 0) ? (*color = FIRST_COLOR) : (*color = SECOND_COLOR);
  (k_x > k_y) ? ((y1 > 0) ? (*color = THIRD_COLOR)
		 : (*color = FOURTH_COLOR)) : (0);
  if (k_x > k_y)
    return (k_y);
  return (k_x);
}
Ejemplo n.º 3
0
void			create_win(t_mlxtool *mlx_tool, char *name)
{
	int sizex;
	int sizey;

	find_x(mlx_tool);
	find_y(mlx_tool);
	sizex = mlx_tool->minx - mlx_tool->maxx;
	sizey = mlx_tool->miny - mlx_tool->maxy;
	mlx_tool->init = mlx_init();
	mlx_tool->win = mlx_new_window(mlx_tool->init, sizex, sizey, name);
	mlx_loop(mlx_tool->init);
}