Пример #1
0
/**************************************************
*
*   FUNCTION:
*       unload_tables - "Unload Tables"
*
*   DESCRIPTION:
*       Unloads (frees) the symbol table
*
**************************************************/
void unload_tables
(
    void
)
{
    free_map( __keyword_table );
    free_map( __id_table );

}   /*unload_tables() */
Пример #2
0
struct bitmap *
and_bitmap(struct bitmap *left, struct bitmap *right)
{
    struct bitmap **rightmp, *lmap, *rmap, **leftmp;
    int i;
    int sig;
    for (leftmp = &left; (lmap = *leftmp);) {
	sig = 0;
	for (rightmp = &right; (rmap = *rightmp); rightmp = &rmap->m_next)
	    if (rmap->m_page == lmap->m_page) {
		for (i = 0; i < MDATA; ++i)
		    sig |= (lmap->m_data[i] &= rmap->m_data[i]);
		*rightmp = rmap->m_next;
		free((char *)rmap);
		break;
	    }
	if (rmap && sig) {
	    leftmp = &lmap->m_next;
	} else {
	    *leftmp = lmap->m_next;
	    free((char *)lmap);
	}
    }
    free_map((struct map *)right);
    return simplify_bitmap(left);
}
Пример #3
0
int			key_hook(int keycode, t_mapinfo *map)
{
	t_mapinfo mapcpy;

	mapcpy = *map;
	mapcpy.points = ft_mapcopy(map);
	if (keycode == 53)
		exit(0);
	else if (keycode == 15)
		key_reset(map);
	else if (keycode >= 0 && keycode <= 14)
		key_rot(keycode, map);
	else if (keycode >= 123 && keycode <= 126)
		key_scale(keycode, map);
	mlx_clear_window(0, map->win);
	scale_points(&mapcpy, mapcpy.scale_x, mapcpy.scale_y);
	rotate_x(map->rot_x, &mapcpy);
	rotate_y(map->rot_y, &mapcpy);
	rotate_z(map->rot_z, &mapcpy);
	ft_centremap(&mapcpy);
	ft_draw_map(mapcpy);
	free_map(mapcpy);
	if (keycode == 15 || keycode == 34)
		ft_draw_instruct(*map);
	//ft_putnbr(keycode);
	//ft_putchar('\n');
	return (0);
}
Пример #4
0
int		main(int ac, char **av)
{
  t_fileinfo	finfo;
  char		**patern;
  int		**map;
  int		fd;
  int		max_diag;

  if (ac != 2)
    {
      my_printf("Usage : \"Program\" \"Map\"\n");
      return (1);
    }
  if ((fd = open(av[1], O_RDONLY)) == -1)
    return (1);
  patern = get_patern(fd, &finfo);
  map = create_map(&finfo, patern);
  max_diag = max_square(map, &finfo);
  change_sqrmap(map, &finfo, max_diag);
  draw_final_map(map, &finfo);
  close(finfo.fd);
  free_patern(patern, &finfo);
  free_map(map, &finfo);
  return (0);
}
Пример #5
0
void	select_level(void)
{
    t_uint	i;
    t_lmap	*map;
    int		x;

    x = 0;
    i = 0;
    if (g_arka.map_count == 0)
        return ;
    map = g_arka.map_list;
    while (i != g_arka.menu.selection)
    {
        i++;
        map = map->next;
    }
    g_arka.current_map = map;
    if (g_arka.map)
        x = 1;
    free_map(g_arka.map);
    g_arka.map = parse_map(map->path);
    recreate();
    g_arka.players[0]->life = 3;
    g_arka.players[0]->score = 0;
    resume_game();
}
Пример #6
0
void		reset_game(void)
{
  t_link	*l;
  t_users	*u;
  int		seed;

  printf("Team %s won!\n", g_info.winner->name);
  lookup(g_info.users, graphics_seg(g_info.winner->name), &notify_graphic);
  while ((l = lookup_and_pop(g_info.users, NULL, &find_player)) != NULL)
    {
      u = (t_users*)l->ptr;
      u->team->free_slots = g_info.world.clients_per_team;
      u->team->nb_max_lvl = 0;
      lookup(g_info.users, graphics_pdi(u), &notify_graphic);
      delete_link(l, &free_users);
    }
  free_map(g_info.map);
  if (g_info.world.seed_spec == true)
    seed = g_info.world.seed;
  else
    seed = time(NULL);
  if ((g_info.map = generate_map(g_info.world.x, g_info.world.y, seed)) == NULL)
    leave("Failed to generate map");
  g_info.winner = NULL;
  g_info.end_game = false;
  log_msg(stdout, "Game restarted!\n");
}
Пример #7
0
struct map *
copy_map(struct map *parm)
{
    struct bitmap *result, **mpp, *map;
#ifdef MAP_DEBUG
    if (Mflag) {
	printf("copymap:");
	print_map(parm);
	printf("\n");
    }
#endif
    map = MAP(parm);
    for (mpp = &result; (*mpp = 0), map; map = map->m_next) {
	*mpp = (struct bitmap *)malloc(sizeof **mpp);
	if (!*mpp) {
#ifdef MAP_DEBUG
	    if (Mflag)
		printf("copy_map: out of memory\n");
#endif
	    free_map((struct map *)result);
	    result = 0;
	    break;
	}
	**mpp = *map;
	mpp = &(*mpp)->m_next;
    }
    if (NEGMAP(parm))
	return NOT_MAP(result);
    else
	return (struct map *)result;
}
Пример #8
0
int clean_map(Map *map, int map_max) {
    int map_ctr;
    for (map_ctr = 0; map_ctr < map_max; map_ctr++) {
        if (free_map(map + map_ctr)) return 1;
    }
    free(map);
    return 0;
}
Пример #9
0
struct map *
add_map(struct map *parm, int node)
{
    struct bitmap *map;
    int bit;
    int x, page;

#ifdef MAP_DEBUG
    if (Aflag) {
	printf("add_map: adding %d to [", node);
	print_map(parm);
	printf(" ] ");
    }
#endif
    bit = NUMBERTOBIT(node);
    x = NUMBERTOINDEX(node);
    page = NUMBERTOPAGE(node);

    bit = 1L << bit;;

    for (map = MAP(parm); map; map = map->m_next)
	if (map->m_page == page)
	    break;
    if (!map) {
	map = (struct bitmap *)malloc(sizeof *map);
	if (!map) {
#ifdef PRINT_MAP_ERROR
	    printf("No memory!\n");
#endif
	    free_map((struct map *)map);
	    return 0;
	}
	map->m_page = page;
	memset( map->m_data, 0, sizeof map->m_data);
	if (NEGMAP(parm)) {
	    int i;
	    for (i = 0; i < MDATA; ++i)
		map->m_data[i] = ~0;
	}
	map->m_next = MAP(parm);
	if (POSMAP(parm))
	    parm = (struct map *)map;
	else
	    parm = NOT_MAP(map);
    }
    if (POSMAP(parm))
	map->m_data[x] |= bit;
    else
	map->m_data[x] &= ~bit;
#ifdef MAP_DEBUG
    if (Aflag) {
	printf(" ->");
	print_map(parm);
	printf("\n");
    }
#endif
    return (struct map *)parm;
}
Пример #10
0
/*
   Frees memory. The amount of memory returned to OS depends on
   compiler trip settings.
 */
VALUE bm_reset(VALUE self) {
    Bitmapper* map;
    VALUE len;
    Data_Get_Struct(self, Bitmapper, map);
    free_map(map);
    len = rb_iv_get(self, "@index_len");
    allocate_map(map, FIX2INT(len));
    return self;
}
Пример #11
0
void close_ekf() {
	free(vectR);
	free_map();
	mFree(mQ,U_SIZE);
	mFree(mV,X_SIZE);	
	mFree(mPpred,X_SIZE);			
	mFree(mPcorr,X_SIZE);		
	
}
Пример #12
0
void				destroy_opengl(t_gl *gl)
{
	glfwDestroyWindow(gl->window);
	glfwTerminate();
	free_map(gl);
	free(gl->titre);
	gl->titre = NULL;
	get_glide(1);
}
Пример #13
0
int main()
{
 int exit = 0;
 int snum;
 LINE_LOOP *map = load_map("map.txt", &snum, 0.2);

 init();
 
 float cam_x = 0.0, cam_y = 2.0, cam_z = 30.0, cam_ax = 0.0, cam_ay = 0.0;

 printf("%d %d", sizeof(float), sizeof(float *));

 while(!exit)
  {
   VECTOR cam_dir = vector(SPEED * cos(M_PI * 0.5 - cam_ay * M_PI / 180.0), SPEED * sin(cam_ay * M_PI / 180.0 - M_PI * 0.5));

   int mx, my;
   get_mouse_mickeys(&mx, &my);
   //position_mouse(240, 320);
   
   cam_ay += mx * 0.03;
   cam_ax -= my * 0.03;
   if(cam_ax > 60) cam_ax = 60;
   if(cam_ax < -40) cam_ax = -40;
 
   if(keypressed())
    {
     if(key[KEY_ESC]) { exit = 1; }
     if(key[KEY_W]) { cam_x += cam_dir.x*10.0; cam_z += cam_dir.y*10.0; }
     if(key[KEY_S]) { cam_x -= cam_dir.x*10.0; cam_z -= cam_dir.y*10.0; }
     if(key[KEY_A]) { cam_x += cam_dir.y*10.0; cam_z += -cam_dir.x*10.0; }
     if(key[KEY_D]) { cam_x -= cam_dir.y*10.0; cam_z -= -cam_dir.x*10.0; }
     
     if(key[KEY_LEFT]) { cam_ay -= 0.09; }
     if(key[KEY_RIGHT]) { cam_ay += 0.09; }
     if(key[KEY_PGDN]) { cam_ax -= 0.09; }
     if(key[KEY_PGUP]) { cam_ax += 0.09; }
    }

   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   transform(-cam_x, -cam_y, -cam_z, -cam_ax, cam_ay, 0.0);
   glBegin(GL_QUADS);

    glColor3ub(128, 128, 128); glVertex3f(-300.0, 0.0, 300.0);
     glVertex3f(300.0, 0.0, 300.0);
     glVertex3f(300.0, 0.0, -300.0);
     glVertex3f(-300.0, 0.0, -300.0);
   
   draw_map_3d(map, snum);
   glEnd();
   allegro_gl_flip();
  }

 free_map(map, snum);
 readkey();
 return 0;
}
Пример #14
0
void		destroy(t_server *server)
{
  free_teams(server->teams);
  free_clients(server->clients);
  free_map(server->map);
  free(server);

  printf("Bye.\n");
}
Пример #15
0
int
ntk_free_maps(void)
{
	bmap_levels_free(me.bnode_map, me.bmap_nodes);
	bmap_counter_free(me.bmap_nodes_closed, me.bmap_nodes_opened);
	free_extmap(me.ext_map, FAMILY_LVLS, 0);
	free_map(me.int_map, 0);

	return 0;
}
Пример #16
0
struct map *
read_map(int (*f) (void *), char *arg)
{
    struct bitmap *map, *result, **mp;
    int page;
    int bitno, lastno;
    int data;

/* count, then startbitno, then bits. */
    lastno = ((*f) (arg));
    if (lastno == -1)
	return 0;
    if (lastno & ((1 << LSHIFT) - 1)) {
#ifdef PRINT_MAP_ERROR
	printf("read_map: bad count\n");
#endif
	return 0;
    }
    bitno = ((*f) (arg));
    if (bitno & ((1 << LSHIFT) - 1)) {
#ifdef PRINT_MAP_ERROR
	printf("read_map: bad start\n");
#endif
	return 0;
    }
    lastno += bitno;
    map = result = 0;
    for (; bitno < lastno; bitno += (1 << LSHIFT)) {
	data = (*f) (arg);
	if (!data)
	    continue;
	page = NUMBERTOPAGE(bitno);
	if (!map || map->m_page != page)
	    for (mp = &result; (map = *mp); mp = &map->m_next)
		if (map->m_page == page)
		    break;
	if (!map) {
	    map = (struct bitmap *)malloc(sizeof *map);
	    if (!map) {
#ifdef PRINT_MAP_ERROR
		printf("No memory!\n");
#endif
		if (result)
		    free_map((struct map *)result);
		return 0;
	    }
	    memset( map->m_data, 0, sizeof map->m_data);
	    map->m_page = page;
	    map->m_next = 0;
	    *mp = map;
	}
	map->m_data[NUMBERTOINDEX(bitno)] = data;
    }
    return (struct map *)result;
}
Пример #17
0
int main( int argc, char **argv){
	
	int c_height,c_width;
	map_t *map;

	map = NULL;
	
	c_height = 0;
	c_width = 0;

	if(argc < 4){
		printf("Usage: mars <map> <court width> <court height> \n");
	}else{
		c_height = atoi(argv[3]);
		c_width = atoi(argv[2]);
		map = ld_map_img(argv[1]);
	}
	
	map->c_width = c_width;
	map->c_height = c_height;
	map->min = map_min(map);
	map->max = map_max(map);
	map->count = count(map);	

	/*if(chk_slope_map(map)){
		printf("Yay, it's right!\n");
	}*/
	int k;	
	map_t *best;
	map_t *current;
	best = new_map(map->side);
	best->cost = 1000000;
	//find_best(map);
	
	for(k=1; k<256; k++){
		current = test_pos(map,k,13,509);
		current->cost = cost(map,current);
		printf("%ld\t%d\n",current->cost,k);
		if(current->cost < best->cost){
			free_map(best);
			best = current;
			best->cost = cost(map,best);
			best->h = k;
		}
		
	}
	printf("%ld (%d,%d,%d)\n",best->cost,best->x,best->y,best->h);
	
	exit(1);

	

}
Пример #18
0
static void clean_main(struct sb *sb, struct inode *inode)
{
    log_finish(sb);
    log_finish_cycle(sb, 1);
    free_map(inode->map);
    destroy_defer_bfree(&sb->derollup);
    destroy_defer_bfree(&sb->defree);
    tux3_clear_dirty_inode(sb->logmap);
    invalidate_buffers(sb->volmap->map);
    tux3_clear_dirty_inode(sb->volmap);
    put_super(sb);
    tux3_exit_mem();
}
Пример #19
0
int main(int argc, const char *const argv[])
{
    int err, ret = EXIT_FAILURE;
    FILE *f, *infile = stdin;
    double start, end;
    unsigned int nnodes;
    struct node *nodes;

    if (argc != 3)
	usage();

    f = fopen(argv[1], "r");
    if (!f) {
	perror("Error opening data file");
	return EXIT_FAILURE;
    }
    if (strcmp(argv[2], "-") != 0) {
	infile = fopen(argv[2], "r");
	if (!infile) {
	    perror("Error opening data file");
	    fclose(f);
	    return EXIT_FAILURE;
	}
    }

    start = get_current_seconds();
    err = load_map(f, &nodes, &nnodes);
    if (err)
	goto out_map;
    end = get_current_seconds();
    fclose(f);
    if (err)
	return EXIT_FAILURE;
    printf("Loaded %d nodes in %f seconds\n", nnodes, end - start);
    printf("Using %d MB\n", peak_memory_usage());

    err = input_and_search(infile, nodes, nnodes);
    if (err)
	goto out;

    printf("Peak memory usage %d MB\n", peak_memory_usage());

    ret = EXIT_SUCCESS;
  out:
    free_map(nodes, nnodes);
  out_map:
    if (infile != stderr)
	fclose(infile);
    return ret;
}
Пример #20
0
t_map	*solve(t_list *list)
{
	t_map	*map;
	int		size;

	size = high_sqrt(ft_lstcount(list) * 4);
	map = map_new(size);
	while (!solve_map(map, list))
	{
		size++;
		free_map(map);
		map = map_new(size);
	}
	return (map);
}
Пример #21
0
int		free_all(t_server *server, int const ret_value)
{
  if (!server)
    return (ret_value);
  free_list(server->data.eggs, ret_value);
  free_teams(server->data.teams, ret_value);
  free_clients(server->queue_clients, 0, ret_value);
  free_clients(server->graphic_clients, 0, ret_value);
  free_clients(server->all_players, 1, ret_value);
  free_int_tab(server->data.required_players, ret_value);
  free_int_tab(server->data.ports, ret_value);
  free_int_tab(server->socks, ret_value);
  free_double_int_tab(server->data.resources, ret_value);
  free(server->data.timers);
  return (free_map(server->data.map, ret_value));
}
Пример #22
0
/*
 * Automount interface to RPC lookup routine
 * Find the corresponding entry and return
 * the file handle for it.
 */
am_node *
amfs_generic_lookup_child(am_node *mp, char *fname, int *error_return, int op)
{
  am_node *new_mp;
  am_loc **al_array;

  dlog("in amfs_generic_lookup_child");

  *error_return = 0;
  new_mp = amfs_lookup_node(mp, fname, error_return);

  /* return if we got an error */
  if (!new_mp || *error_return > 0)
    return new_mp;

  /* also return if it's already mounted and known to be up */
  if (*error_return == 0 && FSRV_ISUP(new_mp->am_al->al_mnt->mf_server))
    return new_mp;

  switch (op) {
  case VLOOK_DELETE:
    /*
     * If doing a delete then don't create again!
     */
    ereturn(ENOENT);
  case VLOOK_LOOKUP:
    return new_mp;
  }

  al_array = amfs_lookup_loc(new_mp, error_return);
  if (!al_array) {
    new_mp->am_error = new_mp->am_al->al_mnt->mf_error = *error_return;
    free_map(new_mp);
    return NULL;
  }

  /* store the array inside the am_node */
  new_mp->am_alarray = al_array;

  /*
   * Note: while it might seem like a good idea to prioritize
   * the list of mntfs's we got here, it probably isn't.
   * It would ignore the ordering of entries specified by the user,
   * which is counterintuitive and confusing.
   */
  return new_mp;
}
Пример #23
0
int		load_map(t_engine *e)
{
  t_coord	pos;

  if (e->scales)
    free_map(e);
  e->scales = (t_scale**)xmalloc(sizeof(*e->scales) * e->map_data.h);
  e->entity = 0;
  for (pos.y = 0; pos.y < e->map_data.h; pos.y++)
    {
      e->scales[pos.y] = (t_scale*)xmalloc(sizeof(**e->scales) *
					   e->map_data.w);
      for (pos.x = 0; pos.x < e->map_data.w; pos.x++)
	{
	  if (!(e->scales[pos.y][pos.x].land =
		  get_land(e, e->map_data.data[pos.y][pos.x].land)))
	  {
	      fprintf(fd_log, "Land unknown x:%d, y:%d, land:%d\n",
		      pos.x, pos.y, e->map_data.data[pos.y][pos.x].land);
	      exit(1);
	  }	    
	  e->scales[pos.y][pos.x].idgfxentity =
			create_gfx_entity(e->scales[pos.y][pos.x].land->idsprite);
	  memset(e->scales[pos.y][pos.x].tab, 0, MAX_ENTITY_ON_SCALE *
		 sizeof(t_entity*));
	  memset(e->scales[pos.y][pos.x].coord, 0, MAX_ENTITY_ON_SCALE *
		 sizeof(t_coord));
	  if (e->map_data.data[pos.y][pos.x].item)
	    if (!get_entity(e, e->map_data.data[pos.y][pos.x].item, pos))
	      fprintf(fd_log, "error on map (unknown entity %d)\n",
		      e->map_data.data[pos.y][pos.x].item);
	  e->scales[pos.y][pos.x].fog =
	    (unsigned char*)xmalloc(sizeof(*e->scales[pos.y][pos.x].fog) *
				    e->map_data.nb_players);
	  memset(e->scales[pos.y][pos.x].fog, FOG_BLACK,
		 e->map_data.nb_players *
		 sizeof(*e->scales[pos.y][pos.x].fog));
	  memset(e->scales[pos.y][pos.x].tab_ephemere, 0, MAX_EPHEM *
		 sizeof(t_instant*));
	  memset(e->scales[pos.y][pos.x].coord_ephemere, 0, MAX_EPHEM *
		 sizeof(t_coord));
	}
    }
  return (0);
}
Пример #24
0
Файл: world.c Проект: phoboz/yz
void free_world(
  WORLD *world
  )
{
  FIELD *field;

  while ((field = (FIELD *) LIST_HEAD(&world->fieldList)) != NULL) {

    listRemove(&world->fieldList, (LIST_NODE *) field);
    free(field);

  }

  free(world->world_map);
  free_map(world->map);
  free_sprite(world->tiles);
  free(world);
}
Пример #25
0
int	main(int ac, char **av)
{
  t_win	win;

  if ((win.win = bunny_start(W_X, W_Y, false, "wolfd3d")) == NULL)
    return (1);
  if ((win.array = bunny_new_pixelarray(W_X, W_Y)) == NULL)
    return (1);
  if (ac == 2 && set_data(av[1], "level1", &win) == -1)
    return (1);
  else if (ac != 2 && set_def_map(&win) == 1)
    return (1);
  set_cols(&win);
  bunny_set_key_response(&press_key);
  bunny_set_loop_main_function(mainloop);
  bunny_loop(win.win, 60, &win);
  free_map(&win.map);
  bunny_delete_clipable(&win.array->clipable);
  bunny_stop(win.win);
  return (0);
}
Пример #26
0
int list_shutdown (List_of_maps * list, int fake) {
    
    if ( !list || !list->map ) return 0;
    int map_ctr;

    if ( fake ) {
	for ( map_ctr= 0; map_ctr< list->no_maps_used; map_ctr++) {
	    Map *current_map = list->map + map_ctr;
	    if (current_map->x2y_residue_level ) free (current_map->x2y_residue_level);
	    if (current_map->y2x_residue_level ) free (current_map->y2x_residue_level);
	}
    } else {
	for ( map_ctr= 0; map_ctr< list->no_maps_allocated; map_ctr++) {
	    if ( free_map(list->map+map_ctr) ) return 1;
	}
    }
    free (list->map_best);
    free (list->map);
    list->map = NULL;
	
    return 0;
}
Пример #27
0
/**
 * Remove a mapping from the gateway
 *
 * All channel pointers in gw->pm[] higher than this one are shifted down by
 * one position and the array is shrunk appropriately. The map is freed, which
 * closes all channels that may still be associated with it.
 *
 * @map		The map to delete
 * @return	Nothing, anything that goes wrong exits the program
 */
void remove_map_from_gw(struct static_port_map *map)
{
	struct gw_host *gw = map->parent;
	int i;

	for(i = 0; i < gw->n_maps; i++)
		if(map == gw->pm[i])
			break;

	if(i == gw->n_maps)
		log_exit(FATAL_ERROR, "Error: map %p not found in gw->pm (%p)",
				 map, gw->pm);

	if(gw->n_maps >= 1)	{
		while(i < gw->n_maps - 1)	{
			gw->pm[i] = gw->pm[i + 1];
			i++;
		}
		gw->n_maps--;
		free_map(map);
	}
}
Пример #28
0
void
am_unmounted(am_node *mp)
{
  mntfs *mf = mp->am_mnt;

  if (!foreground)		/* firewall - should never happen */
    return;

  /*
   * Do unmounted callback
   */
  if (mf->mf_ops->umounted)
    (*mf->mf_ops->umounted) (mp);

  /*
   * Update mtime of parent node
   */
  if (mp->am_parent && mp->am_parent->am_mnt)
    mp->am_parent->am_fattr.na_mtime.nt_seconds = clocktime();

  free_map(mp);
}
Пример #29
0
/* bit set in left, but not in right */
struct bitmap *
bic_bitmap(struct bitmap *left, struct bitmap *right)
{
    struct bitmap **rightmp, *lmap, *rmap, **leftmp;
    int i;
    int sig;
#ifdef MAP_DEBUG
    if (Mflag) {
	printf("bic_bitmap: left=%#lx right=%#lx\n", (long)left, (long)right);
    }
#endif
    for (leftmp = &left; (lmap = *leftmp);) {
	sig = 0;
	for (rightmp = &right; (rmap = *rightmp); rightmp = &rmap->m_next)
	    if (rmap->m_page == lmap->m_page) {
		for (i = 0; i < MDATA; ++i)
		    sig |= (lmap->m_data[i] &= ~rmap->m_data[i]);
		*rightmp = rmap->m_next;
		free((char *)rmap);
		break;
	    }
	if (!rmap || sig) {
	    leftmp = &lmap->m_next;
	} else {
	    *leftmp = lmap->m_next;
	    free((char *)lmap);
	}
    }
    free_map((struct map *)right);
    left = simplify_bitmap(left);
#ifdef MAP_DEBUG
    if (Mflag) {
	printf("bic_bitmap: result=%#lx\n", (long) left);
    }
#endif
    return left;
}
Пример #30
0
void		launch2(t_info *info, int n_path)
{
	int compteur;
	int i;
	int	tot;
	int tmp;

	tmp = info->nb_ants;
	i = 0;
	compteur = 0;
	tot = 0;
	while (i < n_path)
		tot += info->tab[i++];
	i = 0;
	tmp -= tot;
	while (compteur < tmp)
	{
		i = -1;
		while (info->tab[++i] && compteur++ < tmp)
			info->tab[i]++;
	}
	free_map(info->list_line, info->list, info);
	cross_path(info, n_path);
}