light: fix lighting with vis data
This commit is contained in:
parent
338ceae8c8
commit
0a8965bae0
|
|
@ -710,6 +710,7 @@ CalcPvs(const bsp2_t *bsp, lightsurf_t *lightsurf)
|
||||||
surfpoint = lightsurf->points[0];
|
surfpoint = lightsurf->points[0];
|
||||||
for (i = 0; i < lightsurf->numpoints; i++, surfpoint += 3) {
|
for (i = 0; i < lightsurf->numpoints; i++, surfpoint += 3) {
|
||||||
const bsp2_dleaf_t *leaf = Light_PointInLeaf (bsp, surfpoint);
|
const bsp2_dleaf_t *leaf = Light_PointInLeaf (bsp, surfpoint);
|
||||||
|
const int leafnum = leaf - bsp->dleafs;
|
||||||
|
|
||||||
if (leaf == NULL)
|
if (leaf == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -726,6 +727,9 @@ CalcPvs(const bsp2_t *bsp, lightsurf_t *lightsurf)
|
||||||
else
|
else
|
||||||
DecompressVis (bsp, bsp->dvisdata + leaf->visofs, bsp->dvisdata + bsp->visdatasize, pointpvs);
|
DecompressVis (bsp, bsp->dvisdata + leaf->visofs, bsp->dvisdata + bsp->visdatasize, pointpvs);
|
||||||
|
|
||||||
|
/* mark this leaf as visible to itself (why is this not the case in the visdata!?!) */
|
||||||
|
pointpvs[leafnum>>3] |= (1<<(leafnum&7));
|
||||||
|
|
||||||
/* merge the pvs for this sample point into lightsurf->pvs */
|
/* merge the pvs for this sample point into lightsurf->pvs */
|
||||||
for (j=0; j<pvssize; j++)
|
for (j=0; j<pvssize; j++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue