]> icculus.org git repositories - divverent/darkplaces.git/blob - render.h
added sky quality and show framerate options to menu
[divverent/darkplaces.git] / render.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 // refresh.h -- public interface to refresh functions
22
23 // sky stuff
24 extern void R_SetSkyBox(char* sky);
25
26 // far clip distance for scene
27 extern cvar_t r_farclip;
28
29 // fog stuff
30 extern void FOG_clear(void);
31 extern float fog_density, fog_red, fog_green, fog_blue;
32
33 // SHOWLMP stuff (Nehahra)
34 extern void SHOWLMP_decodehide(void);
35 extern void SHOWLMP_decodeshow(void);
36 extern void SHOWLMP_drawall(void);
37 extern void SHOWLMP_clear(void);
38
39 // render profiling stuff
40 extern qboolean intimerefresh;
41 extern cvar_t r_speeds2;
42 extern char r_speeds2_string1[81], r_speeds2_string2[81], r_speeds2_string3[81], r_speeds2_string4[81], r_speeds2_string5[81], r_speeds2_string6[81], r_speeds2_string7[81];
43
44 // lighting stuff
45 extern vec3_t lightspot;
46 extern cvar_t r_ambient;
47
48 // model rendering stuff
49 extern float *aliasvert;
50 extern float *aliasvertnorm;
51 extern byte *aliasvertcolor;
52 extern float modelalpha;
53
54 // vis stuff
55 extern cvar_t r_novis;
56
57 // model transform stuff
58 extern cvar_t gl_transform;
59
60 #define TOP_RANGE               16                      // soldier uniform colors
61 #define BOTTOM_RANGE    96
62
63 //=============================================================================
64
65 typedef struct entity_render_s
66 {
67         vec3_t  origin;
68         vec3_t  angles;
69
70         int             visframe;               // last frame this entity was found in an active leaf
71
72         model_t *model;                 // NULL = no model
73         int             frame;                  // current desired frame (usually identical to frame2, but frame2 is not always used)
74         int             colormap;               // entity shirt and pants colors
75         int             effects;                // light, particles, etc
76         int             skinnum;                // for Alias models
77         int             flags;                  // render flags
78
79         float   alpha;                  // opacity (alpha) of the model
80         float   scale;                  // size the model is shown
81         float   trail_time;             // last time for trail rendering
82         float   colormod[3];    // color tint for model
83
84         model_t *lerp_model;    // lerp resets when model changes
85         int             frame1;                 // frame that the model is interpolating from
86         int             frame2;                 // frame that the model is interpolating to
87         double  lerp_starttime; // start of this transition
88         double  framelerp;              // interpolation factor, usually computed from lerp_starttime
89         double  frame1start;    // time frame1 began playing (for framegroup animations)
90         double  frame2start;    // time frame2 began playing (for framegroup animations)
91 }
92 entity_render_t;
93
94 typedef struct entity_s
95 {
96         entity_state_t state_baseline;  // baseline for entity
97         entity_state_t state_previous;  // previous state (interpolating from this)
98         entity_state_t state_current;   // current state (interpolating to this)
99
100         entity_render_t render;
101 } entity_t;
102
103 typedef struct
104 {
105         vrect_t         vrect;                          // subwindow in video for refresh
106
107         vec3_t          vieworg;
108         vec3_t          viewangles;
109
110         float           fov_x, fov_y;
111 } refdef_t;
112
113
114 //
115 // refresh
116 //
117
118
119 extern  refdef_t        r_refdef;
120 extern vec3_t   r_origin, vpn, vright, vup;
121 extern qboolean hlbsp;
122
123 void R_Init (void);
124 void R_RenderView (void); // must set r_refdef first
125 void R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect); // called whenever r_refdef or vid change
126
127 // LordHavoc: changed this for sake of GLQuake
128 void R_InitSky (byte *src, int bytesperpixel); // called at level load
129
130 int R_VisibleCullBox (vec3_t mins, vec3_t maxs);
131
132 void R_NewMap (void);
133
134 #include "r_decals.h"
135
136 void R_ParseParticleEffect (void);
137 void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
138 void R_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent);
139 void R_RocketTrail2 (vec3_t start, vec3_t end, int type, entity_t *ent);
140 void R_SparkShower (vec3_t org, vec3_t dir, int count);
141 void R_BloodPuff (vec3_t org, vec3_t vel, int count);
142 void R_FlameCube (vec3_t mins, vec3_t maxs, int count);
143 void R_Flames (vec3_t org, vec3_t vel, int count);
144
145 void R_EntityParticles (entity_t *ent);
146 void R_BlobExplosion (vec3_t org);
147 void R_ParticleExplosion (vec3_t org, int smoke);
148 void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength);
149 void R_LavaSplash (vec3_t org);
150 void R_TeleportSplash (vec3_t org);
151
152 void R_NewExplosion(vec3_t org);
153
154 void R_PushDlights (void);
155 void R_DrawWorld (void);
156 //void R_RenderDlights (void);
157 void R_DrawParticles (void);
158 void R_MoveParticles (void);
159 void R_DrawExplosions (void);
160 void R_MoveExplosions (void);