]> icculus.org git repositories - btb/d2x.git/blob - main/render.h
add IPv4 multicasting support
[btb/d2x.git] / main / render.h
1 /* $Id: render.h,v 1.4 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  * Header for rendering-based functions
18  *
19  * Old Log:
20  * Revision 1.1  1995/05/16  16:01:51  allender
21  * Initial revision
22  *
23  * Revision 2.0  1995/02/27  11:33:00  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.17  1994/11/30  12:33:33  mike
28  * prototype Clear_window.
29  *
30  * Revision 1.16  1994/11/02  16:19:52  matt
31  * Increased size of extra object buffer
32  *
33  * Revision 1.15  1994/07/25  00:02:49  matt
34  * Various changes to accomodate new 3d, which no longer takes point numbers
35  * as parms, and now only takes pointers to points.
36  *
37  * Revision 1.14  1994/07/24  14:37:42  matt
38  * Added angles for player head
39  *
40  * Revision 1.13  1994/06/24  17:01:34  john
41  * Add VFX support; Took Game Sequencing, like EndGame and stuff and
42  * took it out of game.c and into gameseq.c
43  *
44  * Revision 1.12  1994/06/16  10:55:57  matt
45  * Made a bunch of test code dependent on #defines
46  *
47  * Revision 1.11  1994/06/01  00:01:36  matt
48  * Added mine destruction flashing effect
49  *
50  * Revision 1.10  1994/05/22  18:47:36  mike
51  * make Render_list a globally accessible variable.
52  *
53  * Revision 1.9  1994/05/22  15:29:32  mike
54  * Separation of lighting from render.c to lighting.c.
55  *
56  * Revision 1.8  1994/05/14  17:59:39  matt
57  * Added extern.
58  *
59  * Revision 1.7  1994/05/14  17:15:17  matt
60  * Got rid of externs in source (non-header) files
61  *
62  * Revision 1.6  1994/02/17  11:32:41  matt
63  * Changes in object system
64  *
65  * Revision 1.5  1994/01/21  17:31:48  matt
66  * Moved code from render_frame() to caller, making code cleaner
67  *
68  * Revision 1.4  1994/01/06  09:46:12  john
69  * Added removable walls... all code that checked for
70  * children to see if a wall was a doorway, i changed
71  * to yuan's wall_is_doorway function that is in wall.c...
72  * doesn't work yet.
73  *
74  * Revision 1.3  1994/01/05  11:25:47  john
75  * Changed Player_zoom to Render_zoom
76  *
77  * Revision 1.2  1994/01/05  10:53:43  john
78  * New object code by John.
79  *
80  * Revision 1.1  1993/11/04  14:01:43  matt
81  * Initial revision
82  *
83  *
84  */
85
86
87 #ifndef _RENDER_H
88 #define _RENDER_H
89
90 #include "3d.h"
91
92 #include "object.h"
93
94 #define MAX_RENDER_SEGS     500
95 #define OBJS_PER_SEG        5
96 #define N_EXTRA_OBJ_LISTS   50
97
98 extern int Clear_window;    // 1 = Clear whole background window, 2 = clear view portals into rest of world, 0 = no clear
99
100 void render_frame(fix eye_offset, int window_num);  //draws the world into the current canvas
101
102 // cycle the flashing light for when mine destroyed
103 void flash_frame();
104
105 int find_seg_side_face(short x,short y,int *seg,int *side,int *face,int *poly);
106
107 // these functions change different rendering parameters
108 // all return the new value of the parameter
109
110 // how may levels deep to render
111 int inc_render_depth(void);
112 int dec_render_depth(void);
113 int reset_render_depth(void);
114
115 // how many levels deep to render in perspective
116 int inc_perspective_depth(void);
117 int dec_perspective_depth(void);
118 int reset_perspective_depth(void);
119
120 // misc toggles
121 int toggle_outline_mode(void);
122 int toggle_show_only_curside(void);
123
124 // When any render function needs to know what's looking at it, it
125 // should access Render_viewer_object members.
126 extern fix Render_zoom;     // the player's zoom factor
127
128 // This is used internally to render_frame(), but is included here so AI
129 // can use it for its own purposes.
130 extern unsigned char visited[MAX_SEGMENTS];
131
132 extern int N_render_segs;
133 extern short Render_list[MAX_RENDER_SEGS];
134
135 #ifdef EDITOR
136 extern int Render_only_bottom;
137 #endif
138
139
140 // Set the following to turn on player head turning
141 extern int Use_player_head_angles;
142
143 // If the above flag is set, these angles specify the orientation of the head
144 extern vms_angvec Player_head_angles;
145
146 //
147 // Routines for conditionally rotating & projecting points
148 //
149
150 // This must be called at the start of the frame if rotate_list() will be used
151 void render_start_frame(void);
152
153 // Given a list of point numbers, rotate any that haven't been rotated
154 // this frame
155 g3s_codes rotate_list(int nv, short *pointnumlist);
156
157 // Given a list of point numbers, project any that haven't been projected
158 void project_list(int nv, short *pointnumlist);
159
160 extern void render_mine(int start_seg_num, fix eye_offset, int window_num);
161
162 extern void update_rendered_data(int window_num, object *viewer, int rear_view_flag, int user);
163
164 #endif /* _RENDER_H */