MASTERNOSEE flag (#1601)
Makes it so that if an actor's master is invisible due to camera/mirror/portal shenanigans, then the actor will also be invisible. Name based off of an Unreal Engine flag that does the exact same thing. Co-authored-by: Christoph Oelckers <coelckers@users.noreply.github.com>
This commit is contained in:
parent
2c69afa118
commit
bb42e541e9
6 changed files with 54 additions and 11 deletions
|
|
@ -997,6 +997,7 @@ namespace swrenderer
|
|||
// Don't waste time projecting sprites that are definitely not visible.
|
||||
if (thing == nullptr ||
|
||||
(thing->renderflags & RF_INVISIBLE) ||
|
||||
(thing->renderflags & RF_MAYBEINVISIBLE) ||
|
||||
!thing->RenderStyle.IsVisible(thing->Alpha) ||
|
||||
!thing->IsVisibleToPlayer() ||
|
||||
!thing->IsInsideVisibleAngles())
|
||||
|
|
@ -1004,6 +1005,16 @@ namespace swrenderer
|
|||
return false;
|
||||
}
|
||||
|
||||
if ((thing->flags8 & MF8_MASTERNOSEE) && thing->master != nullptr)
|
||||
{
|
||||
// Make MASTERNOSEE actors invisible if their master
|
||||
// is invisible due to viewpoint shenanigans.
|
||||
if (thing->master->renderflags & RF_MAYBEINVISIBLE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// check renderrequired vs ~r_rendercaps, if anything matches we don't support that feature,
|
||||
// check renderhidden vs r_rendercaps, if anything matches we do support that feature and should hide it.
|
||||
if ((!r_debug_disable_vis_filter && !!(thing->RenderRequired & ~r_renderercaps)) ||
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ namespace swrenderer
|
|||
|
||||
if (dist1 + dist2 < distp + 1)
|
||||
{
|
||||
viewpoint.camera->renderflags |= RF_INVISIBLE;
|
||||
viewpoint.camera->renderflags |= RF_MAYBEINVISIBLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ namespace swrenderer
|
|||
// Never draw the player unless in chasecam mode
|
||||
if (!MainThread()->Viewport->viewpoint.showviewer)
|
||||
{
|
||||
MainThread()->Viewport->viewpoint.camera->renderflags |= RF_INVISIBLE;
|
||||
MainThread()->Viewport->viewpoint.camera->renderflags |= RF_MAYBEINVISIBLE;
|
||||
}
|
||||
|
||||
RenderThreadSlices();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue