void index_submap_add(struct tile_info *info, struct tile_head *th) { int tlen=tile_len(th->name); int len=tlen; char *index_tile; struct rect r; struct item_bin *item_bin; index_tile=g_alloca(len+1+strlen(info->suffix)); strcpy(index_tile, th->name); if (len > 6) len=6; else len=0; index_tile[len]=0; strcat(index_tile, info->suffix); tile_bbox(th->name, &r, overlap); item_bin=init_item(type_submap); item_bin_add_coord_rect(item_bin, &r); item_bin_add_attr_range(item_bin, attr_order, (tlen > 4)?tlen-4 : 0, 255); item_bin_add_attr_int(item_bin, attr_zipfile_ref, th->zipnum); tile_write_item_to_tile(info, item_bin, NULL, index_tile); }
void tile_write_item_minmax(struct tile_info *info, struct item_bin *ib, FILE *reference, int min, int max) { struct rect r; char buffer[1024]; bbox((struct coord *)(ib+1), ib->clen/2, &r); buffer[0]='\0'; tile(&r, info->suffix, buffer, max, overlap, NULL); tile_write_item_to_tile(info, ib, reference, buffer); }