]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix alphatest surfaces in GL11 path
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 16 May 2012 07:44:52 +0000 (07:44 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 10 Jun 2012 17:08:16 +0000 (19:08 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11819 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=d76bc3d30f1b197c6f1260875d7bed34f0655e36

gl_rmain.c

index ec47acce8b1ecdcda2dc52f656000e3e500b3ac5..62222a731b8f9189a7b3564243bd7a7d19d5f8bc 100644 (file)
@@ -10021,7 +10021,7 @@ static void R_DrawTextureSurfaceList_GL11(int texturenumsurfaces, const msurface
                switch (layer->type)
                {
                case TEXTURELAYERTYPE_LITTEXTURE:
-                       if (layer->blendfunc1 == GL_ONE && layer->blendfunc2 == GL_ZERO)
+                       if (layer->blendfunc1 == GL_ONE && layer->blendfunc2 == GL_ZERO && !(rsurface.texture->currentmaterialflags & MATERIALFLAG_ALPHATEST))
                        {
                                // two-pass lit texture with 2x rgbscale
                                // first the lightmap pass
@@ -10054,6 +10054,8 @@ static void R_DrawTextureSurfaceList_GL11(int texturenumsurfaces, const msurface
                                R_Mesh_TexCoordPointer(0, 2, GL_FLOAT, sizeof(float[2]), rsurface.batchtexcoordtexture2f, rsurface.batchtexcoordtexture2f_vertexbuffer, rsurface.batchtexcoordtexture2f_bufferoffset);
                                if (rsurface.texture->currentmaterialflags & MATERIALFLAG_MODELLIGHT)
                                        RSurf_DrawBatch_GL11_VertexShade(layer->color[0], layer->color[1], layer->color[2], layer->color[3], layer->color[0] != 1 || layer->color[1] != 1 || layer->color[2] != 1 || layer->color[3] != 1, applyfog);
+                               else if (FAKELIGHT_ENABLED)
+                                       RSurf_DrawBatch_GL11_FakeLight(layer->color[0], layer->color[1], layer->color[2], layer->color[3], layer->color[0] != 1 || layer->color[1] != 1 || layer->color[2] != 1 || layer->color[3] != 1, applyfog);
                                else
                                        RSurf_DrawBatch_GL11_VertexColor(layer->color[0], layer->color[1], layer->color[2], layer->color[3], layer->color[0] != 1 || layer->color[1] != 1 || layer->color[2] != 1 || layer->color[3] != 1, applyfog);
                        }