vis: fix ambient sounds when using func_detail, broken in tyrutils-ericw-v0.15.3
This commit is contained in:
parent
8ed849f462
commit
98a020fde7
|
|
@ -110,6 +110,7 @@ typedef struct {
|
|||
extern int numportals;
|
||||
extern int portalleafs;
|
||||
extern int portalleafs_real;
|
||||
extern int *clustermap;
|
||||
|
||||
extern portal_t *portals;
|
||||
extern leaf_t *leafs;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,11 @@ CalcAmbientSounds(bsp2_t *bsp)
|
|||
for (j = 0; j < NUM_AMBIENTS; j++)
|
||||
dists[j] = 1020;
|
||||
|
||||
vis = &uncompressed[i * leafbytes_real];
|
||||
if (portalleafs != portalleafs_real) {
|
||||
vis = &uncompressed[clustermap[i] * leafbytes_real];
|
||||
} else {
|
||||
vis = &uncompressed[i * leafbytes_real];
|
||||
}
|
||||
|
||||
for (j = 0; j < portalleafs_real; j++) {
|
||||
if (!(vis[j >> 3] & (1 << (j & 7))))
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ static byte *vismap_end; // past visfile
|
|||
|
||||
int originalvismapsize;
|
||||
|
||||
byte *uncompressed; // [leafbytes_real*portalleafs_real]
|
||||
byte *uncompressed; // [leafbytes_real*portalleafs]
|
||||
|
||||
int leafbytes; // (portalleafs+63)>>3
|
||||
int leaflongs;
|
||||
|
|
@ -1275,8 +1275,7 @@ main(int argc, char **argv)
|
|||
StripExtension(statetmpfile);
|
||||
DefaultExtension(statetmpfile, ".vi0");
|
||||
|
||||
uncompressed = malloc(leafbytes_real * portalleafs_real);
|
||||
memset(uncompressed, 0, leafbytes_real * portalleafs_real);
|
||||
uncompressed = calloc(portalleafs, leafbytes_real);
|
||||
|
||||
// CalcPassages ();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue