cvar_t r_modellights = {CVAR_SAVE, "r_modellights", "4"};
cvar_t r_vismarklights = {0, "r_vismarklights", "1"};
cvar_t r_coronas = {CVAR_SAVE, "r_coronas", "1"};
-cvar_t gl_flashblend = {CVAR_SAVE, "gl_flashblend", "1"};
+cvar_t gl_flashblend = {CVAR_SAVE, "gl_flashblend", "0"};
static rtexture_t *lightcorona;
static rtexturepool_t *lighttexturepool;
float dist;
// for comparisons to minimum acceptable light
- while(node->contents >= 0)
+ while(node->plane)
{
dist = PlaneDiff(lightorigin, node->plane);
if (dist > light->rtlight.lightmap_cullradius)
// check if leaf is visible according to pvs
leaf = (mleaf_t *)node;
i = leaf->clusterindex;
- if (leaf->nummarksurfaces && (i >= pvsbits || CHECKPVSBIT(pvs, i)))
+ if (leaf->numleaffaces && (i >= pvsbits || CHECKPVSBIT(pvs, i)))
{
- int *surfacepvsframes, d, impacts, impactt;
+ int d, impacts, impactt;
float sdist, maxdist, dist2, impact[3];
msurface_t *surf;
// mark the polygons
maxdist = light->rtlight.lightmap_cullradius2;
- surfacepvsframes = ent->model->brushq1.surfacepvsframes;
- for (i = 0;i < leaf->nummarksurfaces;i++)
+ for (i = 0;i < leaf->numleaffaces;i++)
{
- if (surfacepvsframes[leaf->firstmarksurface[i]] != ent->model->brushq1.pvsframecount)
+ if (ent == r_refdef.worldentity && !r_worldsurfacevisible[leaf->firstleafface[i]])
continue;
- surf = ent->model->brushq1.surfaces + leaf->firstmarksurface[i];
+ surf = ent->model->brushq1.surfaces + leaf->firstleafface[i];
dist = sdist = PlaneDiff(lightorigin, surf->plane);
if (surf->flags & SURF_PLANEBACK)
dist = -dist;
int i, bit, bitindex;
dlight_t *light;
vec3_t lightorigin;
- if (!gl_flashblend.integer && r_dynamic.integer && ent->model && ent->model->brushq1.num_leafs)
+ if (!gl_flashblend.integer && r_dynamic.integer && ent->model && ent->model->brush.num_leafs)
{
for (i = 0, light = r_dlight;i < r_numdlights;i++, light++)
{
lightpvsbytes = 0;
if (r_vismarklights.integer && ent->model->brush.FatPVS)
lightpvsbytes = ent->model->brush.FatPVS(ent->model, lightorigin, 0, lightpvs, sizeof(lightpvs));
- R_RecursiveMarkLights(ent, lightorigin, light, bit, bitindex, ent->model->brushq1.nodes + ent->model->brushq1.hulls[0].firstclipnode, lightpvs, min(lightpvsbytes * 8, ent->model->brush.num_pvsclusters));
+ R_RecursiveMarkLights(ent, lightorigin, light, bit, bitindex, ent->model->brush.data_nodes + ent->model->brushq1.hulls[0].firstclipnode, lightpvs, min(lightpvsbytes * 8, ent->model->brush.num_pvsclusters));
}
}
}