home *** CD-ROM | disk | FTP | other *** search
/ The Party 1994: Try This At Home / disk_image.bin / source / vexsrc / convfont.cpp < prev    next >
C/C++ Source or Header  |  1995-03-29  |  1KB  |  40 lines

  1. /*****************************************************************************
  2.                                   ATTENTION!
  3.                            this source is VOTEWARE,
  4.               you may only use it to the conditions listed below:
  5.  
  6.   -You may modify it, or use parts of it in your own source as long as
  7.     this header stays on top of all files containing this source.
  8.   -You must give proper credit to the author, Niklas Beisert / pascal.
  9.   -You may not use it in commercial productions without the written
  10.     permission of the author.
  11.   -AND MOST IMPORTANT: you have to buy an Assembly '94 CD-ROM
  12.     by Sound Solutions (if you don't have it already) and vote for VEX-InTrO
  13.     in the PC-64k-Intro-Compo! (if you have already sent your voting card,
  14.     buy another one and fill it out CORRECTLY!!!)
  15. *****************************************************************************/
  16.  
  17.  
  18.  
  19. // convert the tga font piccy to an internal format
  20.  
  21. #include <io.h>
  22. #include <fcntl.h>
  23. #include <sys\stat.h>
  24.  
  25. void main()
  26. {
  27.   unsigned char *buf=new unsigned char [64000];
  28.   short f=open("hooks.tga", O_RDONLY|O_BINARY);
  29.   lseek(f, 18+768, SEEK_SET);
  30.   read(f, buf, 64000);
  31.   close(f);
  32.   unsigned short i, j;
  33.  
  34.   f=open("hooks.fnt", O_WRONLY|O_BINARY|O_TRUNC|O_CREAT, S_IREAD|S_IWRITE);
  35.   for (i=0; i<20; i++)
  36.     for (j=0; j<4; j++)
  37.       write(f, buf+i*320+j*20*320, 256);
  38.   close(f);
  39. }
  40.