- added a new render style 'Shadow'. Essentially it's just a black translucent stencil with an alpha of 0.3. The purpose of this style is to be used as a software renderer approximation of GZDoom's spectre effect.
- allow setting 'Shadow' as default fuzz effect - changed CVAR conversion that strings 'false' and 'true' get evaluated as integers 0 and 1 respectively so that changing boolean CVARs to int does not destroy their values. SVN r3076 (trunk)
This commit is contained in:
parent
e46183d836
commit
231e7a1c6d
9 changed files with 81 additions and 16 deletions
|
|
@ -141,6 +141,7 @@ FRenderStyle LegacyRenderStyles[STYLE_Count] =
|
|||
/* STYLE_Add */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, 0 }},
|
||||
/* STYLE_Shaded */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_RedIsAlpha | STYLEF_ColorIsFixed }},
|
||||
/* STYLE_TranslucentStencil */{{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed }},
|
||||
/* STYLE_Shadow */{{ STYLEOP_Shadow, 0, 0, 0 }},
|
||||
};
|
||||
#else
|
||||
FRenderStyle LegacyRenderStyles[STYLE_Count];
|
||||
|
|
@ -157,6 +158,7 @@ static const BYTE Styles[STYLE_Count * 4] =
|
|||
STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, 0,
|
||||
STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_RedIsAlpha | STYLEF_ColorIsFixed,
|
||||
STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed,
|
||||
STYLEOP_Shadow, 0, 0, 0
|
||||
};
|
||||
|
||||
static struct LegacyInit
|
||||
|
|
@ -2068,7 +2070,7 @@ void R_InitColumnDrawers ()
|
|||
}
|
||||
|
||||
// [RH] Choose column drawers in a single place
|
||||
EXTERN_CVAR (Bool, r_drawfuzz)
|
||||
EXTERN_CVAR (Int, r_drawfuzz)
|
||||
EXTERN_CVAR (Float, transsouls)
|
||||
CVAR (Bool, r_drawtrans, true, 0)
|
||||
|
||||
|
|
@ -2235,6 +2237,13 @@ ESPSResult R_SetPatchStyle (FRenderStyle style, fixed_t alpha, int translation,
|
|||
|
||||
style.CheckFuzz();
|
||||
|
||||
if (style.BlendOp == STYLEOP_Shadow)
|
||||
{
|
||||
style = LegacyRenderStyles[STYLE_TranslucentStencil];
|
||||
alpha = FRACUNIT*3/10;
|
||||
color = 0;
|
||||
}
|
||||
|
||||
if (style.Flags & STYLEF_TransSoulsAlpha)
|
||||
{
|
||||
alpha = fixed_t(transsouls * FRACUNIT);
|
||||
|
|
@ -2390,16 +2399,42 @@ bool FRenderStyle::IsVisible(fixed_t alpha) const throw()
|
|||
|
||||
void FRenderStyle::CheckFuzz()
|
||||
{
|
||||
if (BlendOp == STYLEOP_FuzzOrAdd)
|
||||
switch (BlendOp)
|
||||
{
|
||||
BlendOp = (r_drawfuzz || !r_drawtrans) ? STYLEOP_Fuzz : STYLEOP_Add;
|
||||
default:
|
||||
return;
|
||||
|
||||
case STYLEOP_FuzzOrAdd:
|
||||
if (r_drawtrans && r_drawfuzz == 0)
|
||||
{
|
||||
BlendOp = STYLEOP_Add;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case STYLEOP_FuzzOrSub:
|
||||
if (r_drawtrans && r_drawfuzz == 0)
|
||||
{
|
||||
BlendOp = STYLEOP_Sub;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case STYLEOP_FuzzOrRevSub:
|
||||
if (r_drawtrans && r_drawfuzz == 0)
|
||||
{
|
||||
BlendOp = STYLEOP_RevSub;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (BlendOp == STYLEOP_FuzzOrSub)
|
||||
|
||||
if (r_drawfuzz == 2)
|
||||
{
|
||||
BlendOp = (r_drawfuzz || !r_drawtrans) ? STYLEOP_Fuzz : STYLEOP_Sub;
|
||||
BlendOp = STYLEOP_Shadow;
|
||||
}
|
||||
else if (BlendOp == STYLEOP_FuzzOrRevSub)
|
||||
else
|
||||
{
|
||||
BlendOp = (r_drawfuzz || !r_drawtrans) ? STYLEOP_Fuzz : STYLEOP_RevSub;
|
||||
BlendOp = STYLEOP_Fuzz;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue