]> icculus.org git repositories - btb/d2x.git/blob - main/bm.h
draw all gauges properly when using the cockpit in d2x-gl, including the energy bars...
[btb/d2x.git] / main / bm.h
1 /* $Id: bm.h,v 1.15 2005-03-31 09:38:53 chris Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Bitmap and Palette loading functions.
18  *
19  */
20
21 #ifndef _BM_H
22 #define _BM_H
23
24 #include "gr.h"
25 #include "piggy.h"
26
27 #define MAX_TEXTURES    1200
28
29 //tmapinfo flags
30 #define TMI_VOLATILE    1   //this material blows up when hit
31 #define TMI_WATER       2   //this material is water
32 #define TMI_FORCE_FIELD 4   //this is force field - flares don't stick
33 #define TMI_GOAL_BLUE   8   //this is used to remap the blue goal
34 #define TMI_GOAL_RED    16  //this is used to remap the red goal
35 #define TMI_GOAL_HOARD  32  //this is used to remap the goals
36
37 typedef struct {
38         ubyte   flags;     //values defined above
39         ubyte   pad[3];    //keep alignment
40         fix     lighting;  //how much light this casts
41         fix     damage;    //how much damage being against this does (for lava)
42         short   eclip_num; //the eclip that changes this, or -1
43         short   destroyed; //bitmap to show when destroyed, or -1
44         short   slide_u,slide_v;    //slide rates of texture, stored in 8:8 fix
45         #ifdef EDITOR
46         char    filename[13];       //used by editor to remap textures
47         char    pad2[3];
48         #endif
49 } __pack__ tmap_info;
50
51 #define TMAP_INFO_SIZE 20   // how much space it takes up on disk
52
53 extern int Num_object_types;
54
55 #define N_COCKPIT_BITMAPS 6
56 extern int Num_cockpits;
57 extern bitmap_index cockpit_bitmap[N_COCKPIT_BITMAPS];
58
59 extern int Num_tmaps;
60 #ifdef EDITOR
61 extern int TmapList[MAX_TEXTURES];
62 #endif
63
64 extern tmap_info TmapInfo[MAX_TEXTURES];
65
66 //for each model, a model number for dying & dead variants, or -1 if none
67 extern int Dying_modelnums[];
68 extern int Dead_modelnums[];
69
70 //the model number of the marker object
71 extern int Marker_model_num;
72
73 // Initializes the palette, bitmap system...
74 int bm_init();
75 void bm_close();
76
77 // Initializes the Texture[] array of bmd_bitmap structures.
78 void init_textures();
79
80 extern int  Num_object_subtypes;     // Number of possible IDs for the current type of object to be placed
81
82 #define MAX_OBJ_BITMAPS     610
83
84 extern bitmap_index ObjBitmaps[MAX_OBJ_BITMAPS];
85 extern ushort ObjBitmapPtrs[MAX_OBJ_BITMAPS];
86 extern int First_multi_bitmap_num;
87
88 // Initializes all bitmaps from BITMAPS.TBL file.
89 int bm_init_use_tbl(void);
90
91 extern void bm_read_all(CFILE * fp);
92
93 int load_exit_models();
94
95 #endif /* _BM_H */