Add +ONLYVISIBLEINMIRRORS and +INVISIBLEINMIRRORS actor flags. The former makes the actor only visible in reflections, while the latter makes the actor not cast reflections in mirrors.

This commit is contained in:
nashmuhandes 2022-06-19 17:25:59 +08:00 committed by Christoph Oelckers
commit 593627f049
7 changed files with 41 additions and 0 deletions

View file

@ -735,6 +735,17 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
viewmaster = thing->master;
}
// [Nash] filter visibility in mirrors
bool isInMirror = di->mCurrentPortal && (di->mCurrentPortal->mState->MirrorFlag > 0 || di->mCurrentPortal->mState->PlaneMirrorFlag > 0);
if (thing->renderflags2 & RF2_INVISIBLEINMIRRORS && isInMirror)
{
return;
}
else if (thing->renderflags2 & RF2_ONLYVISIBLEINMIRRORS && !isInMirror)
{
return;
}
// Some added checks if the camera actor is not supposed to be seen. It can happen that some portal setup has this actor in view in which case it may not be skipped here
if (viewmaster == camera && !vp.showviewer)
{