icculus quake2 doxygen  1.0 dev
cl_view.c
Go to the documentation of this file.
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 // cl_view.c -- player rendering positioning
21 
22 #include "client.h"
23 
24 //=============
25 //
26 // development tools for weapons
27 //
30 
31 //=============
32 
39 
41 
42 
45 
48 
51 
53 
56 
57 #ifdef QMAX
58 /*
59 ====================
60 CL_Trace
61 
62 ====================
63 */
64 
65 trace_t CL_Trace (vec3_t start, vec3_t end, float size, int contentmask)
66 {
67  vec3_t maxs, mins;
68 
69  VectorSet(maxs, size, size, size);
70  VectorSet(mins, -size, -size, -size);
71 
72  return CM_BoxTrace (start, end, mins, maxs, 0, contentmask);
73 }
74 #endif
75 
76 /*
77 ====================
78 V_ClearScene
79 
80 Specifies the model that will be used as the world
81 ====================
82 */
83 void V_ClearScene (void)
84 {
85  r_numdlights = 0;
86  r_numentities = 0;
87  r_numparticles = 0;
88 }
89 
90 
91 /*
92 =====================
93 V_AddEntity
94 
95 =====================
96 */
97 void V_AddEntity (entity_t *ent)
98 {
100  return;
101  r_entities[r_numentities++] = *ent;
102 }
103 
104 
105 /*
106 =====================
107 V_AddParticle
108 
109 =====================
110 */
111 #ifdef QMAX
112 void V_AddParticle (vec3_t org, vec3_t angle, vec3_t color, float alpha, float size, int image, int flags)
113 {
114  int i;
115  particle_t *p;
116 
118  return;
119  p = &r_particles[r_numparticles++];
120 
121  for (i=0;i<3;i++)
122  {
123  p->origin[i] = org[i];
124  p->angle[i] = angle[i];
125  }
126  p->red = color[0];
127  p->green = color[1];
128  p->blue = color[2];
129  p->alpha = alpha;
130  p->image = image;
131  p->flags = flags;
132  p->size = size;
133 
134 
135 
136 
137 }
138 #else
139 void V_AddParticle (vec3_t org, int color, float alpha)
140 {
141  particle_t *p;
142 
144  return;
145  p = &r_particles[r_numparticles++];
146  VectorCopy (org, p->origin);
147  p->color = color;
148  p->alpha = alpha;
149 }
150 #endif
151 /*
152 =====================
153 V_AddLight
154 
155 =====================
156 */
157 void V_AddLight (vec3_t org, float intensity, float r, float g, float b)
158 {
159  dlight_t *dl;
160 
161  if (r_numdlights >= MAX_DLIGHTS)
162  return;
163  dl = &r_dlights[r_numdlights++];
164  VectorCopy (org, dl->origin);
165  dl->intensity = intensity;
166  dl->color[0] = r;
167  dl->color[1] = g;
168  dl->color[2] = b;
169 }
170 
171 
172 /*
173 =====================
174 V_AddLightStyle
175 
176 =====================
177 */
178 void V_AddLightStyle (int style, float r, float g, float b)
179 {
180  lightstyle_t *ls;
181 
182  if (style < 0 || style > MAX_LIGHTSTYLES)
183  Com_Error (ERR_DROP, "Bad light style %i", style);
184  ls = &r_lightstyles[style];
185 
186  ls->white = r+g+b;
187  ls->rgb[0] = r;
188  ls->rgb[1] = g;
189  ls->rgb[2] = b;
190 }
191 
192 /*
193 ================
194 V_TestParticles
195 
196 If cl_testparticles is set, create 4096 particles in the view
197 ================
198 */
199 void V_TestParticles (void)
200 {
201  particle_t *p;
202  int i, j;
203  float d, r, u;
204 
206  for (i=0 ; i<r_numparticles ; i++)
207  {
208  d = i*0.25;
209  r = 4*((i&7)-3.5);
210  u = 4*(((i>>3)&7)-3.5);
211  p = &r_particles[i];
212 
213  for (j=0 ; j<3 ; j++)
214  p->origin[j] = cl.refdef.vieworg[j] + cl.v_forward[j]*d +
215  cl.v_right[j]*r + cl.v_up[j]*u;
216 
217  p->color = 8;
219  }
220 }
221 
222 /*
223 ================
224 V_TestEntities
225 
226 If cl_testentities is set, create 32 player models
227 ================
228 */
229 void V_TestEntities (void)
230 {
231  int i, j;
232  float f, r;
233  entity_t *ent;
234 
235  r_numentities = 32;
236  memset (r_entities, 0, sizeof(r_entities));
237 
238  for (i=0 ; i<r_numentities ; i++)
239  {
240  ent = &r_entities[i];
241 
242  r = 64 * ( (i%4) - 1.5 );
243  f = 64 * (i/4) + 128;
244 
245  for (j=0 ; j<3 ; j++)
246  ent->origin[j] = cl.refdef.vieworg[j] + cl.v_forward[j]*f +
247  cl.v_right[j]*r;
248 
249  ent->model = cl.baseclientinfo.model;
250  ent->skin = cl.baseclientinfo.skin;
251  }
252 }
253 
254 /*
255 ================
256 V_TestLights
257 
258 If cl_testlights is set, create 32 lights models
259 ================
260 */
261 void V_TestLights (void)
262 {
263  int i, j;
264  float f, r;
265  dlight_t *dl;
266 
267  r_numdlights = 32;
268  memset (r_dlights, 0, sizeof(r_dlights));
269 
270  for (i=0 ; i<r_numdlights ; i++)
271  {
272  dl = &r_dlights[i];
273 
274  r = 64 * ( (i%4) - 1.5 );
275  f = 64 * (i/4) + 128;
276 
277  for (j=0 ; j<3 ; j++)
278  dl->origin[j] = cl.refdef.vieworg[j] + cl.v_forward[j]*f +
279  cl.v_right[j]*r;
280  dl->color[0] = ((i%6)+1) & 1;
281  dl->color[1] = (((i%6)+1) & 2)>>1;
282  dl->color[2] = (((i%6)+1) & 4)>>2;
283  dl->intensity = 200;
284  }
285 }
286 
287 //===================================================================
288 
289 /*
290 =================
291 CL_PrepRefresh
292 
293 Call before entering a new level, or after changing dlls
294 =================
295 */
296 void CL_PrepRefresh (void)
297 {
298  char mapname[32];
299  int i;
300  char name[MAX_QPATH];
301  float rotate;
302  vec3_t axis;
303 
304  if (!cl.configstrings[CS_MODELS+1][0])
305  return; // no map loaded
306 
307  SCR_AddDirtyPoint (0, 0);
309 
310  // let the render dll load the map
311  strcpy (mapname, cl.configstrings[CS_MODELS+1] + 5); // skip "maps/"
312  mapname[strlen(mapname)-4] = 0; // cut off ".bsp"
313 
314  // register models, pics, and skins
315  Com_Printf ("Map: %s\r", mapname);
316  SCR_UpdateScreen ();
317  re.BeginRegistration (mapname);
318  Com_Printf (" \r");
319 
320  // precache status bar pics
321  Com_Printf ("pics\r");
322  SCR_UpdateScreen ();
323  SCR_TouchPics ();
324  Com_Printf (" \r");
325 
327 
329  strcpy(cl_weaponmodels[0], "weapon.md2");
330 
331  for (i=1 ; i<MAX_MODELS && cl.configstrings[CS_MODELS+i][0] ; i++)
332  {
333  strcpy (name, cl.configstrings[CS_MODELS+i]);
334  name[37] = 0; // never go beyond one line
335  if (name[0] != '*')
336  Com_Printf ("%s\r", name);
337  SCR_UpdateScreen ();
338  Sys_SendKeyEvents (); // pump message loop
339  if (name[0] == '#')
340  {
341  // special player weapon model
343  {
345  sizeof(cl_weaponmodels[num_cl_weaponmodels]) - 1);
347  }
348  }
349  else
350  {
352  if (name[0] == '*')
354  else
355  cl.model_clip[i] = NULL;
356  }
357  if (name[0] != '*')
358  Com_Printf (" \r");
359  }
360 
361  Com_Printf ("images\r", i);
362  SCR_UpdateScreen ();
363  for (i=1 ; i<MAX_IMAGES && cl.configstrings[CS_IMAGES+i][0] ; i++)
364  {
366  Sys_SendKeyEvents (); // pump message loop
367  }
368 
369  Com_Printf (" \r");
370  for (i=0 ; i<MAX_CLIENTS ; i++)
371  {
372  if (!cl.configstrings[CS_PLAYERSKINS+i][0])
373  continue;
374  Com_Printf ("client %i\r", i);
375  SCR_UpdateScreen ();
376  Sys_SendKeyEvents (); // pump message loop
378  Com_Printf (" \r");
379  }
380 
381  CL_LoadClientinfo (&cl.baseclientinfo, "unnamed\\male/grunt");
382 
383  // set sky textures and speed
384  Com_Printf ("sky\r", i);
385  SCR_UpdateScreen ();
386  rotate = atof (cl.configstrings[CS_SKYROTATE]);
387  sscanf (cl.configstrings[CS_SKYAXIS], "%f %f %f",
388  &axis[0], &axis[1], &axis[2]);
389  re.SetSky (cl.configstrings[CS_SKY], rotate, axis);
390  Com_Printf (" \r");
391 
392  // the renderer can now free unneeded stuff
393  re.EndRegistration ();
394 
395  // clear any lines of console text
396  Con_ClearNotify ();
397 
398  SCR_UpdateScreen ();
399  cl.refresh_prepped = true;
400  cl.force_refdef = true; // make sure we have a valid refdef
401 
402  // start the cd track
403  if (Cvar_VariableValue("cd_shuffle")){
405  }
406  else{
407  CDAudio_Play (atoi(cl.configstrings[CS_CDTRACK]), true);
408  }
409 }
410 
411 /*
412 ====================
413 CalcFov
414 ====================
415 */
416 float CalcFov (float fov_x, float width, float height)
417 {
418  float a;
419  float x;
420 
421  if (fov_x < 1 || fov_x > 179)
422  Com_Error (ERR_DROP, "Bad fov: %f", fov_x);
423 
424  x = width/tan(fov_x/360*M_PI);
425 
426  a = atan (height/x);
427 
428  a = a*360/M_PI;
429 
430  return a;
431 }
432 
433 //============================================================================
434 
435 // gun frame debugging functions
436 void V_Gun_Next_f (void)
437 {
438  gun_frame++;
439  Com_Printf ("frame %i\n", gun_frame);
440 }
441 
442 void V_Gun_Prev_f (void)
443 {
444  gun_frame--;
445  if (gun_frame < 0)
446  gun_frame = 0;
447  Com_Printf ("frame %i\n", gun_frame);
448 }
449 
450 void V_Gun_Model_f (void)
451 {
452  char name[MAX_QPATH];
453 
454  if (Cmd_Argc() != 2)
455  {
456  gun_model = NULL;
457  return;
458  }
459  Com_sprintf (name, sizeof(name), "models/%s/tris.md2", Cmd_Argv(1));
461 }
462 
463 //============================================================================
464 
465 
466 /*
467 =================
468 SCR_DrawCrosshair
469 =================
470 */
471 void SCR_DrawCrosshair (void)
472 {
473 #ifdef QMAX
474  float scale;
475 #endif
476  if (!crosshair->value)
477  return;
478 
479  if (crosshair->modified)
480  {
481  crosshair->modified = false;
482  SCR_TouchPics ();
483  }
484 
486  {
487  crosshair_scale->modified=false;
488  if (crosshair_scale->value>5)
489  Cvar_SetValue("crosshair_scale", 5);
490  else if (crosshair_scale->value<0.25)
491  Cvar_SetValue("crosshair_scale", 0.25);
492  }
493 
494  if (!crosshair_pic[0])
495  return;
496 
497 #ifdef QMAX
498  scale = crosshair_scale->value * (viddef.width/640);
499  re.DrawScaledPic (scr_vrect.x + ((scr_vrect.width - crosshair_width)>>1) //width
500  , scr_vrect.y + ((scr_vrect.height - crosshair_height)>>1) //height
501  , scale //scale
502  , 0.75 + 0.25*sin(anglemod(cl.time*0.005)) //alpha
503  , crosshair_pic); //pic
504 #else
507 #endif
508 }
509 
510 /*
511 ==================
512 V_RenderView
513 
514 ==================
515 */
516 void V_RenderView( float stereo_separation )
517 {
518  extern int entitycmpfnc( const entity_t *, const entity_t * );
519 
520  if (cls.state != ca_active)
521  return;
522 
523  if (!cl.refresh_prepped)
524  return; // still loading
525 
526  if (cl_timedemo->value)
527  {
528  if (!cl.timedemo_start)
531  }
532 
533  // an invalid frame will just use the exact previous refdef
534  // we can't use the old frame if the video mode has changed, though...
535  if ( cl.frame.valid && (cl.force_refdef || !cl_paused->value) )
536  {
537  cl.force_refdef = false;
538 
539  V_ClearScene ();
540 
541  // build a refresh entity list and calc cl.sim*
542  // this also calls CL_CalcViewValues which loads
543  // v_forward, etc.
544  CL_AddEntities ();
545 
546  if (cl_testparticles->value)
547  V_TestParticles ();
548  if (cl_testentities->value)
549  V_TestEntities ();
550  if (cl_testlights->value)
551  V_TestLights ();
552  if (cl_testblend->value)
553  {
554  cl.refdef.blend[0] = 1;
555  cl.refdef.blend[1] = 0.5;
556  cl.refdef.blend[2] = 0.25;
557  cl.refdef.blend[3] = 0.5;
558  }
559 
560  // offset vieworg appropriately if we're doing stereo separation
561  if ( stereo_separation != 0 )
562  {
563  vec3_t tmp;
564 
565  VectorScale( cl.v_right, stereo_separation, tmp );
567  }
568 
569  // never let it sit exactly on a node line, because a water plane can
570  // dissapear when viewed with the eye exactly on it.
571  // the server protocol only specifies to 1/8 pixel, so add 1/16 in each axis
572  cl.refdef.vieworg[0] += 1.0/16;
573  cl.refdef.vieworg[1] += 1.0/16;
574  cl.refdef.vieworg[2] += 1.0/16;
575 
576  cl.refdef.x = scr_vrect.x;
577  cl.refdef.y = scr_vrect.y;
581  cl.refdef.time = cl.time*0.001;
582 
584 
585  if (!cl_add_entities->value)
586  r_numentities = 0;
587  if (!cl_add_particles->value)
588  r_numparticles = 0;
589  if (!cl_add_lights->value)
590  r_numdlights = 0;
591  if (!cl_add_blend->value)
592  {
594  }
595 
603 
605 
606  // sort entities for better cache locality
607  qsort( cl.refdef.entities, cl.refdef.num_entities, sizeof( cl.refdef.entities[0] ), (int (*)(const void *, const void *))entitycmpfnc );
608  }
609 
610  re.RenderFrame (&cl.refdef);
611  if (cl_stats->value)
612  Com_Printf ("ent:%i lt:%i part:%i\n", r_numentities, r_numdlights, r_numparticles);
613  if ( log_stats->value && ( log_stats_file != 0 ) )
614  fprintf( log_stats_file, "%i,%i,%i,",r_numentities, r_numdlights, r_numparticles);
615 
616 
620 
622 }
623 
624 
625 /*
626 =============
627 V_Viewpos_f
628 =============
629 */
630 void V_Viewpos_f (void)
631 {
632  Com_Printf ("(%i %i %i) : %i\n", (int)cl.refdef.vieworg[0],
633  (int)cl.refdef.vieworg[1], (int)cl.refdef.vieworg[2],
634  (int)cl.refdef.viewangles[YAW]);
635 }
636 
637 /*
638 =============
639 V_Init
640 =============
641 */
642 void V_Init (void)
643 {
644  Cmd_AddCommand ("gun_next", V_Gun_Next_f);
645  Cmd_AddCommand ("gun_prev", V_Gun_Prev_f);
646  Cmd_AddCommand ("gun_model", V_Gun_Model_f);
647 
648  Cmd_AddCommand ("viewpos", V_Viewpos_f);
649 
650  crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE);
651  crosshair_scale = Cvar_Get ("crosshair_scale", "1", CVAR_ARCHIVE);
652  cl_testblend = Cvar_Get ("cl_testblend", "0", 0);
653  cl_testparticles = Cvar_Get ("cl_testparticles", "0", 0);
654  cl_testentities = Cvar_Get ("cl_testentities", "0", 0);
655  cl_testlights = Cvar_Get ("cl_testlights", "0", 0);
656 
657  cl_stats = Cvar_Get ("cl_stats", "0", 0);
658 }
crosshair
cvar_t * crosshair
Definition: cl_view.c:33
MAX_CLIENTS
#define MAX_CLIENTS
Definition: q_shared.h:79
CM_BoxTrace
trace_t CM_BoxTrace(vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, int headnode, int brushmask)
Definition: cmodel.c:1350
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:124
cl_paused
cvar_t * cl_paused
Definition: cl_main.c:75
crosshair_scale
cvar_t * crosshair_scale
Definition: cl_view.c:34
SCR_TouchPics
void SCR_TouchPics(void)
Definition: cl_scrn.c:928
height
GLsizei height
Definition: qgl_win.c:69
entity_s::skin
struct image_s * skin
Definition: ref.h:75
YAW
#define YAW
Definition: q_shared.h:66
CS_SKY
#define CS_SKY
Definition: q_shared.h:1127
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:73
entity_s::origin
float origin[3]
Definition: ref.h:57
entity_s::model
struct model_s * model
Definition: ref.h:51
MAX_MODELS
#define MAX_MODELS
Definition: q_shared.h:82
lightstyle_t::rgb
float rgb[3]
Definition: ref.h:116
MAX_DLIGHTS
#define MAX_DLIGHTS
Definition: ref.h:25
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
CL_ParseClientinfo
void CL_ParseClientinfo(int player)
Definition: cl_parse.c:508
V_TestParticles
void V_TestParticles(void)
Definition: cl_view.c:199
V_Init
void V_Init(void)
Definition: cl_view.c:642
log_stats
cvar_t * log_stats
Definition: common.c:40
client_state_t::v_forward
vec3_t v_forward
Definition: client.h:153
CL_AddEntities
void CL_AddEntities(void)
Definition: cl_ents.c:1495
entitycmpfnc
int entitycmpfnc(const entity_t *a, const entity_t *b)
Definition: cl_scrn.c:619
client_state_t::v_up
vec3_t v_up
Definition: client.h:153
cl_add_blend
cvar_t * cl_add_blend
Definition: cl_main.c:69
refdef_t::areabits
byte * areabits
Definition: ref.h:130
num_cl_weaponmodels
int num_cl_weaponmodels
Definition: cl_view.c:55
r_numentities
int r_numentities
Definition: cl_view.c:46
cvar_s::modified
qboolean modified
Definition: q_shared.h:323
CS_SKYROTATE
#define CS_SKYROTATE
Definition: q_shared.h:1129
vrect_s::height
int height
Definition: vid.h:24
model_s::flags
int flags
Definition: r_model.h:180
CS_CDTRACK
#define CS_CDTRACK
Definition: q_shared.h:1126
refexport_t::RegisterPic
struct image_s *(* RegisterPic)(char *name)
Definition: ref.h:178
VectorScale
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
Definition: q_shared.c:782
CS_MODELS
#define CS_MODELS
Definition: q_shared.h:1136
x
GLint GLenum GLint x
Definition: qgl_win.c:116
viddef_t::width
int width
Definition: vid.h:29
V_Viewpos_f
void V_Viewpos_f(void)
Definition: cl_view.c:630
trace_t
Definition: q_shared.h:449
VectorClear
#define VectorClear(a)
Definition: q_shared.h:159
i
int i
Definition: q_shared.c:305
refdef_t::y
int y
Definition: ref.h:122
MAX_ENTITIES
#define MAX_ENTITIES
Definition: ref.h:26
client_state_t::model_clip
struct cmodel_s * model_clip[MAX_MODELS]
Definition: client.h:184
V_RenderView
void V_RenderView(float stereo_separation)
Definition: cl_view.c:516
ca_active
@ ca_active
Definition: client.h:209
model_s
Definition: r_model.h:171
viddef_t::height
int height
Definition: vid.h:29
dlight_t::origin
vec3_t origin
Definition: ref.h:91
refdef_t::rdflags
int rdflags
Definition: ref.h:128
width
GLint GLsizei width
Definition: qgl_win.c:115
client_state_t::refdef
refdef_t refdef
Definition: client.h:151
M_PI
#define M_PI
Definition: q_shared.h:135
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
gun_model
struct model_s * gun_model
Definition: cl_view.c:29
player_state_t::rdflags
int rdflags
Definition: q_shared.h:1218
cvar_s
Definition: q_shared.h:317
anglemod
float anglemod(float a)
Definition: q_shared.c:293
client_state_t::force_refdef
qboolean force_refdef
Definition: client.h:120
frame_t::areabits
byte areabits[MAX_MAP_AREAS/8]
Definition: client.h:69
intensity
cvar_t * intensity
Definition: gl_image.c:30
refexport_t::EndRegistration
void(* EndRegistration)(void)
Definition: ref.h:180
viddef
viddef_t viddef
Definition: vid_dll.c:49
j
GLint j
Definition: qgl_win.c:150
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:517
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:507
client_state_t::timedemo_start
int timedemo_start
Definition: client.h:116
SCR_DrawCrosshair
void SCR_DrawCrosshair(void)
Definition: cl_view.c:471
CS_IMAGES
#define CS_IMAGES
Definition: q_shared.h:1138
V_ClearScene
void V_ClearScene(void)
Definition: cl_view.c:83
SCR_UpdateScreen
void SCR_UpdateScreen(void)
Definition: cl_scrn.c:1285
CDAudio_Play
void CDAudio_Play(int track, qboolean looping)
Definition: cd_win.c:182
crosshair_height
int crosshair_height
Definition: cl_scrn.c:70
r_entities
entity_t r_entities[MAX_ENTITIES]
Definition: cl_view.c:47
V_Gun_Prev_f
void V_Gun_Prev_f(void)
Definition: cl_view.c:442
clientinfo_t::model
struct model_s * model
Definition: client.h:98
cl_add_lights
cvar_t * cl_add_lights
Definition: cl_main.c:67
client_state_t::model_draw
struct model_s * model_draw[MAX_MODELS]
Definition: client.h:183
r
GLdouble GLdouble r
Definition: qgl_win.c:336
cl_add_entities
cvar_t * cl_add_entities
Definition: cl_main.c:68
refdef_t::num_dlights
int num_dlights
Definition: ref.h:137
particle_t::alpha
float alpha
Definition: ref.h:100
CL_PrepRefresh
void CL_PrepRefresh(void)
Definition: cl_view.c:296
cl_stats
cvar_t * cl_stats
Definition: cl_view.c:40
Sys_SendKeyEvents
void Sys_SendKeyEvents(void)
Definition: sys_win.c:376
model_s::mins
vec3_t mins
Definition: r_model.h:185
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
client_state_t::refresh_prepped
qboolean refresh_prepped
Definition: client.h:118
CS_PLAYERSKINS
#define CS_PLAYERSKINS
Definition: q_shared.h:1141
V_AddParticle
void V_AddParticle(vec3_t org, int color, float alpha)
Definition: cl_view.c:139
dlight_t::color
vec3_t color
Definition: ref.h:92
V_Gun_Next_f
void V_Gun_Next_f(void)
Definition: cl_view.c:436
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:309
gun_frame
int gun_frame
Definition: cl_view.c:28
cvar_s::value
float value
Definition: q_shared.h:324
Cvar_SetValue
void Cvar_SetValue(char *var_name, float value)
Definition: cvar.c:317
frame_t::valid
qboolean valid
Definition: client.h:65
cl_testblend
cvar_t * cl_testblend
Definition: cl_view.c:38
client_state_t::timedemo_frames
int timedemo_frames
Definition: client.h:115
cl_add_particles
cvar_t * cl_add_particles
Definition: cl_main.c:66
refdef_t::blend
float blend[4]
Definition: ref.h:126
V_TestEntities
void V_TestEntities(void)
Definition: cl_view.c:229
NULL
#define NULL
Definition: q_shared.h:60
client_state_t::frame
frame_t frame
Definition: client.h:136
cl_testparticles
cvar_t * cl_testparticles
Definition: cl_view.c:35
CDAudio_RandomPlay
void CDAudio_RandomPlay(void)
Definition: cd_win.c:190
CalcFov
float CalcFov(float fov_x, float width, float height)
Definition: cl_view.c:416
refdef_t::time
float time
Definition: ref.h:127
vrect_s::x
int x
Definition: vid.h:24
cl_weaponmodels
char cl_weaponmodels[MAX_CLIENTWEAPONMODELS][MAX_QPATH]
Definition: cl_view.c:54
V_AddLightStyle
void V_AddLightStyle(int style, float r, float g, float b)
Definition: cl_view.c:178
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
MAX_CLIENTWEAPONMODELS
#define MAX_CLIENTWEAPONMODELS
Definition: client.h:89
particle_t
Definition: ref.h:96
Con_ClearNotify
void Con_ClearNotify(void)
Definition: console.c:215
refexport_t::DrawPic
void(* DrawPic)(int x, int y, char *name)
Definition: ref.h:196
client_state_t::baseclientinfo
clientinfo_t baseclientinfo
Definition: client.h:190
alpha
GLfloat GLfloat GLfloat alpha
Definition: qgl_win.c:74
refdef_t::num_particles
int num_particles
Definition: ref.h:140
client_state_t::time
int time
Definition: client.h:147
refdef_t::height
int height
Definition: ref.h:122
CS_SKYAXIS
#define CS_SKYAXIS
Definition: q_shared.h:1128
refexport_t::RegisterModel
struct model_s *(* RegisterModel)(char *name)
Definition: ref.h:176
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:736
CM_InlineModel
cmodel_t * CM_InlineModel(char *name)
Definition: cmodel.c:639
cl_testlights
cvar_t * cl_testlights
Definition: cl_view.c:37
r_particles
particle_t r_particles[MAX_PARTICLES]
Definition: cl_view.c:50
particle_t::origin
vec3_t origin
Definition: ref.h:98
name
cvar_t * name
Definition: cl_main.c:94
client_state_t::image_precache
struct image_s * image_precache[MAX_IMAGES]
Definition: client.h:187
refexport_t::BeginRegistration
void(* BeginRegistration)(char *map)
Definition: ref.h:175
lightstyle_t
Definition: ref.h:114
clientinfo_t::skin
struct image_s * skin
Definition: client.h:95
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:157
model_s::maxs
vec3_t maxs
Definition: r_model.h:185
CL_Trace
trace_t CL_Trace(vec3_t start, vec3_t end, float size, int contentmask)
SCR_AddDirtyPoint
void SCR_AddDirtyPoint(int x, int y)
Definition: cl_scrn.c:675
re
refexport_t re
Definition: vid_dll.c:31
frame_t::playerstate
player_state_t playerstate
Definition: client.h:70
V_AddEntity
void V_AddEntity(entity_t *ent)
Definition: cl_view.c:97
client_state_t::v_right
vec3_t v_right
Definition: client.h:153
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:158
crosshair_pic
char crosshair_pic[MAX_QPATH]
Definition: cl_scrn.c:69
refdef_t::lightstyles
lightstyle_t * lightstyles
Definition: ref.h:132
refdef_t::particles
particle_t * particles
Definition: ref.h:141
vrect_s::width
int width
Definition: vid.h:24
refdef_t::num_entities
int num_entities
Definition: ref.h:134
refexport_t::SetSky
void(* SetSky)(char *name, float rotate, vec3_t axis)
Definition: ref.h:179
r_numdlights
int r_numdlights
Definition: cl_view.c:43
client_static_t::state
connstate_t state
Definition: client.h:224
dlight_t
Definition: ref.h:84
cl_timedemo
cvar_t * cl_timedemo
Definition: cl_main.c:76
entity_s
Definition: ref.h:49
cl_testentities
cvar_t * cl_testentities
Definition: cl_view.c:36
log_stats_file
FILE * log_stats_file
Definition: common.c:37
refdef_t::fov_x
float fov_x
Definition: ref.h:123
refdef_t::fov_y
float fov_y
Definition: ref.h:123
particle_t::color
int color
Definition: ref.h:99
client_state_t::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:178
refdef_t::dlights
dlight_t * dlights
Definition: ref.h:138
refdef_t::width
int width
Definition: ref.h:122
CL_RegisterTEntModels
void CL_RegisterTEntModels(void)
Definition: cl_tent.c:188
lightstyle_t::white
float white
Definition: ref.h:117
VectorSet
#define VectorSet(v, x, y, z)
Definition: q_shared.h:161
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:102
refdef_t::viewangles
float viewangles[3]
Definition: ref.h:125
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
refdef_t::entities
entity_t * entities
Definition: ref.h:135
refdef_t::x
int x
Definition: ref.h:122
cls
client_static_t cls
Definition: cl_main.c:105
V_Gun_Model_f
void V_Gun_Model_f(void)
Definition: cl_view.c:450
V_TestLights
void V_TestLights(void)
Definition: cl_view.c:261
r_dlights
dlight_t r_dlights[MAX_DLIGHTS]
Definition: cl_view.c:44
r_numparticles
int r_numparticles
Definition: cl_view.c:49
CL_LoadClientinfo
void CL_LoadClientinfo(clientinfo_t *ci, char *s)
Definition: cl_parse.c:387
r_lightstyles
lightstyle_t r_lightstyles[MAX_LIGHTSTYLES]
Definition: cl_view.c:52
MAX_LIGHTSTYLES
#define MAX_LIGHTSTYLES
Definition: q_shared.h:81
scr_vrect
vrect_t scr_vrect
Definition: cl_scrn.c:44
cl
client_state_t cl
Definition: cl_main.c:106
MAX_IMAGES
#define MAX_IMAGES
Definition: q_shared.h:84
dlight_t::intensity
float intensity
Definition: ref.h:93
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:127
crosshair_width
int crosshair_width
Definition: cl_scrn.c:70
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
refexport_t::RenderFrame
void(* RenderFrame)(refdef_t *fd)
Definition: ref.h:182
client.h
V_AddLight
void V_AddLight(vec3_t org, float intensity, float r, float g, float b)
Definition: cl_view.c:157
vrect_s::y
int y
Definition: vid.h:24
Cvar_VariableValue
float Cvar_VariableValue(char *var_name)
Definition: cvar.c:63
MAX_PARTICLES
#define MAX_PARTICLES
Definition: ref.h:27