]> icculus.org git repositories - btb/d2x.git/blob - main/render.h
draw behind the shield number properly in OpenGL
[btb/d2x.git] / main / render.h
1 /* $Id: render.h,v 1.5 2004-08-28 23:17:45 schaffner 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  */
20
21
22 #ifndef _RENDER_H
23 #define _RENDER_H
24
25 #include "3d.h"
26
27 #include "object.h"
28
29 #define MAX_RENDER_SEGS     500
30 #define OBJS_PER_SEG        5
31 #define N_EXTRA_OBJ_LISTS   50
32
33 extern int Clear_window;    // 1 = Clear whole background window, 2 = clear view portals into rest of world, 0 = no clear
34
35 void render_frame(fix eye_offset, int window_num);  //draws the world into the current canvas
36
37 // cycle the flashing light for when mine destroyed
38 void flash_frame();
39
40 int find_seg_side_face(short x,short y,int *seg,int *side,int *face,int *poly);
41
42 // these functions change different rendering parameters
43 // all return the new value of the parameter
44
45 // how may levels deep to render
46 int inc_render_depth(void);
47 int dec_render_depth(void);
48 int reset_render_depth(void);
49
50 // how many levels deep to render in perspective
51 int inc_perspective_depth(void);
52 int dec_perspective_depth(void);
53 int reset_perspective_depth(void);
54
55 // misc toggles
56 int toggle_outline_mode(void);
57 int toggle_show_only_curside(void);
58
59 // When any render function needs to know what's looking at it, it
60 // should access Render_viewer_object members.
61 extern fix Render_zoom;     // the player's zoom factor
62
63 // This is used internally to render_frame(), but is included here so AI
64 // can use it for its own purposes.
65 extern unsigned char visited[MAX_SEGMENTS];
66
67 extern int N_render_segs;
68 extern short Render_list[MAX_RENDER_SEGS];
69
70 #ifdef EDITOR
71 extern int Render_only_bottom;
72 #endif
73
74
75 // Set the following to turn on player head turning
76 extern int Use_player_head_angles;
77
78 // If the above flag is set, these angles specify the orientation of the head
79 extern vms_angvec Player_head_angles;
80
81 //
82 // Routines for conditionally rotating & projecting points
83 //
84
85 // This must be called at the start of the frame if rotate_list() will be used
86 void render_start_frame(void);
87
88 // Given a list of point numbers, rotate any that haven't been rotated
89 // this frame
90 g3s_codes rotate_list(int nv, short *pointnumlist);
91
92 // Given a list of point numbers, project any that haven't been projected
93 void project_list(int nv, short *pointnumlist);
94
95 extern void render_mine(int start_seg_num, fix eye_offset, int window_num);
96
97 extern void update_rendered_data(int window_num, object *viewer, int rear_view_flag, int user);
98
99 #endif /* _RENDER_H */