From ac92225a7eec9da31156e8ae13fb0e16145de6f9 Mon Sep 17 00:00:00 2001 From: cholleme <> Date: Sun, 29 Jun 2003 21:57:40 +0000 Subject: [PATCH] A color state fix Something that I forgot in the shader definition --- gl_bumpgf.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gl_bumpgf.c b/gl_bumpgf.c index 9b4ba05..d2c6b52 100644 --- a/gl_bumpgf.c +++ b/gl_bumpgf.c @@ -605,6 +605,8 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie glDisable(GL_CULL_FACE); //Con_Printf("Cullstuff %s\n",shader->name); } + + glColor3ub(255,255,255); for (i=0; inumstages; i++) { GF3_SetupSimpleStage(&shader->stages[i]); @@ -742,7 +744,6 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie GL_SelectTexture(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); GL_Bind(lightmap_textures+lightmapIndex); - qglClientActiveTextureARB(GL_TEXTURE0_ARB); glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords); glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -795,6 +796,15 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie glDisableClientState(GL_COLOR_ARRAY); } else if (shader->flags & SURF_PPLIGHT) { + //No colors no lightmap + + if (shader->colorstages[0].src_blend >= 0) { + glBlendFunc(shader->colorstages[0].src_blend, shader->colorstages[0].dst_blend); + glEnable(GL_BLEND); + } else { + glDisable(GL_BLEND); + } + glColor3f(0,0,0); glDisable(GL_TEXTURE_2D); glDrawElements(GL_TRIANGLES,numIndecies,GL_UNSIGNED_INT,indecies);