mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- implement per-renderer sprite hiding based on the actor's render feature flags
- hook the thing up to zscript (does not currently compile)
This commit is contained in:
parent
8bb5687159
commit
712d21e26a
4 changed files with 37 additions and 0 deletions
|
@ -79,6 +79,7 @@ EXTERN_CVAR (Float, transsouls)
|
|||
|
||||
extern TArray<spritedef_t> sprites;
|
||||
extern TArray<spriteframe_t> SpriteFrames;
|
||||
extern uint32_t r_renderercaps;
|
||||
|
||||
enum HWRenderStyle
|
||||
{
|
||||
|
@ -677,6 +678,13 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
|
|||
if (!(thing->flags & MF_STEALTH) || !mDrawer->FixedColormap || !gl_enhanced_nightvision || thing == camera)
|
||||
return;
|
||||
}
|
||||
|
||||
// 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 ((!!((uint32_t)(thing->renderrequired) & ~r_renderercaps)) ||
|
||||
(!!((uint32_t)(thing->renderhidden) & r_renderercaps)))
|
||||
return;
|
||||
|
||||
int spritenum = thing->sprite;
|
||||
DVector2 sprscale = thing->Scale;
|
||||
if (thing->player != NULL)
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
EXTERN_CVAR(Float, transsouls)
|
||||
EXTERN_CVAR(Int, r_drawfuzz)
|
||||
extern uint32_t r_renderercaps;
|
||||
|
||||
bool RenderPolySprite::GetLine(AActor *thing, DVector2 &left, DVector2 &right)
|
||||
{
|
||||
|
@ -176,6 +177,12 @@ bool RenderPolySprite::IsThingCulled(AActor *thing)
|
|||
return true;
|
||||
}
|
||||
|
||||
// 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 ((!!((uint32_t)(thing->renderrequired) & ~r_renderercaps)) ||
|
||||
(!!((uint32_t)(thing->renderhidden) & r_renderercaps)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1837,3 +1837,18 @@ DEFINE_SCRIPTED_PROPERTY(unmorphflash, S, PowerMorph)
|
|||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
// actor render feature filters - stop rendering if the renderer does/does not support certain features
|
||||
//==========================================================================
|
||||
DEFINE_SCRIPTED_PROPERTY(renderrequired, I, Actor)
|
||||
{
|
||||
PROP_INT_PARM(f, 0);
|
||||
defaults->renderrequired = f;
|
||||
}
|
||||
|
||||
DEFINE_SCRIPTED_PROPERTY(renderhidden, I, Actor)
|
||||
{
|
||||
PROP_INT_PARM(f, 0);
|
||||
defaults->renderhidden = f;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
|
||||
EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
|
||||
EXTERN_CVAR(Bool, r_drawvoxels);
|
||||
extern uint32_t r_renderercaps;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -968,6 +969,12 @@ namespace swrenderer
|
|||
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 ((!!((uint32_t)(thing->renderrequired) & ~r_renderercaps)) ||
|
||||
(!!((uint32_t)(thing->renderhidden) & r_renderercaps)))
|
||||
return false;
|
||||
|
||||
// [ZZ] Or less definitely not visible (hue)
|
||||
// [ZZ] 10.01.2016: don't try to clip stuff inside a skybox against the current portal.
|
||||
RenderPortal *renderportal = Thread->Portal.get();
|
||||
|
|
Loading…
Reference in a new issue