]> icculus.org git repositories - btb/d2x.git/blob - main/lighting.h
add IPv4 multicasting support
[btb/d2x.git] / main / lighting.h
1 /* $Id: lighting.h,v 1.2 2003-10-10 09:36:35 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 /*
16  *
17  * Lighting system prototypes, structures, etc.
18  *
19  * Old Log:
20  * Revision 1.1  1995/05/16  15:58:51  allender
21  * Initial revision
22  *
23  * Revision 2.0  1995/02/27  11:27:52  john
24  * New version 2.0, which has no anonymous unions, builds with
25  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
26  *
27  * Revision 1.6  1994/11/28  21:50:56  mike
28  * optimizations.
29  *
30  * Revision 1.5  1994/06/07  16:51:58  matt
31  * Made object lighting work correctly; changed name of Ambient_light to
32  * Dynamic_light; cleaned up polygobj object rendering a little.
33  *
34  * Revision 1.4  1994/05/31  18:41:35  matt
35  * Added comments
36  *
37  * Revision 1.3  1994/05/23  15:00:08  mike
38  * Change MIN_LIGHT_DIST.
39  *
40  * Revision 1.2  1994/05/22  15:30:09  mike
41  * First version.
42  *
43  * Revision 1.1  1994/05/22  15:16:44  mike
44  * Initial revision
45  *
46  *
47  */
48
49
50 #ifndef _LIGHTING_H
51 #define _LIGHTING_H
52
53 #define MAX_LIGHT       0x10000     // max value
54
55 #define MIN_LIGHT_DIST  (F1_0*4)
56
57 extern fix Beam_brightness;
58 extern fix Dynamic_light[MAX_VERTICES];
59
60 extern void set_dynamic_light(void);
61
62 // Compute the lighting from the headlight for a given vertex on a face.
63 // Takes:
64 //  point - the 3d coords of the point
65 //  face_light - a scale factor derived from the surface normal of the face
66 // If no surface normal effect is wanted, pass F1_0 for face_light
67 fix compute_headlight_light(vms_vector *point,fix face_light);
68
69 // compute the average dynamic light in a segment.  Takes the segment number
70 fix compute_seg_dynamic_light(int segnum);
71
72 // compute the lighting for an object.  Takes a pointer to the object,
73 // and possibly a rotated 3d point.  If the point isn't specified, the
74 // object's center point is rotated.
75 fix compute_object_light(object *obj,vms_vector *rotated_pnt);
76
77 // turn headlight boost on & off
78 void toggle_headlight_active(void);
79
80 #endif /* _LIGHTING_H */