GL_ColorPointer now resets glColor when array is turned off, because glColor gets trashed while color array is on (so sayeth the GL spec, and so proveth the NVIDIA driver)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4001
d7cf8633-e32d-0410-b094-
e92efae38249
GL_Color(cr, cg, cb, ca);
R_Mesh_Matrix(&r_identitymatrix);
GL_Color(cr, cg, cb, ca);
R_Mesh_Matrix(&r_identitymatrix);
qglColorPointer(4, GL_FLOAT, sizeof(float[4]), NULL);CHECKGLERROR
qglDisableClientState(GL_COLOR_ARRAY);CHECKGLERROR
qglColorPointer(4, GL_FLOAT, sizeof(float[4]), NULL);CHECKGLERROR
qglDisableClientState(GL_COLOR_ARRAY);CHECKGLERROR
GL_Color(0, 0, 0, 0);
GL_Color(1, 1, 1, 1);
GL_Color(0, 0, 0, 0);
GL_Color(1, 1, 1, 1);
{
qglDisableClientState(GL_COLOR_ARRAY);
CHECKGLERROR
{
qglDisableClientState(GL_COLOR_ARRAY);
CHECKGLERROR
+ // when color array is on the glColor gets trashed, set it again
+ qglColor4f(gl_state.color4f[0], gl_state.color4f[1], gl_state.color4f[2], gl_state.color4f[3]);
+ CHECKGLERROR
}
gl_state.pointer_color = p;
qglColorPointer(4, GL_FLOAT, sizeof(float[4]), gl_state.pointer_color);
}
gl_state.pointer_color = p;
qglColorPointer(4, GL_FLOAT, sizeof(float[4]), gl_state.pointer_color);
{
if (r_showtrispass)
return;
{
if (r_showtrispass)
return;
gl_state.color4f[0] = cr;
gl_state.color4f[1] = cg;
gl_state.color4f[2] = cb;
gl_state.color4f[3] = ca;
CHECKGLERROR
gl_state.color4f[0] = cr;
gl_state.color4f[1] = cg;
gl_state.color4f[2] = cb;
gl_state.color4f[3] = ca;
CHECKGLERROR
- qglColor4f(cr, cg, cb, ca);
+ qglColor4f(gl_state.color4f[0], gl_state.color4f[1], gl_state.color4f[2], gl_state.color4f[3]);
pic = NULL;
texnum = 0;
color = 0;
pic = NULL;
texnum = 0;
color = 0;
+ GL_ColorPointer(NULL);
+ GL_Color(1,1,1,1);
batch = false;
batchcount = 0;
batch = false;
batchcount = 0;
m.pointer_texcoord[0] = mesh->data_texcoord2f;
R_Mesh_State_Texture(&m);
R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
m.pointer_texcoord[0] = mesh->data_texcoord2f;
R_Mesh_State_Texture(&m);
R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
currentpic = "\0";
break;
case DRAWQUEUE_SETCLIP:
currentpic = "\0";
break;
case DRAWQUEUE_SETCLIP:
if (layer->flags & ALIASLAYER_FOG)
{
colorscale *= fog;
if (layer->flags & ALIASLAYER_FOG)
{
colorscale *= fog;
GL_Color(fogcolor[0] * colorscale, fogcolor[1] * colorscale, fogcolor[2] * colorscale, ent->alpha);
}
else
GL_Color(fogcolor[0] * colorscale, fogcolor[1] * colorscale, fogcolor[2] * colorscale, ent->alpha);
}
else
VectorScale(tint, r_shadow_realtime_world_lightmaps.value, tint);
colorscale *= ifog;
if (fullbright)
VectorScale(tint, r_shadow_realtime_world_lightmaps.value, tint);
colorscale *= ifog;
if (fullbright)
+ {
+ GL_ColorPointer(NULL);
GL_Color(tint[0] * colorscale, tint[1] * colorscale, tint[2] * colorscale, ent->alpha);
GL_Color(tint[0] * colorscale, tint[1] * colorscale, tint[2] * colorscale, ent->alpha);
else
{
if (R_LightModel(ambientcolor4f, diffusecolor, diffusenormal, ent, tint[0] * colorscale, tint[1] * colorscale, tint[2] * colorscale, ent->alpha, false))
else
{
if (R_LightModel(ambientcolor4f, diffusecolor, diffusenormal, ent, tint[0] * colorscale, tint[1] * colorscale, tint[2] * colorscale, ent->alpha, false))
R_LightModel_CalcVertexColors(ambientcolor4f, diffusecolor, diffusenormal, mesh->num_vertices, varray_vertex3f, varray_normal3f, varray_color4f);
}
else
R_LightModel_CalcVertexColors(ambientcolor4f, diffusecolor, diffusenormal, mesh->num_vertices, varray_vertex3f, varray_normal3f, varray_color4f);
}
else
+ {
+ GL_ColorPointer(NULL);
GL_Color(ambientcolor4f[0], ambientcolor4f[1], ambientcolor4f[2], ambientcolor4f[3]);
GL_Color(ambientcolor4f[0], ambientcolor4f[1], ambientcolor4f[2], ambientcolor4f[3]);
}
}
R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
}
}
R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
R_LightModel_CalcVertexColors(ambientcolor4f, diffusecolor, diffusenormal, numverts, varray_vertex3f, aliasvert_normal3f, varray_color4f);
}
else
R_LightModel_CalcVertexColors(ambientcolor4f, diffusecolor, diffusenormal, numverts, varray_vertex3f, aliasvert_normal3f, varray_color4f);
}
else
+ {
+ GL_ColorPointer(NULL);
GL_Color(ambientcolor4f[0], ambientcolor4f[1], ambientcolor4f[2], ambientcolor4f[3]);
GL_Color(ambientcolor4f[0], ambientcolor4f[1], ambientcolor4f[2], ambientcolor4f[3]);
R_Mesh_Draw(numverts, numtriangles, elements);
c_alias_polys += numtriangles;
R_Mesh_Draw(numverts, numtriangles, elements);
c_alias_polys += numtriangles;
//mstate.pointer_texcoord = ent->model->alias.zymdata_texcoords;
R_Mesh_State_Texture(&mstate);
//mstate.pointer_texcoord = ent->model->alias.zymdata_texcoords;
R_Mesh_State_Texture(&mstate);
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], ent->alpha * fog);
ZymoticTransformVerts(numverts, varray_vertex3f, ent->model->alias.zymdata_vertbonecounts, ent->model->alias.zymdata_verts);
R_Mesh_Draw(numverts, numtriangles, elements);
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], ent->alpha * fog);
ZymoticTransformVerts(numverts, varray_vertex3f, ent->model->alias.zymdata_vertbonecounts, ent->model->alias.zymdata_verts);
R_Mesh_Draw(numverts, numtriangles, elements);
GL_DepthMask(true);
GL_DepthTest(false); // magic
GL_VertexPointer(vertex3f);
GL_DepthMask(true);
GL_DepthTest(false); // magic
GL_VertexPointer(vertex3f);
GL_Color(r_refdef.viewblend[0], r_refdef.viewblend[1], r_refdef.viewblend[2], r_refdef.viewblend[3]);
r = 64;
vertex3f[0] = r_vieworigin[0] + r_viewforward[0] * 1.5 + r_viewleft[0] * r - r_viewup[0] * r;
GL_Color(r_refdef.viewblend[0], r_refdef.viewblend[1], r_refdef.viewblend[2], r_refdef.viewblend[3]);
r = 64;
vertex3f[0] = r_vieworigin[0] + r_viewforward[0] * 1.5 + r_viewleft[0] * r - r_viewup[0] * r;
}
R_Mesh_Matrix(&r_identitymatrix);
}
R_Mesh_Matrix(&r_identitymatrix);
GL_Color(cr, cg, cb, ca);
GL_VertexPointer(varray_vertex3f);
GL_BlendFunc(blendfunc1, blendfunc2);
GL_Color(cr, cg, cb, ca);
GL_VertexPointer(varray_vertex3f);
GL_BlendFunc(blendfunc1, blendfunc2);
R_Mesh_Matrix(&ent->matrix);
R_Mesh_Matrix(&ent->matrix);
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
if (fogenabled)
GL_ColorPointer(varray_color4f);
else
if (fogenabled)
GL_ColorPointer(varray_color4f);
else
+ {
+ GL_ColorPointer(NULL);
GL_Color(1, 1, 1, alpha);
GL_Color(1, 1, 1, alpha);
if (gl_textureshader && r_watershader.value && !fogenabled)
{
GL_ActiveTexture (0);
if (gl_textureshader && r_watershader.value && !fogenabled)
{
GL_ActiveTexture (0);
m.tex[3] = R_GetTexture(texture->skin.glow);
m.texcombinergb[3] = GL_ADD;
}
m.tex[3] = R_GetTexture(texture->skin.glow);
m.texcombinergb[3] = GL_ADD;
}
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
m.texrgbscale[1] = 2;
m.tex[2] = R_GetTexture(texture->skin.detail);
m.texrgbscale[2] = 2;
m.texrgbscale[1] = 2;
m.tex[2] = R_GetTexture(texture->skin.detail);
m.texrgbscale[2] = 2;
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
m.tex[0] = R_GetTexture(texture->skin.base);
m.tex[1] = R_GetTexture((**surfchain).lightmaptexture);
m.texrgbscale[1] = 2;
m.tex[0] = R_GetTexture(texture->skin.base);
m.tex[1] = R_GetTexture((**surfchain).lightmaptexture);
m.texrgbscale[1] = 2;
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
GL_DepthTest(true);
GL_BlendFunc(GL_ONE, GL_ZERO);
m.tex[0] = R_GetTexture(texture->skin.base);
GL_DepthTest(true);
GL_BlendFunc(GL_ONE, GL_ZERO);
m.tex[0] = R_GetTexture(texture->skin.base);
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture((**surfchain).lightmaptexture);
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture((**surfchain).lightmaptexture);
GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.detail);
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.detail);
GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.glow);
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.glow);
GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
GL_DepthMask(true);
m.tex[0] = R_GetTexture(texture->skin.glow);
GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
GL_DepthMask(true);
m.tex[0] = R_GetTexture(texture->skin.glow);
if (m.tex[0])
GL_Color(1, 1, 1, 1);
else
if (m.tex[0])
GL_Color(1, 1, 1, 1);
else
GL_DepthMask(true);
GL_DepthTest(true);
m.tex[0] = R_GetTexture((**surfchain).lightmaptexture);
GL_DepthMask(true);
GL_DepthTest(true);
m.tex[0] = R_GetTexture((**surfchain).lightmaptexture);
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
R_Mesh_State_Texture(&m);
i = portal - ent->model->brushq1.portals;
R_Mesh_State_Texture(&m);
i = portal - ent->model->brushq1.portals;
GL_Color(((i & 0x0007) >> 0) * (1.0f / 7.0f),
((i & 0x0038) >> 3) * (1.0f / 7.0f),
((i & 0x01C0) >> 6) * (1.0f / 7.0f),
GL_Color(((i & 0x0007) >> 0) * (1.0f / 7.0f),
((i & 0x0038) >> 3) * (1.0f / 7.0f),
((i & 0x01C0) >> 6) * (1.0f / 7.0f),
{
int i;
i = ((int)brush) / sizeof(colbrushf_t);
{
int i;
i = ((int)brush) / sizeof(colbrushf_t);
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_VertexPointer(brush->points->v);
R_Mesh_Draw(brush->numpoints, brush->numtriangles, brush->elements);
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_VertexPointer(brush->points->v);
R_Mesh_Draw(brush->numpoints, brush->numtriangles, brush->elements);
if (!face->num_collisiontriangles)
return;
i = ((int)face) / sizeof(q3mface_t);
if (!face->num_collisiontriangles)
return;
i = ((int)face) / sizeof(q3mface_t);
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_VertexPointer(face->data_collisionvertex3f);
R_Mesh_Draw(face->num_collisionvertices, face->num_collisiontriangles, face->data_collisionelement3i);
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_VertexPointer(face->data_collisionvertex3f);
R_Mesh_Draw(face->num_collisionvertices, face->num_collisiontriangles, face->data_collisionelement3i);
R_Mesh_Matrix(&ent->matrix);
R_Mesh_Matrix(&ent->matrix);
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(true);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(true);
if (face->texture->skin.glow)
{
m.tex[0] = R_GetTexture(face->texture->skin.glow);
if (face->texture->skin.glow)
{
m.tex[0] = R_GetTexture(face->texture->skin.glow);
m.tex[1] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[1] = face->data_texcoordlightmap2f;
m.texrgbscale[1] = 2;
m.tex[1] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[1] = face->data_texcoordlightmap2f;
m.texrgbscale[1] = 2;
GL_Color(1, 1, 1, 1);
R_Mesh_State_Texture(&m);
GL_VertexPointer(face->data_vertex3f);
GL_Color(1, 1, 1, 1);
R_Mesh_State_Texture(&m);
GL_VertexPointer(face->data_vertex3f);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->texture->skin.base);
m.pointer_texcoord[0] = face->data_texcoordtexture2f;
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->texture->skin.base);
m.pointer_texcoord[0] = face->data_texcoordtexture2f;
GL_Color(1, 1, 1, 1);
R_Mesh_State_Texture(&m);
GL_VertexPointer(face->data_vertex3f);
GL_Color(1, 1, 1, 1);
R_Mesh_State_Texture(&m);
GL_VertexPointer(face->data_vertex3f);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[0] = face->data_texcoordlightmap2f;
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[0] = face->data_texcoordlightmap2f;
GL_Color(1, 1, 1, 1);
R_Mesh_State_Texture(&m);
GL_VertexPointer(face->data_vertex3f);
GL_Color(1, 1, 1, 1);
R_Mesh_State_Texture(&m);
GL_VertexPointer(face->data_vertex3f);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[0] = face->data_texcoordlightmap2f;
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[0] = face->data_texcoordlightmap2f;
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
if (r_shadow_realtime_world.integer)
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
if (face->texture->skin.glow)
{
m.tex[0] = R_GetTexture(face->texture->skin.glow);
if (face->texture->skin.glow)
{
m.tex[0] = R_GetTexture(face->texture->skin.glow);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->texture->skin.base);
m.pointer_texcoord[0] = face->data_texcoordtexture2f;
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->texture->skin.base);
m.pointer_texcoord[0] = face->data_texcoordtexture2f;
GL_Color(r_ambient.value * (1.0f / 128.0f), r_ambient.value * (1.0f / 128.0f), r_ambient.value * (1.0f / 128.0f), 1);
R_Mesh_State_Texture(&m);
GL_VertexPointer(face->data_vertex3f);
GL_Color(r_ambient.value * (1.0f / 128.0f), r_ambient.value * (1.0f / 128.0f), r_ambient.value * (1.0f / 128.0f), 1);
R_Mesh_State_Texture(&m);
GL_VertexPointer(face->data_vertex3f);
{
m.tex[1] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[1] = face->data_texcoordlightmap2f;
{
m.tex[1] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[1] = face->data_texcoordlightmap2f;
GL_Color(1, 1, 1, ent->alpha);
}
else
GL_Color(1, 1, 1, ent->alpha);
}
else
numtriangles = EXPLOSIONTRIS;
numverts = EXPLOSIONVERTS;
alpha = e->alpha;
numtriangles = EXPLOSIONTRIS;
numverts = EXPLOSIONVERTS;
alpha = e->alpha;
GL_Color(alpha, alpha, alpha, 1);
GL_VertexPointer(e->vert[0]);
GL_Color(alpha, alpha, alpha, 1);
GL_VertexPointer(e->vert[0]);
else
{
// solid color if fog is not used
else
{
// solid color if fog is not used
GL_Color(r_lightningbeam_color_red.value, r_lightningbeam_color_green.value, r_lightningbeam_color_blue.value, 1);
}
GL_Color(r_lightningbeam_color_red.value, r_lightningbeam_color_green.value, r_lightningbeam_color_blue.value, 1);
}
GL_DepthMask(false);
GL_DepthTest(true);
R_Mesh_State_Texture(&m);
GL_DepthMask(false);
GL_DepthTest(true);
R_Mesh_State_Texture(&m);
GL_Color(0, 0, 0, 1);
qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
GL_Color(0, 0, 0, 1);
qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
rmeshstate_t m;
memset(&m, 0, sizeof(m));
R_Mesh_State_Texture(&m);
rmeshstate_t m;
memset(&m, 0, sizeof(m));
R_Mesh_State_Texture(&m);
GL_Color(1, 1, 1, 1);
GL_ColorMask(0, 0, 0, 0);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_Color(1, 1, 1, 1);
GL_ColorMask(0, 0, 0, 0);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthTest(true);
qglPolygonOffset(0, 0);
//qglDisable(GL_POLYGON_OFFSET_FILL);
GL_DepthTest(true);
qglPolygonOffset(0, 0);
//qglDisable(GL_POLYGON_OFFSET_FILL);
GL_Color(1, 1, 1, 1);
GL_ColorMask(1, 1, 1, 1);
qglDepthFunc(GL_EQUAL);
GL_Color(1, 1, 1, 1);
GL_ColorMask(1, 1, 1, 1);
qglDepthFunc(GL_EQUAL);
GL_DepthTest(true);
qglPolygonOffset(0, 0);
//qglDisable(GL_POLYGON_OFFSET_FILL);
GL_DepthTest(true);
qglPolygonOffset(0, 0);
//qglDisable(GL_POLYGON_OFFSET_FILL);
GL_Color(1, 1, 1, 1);
GL_ColorMask(1, 1, 1, 1);
qglDepthFunc(GL_EQUAL);
GL_Color(1, 1, 1, 1);
GL_ColorMask(1, 1, 1, 1);
qglDepthFunc(GL_EQUAL);
GL_DepthTest(true);
qglPolygonOffset(0, 0);
//qglDisable(GL_POLYGON_OFFSET_FILL);
GL_DepthTest(true);
qglPolygonOffset(0, 0);
//qglDisable(GL_POLYGON_OFFSET_FILL);
GL_Color(1, 1, 1, 1);
GL_ColorMask(1, 1, 1, 1);
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
GL_Color(1, 1, 1, 1);
GL_ColorMask(1, 1, 1, 1);
GL_Scissor(r_view_x, r_view_y, r_view_width, r_view_height);
{
if (!bumptexture)
bumptexture = r_shadow_blankbumptexture;
{
if (!bumptexture)
bumptexture = r_shadow_blankbumptexture;
GL_Color(1,1,1,1);
// colorscale accounts for how much we multiply the brightness during combine
// mult is how many times the final pass of the lighting will be
GL_Color(1,1,1,1);
// colorscale accounts for how much we multiply the brightness during combine
// mult is how many times the final pass of the lighting will be
if (glosstexture == r_shadow_blankglosstexture)
colorscale *= r_shadow_gloss2intensity.value;
GL_VertexPointer(vertex3f);
if (glosstexture == r_shadow_blankglosstexture)
colorscale *= r_shadow_gloss2intensity.value;
GL_VertexPointer(vertex3f);
GL_Color(1,1,1,1);
if (r_shadow_texture3d.integer && r_textureunits.integer >= 2 && lightcubemap /*&& gl_support_blendsquare*/) // FIXME: detect blendsquare!
{
GL_Color(1,1,1,1);
if (r_shadow_texture3d.integer && r_textureunits.integer >= 2 && lightcubemap /*&& gl_support_blendsquare*/) // FIXME: detect blendsquare!
{
GL_ColorMask(1,1,1,1);
memset(&m, 0, sizeof(m));
R_Mesh_State_Texture(&m);
GL_ColorMask(1,1,1,1);
memset(&m, 0, sizeof(m));
R_Mesh_State_Texture(&m);
GL_Color(0,0.1,0,1);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
for (mesh = rtlight->static_meshchain_shadow;mesh;mesh = mesh->next)
GL_Color(0,0.1,0,1);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
for (mesh = rtlight->static_meshchain_shadow;mesh;mesh = mesh->next)
//qglDisable(GL_CULL_FACE);
memset(&m, 0, sizeof(m));
R_Mesh_State_Texture(&m);
//qglDisable(GL_CULL_FACE);
memset(&m, 0, sizeof(m));
R_Mesh_State_Texture(&m);
GL_Color(0.2,0,0,1);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
for (mesh = rtlight->static_meshchain_light;mesh;mesh = mesh->next)
GL_Color(0.2,0,0,1);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
for (mesh = rtlight->static_meshchain_light;mesh;mesh = mesh->next)
GL_DepthMask(false);
GL_DepthTest(r_shadow_visiblevolumes.integer < 2);
qglDisable(GL_CULL_FACE);
GL_DepthMask(false);
GL_DepthTest(r_shadow_visiblevolumes.integer < 2);
qglDisable(GL_CULL_FACE);
GL_Color(0.0, 0.0125, 0.1, 1);
}
else
GL_Color(0.0, 0.0125, 0.1, 1);
}
else
GL_Color(1, 1, 1, 1);
memset(&m, 0, sizeof(m));
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_Color(1, 1, 1, 1);
memset(&m, 0, sizeof(m));
GL_BlendFunc(GL_ONE, GL_ZERO);
Matrix4x4_CreateIdentity(&identitymatrix);
GL_VertexPointer(skysphere_vertex3f);
Matrix4x4_CreateIdentity(&identitymatrix);
GL_VertexPointer(skysphere_vertex3f);
GL_Color(1, 1, 1, 1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_Color(1, 1, 1, 1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);