1
0
Fork 0
forked from fte/fteqw

Changed gl->qgl.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@757 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-07 03:03:56 +00:00
parent 5530ac045f
commit 8b543d0d66
2 changed files with 129 additions and 129 deletions

View file

@ -113,15 +113,15 @@ void R_RenderDlight (dlight_t *light)
return; return;
} }
glBegin (GL_TRIANGLE_FAN); qglBegin (GL_TRIANGLE_FAN);
// glColor3f (0.2,0.1,0.0); // qglColor3f (0.2,0.1,0.0);
// glColor3f (0.2,0.1,0.05); // changed dimlight effect // qglColor3f (0.2,0.1,0.05); // changed dimlight effect
glColor4f (light->color[0]*2, light->color[1]*2, light->color[2]*2, qglColor4f (light->color[0]*2, light->color[1]*2, light->color[2]*2,
1);//light->color[3]); 1);//light->color[3]);
for (i=0 ; i<3 ; i++) for (i=0 ; i<3 ; i++)
v[i] = light->origin[i] - vpn[i]*rad/1.5; v[i] = light->origin[i] - vpn[i]*rad/1.5;
glVertex3fv (v); qglVertex3fv (v);
glColor3f (0,0,0); qglColor3f (0,0,0);
for (i=16 ; i>=0 ; i--) for (i=16 ; i>=0 ; i--)
{ {
// a = i/16.0 * M_PI*2; // a = i/16.0 * M_PI*2;
@ -130,9 +130,9 @@ void R_RenderDlight (dlight_t *light)
+ vup[j]*(*bub_sin)) * rad; + vup[j]*(*bub_sin)) * rad;
bub_sin++; bub_sin++;
bub_cos++; bub_cos++;
glVertex3fv (v); qglVertex3fv (v);
} }
glEnd (); qglEnd ();
} }
/* /*
@ -150,11 +150,11 @@ void R_RenderDlights (void)
// r_dlightframecount = r_framecount + 1; // because the count hasn't // r_dlightframecount = r_framecount + 1; // because the count hasn't
// advanced yet for this frame // advanced yet for this frame
glDepthMask (0); qglDepthMask (0);
glDisable (GL_TEXTURE_2D); qglDisable (GL_TEXTURE_2D);
glShadeModel (GL_SMOOTH); qglShadeModel (GL_SMOOTH);
glEnable (GL_BLEND); qglEnable (GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE); qglBlendFunc (GL_ONE, GL_ONE);
l = cl_dlights; l = cl_dlights;
for (i=0 ; i<MAX_DLIGHTS ; i++, l++) for (i=0 ; i<MAX_DLIGHTS ; i++, l++)
@ -164,11 +164,11 @@ void R_RenderDlights (void)
R_RenderDlight (l); R_RenderDlight (l);
} }
glColor3f (1,1,1); qglColor3f (1,1,1);
glDisable (GL_BLEND); qglDisable (GL_BLEND);
glEnable (GL_TEXTURE_2D); qglEnable (GL_TEXTURE_2D);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask (1); qglDepthMask (1);
} }

View file

@ -203,17 +203,17 @@ void R_RotateForEntity (entity_t *e)
void Matrix4_Multiply(float *a, float *b, float *out); void Matrix4_Multiply(float *a, float *b, float *out);
float new[16]; float new[16];
Matrix4_Multiply(m, r_world_matrix, new); Matrix4_Multiply(m, r_world_matrix, new);
glLoadMatrixf(new); qglLoadMatrixf(new);
} }
#endif #endif
glMultMatrixf(m); qglMultMatrixf(m);
#else #else
glTranslatef (e->origin[0], e->origin[1], e->origin[2]); qglTranslatef (e->origin[0], e->origin[1], e->origin[2]);
glRotatef (e->angles[1], 0, 0, 1); qglRotatef (e->angles[1], 0, 0, 1);
glRotatef (-e->angles[0], 0, 1, 0); qglRotatef (-e->angles[0], 0, 1, 0);
//ZOID: fixed z angle //ZOID: fixed z angle
glRotatef (e->angles[2], 1, 0, 0); qglRotatef (e->angles[2], 1, 0, 0);
#endif #endif
} }
@ -330,7 +330,7 @@ void R_DrawSpriteModel (entity_t *e)
right[1]*=currententity->scale; right[1]*=currententity->scale;
right[2]*=currententity->scale; right[2]*=currententity->scale;
glColor4f (1,1,1, e->alpha); qglColor4f (1,1,1, e->alpha);
GL_DisableMultitexture(); GL_DisableMultitexture();
@ -338,39 +338,39 @@ void R_DrawSpriteModel (entity_t *e)
if (e->alpha<1) if (e->alpha<1)
{ {
glEnable(GL_BLEND); qglEnable(GL_BLEND);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
} }
else else
glEnable (GL_ALPHA_TEST); qglEnable (GL_ALPHA_TEST);
glDisable(GL_CULL_FACE); qglDisable(GL_CULL_FACE);
glBegin (GL_QUADS); qglBegin (GL_QUADS);
glTexCoord2f (0, 1); qglTexCoord2f (0, 1);
VectorMA (e->origin, frame->down, up, point); VectorMA (e->origin, frame->down, up, point);
VectorMA (point, frame->left, right, point); VectorMA (point, frame->left, right, point);
glVertex3fv (point); qglVertex3fv (point);
glTexCoord2f (0, 0); qglTexCoord2f (0, 0);
VectorMA (e->origin, frame->up, up, point); VectorMA (e->origin, frame->up, up, point);
VectorMA (point, frame->left, right, point); VectorMA (point, frame->left, right, point);
glVertex3fv (point); qglVertex3fv (point);
glTexCoord2f (1, 0); qglTexCoord2f (1, 0);
VectorMA (e->origin, frame->up, up, point); VectorMA (e->origin, frame->up, up, point);
VectorMA (point, frame->right, right, point); VectorMA (point, frame->right, right, point);
glVertex3fv (point); qglVertex3fv (point);
glTexCoord2f (1, 1); qglTexCoord2f (1, 1);
VectorMA (e->origin, frame->down, up, point); VectorMA (e->origin, frame->down, up, point);
VectorMA (point, frame->right, right, point); VectorMA (point, frame->right, right, point);
glVertex3fv (point); qglVertex3fv (point);
glEnd (); qglEnd ();
glDisable(GL_BLEND); qglDisable(GL_BLEND);
glDisable (GL_ALPHA_TEST); qglDisable (GL_ALPHA_TEST);
} }
#if 0 #if 0
extern int gldepthfunc; extern int gldepthfunc;
@ -789,29 +789,29 @@ void R_PolyBlend (void)
GL_DisableMultitexture(); GL_DisableMultitexture();
glDisable (GL_ALPHA_TEST); qglDisable (GL_ALPHA_TEST);
glEnable (GL_BLEND); qglEnable (GL_BLEND);
glDisable (GL_DEPTH_TEST); qglDisable (GL_DEPTH_TEST);
glDisable (GL_TEXTURE_2D); qglDisable (GL_TEXTURE_2D);
glLoadIdentity (); qglLoadIdentity ();
glRotatef (-90, 1, 0, 0); // put Z going up qglRotatef (-90, 1, 0, 0); // put Z going up
glRotatef (90, 0, 0, 1); // put Z going up qglRotatef (90, 0, 0, 1); // put Z going up
glColor4fv (v_blend); qglColor4fv (v_blend);
glBegin (GL_QUADS); qglBegin (GL_QUADS);
glVertex3f (10, 100, 100); qglVertex3f (10, 100, 100);
glVertex3f (10, -100, 100); qglVertex3f (10, -100, 100);
glVertex3f (10, -100, -100); qglVertex3f (10, -100, -100);
glVertex3f (10, 100, -100); qglVertex3f (10, 100, -100);
glEnd (); qglEnd ();
glDisable (GL_BLEND); qglDisable (GL_BLEND);
glEnable (GL_TEXTURE_2D); qglEnable (GL_TEXTURE_2D);
glEnable (GL_ALPHA_TEST); qglEnable (GL_ALPHA_TEST);
} }
void GLR_BrightenScreen (void) void GLR_BrightenScreen (void)
@ -829,26 +829,26 @@ void GLR_BrightenScreen (void)
f = pow (f, vid_gamma); f = pow (f, vid_gamma);
glDisable (GL_TEXTURE_2D); qglDisable (GL_TEXTURE_2D);
glEnable (GL_BLEND); qglEnable (GL_BLEND);
glBlendFunc (GL_DST_COLOR, GL_ONE); qglBlendFunc (GL_DST_COLOR, GL_ONE);
glBegin (GL_QUADS); qglBegin (GL_QUADS);
while (f > 1) { while (f > 1) {
if (f >= 2) if (f >= 2)
glColor3f (1,1,1); qglColor3f (1,1,1);
else else
glColor3f (f - 1, f - 1, f - 1); qglColor3f (f - 1, f - 1, f - 1);
glVertex2f (0, 0); qglVertex2f (0, 0);
glVertex2f (vid.width, 0); qglVertex2f (vid.width, 0);
glVertex2f (vid.width, vid.height); qglVertex2f (vid.width, vid.height);
glVertex2f (0, vid.height); qglVertex2f (0, vid.height);
f *= 0.5; f *= 0.5;
} }
glEnd (); qglEnd ();
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable (GL_TEXTURE_2D); qglEnable (GL_TEXTURE_2D);
glDisable (GL_BLEND); qglDisable (GL_BLEND);
glColor3f(1, 1, 1); qglColor3f(1, 1, 1);
RSpeedEnd(RSPEED_PALETTEFLASHES); RSpeedEnd(RSPEED_PALETTEFLASHES);
} }
@ -1037,7 +1037,7 @@ void MYgluPerspective( GLdouble fovy, GLdouble aspect,
xmax = ymax * aspect; xmax = ymax * aspect;
#if 1 //for the sake of the d3d... #if 1 //for the sake of the d3d...
glFrustum( xmin, xmax, ymin, ymax, zNear, zFar ); qglFrustum( xmin, xmax, ymin, ymax, zNear, zFar );
#else #else
matrix[0] = (2*zNear) / (xmax - xmin); matrix[0] = (2*zNear) / (xmax - xmin);
@ -1060,7 +1060,7 @@ void MYgluPerspective( GLdouble fovy, GLdouble aspect,
matrix[11] = -1; matrix[11] = -1;
matrix[15] = 0; matrix[15] = 0;
glMultMatrixf(matrix); qglMultMatrixf(matrix);
#endif #endif
} }
@ -1100,7 +1100,7 @@ void GL_InfinatePerspective( GLdouble fovy, GLdouble aspect,
matrix[11] = -1; matrix[11] = -1;
matrix[15] = 0; matrix[15] = 0;
glMultMatrixf(matrix); qglMultMatrixf(matrix);
} }
@ -1142,10 +1142,10 @@ void R_SetupGL (void)
w = h = 256; w = h = 256;
} }
glViewport (glx + x, gly + y2, w, h); qglViewport (glx + x, gly + y2, w, h);
glMatrixMode(GL_PROJECTION); qglMatrixMode(GL_PROJECTION);
glLoadIdentity (); qglLoadIdentity ();
screenaspect = (float)r_refdef.vrect.width/r_refdef.vrect.height; screenaspect = (float)r_refdef.vrect.width/r_refdef.vrect.height;
if (!r_shadows.value || !gl_canstencil)//gl_nv_range_clamp) if (!r_shadows.value || !gl_canstencil)//gl_nv_range_clamp)
@ -1164,47 +1164,47 @@ void R_SetupGL (void)
if (mirror) if (mirror)
{ {
if (mirror_plane->normal[2]) if (mirror_plane->normal[2])
glScalef (1, -1, 1); qglScalef (1, -1, 1);
else else
glScalef (-1, 1, 1); qglScalef (-1, 1, 1);
glCullFace(GL_BACK); qglCullFace(GL_BACK);
} }
else else
glCullFace(GL_FRONT); qglCullFace(GL_FRONT);
glMatrixMode(GL_MODELVIEW); qglMatrixMode(GL_MODELVIEW);
glLoadIdentity (); qglLoadIdentity ();
glRotatef (-90, 1, 0, 0); // put Z going up qglRotatef (-90, 1, 0, 0); // put Z going up
glRotatef (90, 0, 0, 1); // put Z going up qglRotatef (90, 0, 0, 1); // put Z going up
#ifdef R_XFLIP #ifdef R_XFLIP
if (r_xflip.value) if (r_xflip.value)
{ {
glScalef (1, -1, 1); qglScalef (1, -1, 1);
glCullFace(GL_BACK); qglCullFace(GL_BACK);
} }
#endif #endif
glRotatef (-r_refdef.viewangles[2], 1, 0, 0); qglRotatef (-r_refdef.viewangles[2], 1, 0, 0);
glRotatef (-r_refdef.viewangles[0], 0, 1, 0); qglRotatef (-r_refdef.viewangles[0], 0, 1, 0);
glRotatef (-r_refdef.viewangles[1], 0, 0, 1); qglRotatef (-r_refdef.viewangles[1], 0, 0, 1);
glTranslatef (-r_refdef.vieworg[0], -r_refdef.vieworg[1], -r_refdef.vieworg[2]); qglTranslatef (-r_refdef.vieworg[0], -r_refdef.vieworg[1], -r_refdef.vieworg[2]);
glGetFloatv (GL_MODELVIEW_MATRIX, r_world_matrix); qglGetFloatv (GL_MODELVIEW_MATRIX, r_world_matrix);
// //
// set drawing parms // set drawing parms
// //
if (gl_cull.value) if (gl_cull.value)
glEnable(GL_CULL_FACE); qglEnable(GL_CULL_FACE);
else else
glDisable(GL_CULL_FACE); qglDisable(GL_CULL_FACE);
glDisable(GL_BLEND); qglDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST); qglDisable(GL_ALPHA_TEST);
glEnable(GL_DEPTH_TEST); qglEnable(GL_DEPTH_TEST);
//#ifndef D3DQUAKE //#ifndef D3DQUAKE
// glClearDepth(1.0f); // glClearDepth(1.0f);
@ -1227,11 +1227,11 @@ void R_SetupGL (void)
if (gl_dither.value) if (gl_dither.value)
{ {
glEnable(GL_DITHER); qglEnable(GL_DITHER);
} }
else else
{ {
glDisable(GL_DITHER); qglDisable(GL_DITHER);
} }
GL_DisableMultitexture(); GL_DisableMultitexture();
@ -1306,12 +1306,12 @@ void R_Clear (void)
if (r_mirroralpha.value != 1.0) if (r_mirroralpha.value != 1.0)
{ {
if (gl_clear.value && !r_secondaryview) if (gl_clear.value && !r_secondaryview)
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); qglClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
else else
glClear (GL_DEPTH_BUFFER_BIT); qglClear (GL_DEPTH_BUFFER_BIT);
gldepthmin = 0; gldepthmin = 0;
gldepthmax = 0.5; gldepthmax = 0.5;
glDepthFunc (gldepthfunc=GL_LEQUAL); qglDepthFunc (gldepthfunc=GL_LEQUAL);
} }
#ifdef SIDEVIEWS #ifdef SIDEVIEWS
else if (gl_ztrick.value && !gl_ztrickdisabled) else if (gl_ztrick.value && !gl_ztrickdisabled)
@ -1322,34 +1322,34 @@ void R_Clear (void)
static int trickframe; static int trickframe;
if (gl_clear.value && !(r_refdef.flags & 1)) if (gl_clear.value && !(r_refdef.flags & 1))
glClear (GL_COLOR_BUFFER_BIT); qglClear (GL_COLOR_BUFFER_BIT);
trickframe++; trickframe++;
if (trickframe & 1) if (trickframe & 1)
{ {
gldepthmin = 0; gldepthmin = 0;
gldepthmax = 0.49999; gldepthmax = 0.49999;
glDepthFunc (gldepthfunc=GL_LEQUAL); qglDepthFunc (gldepthfunc=GL_LEQUAL);
} }
else else
{ {
gldepthmin = 1; gldepthmin = 1;
gldepthmax = 0.5; gldepthmax = 0.5;
glDepthFunc (gldepthfunc=GL_GEQUAL); qglDepthFunc (gldepthfunc=GL_GEQUAL);
} }
} }
else else
{ {
if (gl_clear.value && !r_secondaryview) if (gl_clear.value && !r_secondaryview)
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); qglClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
else else
glClear (GL_DEPTH_BUFFER_BIT); qglClear (GL_DEPTH_BUFFER_BIT);
gldepthmin = 0; gldepthmin = 0;
gldepthmax = 1; gldepthmax = 1;
glDepthFunc (gldepthfunc=GL_LEQUAL); qglDepthFunc (gldepthfunc=GL_LEQUAL);
} }
glDepthRange (gldepthmin, gldepthmax); qglDepthRange (gldepthmin, gldepthmax);
} }
//#if 0 //!!! FIXME, Zoid, mirror is disabled for now //#if 0 //!!! FIXME, Zoid, mirror is disabled for now
@ -1506,8 +1506,8 @@ void R_Mirror (void)
gldepthmin = 0.5; gldepthmin = 0.5;
gldepthmax = 1; gldepthmax = 1;
glDepthRange (gldepthmin, gldepthmax); qglDepthRange (gldepthmin, gldepthmax);
glDepthFunc (GL_LEQUAL); qglDepthFunc (GL_LEQUAL);
R_RenderScene (); R_RenderScene ();
@ -1516,38 +1516,38 @@ void R_Mirror (void)
gldepthmin = 0; gldepthmin = 0;
gldepthmax = 0.5; gldepthmax = 0.5;
glDepthRange (gldepthmin, gldepthmax); qglDepthRange (gldepthmin, gldepthmax);
glDepthFunc (GL_LEQUAL); qglDepthFunc (GL_LEQUAL);
memcpy(r_refdef.viewangles, oldangles, sizeof(vec3_t)); memcpy(r_refdef.viewangles, oldangles, sizeof(vec3_t));
glMatrixMode(GL_PROJECTION); qglMatrixMode(GL_PROJECTION);
if (mirror_plane->normal[2]) if (mirror_plane->normal[2])
glScalef (1,-1,1); qglScalef (1,-1,1);
else else
glScalef (-1,1,1); qglScalef (-1,1,1);
glCullFace(GL_FRONT); qglCullFace(GL_FRONT);
glMatrixMode(GL_MODELVIEW); qglMatrixMode(GL_MODELVIEW);
glLoadMatrixf (r_base_world_matrix); qglLoadMatrixf (r_base_world_matrix);
// blend on top // blend on top
glDisable(GL_ALPHA_TEST); qglDisable(GL_ALPHA_TEST);
glEnable (GL_BLEND); qglEnable (GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f (1,1,1,r_mirroralpha.value); qglColor4f (1,1,1,r_mirroralpha.value);
s = r_mirror_chain; s = r_mirror_chain;
for ( ; s ; s=s->texturechain) for ( ; s ; s=s->texturechain)
R_RenderBrushPoly (s); R_RenderBrushPoly (s);
cl.worldmodel->textures[mirrortexturenum]->texturechain = NULL; cl.worldmodel->textures[mirrortexturenum]->texturechain = NULL;
glDisable (GL_BLEND); qglDisable (GL_BLEND);
glColor4f (1,1,1,1); qglColor4f (1,1,1,1);
//put things back for rear views //put things back for rear views
glCullFace(GL_BACK); qglCullFace(GL_BACK);
memcpy(r_refdef.viewangles, oldangles, sizeof(vec3_t)); memcpy(r_refdef.viewangles, oldangles, sizeof(vec3_t));
memcpy(r_refdef.vieworg, oldorg, sizeof(vec3_t)); memcpy(r_refdef.vieworg, oldorg, sizeof(vec3_t));
@ -1599,7 +1599,7 @@ void GLR_RenderView (void)
if (gl_finish.value) if (gl_finish.value)
{ {
RSpeedMark(); RSpeedMark();
glFinish (); qglFinish ();
RSpeedEnd(RSPEED_FINISH); RSpeedEnd(RSPEED_FINISH);
} }