742
709
qglDisable( GL_ALPHA_TEST);
745
// MH - detail textures begin
746
// here we draw the detail textures!
747
// we could do this as a multitextured render along with the other stuff, but my own tests
748
// have indicated that for something like this there's no real benefit to be had from doing
749
// so. the difference is in the order of 1 or 2 FPS - the real hit from detail texturing
750
// comes from scrunching large images into small spaces
751
static void R_DrawDetailSurfaces (void)
753
msurface_t *surf = r_detailsurfaces;
762
// we do this rather than checking for 0 (checking for 0 is always bad with floats)
763
// standard 6 decimal place precision
764
if (gl_detailtextures->value < 0.00001)
767
// we *could* use the standard glBindTexture here as we don't need to do any bind checking
768
// but again we'll maintain consistency
769
GL_Bind (r_detailtexture->texnum);
771
// set the correct blending mode
772
qglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
773
qglBlendFunc (GL_DST_COLOR, GL_SRC_COLOR);
774
qglEnable (GL_BLEND);
776
// here we get clever and do our texture scaling in the texture matrix. this saves
777
// us from more runtime calculations in software
778
qglMatrixMode (GL_TEXTURE);
781
// we only need to scale the X and Y co-ords, correcponding to texture s and t.
782
// everyone will have their own favourite scaling amount, so i did a cvar
783
qglScalef (gl_detailtextures->value, gl_detailtextures->value, 1.0);
785
// we can safely leave the texture matrix as the active mode while we're doing the draw
786
for (; surf; surf = surf->detailchain)
788
if (SurfaceIsAlphaBlended(surf))
790
for (p = surf->polys; p; p = p->chain)
792
// using GL_TRIANGLE_FAN is theoretically more efficient than GL_POLYGON as
793
// the GL implementation can know something about what we are going to draw
794
// in advance, and set things up accordingly. the visual result is identical.
795
qglBegin (GL_TRIANGLE_FAN);
797
for (v = p->verts[0], i = 0 ; i < p->numverts; i++, v += VERTEXSIZE)
799
// take the 128 * 128 version of the s and t co-ords
800
qglTexCoord2f (v[7], v[8]);
808
// restore original texture matrix
810
qglMatrixMode (GL_MODELVIEW);
812
// restore original blend
813
qglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
814
qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
815
qglDisable (GL_BLEND);
817
// MH - detail textures end
712
//This next section deals with bumpmapped surfaces. Much of this was gathered from Mike Hiney
713
//and "Paul's Projects" tutorials.
714
static void R_InitNormalSurfaces (void)
718
vec3_t lightAdd, angle;
721
qglActiveTextureARB (GL_TEXTURE0);
722
qglDisable (GL_TEXTURE_2D);
723
qglEnable (GL_TEXTURE_CUBE_MAP_ARB);
725
qglBindTexture (GL_TEXTURE_CUBE_MAP_ARB, r_cubemap->texnum);
726
qglMatrixMode (GL_TEXTURE);
729
// rotate around Y to bring blue/pink to the front
730
qglRotatef (145, 0, 1, 0);
732
// now reposition so that the bright spot is center screen
733
qglRotatef (-45, 1, 0, 0);
734
qglRotatef (-45, 0, 0, 1);
736
// rotate by viewangles
737
qglRotatef (-r_newrefdef.viewangles[2], 1, 0, 0);
738
qglRotatef (-r_newrefdef.viewangles[0], 0, 1, 0);
739
qglRotatef (-r_newrefdef.viewangles[1], 0, 0, 1);
741
//now rotate according to dynamic lights
742
VectorClear(lightAdd);
743
dl = r_newrefdef.dlights;
744
for (lnum=0; lnum<r_newrefdef.num_dlights; lnum++, dl++)
747
VectorSubtract (r_newrefdef.vieworg, dl->origin, angle);
748
add = sqrt(dl->intensity - VectorLength(angle));
749
VectorNormalize(angle);
752
VectorScale(angle, add, angle);
753
VectorAdd (lightAdd, angle, lightAdd);
756
qglRotatef (-lightAdd[2], 1, 0, 0);
757
qglRotatef (-lightAdd[0], 0, 1, 0);
758
qglRotatef (-lightAdd[1], 0, 0, 1);
760
// the next 2 statements will move the cmstr calculations into hardware so that we don;t
761
// have to evaluate them once per vert...
763
// translate after rotation
764
qglTranslatef (r_newrefdef.vieworg[0], r_newrefdef.vieworg[1], r_newrefdef.vieworg[2]);
766
// now flip everything by -1 again to mimic the software calculation
767
// we won't bother batching this part up...
768
qglScalef (-1, -1, -1);
770
qglMatrixMode (GL_MODELVIEW);
772
// basic replace texenv
773
qglTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
776
static void R_DrawNormalSurfaces (void)
778
msurface_t *surf = r_normalsurfaces;
787
if (!gl_normalmaps->value)
790
R_InitNormalSurfaces();
792
qglActiveTextureARB (GL_TEXTURE1);
793
qglEnable (GL_TEXTURE_2D);
795
qglTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
796
qglTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_DOT3_RGB);
797
qglTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB);
798
qglTexEnvi (GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE);
799
qglTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
800
qglTexEnvi (GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR);
802
qglEnable (GL_BLEND);
804
// set the correct blending mode for normal maps
805
qglBlendFunc (GL_ZERO, GL_SRC_COLOR);
807
for (; surf; surf = surf->normalchain)
809
if (SurfaceIsAlphaBlended(surf))
811
if(strcmp(surf->texinfo->normalMap->name, surf->texinfo->image->name))
812
qglBindTexture (GL_TEXTURE_2D, surf->texinfo->normalMap->texnum);
816
for (p = surf->polys; p; p = p->chain)
818
qglBegin (GL_POLYGON);
820
for (v = p->verts[0], i = 0 ; i < p->numverts; i++, v += VERTEXSIZE)
822
qglMTexCoord3fSGIS(GL_TEXTURE0, v[0], v[1], v[2]);
823
qglMTexCoord2fSGIS(GL_TEXTURE1, v[3], v[4]);
832
qglActiveTextureARB (GL_TEXTURE1);
833
qglTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
834
qglDisable (GL_TEXTURE_2D);
837
qglActiveTextureARB (GL_TEXTURE0);
838
qglMatrixMode (GL_TEXTURE);
840
qglMatrixMode (GL_MODELVIEW);
841
qglDisable (GL_TEXTURE_CUBE_MAP_ARB);
842
qglEnable (GL_TEXTURE_2D);
844
// restore original blend
845
qglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
846
qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
847
qglDisable (GL_BLEND);
849
static void R_DrawSpecularSurfaces (void)
851
msurface_t *surf = r_specularsurfaces;
860
if (!gl_normalmaps->value || !gl_specularmaps->value)
863
R_InitNormalSurfaces();
865
qglActiveTextureARB (GL_TEXTURE1);
866
qglEnable (GL_TEXTURE_2D);
867
qglTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
869
qglDepthMask (GL_FALSE);
870
qglEnable (GL_BLEND);
871
qglBlendFunc (GL_ONE, GL_ONE);
873
for (; surf; surf = surf->specularchain)
875
if (SurfaceIsAlphaBlended(surf))
877
if(strcmp(surf->texinfo->specularMap->name, surf->texinfo->image->name))
878
qglBindTexture (GL_TEXTURE_2D, surf->texinfo->specularMap->texnum);
882
for (p = surf->polys; p; p = p->chain)
884
qglBegin (GL_POLYGON);
886
for (v = p->verts[0], i = 0 ; i < p->numverts; i++, v += VERTEXSIZE)
888
qglMTexCoord3fSGIS(GL_TEXTURE0, v[0], v[1], v[2]);
889
qglMTexCoord2fSGIS(GL_TEXTURE1, v[3], v[4]);
898
qglActiveTextureARB (GL_TEXTURE1);
899
qglTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
900
qglDisable (GL_TEXTURE_2D);
903
qglActiveTextureARB (GL_TEXTURE0);
904
qglMatrixMode (GL_TEXTURE);
906
qglMatrixMode (GL_MODELVIEW);
907
qglDisable (GL_TEXTURE_CUBE_MAP_ARB);
908
qglEnable (GL_TEXTURE_2D);
910
// restore original blend
911
qglDepthMask (GL_TRUE);
912
qglTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
913
qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
914
qglDisable (GL_BLEND);
819
917
=================
820
918
R_DrawInlineBModel
1709
1757
GL_EnableMultitexture( false );
1713
========================
1715
draw with vertex array
1716
and ower speedup changes
1717
========================
1721
//sul's minimap thing
1722
void R_RecursiveRadarNode (mnode_t *node)
1724
int c, side, sidebit;
1726
msurface_t *surf, **mark;
1733
if (node->contents == CONTENTS_SOLID) return; // solid
1735
if(r_minimap_zoom->value>=0.1) {
1736
distance = 1024.0/r_minimap_zoom->value;
1741
if ( r_origin[0]+distance < node->minmaxs[0] ||
1742
r_origin[0]-distance > node->minmaxs[3] ||
1743
r_origin[1]+distance < node->minmaxs[1] ||
1744
r_origin[1]-distance > node->minmaxs[4] ||
1745
r_origin[2]+256 < node->minmaxs[2] ||
1746
r_origin[2]-256 > node->minmaxs[5]) return;
1748
// if a leaf node, draw stuff
1749
if (node->contents != -1) {
1750
pleaf = (mleaf_t *)node;
1751
// check for door connected areas
1752
if (r_newrefdef.areabits) {
1754
if (! (r_newrefdef.areabits[pleaf->area>>3] & (1<<(pleaf->area&7)) ) ) return;
1756
mark = pleaf->firstmarksurface;
1757
c = pleaf->nummarksurfaces;
1761
(*mark)->visframe = r_framecount;
1768
// node is just a decision point, so go down the apropriate sides
1769
// find which side of the node we are on
1770
plane = node->plane;
1772
switch (plane->type) {
1774
dot = modelorg[0] - plane->dist;
1777
dot = modelorg[1] - plane->dist;
1780
dot = modelorg[2] - plane->dist;
1783
dot = DotProduct (modelorg, plane->normal) - plane->dist;
1792
sidebit = SURF_PLANEBACK;
1795
// recurse down the children, front side first
1796
R_RecursiveRadarNode (node->children[side]);
1798
if(plane->normal[2]) {
1800
if(plane->normal[2]>0) for ( c = node->numsurfaces, surf = r_worldmodel->surfaces + node->firstsurface; c ; c--, surf++)
1802
if (surf->texinfo->flags & SURF_SKY){
1809
qglDisable(GL_TEXTURE_2D);
1810
for ( c = node->numsurfaces, surf = r_worldmodel->surfaces + node->firstsurface; c ; c--, surf++) {
1812
if (surf->texinfo->flags & SURF_SKY) continue;
1814
if (surf->texinfo->flags & (SURF_WARP|SURF_FLOWING|SURF_TRANS33|SURF_TRANS66)) {
1820
for ( p = surf->polys; p; p = p->chain ) {
1822
qglBegin(GL_LINE_STRIP);
1823
for (i=0 ; i< p->numverts; i++, v+= VERTEXSIZE) {
1824
C[3]= (v[2]-r_origin[2])/512.0;
1853
qglEnable(GL_TEXTURE_2D);
1856
// recurse down the back side
1857
R_RecursiveRadarNode (node->children[!side]);
1865
RadarEnt_t RadarEnts[MAX_RADAR_ENTS];
1867
void GL_DrawRadar(void)
1870
float fS[4]={0,0,-1.0/512.0,0};
1872
if ( r_newrefdef.rdflags & RDF_NOWORLDMODEL ) return;
1873
if(!r_minimap->value) return;
1875
qglViewport (vid.width-r_minimap_size->value,0, r_minimap_size->value, r_minimap_size->value);
1877
qglDisable(GL_DEPTH_TEST);
1878
qglMatrixMode(GL_PROJECTION);
1883
if (r_minimap_style->value) {
1884
qglOrtho(-1024,1024,-1024,1024,-256,256);
1886
qglOrtho(-1024,1024,-512,1536,-256,256);
1889
qglMatrixMode(GL_MODELVIEW);
1895
qglStencilMask(255);
1896
qglClear(GL_STENCIL_BUFFER_BIT);
1897
qglEnable(GL_STENCIL_TEST);
1898
qglStencilFunc(GL_ALWAYS,4,4);
1899
qglStencilOp(GL_KEEP,GL_KEEP,GL_REPLACE);
1902
GLSTATE_ENABLE_ALPHATEST;
1903
qglAlphaFunc(GL_LESS,0.1);
1904
qglColorMask(0,0,0,0);
1906
qglColor4f(1,1,1,1);
1908
GL_Bind(r_around->texnum);
1909
qglBegin(GL_TRIANGLE_FAN);
1910
if (r_minimap_style->value){
1911
qglTexCoord2f(0,1); qglVertex3f(1024,-1024,1);
1912
qglTexCoord2f(1,1); qglVertex3f(-1024,-1024,1);
1913
qglTexCoord2f(1,0); qglVertex3f(-1024,1024,1);
1914
qglTexCoord2f(0,0); qglVertex3f(1024,1024,1);
1916
qglTexCoord2f(0,1); qglVertex3f(1024,-512,1);
1917
qglTexCoord2f(1,1); qglVertex3f(-1024,-512,1);
1918
qglTexCoord2f(1,0); qglVertex3f(-1024,1536,1);
1919
qglTexCoord2f(0,0); qglVertex3f(1024,1536,1);
1923
qglColorMask(1,1,1,1);
1924
GLSTATE_DISABLE_ALPHATEST;
1925
qglAlphaFunc(GL_GREATER, 0.5);
1926
qglStencilOp(GL_KEEP,GL_KEEP,GL_REPLACE);
1927
qglStencilFunc(GL_NOTEQUAL,4,4);
1931
if(r_minimap_zoom->value>=0.1) {
1932
qglScalef(r_minimap_zoom->value,r_minimap_zoom->value,r_minimap_zoom->value);
1935
if (r_minimap_style->value) {
1937
qglRotatef (90-r_newrefdef.viewangles[1], 0, 0, -1);
1939
qglDisable(GL_TEXTURE_2D);
1940
qglBegin(GL_TRIANGLES);
1941
qglColor4f(1,1,1,0.5);
1942
qglVertex3f(0,32,0);
1943
qglColor4f(1,1,0,0.5);
1944
qglVertex3f(24,-32,0);
1945
qglVertex3f(-24,-32,0);
1950
qglDisable(GL_TEXTURE_2D);
1951
qglBegin(GL_TRIANGLES);
1952
qglColor4f(1,1,1,0.5);
1953
qglVertex3f(0,32,0);
1954
qglColor4f(1,1,0,0.5);
1955
qglVertex3f(24,-32,0);
1956
qglVertex3f(-24,-32,0);
1959
qglRotatef (90-r_newrefdef.viewangles[1], 0, 0, 1);
1961
qglTranslatef (-r_newrefdef.vieworg[0], -r_newrefdef.vieworg[1], -r_newrefdef.vieworg[2]);
1964
for(i=0;i<numRadarEnts;i++){
1965
float x=RadarEnts[i].org[0];
1966
float y=RadarEnts[i].org[1];
1967
float z=RadarEnts[i].org[2];
1968
qglColor4fv(RadarEnts[i].color);
1970
qglVertex3f(x+9, y+9, z);
1971
qglVertex3f(x+9, y-9, z);
1972
qglVertex3f(x-9, y-9, z);
1973
qglVertex3f(x-9, y+9, z);
1977
qglEnable(GL_TEXTURE_2D);
1980
GL_Bind(r_radarmap->texnum);
1981
qglBlendFunc(GL_SRC_ALPHA, GL_ONE);
1982
GLSTATE_ENABLE_BLEND;
1985
fS[3]=0.5+ r_newrefdef.vieworg[2]/512.0;
1986
qglTexGenf(GL_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
1988
GLSTATE_ENABLE_TEXGEN;
1989
qglTexGenfv(GL_S,GL_OBJECT_PLANE,fS);
1992
R_RecursiveRadarNode (r_worldmodel->nodes);
1994
qglBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
1995
GLSTATE_DISABLE_TEXGEN;
1999
qglViewport(0,0,vid.width,vid.height);
2001
qglMatrixMode(GL_PROJECTION);
2003
qglMatrixMode(GL_MODELVIEW);
2004
qglDisable(GL_STENCIL_TEST);
2005
GL_TexEnv( GL_REPLACE );
2006
GLSTATE_DISABLE_BLEND;
2007
qglEnable(GL_DEPTH_TEST);
2008
qglColor4f(1,1,1,1);
1761
========================
1763
draw with vertex array
1764
and ower speedup changes
1765
========================
1769
//sul's minimap thing
1770
void R_RecursiveRadarNode (mnode_t *node)
1772
int c, side, sidebit;
1774
msurface_t *surf, **mark;
1781
if (node->contents == CONTENTS_SOLID) return; // solid
1783
if(r_minimap_zoom->value>=0.1) {
1784
distance = 1024.0/r_minimap_zoom->value;
1789
if ( r_origin[0]+distance < node->minmaxs[0] ||
1790
r_origin[0]-distance > node->minmaxs[3] ||
1791
r_origin[1]+distance < node->minmaxs[1] ||
1792
r_origin[1]-distance > node->minmaxs[4] ||
1793
r_origin[2]+256 < node->minmaxs[2] ||
1794
r_origin[2]-256 > node->minmaxs[5]) return;
1796
// if a leaf node, draw stuff
1797
if (node->contents != -1) {
1798
pleaf = (mleaf_t *)node;
1799
// check for door connected areas
1800
if (r_newrefdef.areabits) {
1802
if (! (r_newrefdef.areabits[pleaf->area>>3] & (1<<(pleaf->area&7)) ) ) return;
1804
mark = pleaf->firstmarksurface;
1805
c = pleaf->nummarksurfaces;
1809
(*mark)->visframe = r_framecount;
1816
// node is just a decision point, so go down the apropriate sides
1817
// find which side of the node we are on
1818
plane = node->plane;
1820
switch (plane->type) {
1822
dot = modelorg[0] - plane->dist;
1825
dot = modelorg[1] - plane->dist;
1828
dot = modelorg[2] - plane->dist;
1831
dot = DotProduct (modelorg, plane->normal) - plane->dist;
1840
sidebit = SURF_PLANEBACK;
1843
// recurse down the children, front side first
1844
R_RecursiveRadarNode (node->children[side]);
1846
if(plane->normal[2]) {
1848
if(plane->normal[2]>0) for ( c = node->numsurfaces, surf = r_worldmodel->surfaces + node->firstsurface; c ; c--, surf++)
1850
if (surf->texinfo->flags & SURF_SKY){
1857
qglDisable(GL_TEXTURE_2D);
1858
for ( c = node->numsurfaces, surf = r_worldmodel->surfaces + node->firstsurface; c ; c--, surf++) {
1860
if (surf->texinfo->flags & SURF_SKY) continue;
1862
if (surf->texinfo->flags & (SURF_WARP|SURF_FLOWING|SURF_TRANS33|SURF_TRANS66)) {
1868
for ( p = surf->polys; p; p = p->chain ) {
1870
qglBegin(GL_LINE_STRIP);
1871
for (i=0 ; i< p->numverts; i++, v+= VERTEXSIZE) {
1872
C[3]= (v[2]-r_origin[2])/512.0;
1901
qglEnable(GL_TEXTURE_2D);
1904
// recurse down the back side
1905
R_RecursiveRadarNode (node->children[!side]);
1913
RadarEnt_t RadarEnts[MAX_RADAR_ENTS];
1915
void GL_DrawRadar(void)
1918
float fS[4]={0,0,-1.0/512.0,0};
1920
if ( r_newrefdef.rdflags & RDF_NOWORLDMODEL ) return;
1921
if(!r_minimap->value) return;
1923
qglViewport (vid.width-r_minimap_size->value,0, r_minimap_size->value, r_minimap_size->value);
1925
qglDisable(GL_DEPTH_TEST);
1926
qglMatrixMode(GL_PROJECTION);
1931
if (r_minimap_style->value) {
1932
qglOrtho(-1024,1024,-1024,1024,-256,256);
1934
qglOrtho(-1024,1024,-512,1536,-256,256);
1937
qglMatrixMode(GL_MODELVIEW);
1943
qglStencilMask(255);
1944
qglClear(GL_STENCIL_BUFFER_BIT);
1945
qglEnable(GL_STENCIL_TEST);
1946
qglStencilFunc(GL_ALWAYS,4,4);
1947
qglStencilOp(GL_KEEP,GL_KEEP,GL_REPLACE);
1950
GLSTATE_ENABLE_ALPHATEST;
1951
qglAlphaFunc(GL_LESS,0.1);
1952
qglColorMask(0,0,0,0);
1954
qglColor4f(1,1,1,1);
1956
GL_Bind(r_around->texnum);
1957
qglBegin(GL_TRIANGLE_FAN);
1958
if (r_minimap_style->value){
1959
qglTexCoord2f(0,1); qglVertex3f(1024,-1024,1);
1960
qglTexCoord2f(1,1); qglVertex3f(-1024,-1024,1);
1961
qglTexCoord2f(1,0); qglVertex3f(-1024,1024,1);
1962
qglTexCoord2f(0,0); qglVertex3f(1024,1024,1);
1964
qglTexCoord2f(0,1); qglVertex3f(1024,-512,1);
1965
qglTexCoord2f(1,1); qglVertex3f(-1024,-512,1);
1966
qglTexCoord2f(1,0); qglVertex3f(-1024,1536,1);
1967
qglTexCoord2f(0,0); qglVertex3f(1024,1536,1);
1971
qglColorMask(1,1,1,1);
1972
GLSTATE_DISABLE_ALPHATEST;
1973
qglAlphaFunc(GL_GREATER, 0.5);
1974
qglStencilOp(GL_KEEP,GL_KEEP,GL_REPLACE);
1975
qglStencilFunc(GL_NOTEQUAL,4,4);
1979
if(r_minimap_zoom->value>=0.1) {
1980
qglScalef(r_minimap_zoom->value,r_minimap_zoom->value,r_minimap_zoom->value);
1983
if (r_minimap_style->value) {
1985
qglRotatef (90-r_newrefdef.viewangles[1], 0, 0, -1);
1987
qglDisable(GL_TEXTURE_2D);
1988
qglBegin(GL_TRIANGLES);
1989
qglColor4f(1,1,1,0.5);
1990
qglVertex3f(0,32,0);
1991
qglColor4f(1,1,0,0.5);
1992
qglVertex3f(24,-32,0);
1993
qglVertex3f(-24,-32,0);
1998
qglDisable(GL_TEXTURE_2D);
1999
qglBegin(GL_TRIANGLES);
2000
qglColor4f(1,1,1,0.5);
2001
qglVertex3f(0,32,0);
2002
qglColor4f(1,1,0,0.5);
2003
qglVertex3f(24,-32,0);
2004
qglVertex3f(-24,-32,0);
2007
qglRotatef (90-r_newrefdef.viewangles[1], 0, 0, 1);
2009
qglTranslatef (-r_newrefdef.vieworg[0], -r_newrefdef.vieworg[1], -r_newrefdef.vieworg[2]);
2012
for(i=0;i<numRadarEnts;i++){
2013
float x=RadarEnts[i].org[0];
2014
float y=RadarEnts[i].org[1];
2015
float z=RadarEnts[i].org[2];
2016
qglColor4fv(RadarEnts[i].color);
2018
qglVertex3f(x+9, y+9, z);
2019
qglVertex3f(x+9, y-9, z);
2020
qglVertex3f(x-9, y-9, z);
2021
qglVertex3f(x-9, y+9, z);
2025
qglEnable(GL_TEXTURE_2D);
2028
GL_Bind(r_radarmap->texnum);
2029
qglBlendFunc(GL_SRC_ALPHA, GL_ONE);
2030
GLSTATE_ENABLE_BLEND;
2033
fS[3]=0.5+ r_newrefdef.vieworg[2]/512.0;
2034
qglTexGenf(GL_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
2036
GLSTATE_ENABLE_TEXGEN;
2037
qglTexGenfv(GL_S,GL_OBJECT_PLANE,fS);
2040
R_RecursiveRadarNode (r_worldmodel->nodes);
2042
qglBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
2043
GLSTATE_DISABLE_TEXGEN;
2047
qglViewport(0,0,vid.width,vid.height);
2049
qglMatrixMode(GL_PROJECTION);
2051
qglMatrixMode(GL_MODELVIEW);
2052
qglDisable(GL_STENCIL_TEST);
2053
GL_TexEnv( GL_REPLACE );
2054
GLSTATE_DISABLE_BLEND;
2055
qglEnable(GL_DEPTH_TEST);
2056
qglColor4f(1,1,1,1);