GAMEFONT.C 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. #pragma off (unreferenced)
  54. static char rcsid[] = "$Id: gamefont.c 2.0 1995/02/27 11:30:14 john Exp $";
  55. #pragma on (unreferenced)
  56. #include <stdlib.h>
  57. #include "gr.h"
  58. #include "gamefont.h"
  59. char * Gamefont_filenames[] = { "font1-1.fnt", // Font 0
  60. "font2-1.fnt", // Font 1
  61. "font2-2.fnt", // Font 2
  62. "font2-3.fnt", // Font 3
  63. "font3-1.fnt", // Font 4
  64. };
  65. grs_font *Gamefonts[MAX_FONTS];
  66. int Gamefont_installed=0;
  67. void gamefont_init()
  68. {
  69. int i;
  70. if (Gamefont_installed) return;
  71. Gamefont_installed = 1;
  72. for (i=0; i<MAX_FONTS; i++ )
  73. Gamefonts[i] = gr_init_font(Gamefont_filenames[i]);
  74. atexit( gamefont_close );
  75. }
  76. void gamefont_close()
  77. {
  78. int i;
  79. if (!Gamefont_installed) return;
  80. Gamefont_installed = 0;
  81. for (i=0; i<MAX_FONTS; i++ ) {
  82. gr_close_font( Gamefonts[i] );
  83. Gamefonts[i] = NULL;
  84. }
  85. }
  86.