/*
==================
-R_AnimateLight
+R_UpdateLights
==================
*/
-void R_AnimateLight (void)
+void R_UpdateLights(void)
{
int i, j, k;
+ dlight_t *cd;
+ rdlight_t *rd;
-//
// light animations
// 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int)(cl.time * 10);
k = k*22;
d_lightstylevalue[j] = k;
}
-}
-
-
-void R_BuildLightList(void)
-{
- int i;
- dlight_t *cd;
- rdlight_t *rd;
r_numdlights = 0;
c_dlights = 0;
{
cscale = wl->corona * r_coronas.value * 0.25f;
scale = wl->radius * 0.25f;
- R_DrawSprite(GL_ONE, GL_ONE, lightcorona, true, rd->origin, r_viewright, r_viewup, scale, -scale, -scale, scale, wl->color[0] * cscale, wl->color[1] * cscale, wl->color[2] * cscale, 1);
+ R_DrawSprite(GL_ONE, GL_ONE, lightcorona, true, wl->origin, r_viewright, r_viewup, scale, -scale, -scale, scale, wl->color[0] * cscale, wl->color[1] * cscale, wl->color[2] * cscale, 1);
}
}
}
// check if leaf is visible according to pvs
leaf = (mleaf_t *)node;
- i = (leaf - ent->model->brushq1.leafs) - 1;
- if (leaf->nummarksurfaces && (i >= pvsbits || pvs[i >> 3] & (1 << (i & 7))))
+ i = leaf->clusterindex;
+ if (leaf->nummarksurfaces && (i >= pvsbits || CHECKPVSBIT(pvs, i)))
{
int *surfacepvsframes, d, impacts, impactt;
float sdist, maxdist, dist2, impact[3];
int i, bit, bitindex;
rdlight_t *rd;
vec3_t lightorigin;
- if (!gl_flashblend.integer && r_dynamic.integer && ent->model && ent->model->brushq1.numleafs)
+ if (!gl_flashblend.integer && r_dynamic.integer && ent->model && ent->model->brushq1.num_leafs)
{
for (i = 0, rd = r_dlight;i < r_numdlights;i++, rd++)
{
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, rd, bit, bitindex, ent->model->brushq1.nodes + ent->model->brushq1.hulls[0].firstclipnode, lightpvs, min(lightpvsbytes * 8, ent->model->brushq1.visleafs));
+ R_RecursiveMarkLights(ent, lightorigin, rd, bit, bitindex, ent->model->brushq1.nodes + ent->model->brushq1.hulls[0].firstclipnode, lightpvs, min(lightpvsbytes * 8, ent->model->brushq1.num_pvsclusters));
}
}
}