}
}
- GL_ColorPointer(NULL);
- GL_Color(cr, cg, cb, ca);
-
R_Mesh_Matrix(&r_identitymatrix);
memset(&m, 0, sizeof(m));
m.pointer_vertex = particle_vertex3f;
R_Mesh_State(&m);
+ GL_Color(cr, cg, cb, ca);
+
if (p->blendmode == 0)
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
else if (p->blendmode == 1)
qglColorPointer(4, GL_FLOAT, sizeof(float[4]), NULL);CHECKGLERROR
qglDisableClientState(GL_COLOR_ARRAY);CHECKGLERROR
- GL_ColorPointer(NULL);
GL_Color(0, 0, 0, 0);
GL_Color(1, 1, 1, 1);
}
}
-void GL_ColorPointer(const float *p)
-{
- if (gl_state.pointer_color != p)
- {
- if (r_showtrispass)
- return;
- CHECKGLERROR
- if (!gl_state.pointer_color)
- {
- qglEnableClientState(GL_COLOR_ARRAY);
- CHECKGLERROR
- }
- else if (!p)
- {
- 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);
- CHECKGLERROR
- }
-}
-
void GL_Color(float cr, float cg, float cb, float ca)
{
if (gl_state.pointer_color || gl_state.color4f[0] != cr || gl_state.color4f[1] != cg || gl_state.color4f[2] != cb || gl_state.color4f[3] != ca)
CHECKGLERROR
}
+ if (r_showtrispass)
+ return;
+
+ if (gl_state.pointer_color != m->pointer_color)
+ {
+ CHECKGLERROR
+ if (!gl_state.pointer_color)
+ {
+ qglEnableClientState(GL_COLOR_ARRAY);
+ CHECKGLERROR
+ }
+ else if (!m->pointer_color)
+ {
+ 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 = m->pointer_color;
+ qglColorPointer(4, GL_FLOAT, sizeof(float[4]), gl_state.pointer_color);
+ CHECKGLERROR
+ }
+
if (gl_backend_rebindtextures)
{
gl_backend_rebindtextures = false;
GL_SetupTextureState();
}
- if (r_showtrispass)
- return;
for (i = 0, unit = gl_state.units;i < backendunits;i++, unit++)
{
if (unit->t1d != m->tex1d[i])
void GL_DepthMask(int state);
void GL_DepthTest(int state);
void GL_ColorMask(int r, int g, int b, int a);
-void GL_ColorPointer(const float *p);
void GL_Color(float cr, float cg, float cb, float ca);
void GL_ShowTrisColor(float cr, float cg, float cb, float ca);
void GL_TransformToScreen(const vec4_t in, vec4_t out);
// other state set by this
const float *pointer_vertex;
+ const float *pointer_color;
}
rmeshstate_t;
pic = NULL;
texnum = 0;
color = 0;
- GL_ColorPointer(NULL);
GL_Color(1,1,1,1);
batch = false;
case DRAWQUEUE_MESH:
mesh = (void *)(dq + 1);
m.pointer_vertex = mesh->data_vertex3f;
- GL_ColorPointer(mesh->data_color4f);
+ m.pointer_color = mesh->data_color4f;
m.tex[0] = R_GetTexture(mesh->texture);
m.pointer_texcoord[0] = mesh->data_texcoord2f;
R_Mesh_State(&m);
R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
- GL_ColorPointer(NULL);
+ m.pointer_color = NULL;
currentpic = "\0";
break;
case DRAWQUEUE_SETCLIP:
}
}
m.pointer_vertex = varray_vertex3f;
- R_Mesh_State(&m);
c_alias_polys += mesh->num_triangles;
R_Model_Alias_GetMesh_Array3f(ent, mesh, MODELARRAY_VERTEX, varray_vertex3f);
if (layer->flags & ALIASLAYER_FOG)
{
colorscale *= fog;
- GL_ColorPointer(NULL);
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)
- {
- GL_ColorPointer(NULL);
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))
{
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
R_Model_Alias_GetMesh_Array3f(ent, mesh, MODELARRAY_NORMAL, varray_normal3f);
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]);
- }
}
}
+ R_Mesh_State(&m);
R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
}
}
mstate.tex[0] = R_GetTexture(texture);
mstate.pointer_texcoord[0] = ent->model->alias.zymdata_texcoords;
mstate.pointer_vertex = varray_vertex3f;
- R_Mesh_State(&mstate);
ZymoticLerpBones(ent->model->alias.zymnum_bones, (zymbonematrix *) ent->model->alias.zymdata_poses, ent->frameblend, ent->model->alias.zymdata_bones);
ZymoticCalcNormal3f(numverts, varray_vertex3f, aliasvert_normal3f, ent->model->alias.zymnum_shaders, ent->model->alias.zymdata_renderlist);
if (R_LightModel(ambientcolor4f, diffusecolor, diffusenormal, ent, ifog * colorscale, ifog * colorscale, ifog * colorscale, ent->alpha, false))
{
- GL_ColorPointer(varray_color4f);
+ mstate.pointer_color = varray_color4f;
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]);
- }
+ R_Mesh_State(&mstate);
R_Mesh_Draw(numverts, numtriangles, elements);
c_alias_polys += numtriangles;
mstate.pointer_vertex = varray_vertex3f;
R_Mesh_State(&mstate);
- GL_ColorPointer(NULL);
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_State(&mstate);
R_Mesh_Draw(numverts, numtriangles, elements);
c_alias_polys += numtriangles;
}
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_DepthMask(true);
GL_DepthTest(false); // magic
- GL_ColorPointer(NULL);
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_DepthTest(true);
R_Mesh_Matrix(&r_identitymatrix);
- memset(&m, 0, sizeof(m));
- R_Mesh_State(&m);
-
- R_Mesh_GetSpace(8);
vertex3f[ 0] = mins[0];vertex3f[ 1] = mins[1];vertex3f[ 2] = mins[2];
vertex3f[ 3] = maxs[0];vertex3f[ 4] = mins[1];vertex3f[ 5] = mins[2];
vertex3f[ 6] = mins[0];vertex3f[ 7] = maxs[1];vertex3f[ 8] = mins[2];
vertex3f[15] = maxs[0];vertex3f[16] = mins[1];vertex3f[17] = maxs[2];
vertex3f[18] = mins[0];vertex3f[19] = maxs[1];vertex3f[20] = maxs[2];
vertex3f[21] = maxs[0];vertex3f[22] = maxs[1];vertex3f[23] = maxs[2];
- GL_ColorPointer(color);
R_FillColors(color, 8, cr, cg, cb, ca);
if (fogenabled)
{
c[2] = c[2] * f1 + fogcolor[2] * f2;
}
}
+ memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
+ m.pointer_color = color;
+ R_Mesh_State(&m);
R_Mesh_Draw(8, 12);
}
*/
memset(&m, 0, sizeof(m));
m.pointer_vertex = nomodelvertex3f;
- R_Mesh_State(&m);
if (ent->flags & EF_ADDITIVE)
{
if (fogenabled)
{
memcpy(color4f, nomodelcolor4f, sizeof(float[6*4]));
- GL_ColorPointer(color4f);
+ m.pointer_color = color4f;
VectorSubtract(ent->origin, r_vieworigin, diff);
f2 = exp(fogdensity/DotProduct(diff, diff));
f1 = 1 - f2;
else if (ent->alpha != 1)
{
memcpy(color4f, nomodelcolor4f, sizeof(float[6*4]));
- GL_ColorPointer(color4f);
+ m.pointer_color = color4f;
for (i = 0, c = color4f;i < 6;i++, c += 4)
c[3] *= ent->alpha;
}
else
- GL_ColorPointer(nomodelcolor4f);
+ m.pointer_color = nomodelcolor4f;
+ R_Mesh_State(&m);
R_Mesh_Draw(6, 8, nomodelelements);
}
}
R_Mesh_Matrix(&r_identitymatrix);
- GL_ColorPointer(NULL);
- GL_Color(cr, cg, cb, ca);
GL_BlendFunc(blendfunc1, blendfunc2);
GL_DepthMask(false);
GL_DepthTest(!depthdisable);
- memset(&m, 0, sizeof(m));
- m.tex[0] = R_GetTexture(texture);
- m.pointer_texcoord[0] = spritetexcoord2f;
- m.pointer_vertex = varray_vertex3f;
- R_Mesh_State(&m);
-
varray_vertex3f[ 0] = origin[0] + left[0] * scalex2 + up[0] * scaley1;
varray_vertex3f[ 1] = origin[1] + left[1] * scalex2 + up[1] * scaley1;
varray_vertex3f[ 2] = origin[2] + left[2] * scalex2 + up[2] * scaley1;
varray_vertex3f[ 9] = origin[0] + left[0] * scalex1 + up[0] * scaley1;
varray_vertex3f[10] = origin[1] + left[1] * scalex1 + up[1] * scaley1;
varray_vertex3f[11] = origin[2] + left[2] * scalex1 + up[2] * scaley1;
+
+ memset(&m, 0, sizeof(m));
+ m.tex[0] = R_GetTexture(texture);
+ m.pointer_texcoord[0] = spritetexcoord2f;
+ m.pointer_vertex = varray_vertex3f;
+ R_Mesh_State(&m);
+ GL_Color(cr, cg, cb, ca);
R_Mesh_Draw(4, 2, polygonelements);
}
R_Mesh_Matrix(&ent->matrix);
- GL_ColorPointer(NULL);
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
GL_DepthMask(true);
GL_DepthTest(true);
-
+ memset(&m, 0, sizeof(m));
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
{
- memset(&m, 0, sizeof(m));
m.pointer_vertex = surf->mesh.data_vertex3f;
R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
m.tex[0] = R_GetTexture(texture->skin.base);
GL_DepthTest(true);
if (fogenabled)
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
else
- {
- GL_ColorPointer(NULL);
GL_Color(1, 1, 1, alpha);
- }
if (gl_textureshader && r_watershader.value && !fogenabled)
{
GL_ActiveTexture (0);
qglEnable (GL_TEXTURE_SHADER_NV);
}
- m.pointer_vertex = surf->mesh.data_vertex3f;
- m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- m.pointer_texcoord[1] = surf->mesh.data_texcoordtexture2f;
- m.texcombinergb[1] = GL_REPLACE;
- R_Mesh_State(&m);
if (fogenabled)
{
R_FillColors(varray_color4f, surf->mesh.num_vertices, 1, 1, 1, alpha);
RSurf_FogColors_Vertex3f_Color4f(surf->mesh.data_vertex3f, varray_color4f, 1, surf->mesh.num_vertices, modelorg);
}
+ m.pointer_vertex = surf->mesh.data_vertex3f;
+ m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
+ m.pointer_texcoord[1] = surf->mesh.data_texcoordtexture2f;
+ m.texcombinergb[1] = GL_REPLACE;
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
if (gl_textureshader && r_watershader.value && !fogenabled)
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.fog);
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
R_Mesh_State(&m);
RSurf_FogPassColors_Vertex3f_Color4f(surf->mesh.data_vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], alpha, 1, surf->mesh.num_vertices, modelorg);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
base = ent->effects & EF_FULLBRIGHT ? 2.0f : r_ambient.value * (1.0f / 64.0f);
GL_DepthTest(true);
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
R_Mesh_State(&m);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
+ m.pointer_color = varray_color4f;
m.tex[0] = R_GetTexture(texture->skin.glow);
- GL_ColorPointer(varray_color4f);
m.pointer_vertex = surf->mesh.data_vertex3f;
if (m.tex[0])
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
+ m.pointer_color = varray_color4f;
m.tex[0] = R_GetTexture(texture->skin.fog);
- GL_ColorPointer(varray_color4f);
m.pointer_vertex = surf->mesh.data_vertex3f;
if (m.tex[0])
m.tex[3] = R_GetTexture(texture->skin.glow);
m.texcombinergb[3] = GL_ADD;
}
- GL_ColorPointer(NULL);
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;
- GL_ColorPointer(NULL);
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;
- GL_ColorPointer(NULL);
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_ColorPointer(NULL);
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_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_DepthMask(false);
GL_DepthTest(true);
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.detail);
- GL_ColorPointer(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_ColorPointer(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_ColorPointer(NULL);
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_ColorPointer(NULL);
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(&m);
i = portal - ent->model->brushq1.portals;
- GL_ColorPointer(NULL);
GL_Color(((i & 0x0007) >> 0) * (1.0f / 7.0f),
((i & 0x0038) >> 3) * (1.0f / 7.0f),
((i & 0x01C0) >> 6) * (1.0f / 7.0f),
m.pointer_vertex = brush->points->v;
R_Mesh_State(&m);
i = ((int)brush) / sizeof(colbrushf_t);
- GL_ColorPointer(NULL);
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
R_Mesh_Draw(brush->numpoints, brush->numtriangles, brush->elements);
}
m.pointer_vertex = face->data_collisionvertex3f;
R_Mesh_State(&m);
i = ((int)face) / sizeof(q3mface_t);
- GL_ColorPointer(NULL);
GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
R_Mesh_Draw(face->num_collisionvertices, face->num_collisiontriangles, face->data_collisionelement3i);
}
R_Mesh_Matrix(&ent->matrix);
- GL_ColorPointer(NULL);
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(true);
- GL_ColorPointer(NULL);
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;
- GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
m.pointer_vertex = face->data_vertex3f;
R_Mesh_State(&m);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->texture->skin.base);
m.pointer_texcoord[0] = face->data_texcoordtexture2f;
- GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
m.pointer_vertex = face->data_vertex3f;
R_Mesh_State(&m);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[0] = face->data_texcoordlightmap2f;
- GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
m.pointer_vertex = face->data_vertex3f;
R_Mesh_State(&m);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[0] = face->data_texcoordlightmap2f;
- GL_ColorPointer(NULL);
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_ColorPointer(NULL);
if (face->texture->skin.glow)
{
m.tex[0] = R_GetTexture(face->texture->skin.glow);
if (mul == 2 && gl_combine.integer)
{
m.texrgbscale[0] = 2;
- GL_ColorPointer(face->data_color4f);
+ m.pointer_color = face->data_color4f;
}
else if (mul == 1)
- GL_ColorPointer(face->data_color4f);
+ m.pointer_color = face->data_color4f;
else
{
for (i = 0;i < face->num_vertices;i++)
varray_color4f[i*4+2] = face->data_color4f[i*4+2] * mul;
varray_color4f[i*4+3] = face->data_color4f[i*4+3];
}
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
}
m.pointer_vertex = face->data_vertex3f;
R_Mesh_State(&m);
if (r_shadow_realtime_world.integer && r_shadow_realtime_world_lightmaps.value != 1)
mul *= r_shadow_realtime_world_lightmaps.value;
if (mul == 1)
- GL_ColorPointer(face->data_color4f);
+ m.pointer_color = face->data_color4f;
else
{
for (i = 0;i < face->num_vertices;i++)
varray_color4f[i*4+2] = face->data_color4f[i*4+2] * 2.0f;
varray_color4f[i*4+3] = face->data_color4f[i*4+3];
}
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
}
m.pointer_vertex = face->data_vertex3f;
R_Mesh_State(&m);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->texture->skin.base);
m.pointer_texcoord[0] = face->data_texcoordtexture2f;
- GL_ColorPointer(NULL);
GL_Color(r_ambient.value * (1.0f / 128.0f), r_ambient.value * (1.0f / 128.0f), r_ambient.value * (1.0f / 128.0f), 1);
m.pointer_vertex = face->data_vertex3f;
R_Mesh_State(&m);
{
m.tex[1] = R_GetTexture(face->lightmaptexture);
m.pointer_texcoord[1] = face->data_texcoordlightmap2f;
- GL_ColorPointer(NULL);
GL_Color(1, 1, 1, ent->alpha);
}
else
{
if (ent->alpha == 1)
- GL_ColorPointer(face->data_color4f);
+ m.pointer_color = face->data_color4f;
else
{
int i;
varray_color4f[i*4+2] = face->data_color4f[i*4+2];
varray_color4f[i*4+3] = face->data_color4f[i*4+3] * ent->alpha;
}
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
}
}
}
varray_color4f[i*4+2] = face->data_color4f[i*4+2] * 2.0f;
varray_color4f[i*4+3] = face->data_color4f[i*4+3] * ent->alpha;
}
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
}
m.pointer_vertex = face->data_vertex3f;
R_Mesh_State(&m);
numtriangles = EXPLOSIONTRIS;
numverts = EXPLOSIONVERTS;
alpha = e->alpha;
- GL_ColorPointer(NULL);
- GL_Color(alpha, alpha, alpha, 1);
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(explosiontexture);
m.pointer_vertex = e->vert[0];
R_Mesh_State(&m);
+ GL_Color(alpha, alpha, alpha, 1);
+
R_Mesh_Draw(numverts, numtriangles, explosiontris[0]);
}
m.tex[0] = R_GetTexture(r_lightningbeamtexture);
m.pointer_texcoord[0] = varray_texcoord2f[0];
m.pointer_vertex = varray_vertex3f;
- R_Mesh_State(&m);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
if (fogenabled)
{
// per vertex colors if fog is used
- GL_ColorPointer(varray_color4f);
+ m.pointer_color = varray_color4f;
R_FogLightningBeam_Vertex3f_Color4f(varray_vertex3f, varray_color4f, 12, r_lightningbeam_color_red.value, r_lightningbeam_color_green.value, r_lightningbeam_color_blue.value, 1);
}
else
{
// solid color if fog is not used
- GL_ColorPointer(NULL);
GL_Color(r_lightningbeam_color_red.value, r_lightningbeam_color_green.value, r_lightningbeam_color_blue.value, 1);
}
+ R_Mesh_State(&m);
// draw the 3 polygons as one batch of 6 triangles using the 12 vertices
R_Mesh_Draw(12, 6, r_lightningbeamelements);
GL_DepthMask(false);
GL_DepthTest(true);
R_Mesh_State(&m);
- GL_ColorPointer(NULL);
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(&m);
- GL_ColorPointer(NULL);
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_ColorPointer(NULL);
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_ColorPointer(NULL);
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_ColorPointer(NULL);
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;
- GL_ColorPointer(NULL);
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_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
- GL_ColorPointer(varray_color4f);
VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
memset(&m, 0, sizeof(m));
m.pointer_vertex = vertex3f;
+ m.pointer_color = varray_color4f;
m.tex[0] = R_GetTexture(basetexture);
m.pointer_texcoord[0] = texcoord2f;
if (r_textureunits.integer >= 2)
bumptexture = r_shadow_blankbumptexture;
if (glosstexture == r_shadow_blankglosstexture)
colorscale *= r_shadow_gloss2intensity.value;
- GL_ColorPointer(NULL);
GL_Color(1,1,1,1);
if (r_shadow_texture3d.integer && r_textureunits.integer >= 2 && lightcubemap /*&& gl_support_blendsquare*/) // FIXME: detect blendsquare!
{
qglDisable(GL_STENCIL_TEST);
//qglDisable(GL_CULL_FACE);
GL_ColorMask(1,1,1,1);
- GL_ColorPointer(NULL);
GL_Color(0,0.1,0,1);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
memset(&m, 0, sizeof(m));
qglDisable(GL_STENCIL_TEST);
//qglDisable(GL_CULL_FACE);
memset(&m, 0, sizeof(m));
- GL_ColorPointer(NULL);
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_ColorPointer(NULL);
GL_Color(0.0, 0.0125, 0.1, 1);
}
else
{
int i;
rmeshstate_t m;
- GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
memset(&m, 0, sizeof(m));
GL_BlendFunc(GL_ONE, GL_ZERO);
Matrix4x4_CreateTranslate(&scroll2matrix, speedscale * 2, speedscale * 2, 0);
Matrix4x4_CreateIdentity(&identitymatrix);
- GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);