#include #include #include "../noegnud_gff_tga.h" int main(int argc, char **argv) { FILE *fi; FILE *fo; int size,bit; int mh; unsigned char byte; unsigned char value; unsigned char *fntmap; unsigned char *rgbmap; int x,y,line; if (argc<3) { puts("Usage: noegnud_fnt2tga "); return 0; } if (!(fi=fopen(argv[1],"r"))) { printf("couldn't open %s for reading.\n",argv[1]); exit(-1); } if (!(fo=fopen(argv[2],"w"))) { printf("couldn't open %s for writing.\n",argv[2]); fclose(fo); exit(-1); } fclose(fo); fseek(fi,0,SEEK_END); size=(int)ftell(fi); fseek(fi,0,SEEK_SET); fntmap=(unsigned char *)malloc(size); fread(fntmap,size,1,fi); fclose(fi); mh=0; for (y=0;y<16;y++) { for (x=0;x<16;x++) { for (line=0;linemh) mh=line; }; } } } } mh++; rgbmap=(unsigned char *)malloc(8*size*3); printf("Converting %s to %s as 128x%d of 8x%d chars\n",argv[1],argv[2],16*mh,mh); for (y=0;y<16;y++) { for (x=0;x<16;x++) { for (line=0;line