]> icculus.org git repositories - btb/d2x.git/blob - main/bm.h
if descent.pig available, load d1 textures for d1 levels
[btb/d2x.git] / main / bm.h
1 /* $Id: bm.h,v 1.8 2003-03-19 22:44:15 btb 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 #ifndef _BM_H
16 #define _BM_H
17
18 #include "gr.h"
19 #include "piggy.h"
20
21 #define MAX_TEXTURES    1200
22
23 //tmapinfo flags
24 #define TMI_VOLATILE    1   //this material blows up when hit
25 #define TMI_WATER       2   //this material is water
26 #define TMI_FORCE_FIELD 4   //this is force field - flares don't stick
27 #define TMI_GOAL_BLUE   8   //this is used to remap the blue goal
28 #define TMI_GOAL_RED    16  //this is used to remap the red goal
29 #define TMI_GOAL_HOARD  32  //this is used to remap the goals
30
31 typedef struct {
32         ubyte   flags;     //values defined above
33         ubyte   pad[3];    //keep alignment
34         fix     lighting;  //how much light this casts
35         fix     damage;    //how much damage being against this does (for lava)
36         short   eclip_num; //the eclip that changes this, or -1
37         short   destroyed; //bitmap to show when destroyed, or -1
38         short   slide_u,slide_v;    //slide rates of texture, stored in 8:8 fix
39         #ifdef EDITOR
40         char    filename[13];       //used by editor to remap textures
41         char    pad2[3];
42         #endif
43 } __pack__ tmap_info;
44
45 extern int Num_object_types;
46
47 #define N_COCKPIT_BITMAPS 6
48 extern int Num_cockpits;
49 extern bitmap_index cockpit_bitmap[N_COCKPIT_BITMAPS];
50
51 extern int Num_tmaps;
52 #ifdef EDITOR
53 extern int TmapList[MAX_TEXTURES];
54 #endif
55
56 extern tmap_info TmapInfo[MAX_TEXTURES];
57
58 //for each model, a model number for dying & dead variants, or -1 if none
59 extern int Dying_modelnums[];
60 extern int Dead_modelnums[];
61
62 //the model number of the marker object
63 extern int Marker_model_num;
64
65 // Initializes the palette, bitmap system...
66 int bm_init();
67 void bm_close();
68
69 // Initializes the Texture[] array of bmd_bitmap structures.
70 void init_textures();
71
72 #define OL_ROBOT            1
73 #define OL_HOSTAGE          2
74 #define OL_POWERUP          3
75 #define OL_CONTROL_CENTER   4
76 #define OL_PLAYER           5
77 #define OL_CLUTTER          6   //some sort of misc object
78 #define OL_EXIT             7   //the exit model for external scenes
79 #define OL_WEAPON           8   //a weapon that can be placed
80
81 #define MAX_OBJTYPE         140
82
83 extern int  Num_total_object_types;     // Total number of object types, including robots, hostages, powerups, control centers, faces
84 extern byte ObjType[MAX_OBJTYPE];       // Type of an object, such as Robot, eg if ObjType[11] == OL_ROBOT, then object #11 is a robot
85 extern byte ObjId[MAX_OBJTYPE];         // ID of a robot, within its class, eg if ObjType[11] == 3, then object #11 is the third robot
86 extern fix  ObjStrength[MAX_OBJTYPE];   // initial strength of each object
87
88 #define MAX_OBJ_BITMAPS     610
89
90 extern bitmap_index ObjBitmaps[MAX_OBJ_BITMAPS];
91 extern ushort ObjBitmapPtrs[MAX_OBJ_BITMAPS];
92 extern int First_multi_bitmap_num;
93
94 // Initializes all bitmaps from BITMAPS.TBL file.
95 int bm_init_use_tbl(void);
96
97 extern void bm_read_all(CFILE * fp);
98
99 extern void bm_read_all_d1(CFILE * fp);
100 extern void undo_bm_read_all_d1(void);
101
102 int load_exit_models();
103 void free_exit_model_data();
104
105 #endif /* _BM_H */