]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix rendering of fullbright stuff in showsurfaces 3
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Dec 2008 11:32:52 +0000 (11:32 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Dec 2008 11:32:52 +0000 (11:32 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8576 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index fa23e089ddbd308d19de7da6a75d7b990f6227a8..95ac160dc0b1a0a738ffa45b9136ee94f43bdf39 100644 (file)
@@ -5779,6 +5779,29 @@ static void RSurf_DrawBatch_ShowSurfaces(int texturenumsurfaces, msurface_t **te
        }
 }
 
+static void RSurf_DrawBatch_GL11_MakeFullbrightLightmapColorArray(int texturenumsurfaces, msurface_t **texturesurfacelist)
+{
+       int texturesurfaceindex;
+       int i;
+       float f;
+       float *v, *c2;
+       for (texturesurfaceindex = 0;texturesurfaceindex < texturenumsurfaces;texturesurfaceindex++)
+       {
+               const msurface_t *surface = texturesurfacelist[texturesurfaceindex];
+               for (i = 0, v = (rsurface.vertex3f + 3 * surface->num_firstvertex), c2 = (rsurface.array_color4f + 4 * surface->num_firstvertex);i < surface->num_vertices;i++, v += 3, c2 += 4)
+               {
+                       f = FogPoint_Model(v);
+                       c2[0] = 1;
+                       c2[1] = 1;
+                       c2[2] = 1;
+                       c2[3] = 1;
+               }
+       }
+       rsurface.lightmapcolor4f = rsurface.array_color4f;
+       rsurface.lightmapcolor4f_bufferobject = 0;
+       rsurface.lightmapcolor4f_bufferoffset = 0;
+}
+
 static void RSurf_DrawBatch_GL11_ApplyFog(int texturenumsurfaces, msurface_t **texturesurfacelist)
 {
        int texturesurfaceindex;
@@ -6532,6 +6555,9 @@ static void R_DrawTextureSurfaceList_ShowSurfaces3(int texturenumsurfaces, msurf
        rsurface.lightmapcolor4f_bufferobject = rsurface.modellightmapcolor4f_bufferobject;
        rsurface.lightmapcolor4f_bufferoffset = rsurface.modellightmapcolor4f_bufferoffset;
 
+       if(!rsurface.lightmapcolor4f)
+               RSurf_DrawBatch_GL11_MakeFullbrightLightmapColorArray(texturenumsurfaces, texturesurfacelist);
+
        if (rsurface.texture->currentmaterialflags & MATERIALFLAG_MODELLIGHT)
        {
                qboolean applycolor = true;