mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- added oortal handlong to P_RecursiveSound.
This commit is contained in:
parent
4bb0ca5889
commit
27ac207f4c
1 changed files with 31 additions and 0 deletions
|
@ -150,9 +150,40 @@ void P_RecursiveSound (sector_t *sec, AActor *soundtarget, bool splash, int soun
|
|||
}
|
||||
}
|
||||
|
||||
bool checkabove = !sec->PortalBlocksSound(sector_t::ceiling);
|
||||
bool checkbelow = !sec->PortalBlocksSound(sector_t::floor);
|
||||
|
||||
for (i = 0; i < sec->linecount; i++)
|
||||
{
|
||||
check = sec->lines[i];
|
||||
|
||||
// I wish there was a better method to do this than randomly looking through the portal at a few places...
|
||||
if (checkabove)
|
||||
{
|
||||
sector_t *upper =
|
||||
P_PointInSector(check->v1->x + check->dx / 2 + sec->SkyBoxes[sector_t::ceiling]->scaleX,
|
||||
check->v1->y + check->dy / 2 + sec->SkyBoxes[sector_t::ceiling]->scaleY);
|
||||
|
||||
P_RecursiveSound(upper, soundtarget, splash, soundblocks, emitter, maxdist);
|
||||
}
|
||||
if (checkbelow)
|
||||
{
|
||||
sector_t *lower =
|
||||
P_PointInSector(check->v1->x + check->dx / 2 + sec->SkyBoxes[sector_t::floor]->scaleX,
|
||||
check->v1->y + check->dy / 2 + sec->SkyBoxes[sector_t::floor]->scaleY);
|
||||
|
||||
P_RecursiveSound(lower, soundtarget, splash, soundblocks, emitter, maxdist);
|
||||
}
|
||||
FLinePortal *port = check->getPortal();
|
||||
if (port && (port->mFlags & PORTF_SOUNDTRAVERSE))
|
||||
{
|
||||
if (port->mDestination)
|
||||
{
|
||||
P_RecursiveSound(port->mDestination->frontsector, soundtarget, splash, soundblocks, emitter, maxdist);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (check->sidedef[1] == NULL ||
|
||||
!(check->flags & ML_TWOSIDED))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue