memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(tex->texture);
m.pointer_texcoord[0] = particle_texcoord2f;
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = particle_vertex3f;
+ R_Mesh_State(&m);
if (p->blendmode == 0)
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_BlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
GL_DepthMask(false);
GL_DepthTest(true);
- GL_VertexPointer(particle_vertex3f);
#endif
if (p->orientation == PARTICLE_BILLBOARD || p->orientation == PARTICLE_ORIENTED_DOUBLESIDED)
{
}
}
-void GL_VertexPointer(const float *p)
-{
- if (gl_state.pointer_vertex != p)
- {
- gl_state.pointer_vertex = p;
- CHECKGLERROR
- qglVertexPointer(3, GL_FLOAT, sizeof(float[3]), gl_state.pointer_vertex);
- CHECKGLERROR
- }
-}
-
void GL_ColorPointer(const float *p)
{
if (gl_state.pointer_color != p)
}
}
-void R_Mesh_State_Texture(const rmeshstate_t *m)
+void R_Mesh_State(const rmeshstate_t *m)
{
int i, combinergb, combinealpha, scale, arrayis3d;
gltextureunit_t *unit;
BACKENDACTIVECHECK
+ if (gl_state.pointer_vertex != m->pointer_vertex)
+ {
+ gl_state.pointer_vertex = m->pointer_vertex;
+ CHECKGLERROR
+ qglVertexPointer(3, GL_FLOAT, sizeof(float[3]), gl_state.pointer_vertex);
+ CHECKGLERROR
+ }
+
if (gl_backend_rebindtextures)
{
gl_backend_rebindtextures = false;
GL_DepthTest(GL_FALSE);
GL_DepthMask(GL_FALSE);
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
r_showtrispass = true;
GL_ShowTrisColor(0.2,0.2,0.2,1);
goto showtris;
void GL_DepthMask(int state);
void GL_DepthTest(int state);
void GL_ColorMask(int r, int g, int b, int a);
-void GL_VertexPointer(const float *p);
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);
int texcombinealpha[MAX_TEXTUREUNITS]; // does nothing without combine
// pointers
const float *pointer_texcoord[MAX_TEXTUREUNITS];
+
+ // other state set by this
+ const float *pointer_vertex;
}
rmeshstate_t;
void R_Mesh_TextureMatrix(int unitnumber, const matrix4x4_t *matrix);
// set up the requested state
-void R_Mesh_State_Texture(const rmeshstate_t *m);
+void R_Mesh_State(const rmeshstate_t *m);
// renders a mesh
void R_Mesh_Draw(int numverts, int numtriangles, const int *elements);
chartexnum = R_GetTexture(char_texture);
memset(&m, 0, sizeof(m));
- m.tex[0] = 0;
- R_Mesh_State_Texture(&m);
currentpic = "";
pic = NULL;
m.tex[0] = chartexnum;
}
batchcount = 0;
- GL_VertexPointer(varray_vertex3f);
+ m.pointer_vertex = varray_vertex3f;
m.pointer_texcoord[0] = varray_texcoord2f[0];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
at = varray_texcoord2f[0];
av = varray_vertex3f;
while ((num = *str++) && x < vid.conwidth)
break;
case DRAWQUEUE_MESH:
mesh = (void *)(dq + 1);
- GL_VertexPointer(mesh->data_vertex3f);
+ m.pointer_vertex = mesh->data_vertex3f;
GL_ColorPointer(mesh->data_color4f);
m.tex[0] = R_GetTexture(mesh->texture);
m.pointer_texcoord[0] = mesh->data_texcoord2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(mesh->num_vertices, mesh->num_triangles, mesh->data_element3i);
GL_ColorPointer(NULL);
currentpic = "\0";
{
// all the blends ignore depth
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = blendvertex3f;
+ R_Mesh_State(&m);
GL_DepthMask(true);
GL_DepthTest(false);
if (v_color_enable.integer)
if (c[0] >= 1.01f || c[1] >= 1.01f || c[2] >= 1.01f)
{
GL_BlendFunc(GL_DST_COLOR, GL_ONE);
- GL_VertexPointer(blendvertex3f);
while (c[0] >= 1.01f || c[1] >= 1.01f || c[2] >= 1.01f)
{
GL_Color(bound(0, c[0] - 1, 1), bound(0, c[1] - 1, 1), bound(0, c[2] - 1, 1), 1);
if (c[0] >= 0.01f || c[1] >= 0.01f || c[2] >= 0.01f)
{
GL_BlendFunc(GL_ONE, GL_ONE);
- GL_VertexPointer(blendvertex3f);
GL_Color(c[0], c[1], c[2], 1);
R_Mesh_Draw(3, 1, polygonelements);
}
m.texrgbscale[0] = 4;
}
}
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = varray_vertex3f;
+ R_Mesh_State(&m);
c_alias_polys += mesh->num_triangles;
- GL_VertexPointer(varray_vertex3f);
R_Model_Alias_GetMesh_Array3f(ent, mesh, MODELARRAY_VERTEX, varray_vertex3f);
if (layer->flags & ALIASLAYER_FOG)
{
GL_DepthMask(true);
}
GL_DepthTest(true);
- GL_VertexPointer(varray_vertex3f);
memset(&mstate, 0, sizeof(mstate));
colorscale = 1.0f;
}
mstate.tex[0] = R_GetTexture(texture);
mstate.pointer_texcoord[0] = ent->model->alias.zymdata_texcoords;
- R_Mesh_State_Texture(&mstate);
+ 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);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_DepthMask(false);
GL_DepthTest(true);
- GL_VertexPointer(varray_vertex3f);
memset(&mstate, 0, sizeof(mstate));
// FIXME: need alpha mask for fogging...
//mstate.tex[0] = R_GetTexture(texture);
//mstate.pointer_texcoord = ent->model->alias.zymdata_texcoords;
- R_Mesh_State_Texture(&mstate);
+ mstate.pointer_vertex = varray_vertex3f;
+ R_Mesh_State(&mstate);
GL_ColorPointer(NULL);
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], ent->alpha * fog);
R_Mesh_Matrix(&r_identitymatrix);
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = vertex3f;
+ R_Mesh_State(&m);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_DepthMask(true);
GL_DepthTest(false); // magic
- GL_VertexPointer(vertex3f);
GL_ColorPointer(NULL);
GL_Color(r_refdef.viewblend[0], r_refdef.viewblend[1], r_refdef.viewblend[2], r_refdef.viewblend[3]);
r = 64;
R_Mesh_Matrix(&r_identitymatrix);
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_GetSpace(8);
vertex3f[ 0] = mins[0];vertex3f[ 1] = mins[1];vertex3f[ 2] = mins[2];
R_Mesh_Matrix(&ent->matrix);
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = nomodelvertex3f;
+ R_Mesh_State(&m);
if (ent->flags & EF_ADDITIVE)
{
GL_DepthMask(true);
}
GL_DepthTest(true);
- GL_VertexPointer(nomodelvertex3f);
if (fogenabled)
{
memcpy(color4f, nomodelcolor4f, sizeof(float[6*4]));
R_Mesh_Matrix(&r_identitymatrix);
GL_ColorPointer(NULL);
GL_Color(cr, cg, cb, ca);
- GL_VertexPointer(varray_vertex3f);
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;
- R_Mesh_State_Texture(&m);
+ 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;
GL_DepthMask(true);
GL_DepthTest(true);
- memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
{
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ 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);
}
}
qglEnable (GL_TEXTURE_SHADER_NV);
}
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ 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_Texture(&m);
+ R_Mesh_State(&m);
if (fogenabled)
{
R_FillColors(varray_color4f, surf->mesh.num_vertices, 1, 1, 1, alpha);
if (fogenabled)
{
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = surf->mesh.data_vertex3f;
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.fog);
- GL_VertexPointer(surf->mesh.data_vertex3f);
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
GL_ColorPointer(varray_color4f);
- R_Mesh_State_Texture(&m);
+ 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);
}
GL_DepthTest(true);
GL_ColorPointer(varray_color4f);
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_FillColors(varray_color4f, surf->mesh.num_vertices, base, base, base, currentalpha);
if (!(ent->effects & EF_FULLBRIGHT))
{
m.tex[0] = R_GetTexture(texture->skin.glow);
GL_ColorPointer(varray_color4f);
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.pointer_vertex = surf->mesh.data_vertex3f;
if (m.tex[0])
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
RSurf_FoggedColors_Vertex3f_Color4f(surf->mesh.data_vertex3f, varray_color4f, 1, 1, 1, currentalpha, 1, surf->mesh.num_vertices, modelorg);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
m.tex[0] = R_GetTexture(texture->skin.fog);
GL_ColorPointer(varray_color4f);
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.pointer_vertex = surf->mesh.data_vertex3f;
if (m.tex[0])
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
RSurf_FogPassColors_Vertex3f_Color4f(surf->mesh.data_vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], currentalpha, 1, surf->mesh.num_vertices, modelorg);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
if (surf->visframe == r_framecount)
{
lightmaptexturenum = R_GetTexture(surf->lightmaptexture);
- //if (m.tex[1] != lightmaptexturenum)
- //{
- m.tex[1] = lightmaptexturenum;
- // R_Mesh_State_Texture(&m);
- //}
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.tex[1] = lightmaptexturenum;
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
m.pointer_texcoord[1] = surf->mesh.data_texcoordlightmap2f;
m.pointer_texcoord[2] = surf->mesh.data_texcoorddetail2f;
m.pointer_texcoord[3] = surf->mesh.data_texcoordtexture2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
if (surf->visframe == r_framecount)
{
lightmaptexturenum = R_GetTexture(surf->lightmaptexture);
- //if (m.tex[1] != lightmaptexturenum)
- //{
- m.tex[1] = lightmaptexturenum;
- // R_Mesh_State_Texture(&m);
- //}
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.tex[1] = lightmaptexturenum;
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
m.pointer_texcoord[1] = surf->mesh.data_texcoordlightmap2f;
m.pointer_texcoord[2] = surf->mesh.data_texcoorddetail2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
if (surf->visframe == r_framecount)
{
lightmaptexturenum = R_GetTexture(surf->lightmaptexture);
- //if (m.tex[1] != lightmaptexturenum)
- //{
- m.tex[1] = lightmaptexturenum;
- // R_Mesh_State_Texture(&m);
- //}
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.tex[1] = lightmaptexturenum;
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
m.pointer_texcoord[1] = surf->mesh.data_texcoordlightmap2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
{
if (surf->visframe == r_framecount)
{
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
if (surf->visframe == r_framecount)
{
lightmaptexturenum = R_GetTexture(surf->lightmaptexture);
- //if (m.tex[0] != lightmaptexturenum)
- //{
- m.tex[0] = lightmaptexturenum;
- // R_Mesh_State_Texture(&m);
- //}
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.tex[0] = lightmaptexturenum;
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordlightmap2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
{
if (surf->visframe == r_framecount)
{
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.pointer_vertex = surf->mesh.data_vertex3f;
if (m.tex[0])
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
RSurf_FogPassColors_Vertex3f_Color4f(surf->mesh.data_vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], 1, 1, surf->mesh.num_vertices, modelorg);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
{
if (surf->visframe == r_framecount)
{
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoorddetail2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
{
if (surf->visframe == r_framecount)
{
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
{
if (surf->visframe == r_framecount)
{
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordtexture2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
if (surf->visframe == r_framecount)
{
lightmaptexturenum = R_GetTexture(surf->lightmaptexture);
- //if (m.tex[0] != lightmaptexturenum)
- //{
- m.tex[0] = lightmaptexturenum;
- // R_Mesh_State_Texture(&m);
- //}
- GL_VertexPointer(surf->mesh.data_vertex3f);
+ m.tex[0] = lightmaptexturenum;
+ m.pointer_vertex = surf->mesh.data_vertex3f;
m.pointer_texcoord[0] = surf->mesh.data_texcoordlightmap2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(surf->mesh.num_vertices, surf->mesh.num_triangles, surf->mesh.data_element3i);
}
}
GL_DepthMask(false);
GL_DepthTest(true);
R_Mesh_Matrix(&ent->matrix);
- GL_VertexPointer(varray_vertex3f);
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = varray_vertex3f;
+ R_Mesh_State(&m);
i = portal - ent->model->brushq1.portals;
GL_ColorPointer(NULL);
void R_DrawCollisionBrush(colbrushf_t *brush)
{
int i;
+ rmeshstate_t m;
+ memset(&m, 0, sizeof(m));
+ 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);
- GL_VertexPointer(brush->points->v);
R_Mesh_Draw(brush->numpoints, brush->numtriangles, brush->elements);
}
void R_Q3BSP_DrawCollisionFace(entity_render_t *ent, q3mface_t *face)
{
int i;
+ rmeshstate_t m;
if (!face->num_collisiontriangles)
return;
+ memset(&m, 0, sizeof(m));
+ 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);
- GL_VertexPointer(face->data_collisionvertex3f);
R_Mesh_Draw(face->num_collisionvertices, face->num_collisiontriangles, face->data_collisionelement3i);
}
GL_DepthTest(true);
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
- GL_VertexPointer(face->data_vertex3f);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
GL_ColorMask(1,1,1,1);
}
}
else
GL_Color(0, 0, 0, 1);
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
m.texrgbscale[1] = 2;
GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
m.pointer_texcoord[0] = face->data_texcoordtexture2f;
GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
m.pointer_texcoord[0] = face->data_texcoordlightmap2f;
GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
GL_Color(r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, r_shadow_realtime_world_lightmaps.value, 1);
else
GL_Color(1, 1, 1, 1);
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
}
else
GL_Color(0, 0, 0, 1);
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
}
GL_ColorPointer(varray_color4f);
}
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(true);
- R_Mesh_State_Texture(&m);
mul = 2.0f;
if (r_shadow_realtime_world.integer && r_shadow_realtime_world_lightmaps.value != 1)
mul *= r_shadow_realtime_world_lightmaps.value;
}
GL_ColorPointer(varray_color4f);
}
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
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);
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
}
}
GL_ColorPointer(varray_color4f);
}
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
+ m.pointer_vertex = face->data_vertex3f;
+ R_Mesh_State(&m);
qglDisable(GL_CULL_FACE);
R_Mesh_Draw(face->num_vertices, face->num_triangles, face->data_element3i);
qglEnable(GL_CULL_FACE);
}
if (r_drawcollisionbrushes.integer >= 1)
{
- rmeshstate_t m;
- memset(&m, 0, sizeof(m));
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
- R_Mesh_State_Texture(&m);
qglPolygonOffset(r_drawcollisionbrushes_polygonfactor.value, r_drawcollisionbrushes_polygonoffset.value);
for (i = 0;i < model->brushq3.data_thismodel->numbrushes;i++)
if (model->brushq3.data_thismodel->firstbrush[i].colbrushf && model->brushq3.data_thismodel->firstbrush[i].colbrushf->numtriangles)
alpha = e->alpha;
GL_ColorPointer(NULL);
GL_Color(alpha, alpha, alpha, 1);
- GL_VertexPointer(e->vert[0]);
memset(&m, 0, sizeof(m));
m.tex[0] = R_GetTexture(explosiontexture);
m.pointer_texcoord[0] = explosiontexcoord2f[0];
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = e->vert[0];
+ R_Mesh_State(&m);
R_Mesh_Draw(numverts, numtriangles, explosiontris[0]);
}
else
m.tex[0] = R_GetTexture(r_lightningbeamtexture);
m.pointer_texcoord[0] = varray_texcoord2f[0];
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = varray_vertex3f;
+ R_Mesh_State(&m);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
GL_DepthMask(false);
R_CalcLightningBeamPolygonTexCoord2f(varray_texcoord2f[0] + 0, t1, t2);
R_CalcLightningBeamPolygonTexCoord2f(varray_texcoord2f[0] + 8, t1 + 0.33, t2 + 0.33);
R_CalcLightningBeamPolygonTexCoord2f(varray_texcoord2f[0] + 16, t1 + 0.66, t2 + 0.66);
- GL_VertexPointer(varray_vertex3f);
if (fogenabled)
{
void R_Shadow_RenderVolume(int numvertices, int numtriangles, const float *vertex3f, const int *element3i)
{
- GL_VertexPointer(vertex3f);
+ rmeshstate_t m;
+ memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
+ R_Mesh_State(&m);
if (r_shadowstage == SHADOWSTAGE_STENCIL)
{
// decrement stencil if frontface is behind depthbuffer
void R_Shadow_RenderShadowMeshVolume(shadowmesh_t *firstmesh)
{
shadowmesh_t *mesh;
- if (r_shadowstage == SHADOWSTAGE_STENCIL)
+ rmeshstate_t m;
+ memset(&m, 0, sizeof(m));
+ for (mesh = firstmesh;mesh;mesh = mesh->next)
{
- // decrement stencil if frontface is behind depthbuffer
- qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
- qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
- for (mesh = firstmesh;mesh;mesh = mesh->next)
+ m.pointer_vertex = mesh->vertex3f;
+ R_Mesh_State(&m);
+ if (r_shadowstage == SHADOWSTAGE_STENCIL)
{
- GL_VertexPointer(mesh->vertex3f);
+ // decrement stencil if frontface is behind depthbuffer
+ qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
+ qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
c_rtcached_shadowmeshes++;
c_rtcached_shadowtris += mesh->numtriangles;
+ // increment stencil if backface is behind depthbuffer
+ qglCullFace(GL_BACK); // quake is backwards, this culls front faces
+ qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
}
- // increment stencil if backface is behind depthbuffer
- qglCullFace(GL_BACK); // quake is backwards, this culls front faces
- qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
- }
- for (mesh = firstmesh;mesh;mesh = mesh->next)
- {
- GL_VertexPointer(mesh->vertex3f);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
c_rtcached_shadowmeshes++;
c_rtcached_shadowtris += mesh->numtriangles;
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(false);
GL_DepthTest(true);
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorPointer(NULL);
GL_Color(0, 0, 0, 1);
qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
{
rmeshstate_t m;
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
GL_ColorMask(0, 0, 0, 0);
{
rmeshstate_t m;
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_BlendFunc(GL_ONE, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
{
rmeshstate_t m;
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_BlendFunc(GL_ONE, GL_ONE);
GL_DepthMask(false);
GL_DepthTest(true);
{
rmeshstate_t m;
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(true);
int renders;
float color[3], color2[3];
rmeshstate_t m;
- GL_VertexPointer(vertex3f);
if (gl_dot3arb && gl_texturecubemap && gl_combine.integer && gl_stencil)
{
if (!bumptexture)
{
// 3/2 3D combine path (Geforce3, Radeon 8500)
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(bumptexture);
m.texcubemap[1] = R_GetTexture(r_shadow_normalcubetexture);
m.tex3d[2] = R_GetTexture(r_shadow_attenuation3dtexture);
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
m.pointer_texcoord[2] = varray_texcoord3f[2];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
R_Shadow_GenTexCoords_Diffuse_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(basetexture);
m.pointer_texcoord[0] = texcoord2f;
if (lightcubemap)
m.pointer_texcoord[1] = varray_texcoord3f[1];
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
}
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
{
// 1/2/2 3D combine path (original Radeon)
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex3d[0] = R_GetTexture(r_shadow_attenuation3dtexture);
m.pointer_texcoord[0] = varray_texcoord3f[0];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[0], numverts, vertex3f, matrix_modeltoattenuationxyz);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(bumptexture);
m.texcubemap[1] = R_GetTexture(r_shadow_normalcubetexture);
m.texcombinergb[0] = GL_REPLACE;
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_BlendFunc(GL_DST_ALPHA, GL_ZERO);
R_Shadow_GenTexCoords_Diffuse_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin);
R_Mesh_Draw(numverts, numtriangles, elements);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(basetexture);
m.pointer_texcoord[0] = texcoord2f;
if (lightcubemap)
m.pointer_texcoord[1] = varray_texcoord3f[1];
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
}
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
{
// 2/2 3D combine path (original Radeon)
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(bumptexture);
m.texcubemap[1] = R_GetTexture(r_shadow_normalcubetexture);
m.texcombinergb[0] = GL_REPLACE;
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
R_Shadow_GenTexCoords_Diffuse_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(basetexture);
m.tex3d[1] = R_GetTexture(r_shadow_attenuation3dtexture);
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltoattenuationxyz);
{
// 4/2 2D combine path (Geforce3, Radeon 8500)
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(bumptexture);
m.texcubemap[1] = R_GetTexture(r_shadow_normalcubetexture);
m.texcombinergb[0] = GL_REPLACE;
m.pointer_texcoord[1] = varray_texcoord3f[1];
m.pointer_texcoord[2] = varray_texcoord2f[2];
m.pointer_texcoord[3] = varray_texcoord2f[3];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
R_Shadow_GenTexCoords_Diffuse_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(basetexture);
m.pointer_texcoord[0] = texcoord2f;
if (lightcubemap)
m.pointer_texcoord[1] = varray_texcoord3f[1];
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
}
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
{
// 2/2/2 2D combine path (any dot3 card)
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(r_shadow_attenuation2dtexture);
m.tex[1] = R_GetTexture(r_shadow_attenuation2dtexture);
m.pointer_texcoord[0] = varray_texcoord2f[0];
m.pointer_texcoord[1] = varray_texcoord2f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(0,0,0,1);
GL_BlendFunc(GL_ONE, GL_ZERO);
R_Shadow_Transform_Vertex3f_TexCoord2f(varray_texcoord2f[0], numverts, vertex3f, matrix_modeltoattenuationxyz);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(bumptexture);
m.texcubemap[1] = R_GetTexture(r_shadow_normalcubetexture);
m.texcombinergb[0] = GL_REPLACE;
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_BlendFunc(GL_DST_ALPHA, GL_ZERO);
R_Shadow_GenTexCoords_Diffuse_NormalCubeMap(varray_texcoord3f[1], numverts, vertex3f, svector3f, tvector3f, normal3f, relativelightorigin);
R_Mesh_Draw(numverts, numtriangles, elements);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(basetexture);
m.pointer_texcoord[0] = texcoord2f;
if (lightcubemap)
m.pointer_texcoord[1] = varray_texcoord3f[1];
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
}
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
GL_ColorPointer(varray_color4f);
VectorScale(lightcolor, r_shadow_lightintensityscale.value, color2);
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(basetexture);
m.pointer_texcoord[0] = texcoord2f;
if (r_textureunits.integer >= 2)
m.pointer_texcoord[1] = varray_texcoord2f[1];
R_Shadow_Transform_Vertex3f_TexCoord2f(varray_texcoord2f[1], numverts, vertex3f, matrix_modeltoattenuationxyz);
}
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
for (renders = 0;renders < 64 && (color2[0] > 0 || color2[1] > 0 || color2[2] > 0);renders++, color2[0]--, color2[1]--, color2[2]--)
{
color[0] = bound(0, color2[0], 1);
bumptexture = r_shadow_blankbumptexture;
if (glosstexture == r_shadow_blankglosstexture)
colorscale *= r_shadow_gloss2intensity.value;
- GL_VertexPointer(vertex3f);
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!
{
// 2/0/0/1/2 3D combine blendsquare path
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(bumptexture);
m.texcubemap[1] = R_GetTexture(r_shadow_normalcubetexture);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(0,0,0,1);
// this squares the result
GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = vertex3f;
+ R_Mesh_State(&m);
// square alpha in framebuffer a few times to make it shiny
GL_BlendFunc(GL_ZERO, GL_DST_ALPHA);
// these comments are a test run through this math for intensity 0.5
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex3d[0] = R_GetTexture(r_shadow_attenuation3dtexture);
m.pointer_texcoord[0] = varray_texcoord3f[0];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_BlendFunc(GL_DST_ALPHA, GL_ZERO);
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[0], numverts, vertex3f, matrix_modeltoattenuationxyz);
R_Mesh_Draw(numverts, numtriangles, elements);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(glosstexture);
if (lightcubemap)
{
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
}
m.pointer_texcoord[0] = texcoord2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
VectorScale(lightcolor, colorscale, color2);
{
// 2/0/0/2 3D combine blendsquare path
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(bumptexture);
m.texcubemap[1] = R_GetTexture(r_shadow_normalcubetexture);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(0,0,0,1);
// this squares the result
GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = vertex3f;
+ R_Mesh_State(&m);
// square alpha in framebuffer a few times to make it shiny
GL_BlendFunc(GL_ZERO, GL_DST_ALPHA);
// these comments are a test run through this math for intensity 0.5
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(glosstexture);
m.tex3d[1] = R_GetTexture(r_shadow_attenuation3dtexture);
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltoattenuationxyz);
{
// 2/0/0/2/2 2D combine blendsquare path
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(bumptexture);
m.texcubemap[1] = R_GetTexture(r_shadow_normalcubetexture);
m.texcombinergb[1] = GL_DOT3_RGBA_ARB;
m.pointer_texcoord[0] = texcoord2f;
m.pointer_texcoord[1] = varray_texcoord3f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(0,0,0,1);
// this squares the result
GL_BlendFunc(GL_SRC_ALPHA, GL_ZERO);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ m.pointer_vertex = vertex3f;
+ R_Mesh_State(&m);
// square alpha in framebuffer a few times to make it shiny
GL_BlendFunc(GL_ZERO, GL_DST_ALPHA);
// these comments are a test run through this math for intensity 0.5
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(r_shadow_attenuation2dtexture);
m.tex[1] = R_GetTexture(r_shadow_attenuation2dtexture);
m.pointer_texcoord[0] = varray_texcoord2f[0];
m.pointer_texcoord[1] = varray_texcoord2f[1];
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_BlendFunc(GL_DST_ALPHA, GL_ZERO);
R_Shadow_Transform_Vertex3f_TexCoord2f(varray_texcoord2f[0], numverts, vertex3f, matrix_modeltoattenuationxyz);
R_Shadow_Transform_Vertex3f_TexCoord2f(varray_texcoord2f[1], numverts, vertex3f, matrix_modeltoattenuationz);
c_rt_lighttris += numtriangles;
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = vertex3f;
m.tex[0] = R_GetTexture(glosstexture);
if (lightcubemap)
{
R_Shadow_Transform_Vertex3f_TexCoord3f(varray_texcoord3f[1], numverts, vertex3f, matrix_modeltolight);
}
m.pointer_texcoord[0] = texcoord2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_ColorMask(1,1,1,0);
GL_BlendFunc(GL_DST_ALPHA, GL_ONE);
VectorScale(lightcolor, colorscale, color2);
qglDisable(GL_STENCIL_TEST);
//qglDisable(GL_CULL_FACE);
GL_ColorMask(1,1,1,1);
- memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
GL_ColorPointer(NULL);
GL_Color(0,0.1,0,1);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
+ memset(&m, 0, sizeof(m));
for (mesh = rtlight->static_meshchain_shadow;mesh;mesh = mesh->next)
{
- GL_VertexPointer(mesh->vertex3f);
+ m.pointer_vertex = mesh->vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw_ShowTris(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
//qglEnable(GL_CULL_FACE);
qglDisable(GL_STENCIL_TEST);
//qglDisable(GL_CULL_FACE);
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&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_VertexPointer(mesh->vertex3f);
+ m.pointer_vertex = mesh->vertex3f;
+ R_Mesh_State(&m);
R_Mesh_Draw_ShowTris(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
//qglEnable(GL_CULL_FACE);
if (visiblevolumes)
{
memset(&m, 0, sizeof(m));
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
GL_BlendFunc(GL_ONE, GL_ONE);
GL_DepthMask(false);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(false); // don't modify or read zbuffer
- GL_VertexPointer(skyboxvertex3f);
+ m.pointer_vertex = skyboxvertex3f;
m.pointer_texcoord[0] = skyboxtexcoord2f;
for (i = 0;i < 6;i++)
{
m.tex[0] = R_GetTexture(skyboxside[i]);
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(6*4, 2, skyboxelements + i * 6);
}
}
Matrix4x4_CreateTranslate(&scroll2matrix, speedscale * 2, speedscale * 2, 0);
Matrix4x4_CreateIdentity(&identitymatrix);
- GL_VertexPointer(skysphere_vertex3f);
GL_ColorPointer(NULL);
GL_Color(1, 1, 1, 1);
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(false); // don't modify or read zbuffer
memset(&m, 0, sizeof(m));
+ m.pointer_vertex = skysphere_vertex3f;
m.tex[0] = R_GetTexture(solidskytexture);
m.pointer_texcoord[0] = skysphere_texcoord2f;
R_Mesh_TextureMatrix(0, &scroll1matrix);
m.tex[1] = R_GetTexture(alphaskytexture);
m.texcombinergb[1] = gl_combine.integer ? GL_INTERPOLATE_ARB : GL_DECAL;
m.pointer_texcoord[1] = skysphere_texcoord2f;
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_TextureMatrix(1, &scroll2matrix);
R_Mesh_Draw(skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
R_Mesh_TextureMatrix(1, &identitymatrix);
else
{
// two pass
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_Draw(skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
m.tex[0] = R_GetTexture(alphaskytexture);
- R_Mesh_State_Texture(&m);
+ R_Mesh_State(&m);
R_Mesh_TextureMatrix(0, &scroll2matrix);
R_Mesh_Draw(skysphere_numverts, skysphere_numtriangles, skysphere_element3i);
}