home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / gamefont.c < prev    next >
Text File  |  1998-06-08  |  3KB  |  103 lines

  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  12. */
  13. /*
  14.  * $Source: f:/miner/source/main/rcs/gamefont.c $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:30:14 $
  18.  * 
  19.  * Fonts for the game.
  20.  * 
  21.  * $Log: gamefont.c $
  22.  * Revision 2.0  1995/02/27  11:30:14  john
  23.  * New version 2.0, which has no anonymous unions, builds with
  24.  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25.  * 
  26.  * Revision 1.8  1994/11/18  16:41:39  adam
  27.  * trimmed some meat
  28.  * 
  29.  * Revision 1.7  1994/11/17  13:07:11  adam
  30.  * removed unused font
  31.  * 
  32.  * Revision 1.6  1994/11/03  21:36:12  john
  33.  * Added code for credit fonts.
  34.  * 
  35.  * Revision 1.5  1994/08/17  20:20:02  matt
  36.  * Took out alternate-color versions of font3, since this is a mono font
  37.  * 
  38.  * Revision 1.4  1994/08/12  12:03:44  adam
  39.  * tweaked fonts.
  40.  * 
  41.  * Revision 1.3  1994/08/11  12:43:40  adam
  42.  * changed font filenames
  43.  * 
  44.  * Revision 1.2  1994/08/10  19:57:15  john
  45.  * Changed font stuff; Took out old menu; messed up lots of
  46.  * other stuff like game sequencing messages, etc.
  47.  * 
  48.  * Revision 1.1  1994/08/10  17:20:09  john
  49.  * Initial revision
  50.  * 
  51.  * 
  52.  */
  53.  
  54.  
  55. #pragma off (unreferenced)
  56. static char rcsid[] = "$Id: gamefont.c 2.0 1995/02/27 11:30:14 john Exp $";
  57. #pragma on (unreferenced)
  58.  
  59. #include <stdlib.h>
  60.  
  61. #include "gr.h"
  62. #include "gamefont.h"
  63.  
  64. char * Gamefont_filenames[] = {     "font1-1.fnt",            // Font 0
  65.                                             "font2-1.fnt",            // Font 1
  66.                                             "font2-2.fnt",            // Font 2
  67.                                             "font2-3.fnt",            // Font 3
  68.                                             "font3-1.fnt",            // Font 4
  69.                                         };
  70.  
  71. grs_font *Gamefonts[MAX_FONTS];
  72.  
  73. int Gamefont_installed=0;
  74.  
  75. void gamefont_init()
  76. {
  77.     int i;
  78.  
  79.     if (Gamefont_installed) return;
  80.     Gamefont_installed = 1;
  81.  
  82.     for (i=0; i<MAX_FONTS; i++ )
  83.         Gamefonts[i] = gr_init_font(Gamefont_filenames[i]);
  84.  
  85.     atexit( gamefont_close );
  86. }
  87.  
  88.  
  89. void gamefont_close()
  90. {
  91.     int i;
  92.  
  93.     if (!Gamefont_installed) return;
  94.     Gamefont_installed = 0;
  95.  
  96.     for (i=0; i<MAX_FONTS; i++ )    {
  97.         gr_close_font( Gamefonts[i] );
  98.         Gamefonts[i] = NULL;
  99.     }
  100.  
  101. }
  102. 
  103.