2 Copyright (C) 1996-1997 Id Software, Inc.
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.
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.
13 See the GNU General Public License for more details.
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.
24 extern matrix4x4_t r_identitymatrix;
27 extern float ixtable[4096];
29 // far clip distance for scene
30 extern float r_farclip;
33 extern void FOG_clear(void);
34 extern float fog_density, fog_red, fog_green, fog_blue;
38 extern int skyrendernow, skyrendermasked;
39 extern int R_SetSkyBox(const char *sky);
40 extern void R_SkyStartFrame(void);
41 extern void R_Sky(void);
42 extern void R_ResetQuakeSky(void);
43 extern void R_ResetSkyBox(void);
45 // SHOWLMP stuff (Nehahra)
46 extern void SHOWLMP_decodehide(void);
47 extern void SHOWLMP_decodeshow(void);
48 extern void SHOWLMP_drawall(void);
49 extern void SHOWLMP_clear(void);
51 // render profiling stuff
52 extern qboolean intimerefresh;
53 extern char r_speeds_string[1024];
56 extern cvar_t r_ambient;
58 // model rendering stuff
59 extern float *aliasvert;
60 extern float *aliasvertnorm;
61 extern float *aliasvertcolor;
64 extern cvar_t r_novis;
66 // detail texture stuff
67 extern cvar_t r_detailtextures;
69 // useful functions for rendering
70 void R_ModulateColors(float *in, float *out, int verts, float r, float g, float b);
71 void R_FillColors(float *out, int verts, float r, float g, float b, float a);
73 #define TOP_RANGE 16 // soldier uniform colors
74 #define BOTTOM_RANGE 96
76 //=============================================================================
78 extern int r_framecount;
79 extern mplane_t frustum[4];
80 extern int c_alias_polys, c_light_polys, c_faces, c_nodes, c_leafs, c_models, c_bmodels, c_sprites, c_particles, c_dlights;
89 extern vec3_t r_origin;
91 extern mleaf_t *r_viewleaf, *r_oldviewleaf;
92 extern unsigned short d_lightstylevalue[256]; // 8.8 fraction of base light value
94 extern qboolean envmap;
96 extern cvar_t r_drawentities;
97 extern cvar_t r_drawviewmodel;
98 extern cvar_t r_speeds;
99 extern cvar_t r_fullbright;
100 extern cvar_t r_wateralpha;
101 extern cvar_t r_dynamic;
102 extern cvar_t r_dlightmap;
105 void R_RenderView (void); // must set r_refdef first
108 void R_InitSky (qbyte *src, int bytesperpixel); // called at level load
110 void R_NewMap (void);
112 void R_WorldVisibility(entity_render_t *ent);
113 void R_DrawWorld(entity_render_t *ent);
114 void R_DrawParticles(void);
115 void R_DrawExplosions(void);
117 #define gl_solid_format 3
118 #define gl_alpha_format 4
122 int R_CullBox(const vec3_t mins, const vec3_t maxs);
123 int PVS_CullBox(const vec3_t mins, const vec3_t maxs);
124 int R_CullSphere(const vec3_t origin, vec_t radius);
125 int PVS_CullSphere(const vec3_t origin, vec_t radius);
127 extern qboolean fogenabled;
128 extern vec3_t fogcolor;
129 extern vec_t fogdensity;
130 #define calcfog(v) (exp(-(fogdensity*fogdensity*(((v)[0] - r_origin[0])*((v)[0] - r_origin[0])+((v)[1] - r_origin[1])*((v)[1] - r_origin[1])+((v)[2] - r_origin[2])*((v)[2] - r_origin[2])))))
131 #define calcfogbyte(v) ((qbyte) (bound(0, ((int) ((float) (calcfog((v)) * 255.0f))), 255)))
133 // start a farclip measuring session
134 void R_FarClip_Start(vec3_t origin, vec3_t direction, vec_t startfarclip);
135 // enlarge farclip to accomodate box
136 void R_FarClip_Box(vec3_t mins, vec3_t maxs);
137 // return farclip value
138 float R_FarClip_Finish(void);
140 // updates farclip distance so it is large enough for the specified box
142 void R_Mesh_EnlargeFarClipBBox(vec3_t mins, vec3_t maxs);
144 #include "r_modules.h"
146 #include "meshqueue.h"
148 extern float overbrightscale;
150 #include "r_lerpanim.h"
152 extern cvar_t r_render;
154 extern cvar_t r_textureunits;
155 extern cvar_t gl_dither;
157 #include "gl_backend.h"
161 void R_TimeReport(char *name);
162 void R_TimeReport_Start(void);
163 void R_TimeReport_End(void);
166 void R_Stain (const vec3_t origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2);
168 void R_DrawWorldCrosshair(void);
169 void R_Draw2DCrosshair(void);
171 void R_CalcBeamVerts (float *vert, const vec3_t org1, const vec3_t org2, float width);