\n");
}
num_cells++;
if(++mod_cells>=row_size) mod_cells=0;
// take care of entry in fp_dir for this pix
fprintf(fp_dir, "%s \n", pix_fn, pix_fn);
fprintf(fp_dir, " | \n", pix_fn);
// create html file for texturing this pix
strcpy(fn_html, pix_fn);
strcat(fn_html, ".html");
fp_pix=fopen(fn_html,"w");
if(!fp_pix) {
printf("@@@ unable to open file %s\n", fn_html);
exit(1);
}
fprintf(fp_pix, "\n");
fprintf(fp_pix, "\n%s (tiled)\n", pix_fn);
fprintf(fp_pix, "\n\n", pix_fn);
// show different text colors
fprintf(fp_pix, "\n");
for(r=0; r#%06X ", color, color);
}
fprintf(fp_pix, "
\n");
}
}
fprintf(fp_pix, "
\n\n");
// finish file
fprintf(fp_pix, "
\n\n");
fclose(fp_pix);
} // add_cel
void do_extension(FILE *fp_dir, char *ext) {
long h, num=0;
num_cells = 0;
h = _findfirst(ext, &fileinfo);
if(h>=0) {
add_cell(fp_dir, fileinfo.name);
while(!_findnext(h, &fileinfo)) {
add_cell(fp_dir, fileinfo.name);
}
}
_findclose(h);
printf(" %d %s\n", num_cells, ext);
} // do_extension
int main(int argc, char* argv[]) {
char *fn="ZZZ.html";
char *title="ZZZ";
FILE *fp_dir;
int n, m;
// examine command line arguments
for(n=1;n\n");
fprintf(fp_dir, "\n\n %s\n\n", title);
fprintf(fp_dir, "\n\n");
fprintf(fp_dir, "%s
\n\n", fn);
fprintf(fp_dir, "\n\n");
do_extension(fp_dir, "*.jpg");
do_extension(fp_dir, "*.gif");
do_extension(fp_dir, "*.png");
fprintf(fp_dir, "\n\n");
fprintf(fp_dir, "
\n\n\n\n");
fclose(fp_dir);
return 0;
} // main