[model] Ensure the pvs is not inverted

Mod_DecompressVis_set (via Mod_LeafPVS_set) can be used to recycle pvs
sets, but the set may have been set to everything at some stage, which
is implemented by inverting the set (making the set infinite) and having
1-bits remove elements from the set. This is most definitely not wanted
for pvs :)

Currently undecided what to do about Mod_DecompressVis_mix, thus the
fixme.

Fixes the flickering lights in any map where the camera is out of the
map for a single frame (eg, start.bsp, The Catacombs (hipnotic, hip2m3)).
This commit is contained in:
Bill Currie 2021-07-27 17:54:50 +09:00
parent 1f57f81a20
commit 9e2c474d38

View file

@ -92,6 +92,8 @@ Mod_DecompressVis_set (const byte *in, const mod_brush_t *brush, byte defvis,
byte *start = out;
int row, c;
// Ensure the set repesents visible leafs rather than invisible leafs.
pvs->inverted = 0;
row = (brush->visleafs + 7) >> 3;
if (!in) { // no vis info, so make all visible
@ -125,6 +127,8 @@ Mod_DecompressVis_mix (const byte *in, const mod_brush_t *brush, byte defvis,
byte *start = out;
int row, c;
//FIXME should pvs->inverted be checked and the vis bits used to remove
// set bits?
row = (brush->visleafs + 7) >> 3;
if (!in) { // no vis info, so make all visible