]> icculus.org git repositories - btb/d2x.git/blob - main/render.h
bump version number
[btb/d2x.git] / main / render.h
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 #ifndef _RENDER_H
15 #define _RENDER_H
16
17 #include "3d.h"
18
19 #include "object.h"
20
21 #define MAX_RENDER_SEGS         500
22 #define OBJS_PER_SEG            5
23 #define N_EXTRA_OBJ_LISTS       50
24
25 extern int      Clear_window;                   //      1 = Clear whole background window, 2 = clear view portals into rest of world, 0 = no clear
26
27 void render_frame(fix eye_offset, int window_num);              //draws the world into the current canvas
28
29 //cycle the flashing light for when mine destroyed
30 void flash_frame();
31
32 int find_seg_side_face(short x,short y,int *seg,int *side,int *face,int *poly);
33
34 //these functions change different rendering parameters
35 //all return the new value of the parameter
36
37 //how may levels deep to render
38 int inc_render_depth(void);
39 int dec_render_depth(void);
40 int reset_render_depth(void);
41
42 //how many levels deep to render in perspective
43 int inc_perspective_depth(void);
44 int dec_perspective_depth(void);
45 int reset_perspective_depth(void);
46
47 //misc toggles
48 int toggle_outline_mode(void);
49 int toggle_show_only_curside(void);
50
51 // When any render function needs to know what's looking at it, it should access
52 // Render_viewer_object members.
53 extern fix Render_zoom;         //the player's zoom factor
54
55 //This is used internally to render_frame(), but is included here so AI
56 //can use it for its own purposes.
57 extern char visited[MAX_SEGMENTS];
58
59 extern int N_render_segs;
60 extern short Render_list[MAX_RENDER_SEGS];
61
62 #ifdef EDITOR
63 extern int Render_only_bottom;
64 #endif
65
66
67 //Set the following to turn on player head turning
68 extern int Use_player_head_angles;
69
70 //If the above flag is set, these angles specify the orientation of the head
71 extern vms_angvec Player_head_angles;
72
73 //
74 //      Routines for conditionally rotating & projecting points
75 //
76
77 //This must be called at the start of the frame if rotate_list() will be used
78 void render_start_frame(void);
79
80 //Given a lit of point numbers, rotate any that haven't been rotated this frame
81 g3s_codes rotate_list(int nv,short *pointnumlist);
82
83 //Given a lit of point numbers, project any that haven't been projected
84 void project_list(int nv,short *pointnumlist);
85
86 extern void render_mine(int start_seg_num,fix eye_offset, int window_num);
87
88 extern void update_rendered_data(int window_num, object *viewer, int rear_view_flag, int user);
89
90 #endif
91