From: havoc Date: Thu, 22 Feb 2007 03:42:25 +0000 (+0000) Subject: fix a bug in transparent mesh rendering which often caused crashes X-Git-Tag: xonotic-v0.1.0preview~3528 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=30a7888334527bb340a540d05d8acbdc24a8b772;p=xonotic%2Fdarkplaces.git fix a bug in transparent mesh rendering which often caused crashes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6888 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index d2fa102c..7ef9c09e 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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];