home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / piggy.h < prev    next >
Text File  |  1998-06-08  |  4KB  |  122 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/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.  
  65.  
  66.  
  67. #ifndef _PIGGY_H
  68. #define _PIGGY_H
  69.  
  70. #include "digi.h"
  71. #include "sounds.h"
  72.  
  73. typedef struct bitmap_index {
  74.     ushort    index;
  75. } bitmap_index;
  76.  
  77. int piggy_init();
  78. void piggy_close();
  79. void piggy_dump_all();
  80. bitmap_index piggy_register_bitmap( grs_bitmap * bmp, char * name, int in_file );
  81. int piggy_register_sound( digi_sound * snd, char * name, int in_file );
  82. bitmap_index piggy_find_bitmap( char * name );
  83. int piggy_find_sound( char * name );
  84.  
  85. #ifdef PIGGY_USE_PAGING
  86.     #define PIGGY_PAGE_IN(bmp)                             \
  87. do {                                                                 \
  88.     if ( GameBitmaps[(bmp).index].bm_flags & BM_FLAG_PAGED_OUT )    {    \
  89.         piggy_bitmap_page_in( bmp );                         \
  90.     }                                                                \
  91. } while(0)
  92. //        mprintf(( 0, "Paging in '%s' from file '%s', line %d\n", #bmp, __FILE__,__LINE__ ));    \
  93.  
  94.     extern void piggy_bitmap_page_in( bitmap_index bmp );
  95.     extern void piggy_bitmap_page_out_all();
  96.     extern int piggy_page_flushed;
  97. #else
  98.     #define PIGGY_PAGE_IN(bmp) 
  99. #endif
  100.  
  101. void piggy_read_bitmap_data(grs_bitmap * bmp);
  102. void piggy_read_sound_data(digi_sound    *snd);
  103.  
  104. void piggy_load_level_data();
  105.  
  106. #ifdef SHAREWARE
  107. #define MAX_BITMAP_FILES    1500
  108. #define MAX_SOUND_FILES        MAX_SOUNDS
  109. #else
  110. #define MAX_BITMAP_FILES    1800
  111. #define MAX_SOUND_FILES        MAX_SOUNDS
  112. #endif
  113.  
  114. extern digi_sound GameSounds[MAX_SOUND_FILES];
  115. extern grs_bitmap GameBitmaps[MAX_BITMAP_FILES];
  116.  
  117. void piggy_read_sounds();
  118.  
  119.  
  120. #endif
  121. 
  122.