vkQuake2 doxygen  1.0 dev
gl_mesh.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 // gl_mesh.c: triangle model functions
21 
22 #include "gl_local.h"
23 
24 /*
25 =============================================================
26 
27  ALIAS MODELS
28 
29 =============================================================
30 */
31 
32 #define NUMVERTEXNORMALS 162
33 
35 #include "anorms.h"
36 };
37 
38 typedef float vec4_t[4];
39 
41 //static vec3_t lerped[MAX_VERTS];
42 
44 float shadelight[3];
45 
46 // precalculated dot products for quantized angles
47 #define SHADEDOT_QUANT 16
49 #include "anormtab.h"
50 ;
51 
53 
54 void GL_LerpVerts( int nverts, dtrivertx_t *v, dtrivertx_t *ov, dtrivertx_t *verts, float *lerp, float move[3], float frontv[3], float backv[3] )
55 {
56  int i;
57 
58  //PMM -- added RF_SHELL_DOUBLE, RF_SHELL_HALF_DAM
60  {
61  for (i=0 ; i < nverts; i++, v++, ov++, lerp+=4 )
62  {
63  float *normal = r_avertexnormals[verts[i].lightnormalindex];
64 
65  lerp[0] = move[0] + ov->v[0]*backv[0] + v->v[0]*frontv[0] + normal[0] * POWERSUIT_SCALE;
66  lerp[1] = move[1] + ov->v[1]*backv[1] + v->v[1]*frontv[1] + normal[1] * POWERSUIT_SCALE;
67  lerp[2] = move[2] + ov->v[2]*backv[2] + v->v[2]*frontv[2] + normal[2] * POWERSUIT_SCALE;
68  }
69  }
70  else
71  {
72  for (i=0 ; i < nverts; i++, v++, ov++, lerp+=4)
73  {
74  lerp[0] = move[0] + ov->v[0]*backv[0] + v->v[0]*frontv[0];
75  lerp[1] = move[1] + ov->v[1]*backv[1] + v->v[1]*frontv[1];
76  lerp[2] = move[2] + ov->v[2]*backv[2] + v->v[2]*frontv[2];
77  }
78  }
79 
80 }
81 
82 /*
83 =============
84 GL_DrawAliasFrameLerp
85 
86 interpolates between two frames and origins
87 FIXME: batch lerp all vertexes
88 =============
89 */
90 void GL_DrawAliasFrameLerp (dmdl_t *paliashdr, float backlerp)
91 {
92  float l;
93  daliasframe_t *frame, *oldframe;
94  dtrivertx_t *v, *ov, *verts;
95  int *order;
96  int count;
97  float frontlerp;
98  float alpha;
99  vec3_t move, delta, vectors[3];
100  vec3_t frontv, backv;
101  int i;
102  int index_xyz;
103  float *lerp;
104 
105  frame = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
106  + currententity->frame * paliashdr->framesize);
107  verts = v = frame->verts;
108 
109  oldframe = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
110  + currententity->oldframe * paliashdr->framesize);
111  ov = oldframe->verts;
112 
113  order = (int *)((byte *)paliashdr + paliashdr->ofs_glcmds);
114 
115 // glTranslatef (frame->translate[0], frame->translate[1], frame->translate[2]);
116 // glScalef (frame->scale[0], frame->scale[1], frame->scale[2]);
117 
120  else
121  alpha = 1.0;
122 
123  // PMM - added double shell
125  qglDisable( GL_TEXTURE_2D );
126 
127  frontlerp = 1.0 - backlerp;
128 
129  // move should be the delta back to the previous frame * backlerp
131  AngleVectors (currententity->angles, vectors[0], vectors[1], vectors[2]);
132 
133  move[0] = DotProduct (delta, vectors[0]); // forward
134  move[1] = -DotProduct (delta, vectors[1]); // left
135  move[2] = DotProduct (delta, vectors[2]); // up
136 
137  VectorAdd (move, oldframe->translate, move);
138 
139  for (i=0 ; i<3 ; i++)
140  {
141  move[i] = backlerp*move[i] + frontlerp*frame->translate[i];
142  }
143 
144  for (i=0 ; i<3 ; i++)
145  {
146  frontv[i] = frontlerp*frame->scale[i];
147  backv[i] = backlerp*oldframe->scale[i];
148  }
149 
150  lerp = s_lerped[0];
151 
152  GL_LerpVerts( paliashdr->num_xyz, v, ov, verts, lerp, move, frontv, backv );
153 
154  if ( gl_vertex_arrays->value )
155  {
156  float colorArray[MAX_VERTS*4];
157 
158  qglEnableClientState( GL_VERTEX_ARRAY );
159  qglVertexPointer( 3, GL_FLOAT, 16, s_lerped ); // padded for SIMD
160 
161 // if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE ) )
162  // PMM - added double damage shell
164  {
165  qglColor4f( shadelight[0], shadelight[1], shadelight[2], alpha );
166  }
167  else
168  {
169  qglEnableClientState( GL_COLOR_ARRAY );
170  qglColorPointer( 3, GL_FLOAT, 0, colorArray );
171 
172  //
173  // pre light everything
174  //
175  for ( i = 0; i < paliashdr->num_xyz; i++ )
176  {
177  float l = shadedots[verts[i].lightnormalindex];
178 
179  colorArray[i*3+0] = l * shadelight[0];
180  colorArray[i*3+1] = l * shadelight[1];
181  colorArray[i*3+2] = l * shadelight[2];
182  }
183  }
184 
185  if ( qglLockArraysEXT != 0 )
186  qglLockArraysEXT( 0, paliashdr->num_xyz );
187 
188  while (1)
189  {
190  // get the vertex count and primitive type
191  count = *order++;
192  if (!count)
193  break; // done
194  if (count < 0)
195  {
196  count = -count;
197  qglBegin (GL_TRIANGLE_FAN);
198  }
199  else
200  {
201  qglBegin (GL_TRIANGLE_STRIP);
202  }
203 
204  // PMM - added double damage shell
206  {
207  do
208  {
209  index_xyz = order[2];
210  order += 3;
211 
212  qglVertex3fv( s_lerped[index_xyz] );
213 
214  } while (--count);
215  }
216  else
217  {
218  do
219  {
220  // texture coordinates come from the draw list
221  qglTexCoord2f (((float *)order)[0], ((float *)order)[1]);
222  index_xyz = order[2];
223 
224  order += 3;
225 
226  // normals and vertexes come from the frame list
227 // l = shadedots[verts[index_xyz].lightnormalindex];
228 
229 // qglColor4f (l* shadelight[0], l*shadelight[1], l*shadelight[2], alpha);
230  qglArrayElement( index_xyz );
231 
232  } while (--count);
233  }
234  qglEnd ();
235  }
236 
237  if ( qglUnlockArraysEXT != 0 )
238  qglUnlockArraysEXT();
239  }
240  else
241  {
242  while (1)
243  {
244  // get the vertex count and primitive type
245  count = *order++;
246  if (!count)
247  break; // done
248  if (count < 0)
249  {
250  count = -count;
251  qglBegin (GL_TRIANGLE_FAN);
252  }
253  else
254  {
255  qglBegin (GL_TRIANGLE_STRIP);
256  }
257 
259  {
260  do
261  {
262  index_xyz = order[2];
263  order += 3;
264 
265  qglColor4f( shadelight[0], shadelight[1], shadelight[2], alpha);
266  qglVertex3fv (s_lerped[index_xyz]);
267 
268  } while (--count);
269  }
270  else
271  {
272  do
273  {
274  // texture coordinates come from the draw list
275  qglTexCoord2f (((float *)order)[0], ((float *)order)[1]);
276  index_xyz = order[2];
277  order += 3;
278 
279  // normals and vertexes come from the frame list
280  l = shadedots[verts[index_xyz].lightnormalindex];
281 
282  qglColor4f (l* shadelight[0], l*shadelight[1], l*shadelight[2], alpha);
283  qglVertex3fv (s_lerped[index_xyz]);
284  } while (--count);
285  }
286 
287  qglEnd ();
288  }
289  }
290 
291 // if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE ) )
292  // PMM - added double damage shell
294  qglEnable( GL_TEXTURE_2D );
295 }
296 
297 
298 #if 1
299 /*
300 =============
301 GL_DrawAliasShadow
302 =============
303 */
304 extern vec3_t lightspot;
305 
306 void GL_DrawAliasShadow (dmdl_t *paliashdr, int posenum)
307 {
308  dtrivertx_t *verts;
309  int *order;
310  vec3_t point;
311  float height, lheight;
312  int count;
313  daliasframe_t *frame;
314 
315  lheight = currententity->origin[2] - lightspot[2];
316 
317  frame = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
318  + currententity->frame * paliashdr->framesize);
319  verts = frame->verts;
320 
321  height = 0;
322 
323  order = (int *)((byte *)paliashdr + paliashdr->ofs_glcmds);
324 
325  height = -lheight + 1.0;
326 
327  while (1)
328  {
329  // get the vertex count and primitive type
330  count = *order++;
331  if (!count)
332  break; // done
333  if (count < 0)
334  {
335  count = -count;
336  qglBegin (GL_TRIANGLE_FAN);
337  }
338  else
339  qglBegin (GL_TRIANGLE_STRIP);
340 
341  do
342  {
343  // normals and vertexes come from the frame list
344 /*
345  point[0] = verts[order[2]].v[0] * frame->scale[0] + frame->translate[0];
346  point[1] = verts[order[2]].v[1] * frame->scale[1] + frame->translate[1];
347  point[2] = verts[order[2]].v[2] * frame->scale[2] + frame->translate[2];
348 */
349 
350  memcpy( point, s_lerped[order[2]], sizeof( point ) );
351 
352  point[0] -= shadevector[0]*(point[2]+lheight);
353  point[1] -= shadevector[1]*(point[2]+lheight);
354  point[2] = height;
355 // height -= 0.001;
356  qglVertex3fv (point);
357 
358  order += 3;
359 
360 // verts++;
361 
362  } while (--count);
363 
364  qglEnd ();
365  }
366 }
367 
368 #endif
369 
370 /*
371 ** R_CullAliasModel
372 */
374 {
375  int i;
376  vec3_t mins, maxs;
377  dmdl_t *paliashdr;
378  vec3_t vectors[3];
379  vec3_t thismins, oldmins, thismaxs, oldmaxs;
380  daliasframe_t *pframe, *poldframe;
381  vec3_t angles;
382 
383  paliashdr = (dmdl_t *)currentmodel->extradata;
384 
385  if ( ( e->frame >= paliashdr->num_frames ) || ( e->frame < 0 ) )
386  {
387  ri.Con_Printf (PRINT_ALL, "R_CullAliasModel %s: no such frame %d\n",
388  currentmodel->name, e->frame);
389  e->frame = 0;
390  }
391  if ( ( e->oldframe >= paliashdr->num_frames ) || ( e->oldframe < 0 ) )
392  {
393  ri.Con_Printf (PRINT_ALL, "R_CullAliasModel %s: no such oldframe %d\n",
394  currentmodel->name, e->oldframe);
395  e->oldframe = 0;
396  }
397 
398  pframe = ( daliasframe_t * ) ( ( byte * ) paliashdr +
399  paliashdr->ofs_frames +
400  e->frame * paliashdr->framesize);
401 
402  poldframe = ( daliasframe_t * ) ( ( byte * ) paliashdr +
403  paliashdr->ofs_frames +
404  e->oldframe * paliashdr->framesize);
405 
406  /*
407  ** compute axially aligned mins and maxs
408  */
409  if ( pframe == poldframe )
410  {
411  for ( i = 0; i < 3; i++ )
412  {
413  mins[i] = pframe->translate[i];
414  maxs[i] = mins[i] + pframe->scale[i]*255;
415  }
416  }
417  else
418  {
419  for ( i = 0; i < 3; i++ )
420  {
421  thismins[i] = pframe->translate[i];
422  thismaxs[i] = thismins[i] + pframe->scale[i]*255;
423 
424  oldmins[i] = poldframe->translate[i];
425  oldmaxs[i] = oldmins[i] + poldframe->scale[i]*255;
426 
427  if ( thismins[i] < oldmins[i] )
428  mins[i] = thismins[i];
429  else
430  mins[i] = oldmins[i];
431 
432  if ( thismaxs[i] > oldmaxs[i] )
433  maxs[i] = thismaxs[i];
434  else
435  maxs[i] = oldmaxs[i];
436  }
437  }
438 
439  /*
440  ** compute a full bounding box
441  */
442  for ( i = 0; i < 8; i++ )
443  {
444  vec3_t tmp;
445 
446  if ( i & 1 )
447  tmp[0] = mins[0];
448  else
449  tmp[0] = maxs[0];
450 
451  if ( i & 2 )
452  tmp[1] = mins[1];
453  else
454  tmp[1] = maxs[1];
455 
456  if ( i & 4 )
457  tmp[2] = mins[2];
458  else
459  tmp[2] = maxs[2];
460 
461  VectorCopy( tmp, bbox[i] );
462  }
463 
464  /*
465  ** rotate the bounding box
466  */
467  VectorCopy( e->angles, angles );
468  angles[YAW] = -angles[YAW];
469  AngleVectors( angles, vectors[0], vectors[1], vectors[2] );
470 
471  for ( i = 0; i < 8; i++ )
472  {
473  vec3_t tmp;
474 
475  VectorCopy( bbox[i], tmp );
476 
477  bbox[i][0] = DotProduct( vectors[0], tmp );
478  bbox[i][1] = -DotProduct( vectors[1], tmp );
479  bbox[i][2] = DotProduct( vectors[2], tmp );
480 
481  VectorAdd( e->origin, bbox[i], bbox[i] );
482  }
483 
484  {
485  int p, f, aggregatemask = ~0;
486 
487  for ( p = 0; p < 8; p++ )
488  {
489  int mask = 0;
490 
491  for ( f = 0; f < 4; f++ )
492  {
493  float dp = DotProduct( frustum[f].normal, bbox[p] );
494 
495  if ( ( dp - frustum[f].dist ) < 0 )
496  {
497  mask |= ( 1 << f );
498  }
499  }
500 
501  aggregatemask &= mask;
502  }
503 
504  if ( aggregatemask )
505  {
506  return true;
507  }
508 
509  return false;
510  }
511 }
512 
513 /*
514 =================
515 R_DrawAliasModel
516 
517 =================
518 */
520 {
521  int i;
522  dmdl_t *paliashdr;
523  float an;
524  vec3_t bbox[8];
525  image_t *skin;
526 
527  if ( !( e->flags & RF_WEAPONMODEL ) )
528  {
529  if ( R_CullAliasModel( bbox, e ) )
530  return;
531  }
532 
533  if ( e->flags & RF_WEAPONMODEL )
534  {
535  if ( r_lefthand->value == 2 )
536  return;
537  }
538 
539  paliashdr = (dmdl_t *)currentmodel->extradata;
540 
541  //
542  // get lighting information
543  //
544  // PMM - rewrote, reordered to handle new shells & mixing
545  // PMM - 3.20 code .. replaced with original way of doing it to keep mod authors happy
546  //
548  {
551  {
552  shadelight[0] = 0.56;
553  shadelight[1] = 0.59;
554  shadelight[2] = 0.45;
555  }
557  {
558  shadelight[0] = 0.9;
559  shadelight[1] = 0.7;
560  }
562  shadelight[0] = 1.0;
564  shadelight[1] = 1.0;
566  shadelight[2] = 1.0;
567  }
568 /*
569  // PMM -special case for godmode
570  if ( (currententity->flags & RF_SHELL_RED) &&
571  (currententity->flags & RF_SHELL_BLUE) &&
572  (currententity->flags & RF_SHELL_GREEN) )
573  {
574  for (i=0 ; i<3 ; i++)
575  shadelight[i] = 1.0;
576  }
577  else if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_DOUBLE ) )
578  {
579  VectorClear (shadelight);
580 
581  if ( currententity->flags & RF_SHELL_RED )
582  {
583  shadelight[0] = 1.0;
584  if (currententity->flags & (RF_SHELL_BLUE|RF_SHELL_DOUBLE) )
585  shadelight[2] = 1.0;
586  }
587  else if ( currententity->flags & RF_SHELL_BLUE )
588  {
589  if ( currententity->flags & RF_SHELL_DOUBLE )
590  {
591  shadelight[1] = 1.0;
592  shadelight[2] = 1.0;
593  }
594  else
595  {
596  shadelight[2] = 1.0;
597  }
598  }
599  else if ( currententity->flags & RF_SHELL_DOUBLE )
600  {
601  shadelight[0] = 0.9;
602  shadelight[1] = 0.7;
603  }
604  }
605  else if ( currententity->flags & ( RF_SHELL_HALF_DAM | RF_SHELL_GREEN ) )
606  {
607  VectorClear (shadelight);
608  // PMM - new colors
609  if ( currententity->flags & RF_SHELL_HALF_DAM )
610  {
611  shadelight[0] = 0.56;
612  shadelight[1] = 0.59;
613  shadelight[2] = 0.45;
614  }
615  if ( currententity->flags & RF_SHELL_GREEN )
616  {
617  shadelight[1] = 1.0;
618  }
619  }
620  }
621  //PMM - ok, now flatten these down to range from 0 to 1.0.
622  // max_shell_val = max(shadelight[0], max(shadelight[1], shadelight[2]));
623  // if (max_shell_val > 0)
624  // {
625  // for (i=0; i<3; i++)
626  // {
627  // shadelight[i] = shadelight[i] / max_shell_val;
628  // }
629  // }
630  // pmm
631 */
632  else if ( currententity->flags & RF_FULLBRIGHT )
633  {
634  for (i=0 ; i<3 ; i++)
635  shadelight[i] = 1.0;
636  }
637  else
638  {
640 
641  // player lighting hack for communication back to server
642  // big hack!
644  {
645  // pick the greatest component, which should be the same
646  // as the mono value returned by software
647  if (shadelight[0] > shadelight[1])
648  {
649  if (shadelight[0] > shadelight[2])
650  r_lightlevel->value = 150*shadelight[0];
651  else
652  r_lightlevel->value = 150*shadelight[2];
653  }
654  else
655  {
656  if (shadelight[1] > shadelight[2])
657  r_lightlevel->value = 150*shadelight[1];
658  else
659  r_lightlevel->value = 150*shadelight[2];
660  }
661 
662  }
663 
664  if ( gl_monolightmap->string[0] != '0' )
665  {
666  float s = shadelight[0];
667 
668  if ( s < shadelight[1] )
669  s = shadelight[1];
670  if ( s < shadelight[2] )
671  s = shadelight[2];
672 
673  shadelight[0] = s;
674  shadelight[1] = s;
675  shadelight[2] = s;
676  }
677  }
678 
680  {
681  for (i=0 ; i<3 ; i++)
682  if (shadelight[i] > 0.1)
683  break;
684  if (i == 3)
685  {
686  shadelight[0] = 0.1;
687  shadelight[1] = 0.1;
688  shadelight[2] = 0.1;
689  }
690  }
691 
692  if ( currententity->flags & RF_GLOW )
693  { // bonus items will pulse with time
694  float scale;
695  float min;
696 
697  scale = 0.1 * sin(r_newrefdef.time*7);
698  for (i=0 ; i<3 ; i++)
699  {
700  min = shadelight[i] * 0.8;
701  shadelight[i] += scale;
702  if (shadelight[i] < min)
703  shadelight[i] = min;
704  }
705  }
706 
707 // =================
708 // PGM ir goggles color override
710  {
711  shadelight[0] = 1.0;
712  shadelight[1] = 0.0;
713  shadelight[2] = 0.0;
714  }
715 // PGM
716 // =================
717 
719 
720  an = currententity->angles[1]/180*M_PI;
721  shadevector[0] = cos(-an);
722  shadevector[1] = sin(-an);
723  shadevector[2] = 1;
725 
726  //
727  // locate the proper data
728  //
729 
730  c_alias_polys += paliashdr->num_tris;
731 
732  //
733  // draw all the triangles
734  //
735  if (currententity->flags & RF_DEPTHHACK) // hack the depth range to prevent view model from poking into walls
736  qglDepthRange (gldepthmin, gldepthmin + 0.3*(gldepthmax-gldepthmin));
737 
738  if ( ( currententity->flags & RF_WEAPONMODEL ) && ( r_lefthand->value == 1.0F ) )
739  {
740  extern void MYgluPerspective( GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar );
741 
742  qglMatrixMode( GL_PROJECTION );
743  qglPushMatrix();
744  qglLoadIdentity();
745  qglScalef( -1, 1, 1 );
747  qglMatrixMode( GL_MODELVIEW );
748 
749  qglCullFace( GL_BACK );
750  }
751 
752  qglPushMatrix ();
753  e->angles[PITCH] = -e->angles[PITCH]; // sigh.
754  R_RotateForEntity (e);
755  e->angles[PITCH] = -e->angles[PITCH]; // sigh.
756 
757  // select skin
758  if (currententity->skin)
759  skin = currententity->skin; // custom player skin
760  else
761  {
763  skin = currentmodel->skins[0];
764  else
765  {
767  if (!skin)
768  skin = currentmodel->skins[0];
769  }
770  }
771  if (!skin)
772  skin = r_notexture; // fallback...
773  GL_Bind(skin->texnum);
774 
775  // draw it
776 
777  qglShadeModel (GL_SMOOTH);
778 
779  GL_TexEnv( GL_MODULATE );
781  {
782  qglEnable (GL_BLEND);
783  }
784 
785 
786  if ( (currententity->frame >= paliashdr->num_frames)
787  || (currententity->frame < 0) )
788  {
789  ri.Con_Printf (PRINT_ALL, "R_DrawAliasModel %s: no such frame %d\n",
791  currententity->frame = 0;
792  currententity->oldframe = 0;
793  }
794 
795  if ( (currententity->oldframe >= paliashdr->num_frames)
796  || (currententity->oldframe < 0))
797  {
798  ri.Con_Printf (PRINT_ALL, "R_DrawAliasModel %s: no such oldframe %d\n",
800  currententity->frame = 0;
801  currententity->oldframe = 0;
802  }
803 
804  if ( !r_lerpmodels->value )
805  currententity->backlerp = 0;
807 
808  GL_TexEnv( GL_REPLACE );
809  qglShadeModel (GL_FLAT);
810 
811  qglPopMatrix ();
812 
813 #if 0
814  qglDisable( GL_CULL_FACE );
815  qglPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
816  qglDisable( GL_TEXTURE_2D );
817  qglBegin( GL_TRIANGLE_STRIP );
818  for ( i = 0; i < 8; i++ )
819  {
820  qglVertex3fv( bbox[i] );
821  }
822  qglEnd();
823  qglEnable( GL_TEXTURE_2D );
824  qglPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
825  qglEnable( GL_CULL_FACE );
826 #endif
827 
828  if ( ( currententity->flags & RF_WEAPONMODEL ) && ( r_lefthand->value == 1.0F ) )
829  {
830  qglMatrixMode( GL_PROJECTION );
831  qglPopMatrix();
832  qglMatrixMode( GL_MODELVIEW );
833  qglCullFace( GL_FRONT );
834  }
835 
837  {
838  qglDisable (GL_BLEND);
839  }
840 
842  qglDepthRange (gldepthmin, gldepthmax);
843 
844 #if 1
846  {
847  qglPushMatrix ();
848  R_RotateForEntity (e);
849  qglDisable (GL_TEXTURE_2D);
850  qglEnable (GL_BLEND);
851  qglColor4f (0,0,0,0.5);
852  GL_DrawAliasShadow (paliashdr, currententity->frame );
853  qglEnable (GL_TEXTURE_2D);
854  qglDisable (GL_BLEND);
855  qglPopMatrix ();
856  }
857 #endif
858  qglColor4f (1,1,1,1);
859 }
860 
861 
RF_TRANSLUCENT
#define RF_TRANSLUCENT
Definition: q_shared.h:604
dtrivertx_t::lightnormalindex
byte lightnormalindex
Definition: qfiles.h:110
RF_SHELL_RED
#define RF_SHELL_RED
Definition: q_shared.h:609
dmdl_t::ofs_glcmds
int ofs_glcmds
Definition: qfiles.h:157
height
GLsizei height
Definition: qgl_win.c:69
currentmodel
model_t * currentmodel
Definition: r_main.c:39
entity_s::skin
struct image_s * skin
Definition: ref.h:75
YAW
#define YAW
Definition: q_shared.h:73
entity_s::origin
float origin[3]
Definition: ref.h:57
RF_IR_VISIBLE
#define RF_IR_VISIBLE
Definition: q_shared.h:614
daliasframe_t::scale
float scale[3]
Definition: qfiles.h:121
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
gl_vertex_arrays
cvar_t * gl_vertex_arrays
Definition: gl_rmain.c:94
RF_MINLIGHT
#define RF_MINLIGHT
Definition: q_shared.h:599
VectorSubtract
#define VectorSubtract(a, b, c)
Definition: q_shared.h:163
RF_SHELL_HALF_DAM
#define RF_SHELL_HALF_DAM
Definition: q_shared.h:616
r_notexture
image_t * r_notexture
Definition: gl_rmain.c:44
gl_shadows
cvar_t * gl_shadows
Definition: gl_rmain.c:114
ri
refimport_t ri
Definition: r_main.c:25
RF_SHELL_GREEN
#define RF_SHELL_GREEN
Definition: q_shared.h:610
v
GLdouble v
Definition: qgl_win.c:143
zNear
GLdouble GLdouble GLdouble GLdouble zNear
Definition: qgl_win.c:159
dmdl_t::num_tris
int num_tris
Definition: qfiles.h:149
gldepthmax
float gldepthmax
Definition: gl_local.h:129
frustum
cplane_t frustum[4]
Definition: gl_rmain.c:50
R_LightPoint
void R_LightPoint(vec3_t p, vec3_t color)
Definition: r_light.c:226
shadevector
vec3_t shadevector
Definition: gl_mesh.c:43
cvar_s::string
char * string
Definition: q_shared.h:327
qboolean
qboolean
Definition: q_shared.h:63
entity_s::skinnum
int skinnum
Definition: ref.h:70
VectorClear
#define VectorClear(a)
Definition: q_shared.h:166
i
int i
Definition: q_shared.c:305
GL_DrawAliasShadow
void GL_DrawAliasShadow(dmdl_t *paliashdr, int posenum)
Definition: gl_mesh.c:306
dtrivertx_t
Definition: qfiles.h:107
PITCH
#define PITCH
Definition: q_shared.h:72
refdef_t::rdflags
int rdflags
Definition: ref.h:110
order
GLdouble GLdouble GLint GLint order
Definition: qgl_win.c:225
entity_s::flags
int flags
Definition: ref.h:76
M_PI
#define M_PI
Definition: q_shared.h:142
currententity
entity_t * currententity
Definition: r_bsp.c:28
r_avertexnormal_dots
float r_avertexnormal_dots[SHADEDOT_QUANT][256]
Definition: gl_mesh.c:48
r_lefthand
cvar_t * r_lefthand
Definition: r_main.c:117
model_s::extradata
void * extradata
Definition: r_model.h:235
anormtab.h
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
RF_WEAPONMODEL
#define RF_WEAPONMODEL
Definition: q_shared.h:601
refimport_t::Con_Printf
void(* Con_Printf)(int print_level, char *str,...)
Definition: ref.h:202
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:751
SHADEDOT_QUANT
#define SHADEDOT_QUANT
Definition: gl_mesh.c:47
skin
cvar_t * skin
Definition: cl_main.c:80
shadedots
float * shadedots
Definition: gl_mesh.c:52
entity_s::alpha
float alpha
Definition: ref.h:73
dmdl_t::ofs_frames
int ofs_frames
Definition: qfiles.h:156
r_lerpmodels
cvar_t * r_lerpmodels
Definition: r_main.c:138
s_lerped
static vec4_t s_lerped[MAX_VERTS]
Definition: gl_mesh.c:40
RF_DEPTHHACK
#define RF_DEPTHHACK
Definition: q_shared.h:603
r_avertexnormals
float r_avertexnormals[NUMVERTEXNORMALS][3]
Definition: gl_mesh.c:34
RDF_IRGOGGLES
#define RDF_IRGOGGLES
Definition: q_shared.h:625
min
#define min(a, b)
Definition: vk_local.h:72
GL_Bind
void GL_Bind(int texnum)
Definition: gl_image.c:137
entity_s::oldframe
int oldframe
Definition: ref.h:64
R_CullAliasModel
static qboolean R_CullAliasModel(vec3_t bbox[8], entity_t *e)
Definition: gl_mesh.c:373
RF_SHELL_DOUBLE
#define RF_SHELL_DOUBLE
Definition: q_shared.h:615
r_newrefdef
refdef_t r_newrefdef
Definition: r_main.c:38
R_DrawAliasModel
void R_DrawAliasModel(entity_t *e)
Definition: gl_mesh.c:519
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:162
dmdl_t::num_xyz
int num_xyz
Definition: qfiles.h:147
cvar_s::value
float value
Definition: q_shared.h:331
entity_s::backlerp
float backlerp
Definition: ref.h:69
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: q_shared.c:681
dmdl_t::framesize
int framesize
Definition: qfiles.h:144
refdef_t::time
float time
Definition: ref.h:109
RF_GLOW
#define RF_GLOW
Definition: q_shared.h:608
anorms.h
daliasframe_t::translate
float translate[3]
Definition: qfiles.h:122
alpha
GLfloat GLfloat GLfloat alpha
Definition: qgl_win.c:74
refdef_t::height
int height
Definition: ref.h:104
MAX_MD2SKINS
#define MAX_MD2SKINS
Definition: qfiles.h:92
MYgluPerspective
void MYgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
Definition: gl_rmain.c:682
GL_DrawAliasFrameLerp
void GL_DrawAliasFrameLerp(dmdl_t *paliashdr, float backlerp)
Definition: gl_mesh.c:90
r_lightlevel
cvar_t * r_lightlevel
Definition: r_main.c:142
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:164
s
static fixed16_t s
Definition: r_scan.c:30
entity_s::frame
int frame
Definition: ref.h:58
zFar
GLclampd zFar
Definition: qgl_win.c:125
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
model_s::skins
image_t * skins[MAX_MD2SKINS]
Definition: r_model.h:234
MAX_VERTS
#define MAX_VERTS
Definition: qfiles.h:90
c_alias_polys
int c_alias_polys
Definition: gl_local.h:157
model_s::name
char name[MAX_QPATH]
Definition: r_model.h:173
POWERSUIT_SCALE
#define POWERSUIT_SCALE
Definition: ref.h:30
lightspot
vec3_t lightspot
Definition: r_light.c:118
entity_s
Definition: ref.h:49
RF_FULLBRIGHT
#define RF_FULLBRIGHT
Definition: q_shared.h:602
GL_TexEnv
void GL_TexEnv(GLenum mode)
Definition: gl_image.c:126
daliasframe_t
Definition: qfiles.h:119
shadelight
float shadelight[3]
Definition: gl_mesh.c:44
NUMVERTEXNORMALS
#define NUMVERTEXNORMALS
Definition: gl_mesh.c:32
gl_local.h
refdef_t::fov_y
float fov_y
Definition: ref.h:105
daliasframe_t::verts
dtrivertx_t verts[1]
Definition: qfiles.h:124
R_RotateForEntity
void R_RotateForEntity(entity_t *e)
Definition: gl_rmain.c:165
refdef_t::width
int width
Definition: ref.h:104
RF_SHELL_BLUE
#define RF_SHELL_BLUE
Definition: q_shared.h:611
image_s
Definition: r_local.h:71
mask
GLint GLuint mask
Definition: qgl_win.c:317
gldepthmin
float gldepthmin
Definition: gl_rmain.c:39
gl_monolightmap
cvar_t * gl_monolightmap
Definition: gl_rmain.c:117
entity_s::oldorigin
float oldorigin[3]
Definition: ref.h:63
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
dmdl_t
Definition: qfiles.h:137
GL_LerpVerts
void GL_LerpVerts(int nverts, dtrivertx_t *v, dtrivertx_t *ov, dtrivertx_t *verts, float *lerp, float move[3], float frontv[3], float backv[3])
Definition: gl_mesh.c:54
entity_s::angles
float angles[3]
Definition: ref.h:52
count
GLint GLsizei count
Definition: qgl_win.c:128
dmdl_t::num_frames
int num_frames
Definition: qfiles.h:151
vec4_t
float vec4_t[4]
Definition: gl_mesh.c:38