~paulbrianstewart/ubuntu/oneiric/alien-arena/834369-Spelling-Grammar-Errors-Fix

« back to all changes in this revision

Viewing changes to source/ref_gl/r_local.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Gilbert
  • Date: 2010-01-24 14:42:07 UTC
  • mfrom: (4.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100124144207-egbdkjbjdrbv92bq
Tags: 7.33-2
* Fix help text wrapping in launcher scripts (closes: #566633).
* Depend on alien-arena-data (>= ${source:Upstream-Version}) to make
  the package NMU-safe (closes: #566636).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Copyright (C) 1997-2001 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
 
#ifdef _WIN32
22
 
#  include <windows.h>
23
 
#endif
24
 
 
25
 
#include <stdio.h>
26
 
 
27
 
#include <GL/gl.h>
28
 
#include <math.h>
29
 
#include "glext.h"
30
 
 
31
 
#ifndef __unix__
32
 
#ifndef GL_COLOR_INDEX8_EXT
33
 
#define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX
34
 
#endif
35
 
#endif
36
 
 
37
 
#include "../client/ref.h"
38
 
#include "../client/vid.h"
39
 
 
40
 
#include "qgl.h"
41
 
#include "r_math.h"
42
 
#define REF_VERSION     "GL 0.01"
43
 
 
44
 
// up / down
45
 
#define PITCH   0
46
 
 
47
 
// left / right
48
 
#define YAW             1
49
 
 
50
 
// fall over
51
 
#define ROLL    2
52
 
 
53
 
extern  viddef_t        vid;
54
 
 
55
 
#include "r_image.h"
56
 
 
57
 
//===================================================================
58
 
 
59
 
typedef enum
60
 
{
61
 
        rserr_ok,
62
 
 
63
 
        rserr_invalid_fullscreen,
64
 
        rserr_invalid_mode,
65
 
 
66
 
        rserr_unknown
67
 
} rserr_t;
68
 
 
69
 
#include "r_model.h"
70
 
 
71
 
void GL_BeginRendering (int *x, int *y, int *width, int *height);
72
 
void GL_EndRendering (void);
73
 
 
74
 
void GL_SetDefaultState( void );
75
 
void GL_UpdateSwapInterval( void );
76
 
 
77
 
extern  float   gldepthmin, gldepthmax;
78
 
 
79
 
#define MAX_LBM_HEIGHT          512
80
 
 
81
 
#define BACKFACE_EPSILON        0.01
82
 
 
83
 
extern  entity_t        *currententity;
84
 
extern  model_t         *currentmodel;
85
 
extern  int                     r_visframecount;
86
 
extern  int                     r_framecount;
87
 
extern  cplane_t        frustum[4];
88
 
extern  int                     c_brush_polys, c_alias_polys;
89
 
extern  int c_flares;
90
 
 
91
 
extern  int                     gl_filter_min, gl_filter_max;
92
 
 
93
 
//
94
 
// view origin
95
 
//
96
 
extern  vec3_t  vup;
97
 
extern  vec3_t  vpn;
98
 
extern  vec3_t  vright;
99
 
extern  vec3_t  r_origin;
100
 
 
101
 
//
102
 
// screen size info
103
 
//
104
 
extern  refdef_t        r_newrefdef;
105
 
extern  int             r_viewcluster, r_viewcluster2, r_oldviewcluster, r_oldviewcluster2;
106
 
 
107
 
extern  cvar_t  *r_norefresh;
108
 
extern  cvar_t  *r_lefthand;
109
 
extern  cvar_t  *r_drawentities;
110
 
extern  cvar_t  *r_drawworld;
111
 
extern  cvar_t  *r_speeds;
112
 
extern  cvar_t  *r_fullbright;
113
 
extern  cvar_t  *r_novis;
114
 
extern  cvar_t  *r_nocull;
115
 
extern  cvar_t  *r_lerpmodels;
116
 
 
117
 
extern  cvar_t  *r_lightlevel;  // FIXME: This is a HACK to get the client's light level
118
 
extern  cvar_t  *r_wave; //water waves
119
 
 
120
 
extern cvar_t   *gl_vertex_arrays;
121
 
 
122
 
extern cvar_t   *gl_ext_swapinterval;
123
 
extern cvar_t   *gl_ext_palettedtexture;
124
 
extern cvar_t   *gl_ext_multitexture;
125
 
extern cvar_t   *gl_ext_pointparameters;
126
 
extern cvar_t   *gl_ext_compiled_vertex_array;
127
 
 
128
 
extern cvar_t   *gl_particle_min_size;
129
 
extern cvar_t   *gl_particle_max_size;
130
 
extern cvar_t   *gl_particle_size;
131
 
extern cvar_t   *gl_particle_att_a;
132
 
extern cvar_t   *gl_particle_att_b;
133
 
extern cvar_t   *gl_particle_att_c;
134
 
 
135
 
extern  cvar_t  *gl_nosubimage;
136
 
extern  cvar_t  *gl_bitdepth;
137
 
extern  cvar_t  *gl_mode;
138
 
extern  cvar_t  *gl_log;
139
 
extern  cvar_t  *gl_lightmap;
140
 
extern  cvar_t  *gl_shadows;
141
 
extern  cvar_t  *gl_dynamic;
142
 
extern  cvar_t  *gl_nobind;
143
 
extern  cvar_t  *gl_round_down;
144
 
extern  cvar_t  *gl_picmip;
145
 
extern  cvar_t  *gl_skymip;
146
 
extern  cvar_t  *gl_showtris;
147
 
extern  cvar_t  *gl_finish;
148
 
extern  cvar_t  *gl_clear;
149
 
extern  cvar_t  *gl_cull;
150
 
extern  cvar_t  *gl_poly;
151
 
extern  cvar_t  *gl_texsort;
152
 
extern  cvar_t  *gl_polyblend;
153
 
extern  cvar_t  *gl_flashblend;
154
 
extern  cvar_t  *gl_lightmaptype;
155
 
extern  cvar_t  *gl_modulate;
156
 
extern  cvar_t  *gl_playermip;
157
 
extern  cvar_t  *gl_drawbuffer;
158
 
extern  cvar_t  *gl_3dlabs_broken;
159
 
extern  cvar_t  *gl_driver;
160
 
extern  cvar_t  *gl_swapinterval;
161
 
extern  cvar_t  *gl_texturemode;
162
 
extern  cvar_t  *gl_texturealphamode;
163
 
extern  cvar_t  *gl_texturesolidmode;
164
 
extern  cvar_t  *gl_lockpvs;
165
 
extern  cvar_t  *gl_rtlights;
166
 
extern  cvar_t  *gl_texres;
167
 
 
168
 
extern  cvar_t  *vid_fullscreen;
169
 
extern  cvar_t  *vid_gamma;
170
 
 
171
 
extern  cvar_t  *intensity;
172
 
// Vic - begin
173
 
 
174
 
extern cvar_t   *r_overbrightbits;
175
 
extern cvar_t   *gl_ext_mtexcombine;
176
 
 
177
 
// Vic - end
 
1
/*
 
2
Copyright (C) 1997-2001 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
#ifdef _WIN32
 
22
#  include <windows.h>
 
23
#endif
 
24
 
 
25
#include <stdio.h>
 
26
 
 
27
#include <GL/gl.h>
 
28
#include <math.h>
 
29
#include "glext.h"
 
30
 
 
31
#ifndef __unix__
 
32
#ifndef GL_COLOR_INDEX8_EXT
 
33
#define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX
 
34
#endif
 
35
#endif
 
36
 
 
37
#include "../client/ref.h"
 
38
#include "../client/vid.h"
 
39
 
 
40
#include "qgl.h"
 
41
#include "r_math.h"
 
42
 
 
43
// up / down
 
44
#define PITCH   0
 
45
 
 
46
// left / right
 
47
#define YAW             1
 
48
 
 
49
// fall over
 
50
#define ROLL    2
 
51
 
 
52
#define DLIGHT_CUTOFF   64
 
53
 
 
54
extern  viddef_t        vid;
 
55
 
 
56
#include "r_image.h"
 
57
 
 
58
//===================================================================
 
59
 
 
60
typedef enum
 
61
{
 
62
        rserr_ok,
 
63
 
 
64
        rserr_invalid_fullscreen,
 
65
        rserr_invalid_mode,
 
66
 
 
67
        rserr_unknown
 
68
} rserr_t;
 
69
 
 
70
#include "r_model.h"
 
71
 
 
72
extern float    r_frametime;
 
73
 
 
74
void GL_BeginRendering (int *x, int *y, int *width, int *height);
 
75
void GL_EndRendering (void);
 
76
 
 
77
void GL_SetDefaultState( void );
 
78
void GL_UpdateSwapInterval( void );
 
79
 
 
80
extern  float   gldepthmin, gldepthmax;
 
81
 
 
82
#define MAX_LBM_HEIGHT          512
 
83
 
 
84
#define BACKFACE_EPSILON        0.01
 
85
 
 
86
extern  entity_t        *currententity;
 
87
extern  model_t         *currentmodel;
 
88
extern  int                     r_visframecount;
 
89
extern  int                     r_framecount;
 
90
extern  cplane_t        frustum[4];
 
91
extern  int                     c_brush_polys, c_alias_polys;
 
92
extern  int c_flares;
 
93
extern  int c_grasses;
 
94
extern  int c_beams;
 
95
 
 
96
extern  int                     gl_filter_min, gl_filter_max;
 
97
 
 
98
//
 
99
// view origin
 
100
//
 
101
extern  vec3_t  vup;
 
102
extern  vec3_t  vpn;
 
103
extern  vec3_t  vright;
 
104
extern  vec3_t  r_origin;
 
105
 
 
106
//
 
107
// screen size info
 
108
//
 
109
extern  refdef_t        r_newrefdef;
 
110
extern  int             r_viewcluster, r_viewcluster2, r_oldviewcluster, r_oldviewcluster2;
 
111
 
 
112
extern  cvar_t  *r_norefresh;
 
113
extern  cvar_t  *r_lefthand;
 
114
extern  cvar_t  *r_drawentities;
 
115
extern  cvar_t  *r_drawworld;
 
116
extern  cvar_t  *r_speeds;
 
117
extern  cvar_t  *r_fullbright;
 
118
extern  cvar_t  *r_novis;
 
119
extern  cvar_t  *r_nocull;
 
120
extern  cvar_t  *r_lerpmodels;
 
121
 
 
122
extern  cvar_t  *r_lightlevel;  // FIXME: This is a HACK to get the client's light level
 
123
extern  cvar_t  *r_wave; //water waves
 
124
 
 
125
extern cvar_t   *gl_ext_swapinterval;
 
126
extern cvar_t   *gl_ext_palettedtexture;
 
127
extern cvar_t   *gl_ext_multitexture;
 
128
extern cvar_t   *gl_ext_pointparameters;
 
129
extern cvar_t   *gl_ext_compiled_vertex_array;
 
130
 
 
131
extern cvar_t   *gl_particle_min_size;
 
132
extern cvar_t   *gl_particle_max_size;
 
133
extern cvar_t   *gl_particle_size;
 
134
extern cvar_t   *gl_particle_att_a;
 
135
extern cvar_t   *gl_particle_att_b;
 
136
extern cvar_t   *gl_particle_att_c;
 
137
 
 
138
extern  cvar_t  *gl_bitdepth;
 
139
extern  cvar_t  *gl_mode;
 
140
extern  cvar_t  *gl_log;
 
141
extern  cvar_t  *gl_lightmap;
 
142
extern  cvar_t  *gl_shadows;
 
143
extern  cvar_t  *gl_dynamic;
 
144
extern  cvar_t  *gl_nobind;
 
145
extern  cvar_t  *gl_round_down;
 
146
extern  cvar_t  *gl_picmip;
 
147
extern  cvar_t  *gl_skymip;
 
148
extern  cvar_t  *gl_showtris;
 
149
extern  cvar_t  *gl_showpolys;
 
150
extern  cvar_t  *gl_finish;
 
151
extern  cvar_t  *gl_clear;
 
152
extern  cvar_t  *gl_cull;
 
153
extern  cvar_t  *gl_poly;
 
154
extern  cvar_t  *gl_texsort;
 
155
extern  cvar_t  *gl_polyblend;
 
156
extern  cvar_t  *gl_flashblend;
 
157
extern  cvar_t  *gl_lightmaptype;
 
158
extern  cvar_t  *gl_modulate;
 
159
extern  cvar_t  *gl_playermip;
 
160
extern  cvar_t  *gl_drawbuffer;
 
161
extern  cvar_t  *gl_3dlabs_broken;
 
162
extern  cvar_t  *gl_driver;
 
163
extern  cvar_t  *gl_swapinterval;
 
164
extern  cvar_t  *gl_texturemode;
 
165
extern  cvar_t  *gl_texturealphamode;
 
166
extern  cvar_t  *gl_texturesolidmode;
 
167
extern  cvar_t  *gl_lockpvs;
 
168
extern  cvar_t  *gl_rtlights;
 
169
 
 
170
extern  cvar_t  *vid_fullscreen;
 
171
extern  cvar_t  *vid_gamma;
 
172
extern  cvar_t  *vid_contrast;
 
173
 
 
174
extern  cvar_t  *intensity;
 
175
 
 
176
extern cvar_t *r_anisotropic;
 
177
extern cvar_t *r_ext_max_anisotropy;
 
178
 
 
179
// Vic - begin
 
180
 
 
181
extern cvar_t   *r_overbrightbits;
 
182
extern cvar_t   *gl_ext_mtexcombine;
 
183
 
 
184
// Vic - end
178
185
extern cvar_t   *gl_normalmaps;
179
 
extern cvar_t   *gl_specularmaps;
180
 
extern cvar_t   *gl_cubemaps;
181
 
 
182
 
extern  cvar_t  *r_shaders;
183
 
extern  cvar_t  *r_bloom;
184
 
extern  cvar_t  *r_lensflare;
 
186
extern cvar_t   *gl_shadowmaps;
 
187
extern cvar_t   *gl_parallaxmaps;
 
188
extern cvar_t   *gl_specular;
 
189
extern cvar_t   *gl_glsl_postprocess;
 
190
 
 
191
extern  cvar_t  *r_shaders;
 
192
extern  cvar_t  *r_bloom;
 
193
extern  cvar_t  *r_lensflare;
185
194
extern  cvar_t  *r_lensflare_intens;
186
 
 
187
 
extern  qboolean        map_fog;
188
 
extern  char            map_music[128];
189
 
 
190
 
extern  cvar_t          *r_minimap;
191
 
extern  cvar_t          *r_minimap_size;
192
 
extern  cvar_t          *r_minimap_zoom;
193
 
extern  cvar_t          *r_minimap_style;
194
 
 
195
 
extern  cvar_t  *gl_reflection;                 // MPO
196
 
extern  cvar_t  *gl_reflection_debug;   // MPO  for debugging the reflection
197
 
extern  cvar_t  *gl_reflection_max;             // MPO  max number of water reflections
198
 
extern  cvar_t  *gl_arb_fragment_program; // jit
199
 
 
200
 
extern  cvar_t  *sys_affinity;
201
 
extern  cvar_t  *sys_priority;
202
 
 
203
 
extern  cvar_t  *gl_screenshot_type;
204
 
extern  cvar_t  *gl_screenshot_jpeg_quality;
205
 
 
206
 
extern  int             gl_lightmap_format;
207
 
extern  int             gl_solid_format;
208
 
extern  int             gl_alpha_format;
209
 
extern  int             gl_tex_solid_format;
210
 
extern  int             gl_tex_alpha_format;
211
 
 
212
 
extern  int             c_visible_lightmaps;
213
 
extern  int             c_visible_textures;
214
 
 
215
 
extern  float   r_world_matrix[16];
216
 
extern  float           r_farclip, r_farclip_min, r_farclip_bias;
217
 
void GL_Bind (int texnum);
218
 
void GL_MBind( GLenum target, int texnum );
219
 
void GL_TexEnv( GLenum value );
220
 
void GL_EnableMultitexture( qboolean enable );
221
 
void GL_SelectTexture( GLenum );
222
 
void vectoangles (vec3_t value1, vec3_t angles);
223
 
void R_LightPoint (vec3_t p, vec3_t color, qboolean addDynamic);
224
 
void R_LightPointDynamics (vec3_t p, vec3_t color, m_dlight_t *list, int *amount, int max);
225
 
void R_PushDlights (void);
226
 
void R_PushStains (void);
227
 
void R_PushStainsForBModel (entity_t *e);
228
 
void R_PushDlightsForBModel (entity_t *e);
229
 
 
230
 
void RefreshFont (void);
231
 
 
232
 
//====================================================================
233
 
typedef struct
234
 
{
235
 
        vec3_t  origin;
236
 
        vec3_t  angle;
237
 
        float   alpha;
238
 
        float   dist;
239
 
        int             type;
240
 
        int             texnum;
241
 
        int             blenddst;
242
 
        int             blendsrc;
243
 
        int             color;
244
 
        float   scale;
245
 
} gparticle_t;
246
 
 
247
 
extern  model_t *r_worldmodel;
248
 
 
249
 
extern  unsigned        d_8to24table[256];
250
 
 
251
 
extern  int             registration_sequence;
252
 
 
253
 
 
254
 
void V_AddBlend (float r, float g, float b, float a, float *v_blend);
255
 
 
256
 
int     R_Init( void *hinstance, void *hWnd );
257
 
void    R_Shutdown( void );
258
 
 
259
 
void R_RenderView (refdef_t *fd);
260
 
void GL_ScreenShot_f (void);
261
 
void R_DrawAliasModel (entity_t *e);
262
 
void R_DrawBrushModel (entity_t *e);
263
 
void R_DrawBeam( entity_t *e );
264
 
void R_DrawWorld (void);
265
 
void R_RenderDlights (void);
266
 
void R_DrawAlphaSurfaces (void);
267
 
void R_RenderBrushPoly (msurface_t *fa);
268
 
void R_InitParticleTexture (void);
269
 
void GL_DrawRadar(void);
270
 
void Draw_InitLocal (void);
271
 
void GL_SubdivideSurface (msurface_t *fa);
272
 
qboolean R_CullBox (vec3_t mins, vec3_t maxs);
273
 
void R_RotateForEntity (entity_t *e);
274
 
void R_MarkLeaves (void);
275
 
void R_AddSkySurface (msurface_t *fa);
276
 
void EmitWaterPolys (msurface_t *fa);
277
 
void EmitWaterPolys_original (msurface_t *fa);
278
 
void R_ClearSkyBox (void);
279
 
void R_DrawSkyBox (void);
280
 
void R_DrawSkyBoxVooDoo (void);
281
 
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
282
 
float R_ShadowLight (vec3_t pos, vec3_t lightAdd, int type);
283
 
#ifdef __unix__
284
 
void R_ReadFogScript(char config_file[128]);
285
 
void R_ReadMusicScript(char config_file[128]);
 
195
extern  cvar_t  *r_drawsun;
 
196
 
 
197
extern  qboolean        map_fog;
 
198
extern  char            map_music[128];
 
199
extern  unsigned        r_weather;
 
200
 
 
201
extern  cvar_t          *r_minimap;
 
202
extern  cvar_t          *r_minimap_size;
 
203
extern  cvar_t          *r_minimap_zoom;
 
204
extern  cvar_t          *r_minimap_style;
 
205
 
 
206
extern  cvar_t  *gl_mirror;
 
207
 
 
208
extern  cvar_t  *gl_arb_fragment_program; 
 
209
extern  cvar_t  *gl_glsl_shaders;
 
210
 
 
211
 
 
212
extern  cvar_t  *sys_affinity;
 
213
extern  cvar_t  *sys_priority;
 
214
 
 
215
extern  cvar_t  *gl_screenshot_type;
 
216
extern  cvar_t  *gl_screenshot_jpeg_quality;
 
217
 
 
218
extern  cvar_t  *r_legacy;
 
219
 
 
220
extern  int             gl_lightmap_format;
 
221
extern  int             gl_solid_format;
 
222
extern  int             gl_alpha_format;
 
223
extern  int             gl_tex_solid_format;
 
224
extern  int             gl_tex_alpha_format;
 
225
 
 
226
extern  int             c_visible_lightmaps;
 
227
extern  int             c_visible_textures;
 
228
 
 
229
extern  float   r_world_matrix[16];
 
230
extern float r_project_matrix[16];
 
231
extern int      r_viewport[4];
 
232
extern  float           r_farclip, r_farclip_min, r_farclip_bias;
 
233
void GL_Bind (int texnum);
 
234
void GL_MBind( GLenum target, int texnum );
 
235
void GL_TexEnv( GLenum value );
 
236
void GL_EnableMultitexture( qboolean enable );
 
237
void GL_SelectTexture( GLenum );
 
238
void vectoangles (vec3_t value1, vec3_t angles);
 
239
void R_LightPoint (vec3_t p, vec3_t color, qboolean addDynamic);
 
240
void R_LightPointDynamics (vec3_t p, vec3_t color, m_dlight_t *list, int *amount, int max);
 
241
void R_PushDlights (void);
 
242
void R_PushDlightsForBModel (entity_t *e);
 
243
void SetVertexOverbrights (qboolean toggle);
 
244
void RefreshFont (void);
 
245
 
 
246
//====================================================================
 
247
typedef struct
 
248
{
 
249
        vec3_t  origin;
 
250
        vec3_t  angle;
 
251
        float   alpha;
 
252
        float   dist;
 
253
        int             type;
 
254
        int             texnum;
 
255
        int             blenddst;
 
256
        int             blendsrc;
 
257
        int             color;
 
258
        float   scale;
 
259
} gparticle_t;
 
260
 
 
261
extern  model_t *r_worldmodel;
 
262
 
 
263
extern  unsigned        d_8to24table[256];
 
264
 
 
265
extern  int             registration_sequence;
 
266
 
 
267
 
 
268
void V_AddBlend (float r, float g, float b, float a, float *v_blend);
 
269
 
 
270
int     R_Init( void *hinstance, void *hWnd );
 
271
void R_Shutdown( void );
 
272
 
 
273
void R_RenderView (refdef_t *fd);
 
274
void GL_ScreenShot_f (void);
 
275
void R_DrawAliasModel (entity_t *e);
 
276
void R_DrawBrushModel (entity_t *e);
 
277
void R_DrawBeam( entity_t *e );
 
278
void R_DrawWorld (void);
 
279
void R_RenderDlights (void);
 
280
void R_DrawAlphaSurfaces (void);
 
281
void R_RenderBrushPoly (msurface_t *fa);
 
282
void R_DrawSpecialSurfaces(void);
 
283
void R_InitParticleTexture (void);
 
284
void R_DrawParticles (void);
 
285
void GL_DrawRadar(void);
 
286
void Draw_InitLocal (void);
 
287
void GL_SubdivideSurface (msurface_t *fa);
 
288
qboolean R_CullBox (vec3_t mins, vec3_t maxs);
 
289
qboolean R_CullOrigin(vec3_t origin);
 
290
void R_RotateForEntity (entity_t *e);
 
291
void R_MarkLeaves (void);
 
292
void R_AddSkySurface (msurface_t *fa);
 
293
void GL_RenderWaterPolys (msurface_t *fa, int texnum, float scaleX, float scaleY);
 
294
void R_ClearSkyBox (void);
 
295
void R_DrawSkyBox (void);
 
296
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
 
297
float R_ShadowLight (vec3_t pos, vec3_t lightAdd, int type);
 
298
void R_DrawShadowVolume(entity_t * e);
 
299
void R_ShadowBlend(float alpha);
 
300
#ifdef __unix__
 
301
void R_ReadFogScript(char config_file[128]);
 
302
void R_ReadMusicScript(char config_file[128]);
286
303
#endif
287
 
 
288
 
//BLOOMS[start]
289
 
//
290
 
// r_bloom.c
291
 
//
292
 
void R_BloomBlend( refdef_t *fd );
293
 
void R_InitBloomTextures( void );
294
 
//BLOOMS[end]
295
 
 
296
 
void R_RenderFlares (void);
297
 
//lava haze [start]
298
 
//void R_InitSmokes (void);
299
 
//void R_SmokeFrame (void);
300
 
//lava haze [end]
301
 
 
302
 
void    Draw_GetPicSize (int *w, int *h, char *name);
303
 
void    Draw_Pic (int x, int y, char *name);
304
 
void    Draw_ScaledPic (int x, int y, float scale, char *pic);
305
 
void    Draw_StretchPic (int x, int y, int w, int h, char *name);
306
 
void    Draw_Char (int x, int y, int c);
307
 
void    Draw_ColorChar (int x, int y, int num, vec4_t color);
308
 
void    Draw_ScaledChar(int x, int y, int num, int scale);
309
 
void    Draw_ScaledColorChar (int x, int y, int num, vec4_t color, int scale);
310
 
void    Draw_TileClear (int x, int y, int w, int h, char *name);
311
 
void    Draw_Fill (int x, int y, int w, int h, int c);
312
 
void    Draw_FadeScreen (void);
313
 
void    Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data);
314
 
 
315
 
void    R_BeginFrame( float camera_separation );
316
 
void    R_SwapBuffers( int );
317
 
void    R_SetPalette ( const unsigned char *palette);
318
 
 
319
 
int             Draw_GetPalette (void);
320
 
 
321
 
void    GL_ResampleTexture (unsigned *in, int inwidth, int inheight, unsigned *out,  int outwidth, int outheight);
322
 
 
323
 
image_t *R_RegisterSkin (char *name);
324
 
image_t *R_RegisterParticlePic(char *name);
325
 
image_t *R_RegisterGfxPic(char *name);
326
 
 
327
 
void    LoadPCX (char *filename, byte **pic, byte **palette, int *width, int *height);
328
 
image_t *GL_LoadPic (char *name, byte *pic, int width, int height, imagetype_t type, int bits);
329
 
image_t *GL_FindImage (char *name, imagetype_t type);
330
 
void    GL_TextureMode( char *string );
331
 
void    GL_ImageList_f (void);
332
 
 
333
 
void    GL_SetTexturePalette( unsigned palette[256] );
334
 
 
335
 
void    GL_InitImages (void);
336
 
void    GL_ShutdownImages (void);
337
 
 
338
 
void    GL_FreeUnusedImages (void);
339
 
 
340
 
void    GL_TextureAlphaMode( char *string );
341
 
void    GL_TextureSolidMode( char *string );
342
 
 
343
 
/*
344
 
** GL config stuff
345
 
*/
346
 
#define GL_RENDERER_VOODOO              0x00000001
347
 
#define GL_RENDERER_VOODOO2     0x00000002
348
 
#define GL_RENDERER_VOODOO_RUSH 0x00000004
349
 
#define GL_RENDERER_BANSHEE             0x00000008
350
 
#define GL_RENDERER_3DFX                0x0000000F
351
 
 
352
 
#define GL_RENDERER_PCX1                0x00000010
353
 
#define GL_RENDERER_PCX2                0x00000020
354
 
#define GL_RENDERER_PMX                 0x00000040
355
 
#define GL_RENDERER_POWERVR             0x00000070
356
 
 
357
 
#define GL_RENDERER_PERMEDIA2   0x00000100
358
 
#define GL_RENDERER_GLINT_MX    0x00000200
359
 
#define GL_RENDERER_GLINT_TX    0x00000400
360
 
#define GL_RENDERER_3DLABS_MISC 0x00000800
361
 
#define GL_RENDERER_3DLABS              0x00000F00
362
 
 
363
 
#define GL_RENDERER_REALIZM             0x00001000
364
 
#define GL_RENDERER_REALIZM2    0x00002000
365
 
#define GL_RENDERER_INTERGRAPH  0x00003000
366
 
 
367
 
#define GL_RENDERER_3DPRO               0x00004000
368
 
#define GL_RENDERER_REAL3D              0x00008000
369
 
#define GL_RENDERER_RIVA128             0x00010000
370
 
#define GL_RENDERER_DYPIC               0x00020000
371
 
 
372
 
#define GL_RENDERER_V1000               0x00040000
373
 
#define GL_RENDERER_V2100               0x00080000
374
 
#define GL_RENDERER_V2200               0x00100000
375
 
#define GL_RENDERER_RENDITION   0x001C0000
376
 
 
377
 
#define GL_RENDERER_O2          0x00100000
378
 
#define GL_RENDERER_IMPACT      0x00200000
379
 
#define GL_RENDERER_RE                  0x00400000
380
 
#define GL_RENDERER_IR                  0x00800000
381
 
#define GL_RENDERER_SGI                 0x00F00000
382
 
 
383
 
#define GL_RENDERER_MCD                 0x01000000
384
 
#define GL_RENDERER_OTHER               0x80000000
385
 
 
386
 
#define GLSTATE_DISABLE_ALPHATEST       if (gl_state.alpha_test) { qglDisable(GL_ALPHA_TEST); gl_state.alpha_test=false; }
387
 
#define GLSTATE_ENABLE_ALPHATEST        if (!gl_state.alpha_test) { qglEnable(GL_ALPHA_TEST); gl_state.alpha_test=true; }
388
 
 
389
 
#define GLSTATE_DISABLE_BLEND           if (gl_state.blend) { qglDisable(GL_BLEND); gl_state.blend=false; }
390
 
#define GLSTATE_ENABLE_BLEND            if (!gl_state.blend) { qglEnable(GL_BLEND); gl_state.blend=true; }
391
 
 
392
 
#define GLSTATE_DISABLE_TEXGEN          if (gl_state.texgen) { qglDisable(GL_TEXTURE_GEN_S); qglDisable(GL_TEXTURE_GEN_T); qglDisable(GL_TEXTURE_GEN_R); gl_state.texgen=false; }
393
 
#define GLSTATE_ENABLE_TEXGEN           if (!gl_state.texgen) { qglEnable(GL_TEXTURE_GEN_S); qglEnable(GL_TEXTURE_GEN_T); qglEnable(GL_TEXTURE_GEN_R); gl_state.texgen=true; }
394
 
 
395
 
#define GL_COMBINE                        0x8570
396
 
#define GL_DOT3_RGB                       0x86AE
397
 
 
398
 
typedef struct
399
 
{
400
 
        int         renderer;
401
 
        const char *renderer_string;
402
 
        const char *vendor_string;
403
 
        const char *version_string;
404
 
        const char *extensions_string;
405
 
 
406
 
        qboolean        allow_cds;
407
 
 
408
 
        // Vic - begin
409
 
 
410
 
        qboolean        mtexcombine;
411
 
 
412
 
        // Vic - end
413
 
} glconfig_t;
414
 
 
415
 
typedef struct
416
 
{
417
 
        float           inverse_intensity;
418
 
        qboolean        fullscreen;
419
 
 
420
 
        int                     prev_mode;
421
 
 
422
 
        unsigned char *d_16to8table;
423
 
 
424
 
        int                     lightmap_textures;
425
 
 
426
 
        int                     currenttextures[2];
427
 
        int                     currenttmu;
428
 
 
429
 
        float           camera_separation;
430
 
        qboolean        stereo_enabled;
431
 
 
432
 
        qboolean        alpha_test;
433
 
        qboolean        blend;
434
 
        qboolean        texgen;
435
 
        qboolean        texshaders;
436
 
        qboolean        fragment_program; // jitwater
437
 
} glstate_t;
438
 
 
439
 
extern glconfig_t  gl_config;
440
 
extern glstate_t   gl_state;
441
 
 
442
 
 
443
 
// vertex arrays
444
 
 
445
 
#define MAX_ARRAY MAX_PARTICLES*4
446
 
 
447
 
#define VA_SetElem2(v,a,b)              ((v)[0]=(a),(v)[1]=(b))
448
 
#define VA_SetElem3(v,a,b,c)    ((v)[0]=(a),(v)[1]=(b),(v)[2]=(c))
449
 
#define VA_SetElem4(v,a,b,c,d)  ((v)[0]=(a),(v)[1]=(b),(v)[2]=(c),(v)[3]=(d))
450
 
 
451
 
extern float    tex_array[MAX_ARRAY][2];
452
 
extern float    vert_array[MAX_ARRAY][3];
453
 
extern float    col_array[MAX_ARRAY][4];
454
 
/*
455
 
====================================================================
456
 
 
457
 
IMPLEMENTATION SPECIFIC FUNCTIONS
458
 
 
459
 
====================================================================
460
 
*/
461
 
 
462
 
void            GLimp_BeginFrame( float camera_separation );
463
 
void            GLimp_EndFrame( void );
464
 
int             GLimp_Init( void *hinstance, void *hWnd );
465
 
void            GLimp_Shutdown( void );
466
 
int             GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen );
467
 
void            GLimp_AppActivate( qboolean active );
468
 
void            GLimp_EnableLogging( qboolean enable );
469
 
void            GLimp_LogNewFrame( void );
470
 
 
471
 
/*
472
 
====================================================================
473
 
 
474
 
IMPORTED FUNCTIONS
475
 
 
476
 
====================================================================
477
 
*/
478
 
 
479
 
#include "r_script.h"
 
304
void R_GLSLPostProcess(void);
 
305
void R_FB_InitTextures(void);
 
306
 
 
307
//VBO
 
308
void R_VCInit(void);
 
309
void GL_BindVBO(vertCache_t *cache);
 
310
vertCache_t *R_VCFindCache(vertStoreMode_t store, entity_t *ent);
 
311
vertCache_t *R_VCLoadData(vertCacheMode_t mode, int size, void *buffer, vertStoreMode_t store, entity_t *ent);
 
312
void R_VCShutdown(void);
 
313
 
 
314
//BLOOMS[start]
 
315
//
 
316
// r_bloom.c
 
317
//
 
318
void R_BloomBlend( refdef_t *fd );
 
319
void R_InitBloomTextures( void );
 
320
//BLOOMS[end]
 
321
 
 
322
//FLARES and SUN
 
323
void R_RenderFlares (void);
 
324
void R_DrawVegetationSurface (void);
 
325
void R_DrawBeamSurface ( void );
 
326
void R_InitSun();
 
327
void R_RenderSun();
 
328
vec3_t sun_origin;
 
329
qboolean spacebox;
 
330
 
 
331
//Player icons
 
332
extern float    scr_playericonalpha;
 
333
 
 
334
void    Draw_GetPicSize (int *w, int *h, char *name);
 
335
void    Draw_Pic (int x, int y, char *name);
 
336
void    Draw_ScaledPic (int x, int y, float scale, char *pic);
 
337
void    Draw_StretchPic (int x, int y, int w, int h, char *name);
 
338
void    Draw_Char (int x, int y, int c);
 
339
void    Draw_ColorChar (int x, int y, int num, vec4_t color);
 
340
void    Draw_ScaledChar(float x, float y, int num, float scale);
 
341
void    Draw_ScaledColorChar (float x, float y, int num, vec4_t color, float scale);
 
342
void    Draw_TileClear (int x, int y, int w, int h, char *name);
 
343
void    Draw_Fill (int x, int y, int w, int h, int c);
 
344
void    Draw_FadeScreen (void);
 
345
void    Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data);
 
346
 
 
347
void    R_BeginFrame( float camera_separation );
 
348
void    R_SwapBuffers( int );
 
349
void    R_SetPalette ( const unsigned char *palette);
 
350
 
 
351
int             Draw_GetPalette (void);
 
352
 
 
353
void    GL_ResampleTexture (unsigned *in, int inwidth, int inheight, unsigned *out,  int outwidth, int outheight);
 
354
 
 
355
image_t *R_RegisterSkin (char *name);
 
356
image_t *R_RegisterParticlePic(char *name);
 
357
image_t *R_RegisterParticleNormal(char *name);
 
358
image_t *R_RegisterGfxPic(char *name);
 
359
 
 
360
void    LoadPCX (char *filename, byte **pic, byte **palette, int *width, int *height);
 
361
image_t *GL_LoadPic (char *name, byte *pic, int width, int height, imagetype_t type, int bits);
 
362
image_t *GL_FindImage (char *name, imagetype_t type);
 
363
void    GL_TextureMode( char *string );
 
364
void    GL_ImageList_f (void);
 
365
 
 
366
void    GL_SetTexturePalette( unsigned palette[256] );
 
367
 
 
368
void    GL_InitImages (void);
 
369
void    GL_ShutdownImages (void);
 
370
 
 
371
void    GL_FreeUnusedImages (void);
 
372
 
 
373
void    GL_TextureAlphaMode( char *string );
 
374
void    GL_TextureSolidMode( char *string );
 
375
 
 
376
/*
 
377
** GL config stuff
 
378
*/
 
379
#define GL_RENDERER_VOODOO              0x00000001
 
380
#define GL_RENDERER_VOODOO2     0x00000002
 
381
#define GL_RENDERER_VOODOO_RUSH 0x00000004
 
382
#define GL_RENDERER_BANSHEE             0x00000008
 
383
#define GL_RENDERER_3DFX                0x0000000F
 
384
 
 
385
#define GL_RENDERER_PCX1                0x00000010
 
386
#define GL_RENDERER_PCX2                0x00000020
 
387
#define GL_RENDERER_PMX                 0x00000040
 
388
#define GL_RENDERER_POWERVR             0x00000070
 
389
 
 
390
#define GL_RENDERER_PERMEDIA2   0x00000100
 
391
#define GL_RENDERER_GLINT_MX    0x00000200
 
392
#define GL_RENDERER_GLINT_TX    0x00000400
 
393
#define GL_RENDERER_3DLABS_MISC 0x00000800
 
394
#define GL_RENDERER_3DLABS              0x00000F00
 
395
 
 
396
#define GL_RENDERER_REALIZM             0x00001000
 
397
#define GL_RENDERER_REALIZM2    0x00002000
 
398
#define GL_RENDERER_INTERGRAPH  0x00003000
 
399
 
 
400
#define GL_RENDERER_3DPRO               0x00004000
 
401
#define GL_RENDERER_REAL3D              0x00008000
 
402
#define GL_RENDERER_RIVA128             0x00010000
 
403
#define GL_RENDERER_DYPIC               0x00020000
 
404
 
 
405
#define GL_RENDERER_V1000               0x00040000
 
406
#define GL_RENDERER_V2100               0x00080000
 
407
#define GL_RENDERER_V2200               0x00100000
 
408
#define GL_RENDERER_RENDITION   0x001C0000
 
409
 
 
410
#define GL_RENDERER_O2          0x00100000
 
411
#define GL_RENDERER_IMPACT      0x00200000
 
412
#define GL_RENDERER_RE                  0x00400000
 
413
#define GL_RENDERER_IR                  0x00800000
 
414
#define GL_RENDERER_SGI                 0x00F00000
 
415
 
 
416
#define GL_RENDERER_MCD                 0x01000000
 
417
#define GL_RENDERER_OTHER               0x80000000
 
418
 
 
419
#define GLSTATE_DISABLE_ALPHATEST       if (gl_state.alpha_test) { qglDisable(GL_ALPHA_TEST); gl_state.alpha_test=false; }
 
420
#define GLSTATE_ENABLE_ALPHATEST        if (!gl_state.alpha_test) { qglEnable(GL_ALPHA_TEST); gl_state.alpha_test=true; }
 
421
 
 
422
#define GLSTATE_DISABLE_BLEND           if (gl_state.blend) { qglDisable(GL_BLEND); gl_state.blend=false; }
 
423
#define GLSTATE_ENABLE_BLEND            if (!gl_state.blend) { qglEnable(GL_BLEND); gl_state.blend=true; }
 
424
 
 
425
#define GLSTATE_DISABLE_TEXGEN          if (gl_state.texgen) { qglDisable(GL_TEXTURE_GEN_S); qglDisable(GL_TEXTURE_GEN_T); qglDisable(GL_TEXTURE_GEN_R); gl_state.texgen=false; }
 
426
#define GLSTATE_ENABLE_TEXGEN           if (!gl_state.texgen) { qglEnable(GL_TEXTURE_GEN_S); qglEnable(GL_TEXTURE_GEN_T); qglEnable(GL_TEXTURE_GEN_R); gl_state.texgen=true; }
 
427
 
 
428
#define GL_COMBINE                        0x8570
 
429
#define GL_DOT3_RGB                       0x86AE
 
430
 
 
431
typedef struct
 
432
{
 
433
        int         renderer;
 
434
        const char *renderer_string;
 
435
        const char *vendor_string;
 
436
        const char *version_string;
 
437
        const char *extensions_string;
 
438
        qboolean        allow_cds;
 
439
        qboolean        mtexcombine;
 
440
} glconfig_t;
 
441
 
 
442
typedef struct
 
443
{
 
444
        float           inverse_intensity;
 
445
        qboolean        fullscreen;
 
446
 
 
447
        int                     prev_mode;
 
448
 
 
449
        unsigned char *d_16to8table;
 
450
 
 
451
        int                     lightmap_textures;
 
452
 
 
453
        int                     currenttextures[3];
 
454
        int                     currenttmu;
 
455
 
 
456
        float           camera_separation;
 
457
        qboolean        stereo_enabled;
 
458
 
 
459
        qboolean        alpha_test;
 
460
        qboolean        blend;
 
461
        qboolean        texgen;
 
462
        qboolean        fragment_program; 
 
463
        qboolean        glsl_shaders;
 
464
        qboolean        separateStencil;
 
465
        qboolean        stencil_wrap;
 
466
        qboolean        vbo;
 
467
 
 
468
} glstate_t;
 
469
 
 
470
extern glconfig_t  gl_config;
 
471
extern glstate_t   gl_state;
 
472
 
 
473
// vertex arrays
 
474
 
 
475
#define MAX_ARRAY MAX_PARTICLES*4
 
476
 
 
477
#define VA_SetElem2(v,a,b)              ((v)[0]=(a),(v)[1]=(b))
 
478
#define VA_SetElem3(v,a,b,c)    ((v)[0]=(a),(v)[1]=(b),(v)[2]=(c))
 
479
#define VA_SetElem4(v,a,b,c,d)  ((v)[0]=(a),(v)[1]=(b),(v)[2]=(c),(v)[3]=(d))
 
480
 
 
481
extern float    tex_array[MAX_ARRAY][2];
 
482
extern float    vert_array[MAX_ARRAY][3];
 
483
extern float    col_array[MAX_ARRAY][4];
 
484
extern float    norm_array[MAX_ARRAY][3];
 
485
 
 
486
#define MAX_VARRAY_VERTS MAX_VERTS + 2
 
487
#define MAX_VARRAY_VERTEX_SIZE 11
 
488
 
 
489
#define MAX_VERTICES            16384
 
490
#define MAX_INDICES             MAX_VERTICES * 4
 
491
#define MAX_SHADOW_VERTS        16384
 
492
 
 
493
extern float VArrayVerts[MAX_VARRAY_VERTS * MAX_VARRAY_VERTEX_SIZE];
 
494
extern int VertexSizes[];
 
495
extern float *VArray;
 
496
static vec3_t NormalsArray[MAX_TRIANGLES*3];
 
497
extern vec3_t ShadowArray[MAX_SHADOW_VERTS];
 
498
 
 
499
// define our vertex types
 
500
#define VERT_SINGLE_TEXTURED                    0               // verts and st for 1 tmu
 
501
#define VERT_BUMPMAPPED                                 1               // verts and st for 1 tmu, but with 2 texcoord pointers
 
502
#define VERT_MULTI_TEXTURED                             2               // verts and st for 2 tmus
 
503
#define VERT_COLOURED_UNTEXTURED                3               // verts and colour
 
504
#define VERT_COLOURED_TEXTURED                  4               // verts, st for 1 tmu and colour
 
505
#define VERT_COLOURED_MULTI_TEXTURED    5               // verts, st for 2 tmus and colour
 
506
#define VERT_DUAL_TEXTURED                              6               // verts, st for 2 tmus both with same st
 
507
#define VERT_NO_TEXTURE                                 7               // verts only, no textures
 
508
#define VERT_BUMPMAPPED_COLOURED                8               // verts and st for 1 tmu, 2 texoord pointers and colour
 
509
#define VERT_NORMAL_COLOURED_TEXTURED   9               // verts and st for 1tmu and color, with normals
 
510
 
 
511
// vertex array kill flags
 
512
#define KILL_TMU0_POINTER       1
 
513
#define KILL_TMU1_POINTER       2
 
514
#define KILL_TMU2_POINTER       3
 
515
#define KILL_TMU3_POINTER       4
 
516
#define KILL_RGBA_POINTER       5
 
517
#define KILL_NORMAL_POINTER 6
 
518
 
 
519
// vertex array subsystem
 
520
void R_InitVArrays (int varraytype);
 
521
void R_KillVArrays (void);
 
522
void R_InitQuadVarrays(void);
 
523
void R_AddTexturedSurfToVArray (msurface_t *surf, float scroll);
 
524
void R_AddLightMappedSurfToVArray (msurface_t *surf, float scroll);
 
525
void R_AddGLSLShadedSurfToVArray (msurface_t *surf, float scroll, qboolean lightmap);
 
526
void R_AddGLSLShadedWarpSurfToVArray (msurface_t *surf, float scroll);
 
527
void R_KillNormalTMUs(void);
 
528
 
 
529
// stencil volumes
 
530
extern glStencilFuncSeparatePROC        qglStencilFuncSeparate;
 
531
extern glStencilOpSeparatePROC          qglStencilOpSeparate;
 
532
extern glStencilMaskSeparatePROC        qglStencilMaskSeparate;
 
533
 
 
534
//shadow maps
 
535
GLuint fboId;
 
536
void setupMatrices(float position_x,float position_y,float position_z,float lookAt_x,float lookAt_y,float lookAt_z);
 
537
void setTextureMatrix();
 
538
void R_DrawShadowMapWorld (void);
 
539
extern image_t *r_depthtexture;
 
540
 
 
541
//arb fragment
 
542
extern unsigned int g_water_program_id;
 
543
 
 
544
//glsl
 
545
extern GLhandleARB      g_programObj;
 
546
extern GLhandleARB      g_waterprogramObj;
 
547
extern GLhandleARB      g_meshprogramObj;
 
548
extern GLhandleARB      g_fbprogramObj;
 
549
 
 
550
extern GLhandleARB      g_vertexShader;
 
551
extern GLhandleARB      g_fragmentShader;
 
552
 
 
553
//standard bsp surfaces
 
554
extern GLuint           g_location_testTexture;
 
555
extern GLuint           g_location_eyePos;
 
556
extern GLuint           g_tangentSpaceTransform;
 
557
extern GLuint           g_location_heightTexture;
 
558
extern GLuint           g_location_lmTexture;
 
559
extern GLuint           g_location_normalTexture;
 
560
extern GLuint           g_location_bspShadowmapTexture;
 
561
extern GLuint           g_heightMapID;
 
562
extern GLuint           g_location_fog;
 
563
extern GLuint           g_location_parallax;
 
564
extern GLuint           g_location_dynamic;
 
565
extern GLuint           g_location_specular;
 
566
extern GLuint           g_location_shadowmap;
 
567
extern GLuint           g_location_lightPosition;
 
568
extern GLuint           g_location_lightColour;
 
569
extern GLuint           g_location_lightCutoffSquared;
 
570
 
 
571
//water
 
572
extern GLuint           g_location_baseTexture;
 
573
extern GLuint           g_location_normTexture;
 
574
extern GLuint           g_location_refTexture;
 
575
extern GLuint           g_location_tangent;
 
576
extern GLuint           g_location_time;
 
577
extern GLuint           g_location_lightPos;
 
578
extern GLuint           g_location_reflect;
 
579
extern GLuint           g_location_trans;
 
580
extern GLuint           g_location_fogamount;
 
581
 
 
582
//mesh
 
583
extern GLuint           g_location_meshlightPosition;
 
584
extern GLuint           g_location_meshnormal;
 
585
extern GLuint           g_location_baseTex;
 
586
extern GLuint           g_location_normTex;
 
587
extern GLuint           g_location_fxTex;
 
588
extern GLuint           g_location_color;
 
589
extern GLuint           g_location_meshNormal;
 
590
extern GLuint           g_location_meshTangent;
 
591
extern GLuint           g_location_meshTime;
 
592
extern GLuint           g_location_meshFog;
 
593
extern GLuint           g_location_useFX;
 
594
extern GLuint           g_location_useGlow;
 
595
 
 
596
//fullscreen
 
597
extern GLuint           g_location_framebuffTex;
 
598
extern GLuint           g_location_distortTex;
 
599
extern GLuint           g_location_frametime;
 
600
extern GLuint           g_location_fxType;
 
601
extern GLuint           g_location_fxPos;
 
602
extern GLuint           g_location_fxColor;
 
603
extern GLuint           g_location_fbSampleSize;
 
604
 
 
605
#define TURBSCALE2 (256.0 / (2 * M_PI)) 
 
606
 
 
607
// reduce runtime calcs
 
608
#define TURBSCALE 40.743665431525205956834243423364
 
609
 
 
610
extern float r_turbsin[];
 
611
/*
 
612
====================================================================
 
613
 
 
614
IMPLEMENTATION SPECIFIC FUNCTIONS
 
615
 
 
616
====================================================================
 
617
*/
 
618
 
 
619
void            GLimp_BeginFrame( float camera_separation );
 
620
void            GLimp_EndFrame( void );
 
621
int             GLimp_Init( void *hinstance, void *hWnd );
 
622
void            GLimp_Shutdown( void );
 
623
int             GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen );
 
624
void            GLimp_AppActivate( qboolean active );
 
625
void            GLimp_EnableLogging( qboolean enable );
 
626
void            GLimp_LogNewFrame( void );
 
627
 
 
628
/*
 
629
====================================================================
 
630
 
 
631
IMPORTED FUNCTIONS
 
632
 
 
633
====================================================================
 
634
*/
 
635
 
 
636
#include "r_script.h"