PIGGY.H 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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/piggy.h $
  15. * $Revision: 2.0 $
  16. * $Author: john $
  17. * $Date: 1995/02/27 11:31:21 $
  18. *
  19. * Interface to piggy functions.
  20. *
  21. * $Log: piggy.h $
  22. * Revision 2.0 1995/02/27 11:31:21 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.10 1995/02/03 17:08:29 john
  27. * Changed sound stuff to allow low memory usage.
  28. * Also, changed so that Sounds isn't an array of digi_sounds, it
  29. * is a ubyte pointing into GameSounds, this way the digi.c code that
  30. * locks sounds won't accidentally unlock a sound that is already playing, but
  31. * since it's Sounds[soundno] is different, it would erroneously be unlocked.
  32. *
  33. * Revision 1.9 1995/01/24 14:33:49 john
  34. * *** empty log message ***
  35. *
  36. * Revision 1.8 1995/01/24 14:32:35 john
  37. * Took out paging in code.
  38. *
  39. * Revision 1.7 1995/01/23 12:30:17 john
  40. * Made debug code that mprintf what bitmap gets paged in.
  41. *
  42. * Revision 1.6 1995/01/17 14:11:37 john
  43. * Added function that is called after level loaded.
  44. *
  45. * Revision 1.5 1995/01/14 19:16:58 john
  46. * First version of new bitmap paging code.
  47. *
  48. * Revision 1.4 1994/10/27 18:51:57 john
  49. * Added -piglet option that only loads needed textures for a
  50. * mine. Only saved ~1MB, and code still doesn't free textures
  51. * before you load a new mine.
  52. *
  53. * Revision 1.3 1994/06/08 14:20:47 john
  54. * Made piggy dump before going into game.
  55. *
  56. * Revision 1.2 1994/05/06 13:02:40 john
  57. * Added piggy stuff; worked on supertransparency
  58. *
  59. * Revision 1.1 1994/05/06 11:47:46 john
  60. * Initial revision
  61. *
  62. *
  63. */
  64. #ifndef _PIGGY_H
  65. #define _PIGGY_H
  66. #include "digi.h"
  67. #include "sounds.h"
  68. typedef struct bitmap_index {
  69. ushort index;
  70. } bitmap_index;
  71. int piggy_init();
  72. void piggy_close();
  73. void piggy_dump_all();
  74. bitmap_index piggy_register_bitmap( grs_bitmap * bmp, char * name, int in_file );
  75. int piggy_register_sound( digi_sound * snd, char * name, int in_file );
  76. bitmap_index piggy_find_bitmap( char * name );
  77. int piggy_find_sound( char * name );
  78. #ifdef PIGGY_USE_PAGING
  79. #define PIGGY_PAGE_IN(bmp) \
  80. do { \
  81. if ( GameBitmaps[(bmp).index].bm_flags & BM_FLAG_PAGED_OUT ) { \
  82. piggy_bitmap_page_in( bmp ); \
  83. } \
  84. } while(0)
  85. // mprintf(( 0, "Paging in '%s' from file '%s', line %d\n", #bmp, __FILE__,__LINE__ )); \
  86. extern void piggy_bitmap_page_in( bitmap_index bmp );
  87. extern void piggy_bitmap_page_out_all();
  88. extern int piggy_page_flushed;
  89. #else
  90. #define PIGGY_PAGE_IN(bmp)
  91. #endif
  92. void piggy_read_bitmap_data(grs_bitmap * bmp);
  93. void piggy_read_sound_data(digi_sound *snd);
  94. void piggy_load_level_data();
  95. #ifdef SHAREWARE
  96. #define MAX_BITMAP_FILES 1500
  97. #define MAX_SOUND_FILES MAX_SOUNDS
  98. #else
  99. #define MAX_BITMAP_FILES 1800
  100. #define MAX_SOUND_FILES MAX_SOUNDS
  101. #endif
  102. extern digi_sound GameSounds[MAX_SOUND_FILES];
  103. extern grs_bitmap GameBitmaps[MAX_BITMAP_FILES];
  104. void piggy_read_sounds();
  105. #endif
  106.