]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
gl_rmain: Comments and style fix (no pun intended...)
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Nov 2020 18:11:11 +0000 (18:11 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Nov 2020 18:11:11 +0000 (18:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13060 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index ebebd6c3eaea67dcbcb2adce069024d5e75e5ee0..6c2890348efe04e8d4107414d785788eff39751e 100644 (file)
@@ -10075,30 +10075,37 @@ void R_DrawModelSurfaces(entity_render_t *ent, qbool skysurfaces, qbool writedep
                        r_surfacelist[numsurfacelist++] = surfaces + model->sortedmodelsurfaces[i];
        }
 
                        r_surfacelist[numsurfacelist++] = surfaces + model->sortedmodelsurfaces[i];
        }
 
-       // mark lightmaps as dirty if their lightstyle's value changed
-       // we do this by using style chains because most styles do not change on most frames,
-       // and most surfaces do not have styles on them
-       // map packs like Arcane Dimensions (e.g. ad_sepulcher) break this rule and animate most surfaces
+       /*
+        * Mark lightmaps as dirty if their lightstyle's value changed. We do this by
+        * using style chains because most styles do not change on most frames, and most
+        * surfaces do not have styles on them. Mods like Arcane Dimensions (e.g. ad_necrokeep)
+        * break this rule and animate most surfaces.
+        */
        if (update && !skysurfaces && !depthonly && !prepass && model->brushq1.num_lightstyles && r_refdef.scene.lightmapintensity > 0 && r_q1bsp_lightmap_updates_enabled.integer)
        {
        if (update && !skysurfaces && !depthonly && !prepass && model->brushq1.num_lightstyles && r_refdef.scene.lightmapintensity > 0 && r_q1bsp_lightmap_updates_enabled.integer)
        {
-               model_brush_lightstyleinfo_t* style;
-               // for each lightstyle, check if its value changed and mark the lightmaps as dirty if so
+               model_brush_lightstyleinfo_t *style;
+
+               // For each lightstyle, check if its value changed and mark the lightmaps as dirty if so
                for (i = 0, style = model->brushq1.data_lightstyleinfo; i < model->brushq1.num_lightstyles; i++, style++)
                {
                        if (style->value != r_refdef.scene.lightstylevalue[style->style])
                        {
                                int* list = style->surfacelist;
                                style->value = r_refdef.scene.lightstylevalue[style->style];
                for (i = 0, style = model->brushq1.data_lightstyleinfo; i < model->brushq1.num_lightstyles; i++, style++)
                {
                        if (style->value != r_refdef.scene.lightstylevalue[style->style])
                        {
                                int* list = style->surfacelist;
                                style->value = r_refdef.scene.lightstylevalue[style->style];
-                               // value changed - mark the surfaces belonging to this style chain as dirty
+                               // Value changed - mark the surfaces belonging to this style chain as dirty
                                for (j = 0; j < style->numsurfaces; j++)
                                        update[list[j]] = true;
                        }
                }
                                for (j = 0; j < style->numsurfaces; j++)
                                        update[list[j]] = true;
                        }
                }
-               // now check if update flags are set on any surfaces that are visible
+               // Now check if update flags are set on any surfaces that are visible
                if (r_q1bsp_lightmap_updates_hidden_surfaces.integer)
                {
                if (r_q1bsp_lightmap_updates_hidden_surfaces.integer)
                {
-                       // we can do less frequent texture uploads (approximately 10hz for animated lightstyles) by rebuilding lightmaps on surfaces that are not currently visible
-                       // for optimal efficiency, this includes the submodels of the worldmodel, so we use model->num_surfaces, not nummodelsurfaces
+                       /* 
+                        * We can do less frequent texture uploads (approximately 10hz for animated
+                        * lightstyles) by rebuilding lightmaps on surfaces that are not currently visible.
+                        * For optimal efficiency, this includes the submodels of the worldmodel, so we
+                        * use model->num_surfaces, not nummodelsurfaces.
+                        */
                        for (i = 0; i < model->num_surfaces;i++)
                                if (update[i])
                                        R_BuildLightMap(ent, surfaces + i, r_q1bsp_lightmap_updates_combine.integer);
                        for (i = 0; i < model->num_surfaces;i++)
                                if (update[i])
                                        R_BuildLightMap(ent, surfaces + i, r_q1bsp_lightmap_updates_combine.integer);