1 // LIGHTS
2 #ifndef prlight_h_
3 # define prlight_h_
4 
5 #define             PR_MAXLIGHTS            1024
6 #define             SHADOW_DEPTH_OFFSET     30
7 #define             PR_MAXLIGHTPRIORITY     6
8 
9 typedef struct      s_prplanelist {
10     struct s_prplane*       plane;
11     struct s_prplanelist*   n;
12 }                   _prplanelist;
13 
14 #pragma pack(push,1)
15 typedef struct      s_prlight {
16     int32_t         x, y, z, horiz, range;
17     int16_t         angle, faderadius, radius, sector;
18     uint8_t         color[3], priority;
19     int8_t          minshade, maxshade;
20     int16_t         tilenum;
21     struct          {
22         int32_t     emitshadow  : 1;
23         int32_t     negative    : 1;
24     }               publicflags;
25     // internal members
26     float           proj[16];
27     float           transform[16];
28     float           frustum[5 * 4];
29     int32_t         rtindex;
30     struct          {
31         int32_t     active      : 1;
32         int32_t     invalidate  : 1;
33         int32_t     isinview    : 1;
34     }               flags;
35     uint32_t        lightmap;
36     _prplanelist*   planelist;
37     int32_t         planecount;
38 }                   _prlight;
39 
40 extern _prlight     prlights[PR_MAXLIGHTS];
41 extern int32_t      lightcount;
42 #pragma pack(pop)
43 
44 #endif
45