]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
upload all q1bsp lightmaps on first frame, rather than waiting for
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 2 Jan 2010 17:03:26 +0000 (17:03 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 2 Jan 2010 17:03:26 +0000 (17:03 +0000)
surfaces to become visible

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9769 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
model_brush.c
model_shared.h

index f959c6c1205c81e882549bb0de7e1fe8fa9f00d6..1323fef26774d0a2d6e6ccb6d385d4a78902bc98 100644 (file)
@@ -11823,20 +11823,19 @@ void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean dep
                        r_surfacelist[numsurfacelist++] = surfaces + j;
        }
        // update lightmaps if needed
-       if (update)
+       if (model->brushq1.firstrender)
+       {
+               model->brushq1.firstrender = false;
+               for (j = model->firstmodelsurface, endj = model->firstmodelsurface + model->nummodelsurfaces;j < endj;j++)
+                       if (update[j])
+                               R_BuildLightMap(r_refdef.scene.worldentity, surfaces + j);
+       }
+       else if (update)
        {
-               int updated = 0;
                for (j = model->firstmodelsurface, endj = model->firstmodelsurface + model->nummodelsurfaces;j < endj;j++)
-               {
                        if (r_refdef.viewcache.world_surfacevisible[j])
-                       {
                                if (update[j])
-                               {
-                                       updated++;
                                        R_BuildLightMap(r_refdef.scene.worldentity, surfaces + j);
-                               }
-                       }
-               }
        }
        // don't do anything if there were no surfaces
        if (!numsurfacelist)
index 4e9ac3a6729798752e60af60dd5111d1e4180486..93c1bbf654500831b9dd44ebc0a08b74bcbfb736 100644 (file)
@@ -2248,6 +2248,7 @@ static void Mod_Q1BSP_LoadFaces(lump_t *l)
 
        loadmodel->num_surfaces = count;
 
+       loadmodel->brushq1.firstrender = true;
        loadmodel->brushq1.lightmapupdateflags = (unsigned char *)Mem_Alloc(loadmodel->mempool, count*sizeof(unsigned char));
 
        totalverts = 0;
index cdf8e17fde6076b83e9b480f3012b0c663b0b2b9..04233ddc9ee05c76b5faa6e94793350ac1a95cc2 100644 (file)
@@ -747,6 +747,7 @@ typedef struct model_brushq1_s
 
        // this contains bytes that are 1 if a surface needs its lightmap rebuilt
        unsigned char *lightmapupdateflags;
+       qboolean firstrender; // causes all surface lightmaps to be loaded in first frame
 }
 model_brushq1_t;