home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / bm.h < prev    next >
Text File  |  1998-06-08  |  9KB  |  290 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/bm.h $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:32:59 $
  18.  *
  19.  * Bitmap and Palette loading functions.
  20.  *
  21.  * $Log: bm.h $
  22.  * Revision 2.0  1995/02/27  11:32:59  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.60  1994/12/06  13:24:58  matt
  27.  * Made exit model come out of bitmaps.tbl
  28.  * 
  29.  * Revision 1.59  1994/11/10  14:02:48  matt
  30.  * Hacked in support for player ships with different textures
  31.  * 
  32.  * Revision 1.58  1994/10/27  13:32:17  john
  33.  * Made TmapList only be in if editor
  34.  * 
  35.  * Revision 1.57  1994/10/11  12:25:20  matt
  36.  * Added "hot rocks" that create badass explosion when hit by weapons
  37.  * 
  38.  * Revision 1.56  1994/09/29  12:38:13  matt
  39.  * Took out include of digi.h, saving hours of unneeded compiles
  40.  * 
  41.  * Revision 1.55  1994/09/25  00:39:51  matt
  42.  * Added the ability to make eclips (monitors, fans) which can be blown up
  43.  * 
  44.  * Revision 1.54  1994/09/17  01:40:59  matt
  45.  * Added status bar/sizable window mode, and in the process revamped the
  46.  * whole cockpit mode system.
  47.  * 
  48.  * Revision 1.53  1994/09/08  16:20:48  matt
  49.  * Gave textures the ability to cause damage when scraped
  50.  * 
  51.  * Revision 1.52  1994/08/30  22:23:43  matt
  52.  * Added cabability for player ship to have alternate model to use to
  53.  * create debris.
  54.  * 
  55.  * Revision 1.51  1994/08/26  15:35:57  matt
  56.  * Made eclips usable on more than one object at a time
  57.  * 
  58.  * Revision 1.50  1994/08/23  16:59:51  john
  59.  * Added 3 cockpuits
  60.  * 
  61.  * Revision 1.49  1994/08/19  20:09:43  matt
  62.  * Added end-of-level cut scene with external scene
  63.  * 
  64.  * Revision 1.48  1994/08/12  22:20:45  matt
  65.  * Generalized polygon objects (such as control center)
  66.  * 
  67.  * Revision 1.47  1994/08/09  16:04:21  john
  68.  * Added network players to editor.
  69.  * 
  70.  * Revision 1.46  1994/08/09  09:01:31  john
  71.  * Increase MAX_TEXTURES
  72.  * 
  73.  * Revision 1.45  1994/07/13  00:14:57  matt
  74.  * Moved all (or nearly all) of the values that affect player movement to 
  75.  * bitmaps.tbl
  76.  * 
  77.  * Revision 1.44  1994/06/20  21:33:15  matt
  78.  * Made bm.h not include sounds.h, to reduce dependencies
  79.  * 
  80.  * Revision 1.43  1994/06/15  11:55:58  matt
  81.  * Added 3d model for player
  82.  * 
  83.  * Revision 1.42  1994/06/13  16:09:11  adam
  84.  * increased max textures to 600
  85.  * 
  86.  * Revision 1.41  1994/06/06  15:38:58  john
  87.  * Made fullscreen view be just another cockpit, but the "hole"
  88.  * in the cockpit is just bigger.
  89.  * 
  90.  * Revision 1.40  1994/05/26  21:08:59  matt
  91.  * Moved robot stuff out of polygon model and into robot_info struct
  92.  * Made new file, robot.c, to deal with robots
  93.  * 
  94.  * Revision 1.39  1994/05/18  11:00:05  mike
  95.  * Add robot_info stuff.
  96.  * 
  97.  * Revision 1.38  1994/05/17  14:44:56  mike
  98.  * Get object type and id from ObjType and ObjId.
  99.  * 
  100.  * Revision 1.37  1994/05/17  12:04:45  mike
  101.  * Deal with little known fact that polygon object != robot.
  102.  * 
  103.  * Revision 1.36  1994/05/16  16:17:35  john
  104.  * Bunch of stuff on my Inferno Task list May16-23
  105.  * 
  106.  * Revision 1.35  1994/04/27  11:43:42  john
  107.  * First version of sound! Yay!
  108.  * 
  109.  * Revision 1.34  1994/04/22  10:53:48  john
  110.  * Increased MAX_TEXTURES to 500.
  111.  * 
  112.  * Revision 1.33  1994/04/01  11:15:05  yuan
  113.  * Added multiple bitmap functionality to all objects...
  114.  * (hostages, powerups, lasers, etc.)  
  115.  * Hostages and powerups are implemented in the object system,
  116.  * just need to finish function call to "affect" player.
  117.  * 
  118.  * Revision 1.32  1994/03/25  17:30:37  yuan
  119.  * Checking in hostage stuff.
  120.  * 
  121.  * Revision 1.31  1994/03/17  18:07:28  yuan
  122.  * Removed switch code... Now we just have Walls, Triggers, and Links...
  123.  * 
  124.  * Revision 1.30  1994/03/15  17:03:51  yuan
  125.  * Added Robot/object bitmap capability
  126.  * 
  127.  * Revision 1.29  1994/03/15  16:32:58  yuan
  128.  * Cleaned up bm-loading code.
  129.  * (Fixed structures too)
  130.  * 
  131.  * Revision 1.28  1994/03/04  17:09:13  yuan
  132.  * New door stuff.
  133.  * 
  134.  * Revision 1.27  1994/01/31  14:50:09  yuan
  135.  * Added Robotex
  136.  * 
  137.  * Revision 1.26  1994/01/31  12:27:14  yuan
  138.  * Added demo stuff (menu, etc.)
  139.  * 
  140.  * Revision 1.25  1994/01/25  17:11:43  john
  141.  * New texmaped lasers.
  142.  * 
  143.  * Revision 1.24  1994/01/24  11:48:06  yuan
  144.  * Lighting stuff
  145.  * 
  146.  * Revision 1.23  1994/01/22  13:40:15  yuan
  147.  * Modified the bmd_bitmap structure a bit.
  148.  * (Saves some memory, and added reflection)
  149.  * 
  150.  * Revision 1.22  1994/01/11  10:58:38  yuan
  151.  * Added effects system
  152.  * 
  153.  * Revision 1.21  1994/01/06  17:13:12  john
  154.  * Added Video clip functionality
  155.  * 
  156.  * Revision 1.20  1993/12/21  20:00:15  john
  157.  * moved selector stuff to grs_bitmap
  158.  * 
  159.  * Revision 1.19  1993/12/21  19:33:58  john
  160.  * Added selector to bmd_bitmap.
  161.  * 
  162.  * Revision 1.18  1993/12/07  12:28:48  john
  163.  * moved bmd_palette to gr_palette
  164.  * 
  165.  * Revision 1.17  1993/12/06  18:40:37  matt
  166.  * Changed object loading & handling
  167.  * 
  168.  * Revision 1.16  1993/12/05  23:05:03  matt
  169.  * Added include of gr.h
  170.  * 
  171.  * Revision 1.15  1993/12/03  17:38:04  yuan
  172.  * Ooops. meant to say:
  173.  * Moved MAX variables to bm.c, Arrays left open.
  174.  * 
  175.  * Revision 1.14  1993/12/03  17:37:26  yuan
  176.  * Added Asserts.
  177.  * 
  178.  * Revision 1.13  1993/12/02  17:22:54  yuan
  179.  * New global var. Num_object_types
  180.  * 
  181.  * Revision 1.12  1993/12/02  16:34:39  yuan
  182.  * Added fireball hack stuff.
  183.  * 
  184.  * Revision 1.11  1993/12/02  15:45:14  yuan
  185.  * Added a buncha constants, variables, and function prototypes
  186.  * for the new bitmaps.tbl format.
  187.  * 
  188.  * Revision 1.10  1993/12/01  11:25:11  yuan
  189.  * Changed MALLOC'd buffers for filename and type in
  190.  * the bmd_bitmap structure into arrays... Saves time
  191.  * at load up.
  192.  * 
  193.  * Revision 1.9  1993/12/01  00:28:09  yuan
  194.  * New bitmap system structure.
  195.  * 
  196.  * Revision 1.8  1993/11/03  11:34:08  john
  197.  * made it use bitmaps.tbl
  198.  * 
  199.  * Revision 1.7  1993/10/26  18:11:03  john
  200.  * made all palette data be statically allocated
  201.  * 
  202.  * Revision 1.6  1993/10/19  12:17:51  john
  203.  * *** empty log message ***
  204.  * 
  205.  * Revision 1.5  1993/10/16  20:02:41  matt
  206.  * Changed name of backdrop bitmap file
  207.  * 
  208.  * Revision 1.4  1993/10/12  15:08:52  matt
  209.  * Added a bunch of new textures
  210.  * 
  211.  * Revision 1.3  1993/10/12  12:30:41  john
  212.  * *** empty log message ***
  213.  * 
  214.  * Revision 1.2  1993/10/12  11:27:58  john
  215.  * added more bitmaps
  216.  * 
  217.  * Revision 1.1  1993/09/23  13:09:10  john
  218.  * Initial revision
  219.  * 
  220.  *
  221.  */
  222.  
  223. #ifndef _BM_H
  224. #define _BM_H
  225.  
  226. #include "gr.h"
  227. #include "piggy.h"
  228.  
  229. #define MAX_TEXTURES        800
  230. #define BM_MAX_ARGS        10
  231.  
  232. //tmapinfo flags
  233. #define TMI_VOLATILE        1        //this material blows up when hit
  234.  
  235. typedef struct {
  236.     char            filename[13];
  237.     ubyte            flags;
  238.     fix            lighting;        // 0 to 1
  239.     fix            damage;            //how much damage being against this does
  240.     int            eclip_num;        //if not -1, the eclip that changes this   
  241. } tmap_info;
  242.  
  243. extern int Num_object_types;
  244.  
  245. #define N_COCKPIT_BITMAPS 4
  246. extern int Num_cockpits;
  247. extern bitmap_index cockpit_bitmap[N_COCKPIT_BITMAPS];
  248.  
  249. extern int Num_tmaps;
  250. #ifdef EDITOR
  251. extern int TmapList[MAX_TEXTURES];
  252. #endif
  253.  
  254. extern tmap_info TmapInfo[MAX_TEXTURES];
  255.  
  256. //for each model, a model number for dying & dead variants, or -1 if none
  257. extern int Dying_modelnums[];
  258. extern int Dead_modelnums[];
  259.  
  260. // Initializes the palette, bitmap system...
  261. int bm_init();
  262. void bm_close();
  263.  
  264. // Initializes the Texture[] array of bmd_bitmap structures.
  265. void init_textures();
  266.  
  267. #define OL_ROBOT                 1
  268. #define OL_HOSTAGE             2
  269. #define OL_POWERUP             3
  270. #define OL_CONTROL_CENTER    4
  271. #define OL_PLAYER                5
  272. #define OL_CLUTTER            6        //some sort of misc object
  273. #define OL_EXIT                7        //the exit model for external scenes
  274.  
  275. #define    MAX_OBJTYPE            100
  276.  
  277. extern int Num_total_object_types;        //    Total number of object types, including robots, hostages, powerups, control centers, faces
  278. extern byte    ObjType[MAX_OBJTYPE];        // Type of an object, such as Robot, eg if ObjType[11] == OL_ROBOT, then object #11 is a robot
  279. extern byte    ObjId[MAX_OBJTYPE];            // ID of a robot, within its class, eg if ObjType[11] == 3, then object #11 is the third robot
  280. extern fix    ObjStrength[MAX_OBJTYPE];    // initial strength of each object
  281.  
  282. #define MAX_OBJ_BITMAPS                210
  283. extern bitmap_index ObjBitmaps[MAX_OBJ_BITMAPS];
  284. extern ushort ObjBitmapPtrs[MAX_OBJ_BITMAPS];
  285. extern int First_multi_bitmap_num;
  286.  
  287.  
  288. #endif
  289. 
  290.