]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a bug in transparent mesh rendering which often caused crashes
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 22 Feb 2007 03:42:25 +0000 (03:42 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 22 Feb 2007 03:42:25 +0000 (03:42 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6888 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index d2fa102cce068d6afd366e309e5ea7eb52f9dec5..7ef9c09ed7a9c1ad675220753cfabf52f5c33fa6 100644 (file)
@@ -3307,7 +3307,7 @@ static void RSurf_DrawBatch_Lightmap(int texturenumsurfaces, msurface_t **textur
        }
        R_Mesh_ColorPointer(rsurface_lightmapcolor4f);
        GL_Color(r, g, b, a);
-       if (rsurface_uselightmaptexture && !(rsurface_texture->currentmaterialflags & MATERIALFLAG_FULLBRIGHT))
+       if (lightmode == 0 && rsurface_uselightmaptexture && !(rsurface_texture->currentmaterialflags & MATERIALFLAG_FULLBRIGHT))
                RSurf_DrawBatch_WithLightmapSwitching(texturenumsurfaces, texturesurfacelist, 0, -1);
        else
                RSurf_DrawBatch_Simple(texturenumsurfaces, texturesurfacelist);
@@ -3714,6 +3714,7 @@ static void R_DrawSurface_TransparentCallback(const entity_render_t *ent, const
                // scan ahead until we find a different texture
                endsurface = min(i + 1024, numsurfaces);
                texturenumsurfaces = 0;
+               texturesurfacelist[texturenumsurfaces++] = surface;
                for (;j < endsurface;j++)
                {
                        surface = rsurface_model->data_surfaces + surfacelist[j];