mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- added new renderstyles AddStencil and AddShaded.
This commit is contained in:
parent
ca4179caa3
commit
30f57c0b8e
7 changed files with 44 additions and 16 deletions
|
@ -605,7 +605,13 @@ void APowerInvisibility::DoEffect ()
|
||||||
case (NAME_Stencil):
|
case (NAME_Stencil):
|
||||||
Owner->RenderStyle = STYLE_Stencil;
|
Owner->RenderStyle = STYLE_Stencil;
|
||||||
break;
|
break;
|
||||||
case (NAME_None):
|
case (NAME_AddStencil) :
|
||||||
|
Owner->RenderStyle = STYLE_AddStencil;
|
||||||
|
break;
|
||||||
|
case (NAME_TranslucentStencil) :
|
||||||
|
Owner->RenderStyle = STYLE_TranslucentStencil;
|
||||||
|
break;
|
||||||
|
case (NAME_None) :
|
||||||
case (NAME_Cumulative):
|
case (NAME_Cumulative):
|
||||||
case (NAME_Translucent):
|
case (NAME_Translucent):
|
||||||
Owner->RenderStyle = STYLE_Translucent;
|
Owner->RenderStyle = STYLE_Translucent;
|
||||||
|
@ -685,7 +691,13 @@ int APowerInvisibility::AlterWeaponSprite (visstyle_t *vis)
|
||||||
case (NAME_Stencil):
|
case (NAME_Stencil):
|
||||||
vis->RenderStyle = STYLE_Stencil;
|
vis->RenderStyle = STYLE_Stencil;
|
||||||
break;
|
break;
|
||||||
case (NAME_None):
|
case (NAME_TranslucentStencil) :
|
||||||
|
vis->RenderStyle = STYLE_TranslucentStencil;
|
||||||
|
break;
|
||||||
|
case (NAME_AddStencil) :
|
||||||
|
vis->RenderStyle = STYLE_AddStencil;
|
||||||
|
break;
|
||||||
|
case (NAME_None) :
|
||||||
case (NAME_Cumulative):
|
case (NAME_Cumulative):
|
||||||
case (NAME_Translucent):
|
case (NAME_Translucent):
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -30,6 +30,7 @@ xx(Cumulative)
|
||||||
xx(Fuzzy)
|
xx(Fuzzy)
|
||||||
xx(Opaque)
|
xx(Opaque)
|
||||||
xx(Stencil)
|
xx(Stencil)
|
||||||
|
xx(AddStencil)
|
||||||
|
|
||||||
// Render styles
|
// Render styles
|
||||||
xx(Normal)
|
xx(Normal)
|
||||||
|
@ -37,6 +38,7 @@ xx(SoulTrans)
|
||||||
xx(OptFuzzy)
|
xx(OptFuzzy)
|
||||||
xx(Add)
|
xx(Add)
|
||||||
xx(Shaded)
|
xx(Shaded)
|
||||||
|
xx(AddShaded)
|
||||||
xx(TranslucentStencil)
|
xx(TranslucentStencil)
|
||||||
xx(Shadow)
|
xx(Shadow)
|
||||||
xx(Subtract)
|
xx(Subtract)
|
||||||
|
|
|
@ -3542,6 +3542,8 @@ static const int LegacyRenderStyleIndices[] =
|
||||||
3, // STYLE_SoulTrans,
|
3, // STYLE_SoulTrans,
|
||||||
4, // STYLE_OptFuzzy,
|
4, // STYLE_OptFuzzy,
|
||||||
5, // STYLE_Stencil,
|
5, // STYLE_Stencil,
|
||||||
|
6, // STYLE_AddStencil
|
||||||
|
7, // STYLE_AddShaded
|
||||||
64, // STYLE_Translucent
|
64, // STYLE_Translucent
|
||||||
65, // STYLE_Add,
|
65, // STYLE_Add,
|
||||||
66, // STYLE_Shaded,
|
66, // STYLE_Shaded,
|
||||||
|
|
|
@ -658,6 +658,9 @@ public:
|
||||||
case NAME_Stencil:
|
case NAME_Stencil:
|
||||||
th->RenderStyle = STYLE_Stencil;
|
th->RenderStyle = STYLE_Stencil;
|
||||||
break;
|
break;
|
||||||
|
case NAME_AddStencil:
|
||||||
|
th->RenderStyle = STYLE_AddStencil;
|
||||||
|
break;
|
||||||
case NAME_Translucent:
|
case NAME_Translucent:
|
||||||
th->RenderStyle = STYLE_Translucent;
|
th->RenderStyle = STYLE_Translucent;
|
||||||
break;
|
break;
|
||||||
|
@ -668,6 +671,9 @@ public:
|
||||||
case NAME_Shaded:
|
case NAME_Shaded:
|
||||||
th->RenderStyle = STYLE_Shaded;
|
th->RenderStyle = STYLE_Shaded;
|
||||||
break;
|
break;
|
||||||
|
case NAME_AddShaded:
|
||||||
|
th->RenderStyle = STYLE_AddShaded;
|
||||||
|
break;
|
||||||
case NAME_TranslucentStencil:
|
case NAME_TranslucentStencil:
|
||||||
th->RenderStyle = STYLE_TranslucentStencil;
|
th->RenderStyle = STYLE_TranslucentStencil;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -47,18 +47,20 @@ CVAR (Int, r_drawfuzz, 1, CVAR_ARCHIVE)
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
FRenderStyle LegacyRenderStyles[STYLE_Count] =
|
FRenderStyle LegacyRenderStyles[STYLE_Count] =
|
||||||
{
|
{
|
||||||
/* STYLE_None */ {{ STYLEOP_None, STYLEALPHA_Zero, STYLEALPHA_Zero, 0 }},
|
{ { STYLEOP_None, STYLEALPHA_Zero, STYLEALPHA_Zero, 0 } }, /* STYLE_None */
|
||||||
/* STYLE_Normal */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_Alpha1 }},
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_Alpha1 } }, /* STYLE_Normal */
|
||||||
/* STYLE_Fuzzy */ {{ STYLEOP_Fuzz, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 }},
|
{ { STYLEOP_Fuzz, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 } }, /* STYLE_Fuzzy */
|
||||||
/* STYLE_SoulTrans */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_TransSoulsAlpha }},
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_TransSoulsAlpha } }, /* STYLE_SoulTrans */
|
||||||
/* STYLE_OptFuzzy */ {{ STYLEOP_FuzzOrAdd, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 }},
|
{ { STYLEOP_FuzzOrAdd, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 } }, /* STYLE_OptFuzzy */
|
||||||
/* STYLE_Stencil */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_Alpha1 | STYLEF_ColorIsFixed }},
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_Alpha1 | STYLEF_ColorIsFixed } }, /* STYLE_Stencil */
|
||||||
/* STYLE_Translucent */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 }},
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 } }, /* STYLE_Translucent */
|
||||||
/* STYLE_Add */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, 0 }},
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, 0 } }, /* STYLE_Add */
|
||||||
/* STYLE_Shaded */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_RedIsAlpha | STYLEF_ColorIsFixed }},
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_RedIsAlpha | STYLEF_ColorIsFixed } }, /* STYLE_Shaded */
|
||||||
/* STYLE_TranslucentStencil */{{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed }},
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed } }, /* STYLE_TranslucentStencil */
|
||||||
/* STYLE_Shadow */ {{ STYLEOP_Shadow, 0, 0, 0 }},
|
{ { STYLEOP_Shadow, 0, 0, 0 } }, /* STYLE_Shadow */
|
||||||
/* STYLE_Subtract*/ {{ STYLEOP_RevSub, STYLEALPHA_Src, STYLEALPHA_One, 0 }},
|
{ { STYLEOP_RevSub, STYLEALPHA_Src, STYLEALPHA_One, 0 } }, /* STYLE_Subtract*/
|
||||||
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, STYLEF_ColorIsFixed } }, /* STYLE_AddStencil */
|
||||||
|
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, STYLEF_RedIsAlpha | STYLEF_ColorIsFixed } }, /* STYLE_AddShaded */
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
FRenderStyle LegacyRenderStyles[STYLE_Count];
|
FRenderStyle LegacyRenderStyles[STYLE_Count];
|
||||||
|
@ -77,6 +79,8 @@ static const BYTE Styles[STYLE_Count * 4] =
|
||||||
STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed,
|
STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed,
|
||||||
STYLEOP_Shadow, 0, 0, 0,
|
STYLEOP_Shadow, 0, 0, 0,
|
||||||
STYLEOP_RevSub, STYLEALPHA_Src, STYLEALPHA_One, 0,
|
STYLEOP_RevSub, STYLEALPHA_Src, STYLEALPHA_One, 0,
|
||||||
|
STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, STYLEF_Alpha1 | STYLEF_ColorIsFixed,
|
||||||
|
STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, STYLEF_RedIsAlpha | STYLEF_ColorIsFixed,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct LegacyInit
|
static struct LegacyInit
|
||||||
|
|
|
@ -50,6 +50,8 @@ enum ERenderStyle
|
||||||
STYLE_TranslucentStencil,
|
STYLE_TranslucentStencil,
|
||||||
STYLE_Shadow,
|
STYLE_Shadow,
|
||||||
STYLE_Subtract, // Actually this is 'reverse subtract' but this is what normal people would expect by 'subtract'.
|
STYLE_Subtract, // Actually this is 'reverse subtract' but this is what normal people would expect by 'subtract'.
|
||||||
|
STYLE_AddStencil, // Fill image interior with alphacolor
|
||||||
|
STYLE_AddShaded, // Treat patch data as alpha values for alphacolor
|
||||||
|
|
||||||
STYLE_Count
|
STYLE_Count
|
||||||
};
|
};
|
||||||
|
|
|
@ -797,12 +797,12 @@ DEFINE_PROPERTY(renderstyle, S, Actor)
|
||||||
PROP_STRING_PARM(str, 0);
|
PROP_STRING_PARM(str, 0);
|
||||||
static const char * renderstyles[]={
|
static const char * renderstyles[]={
|
||||||
"NONE", "NORMAL", "FUZZY", "SOULTRANS", "OPTFUZZY", "STENCIL",
|
"NONE", "NORMAL", "FUZZY", "SOULTRANS", "OPTFUZZY", "STENCIL",
|
||||||
"TRANSLUCENT", "ADD", "SHADED", "SHADOW", "SUBTRACT", NULL };
|
"TRANSLUCENT", "ADD", "SHADED", "SHADOW", "SUBTRACT", "ADDSTENCIL", "ADDSHADED", NULL };
|
||||||
|
|
||||||
static const int renderstyle_values[]={
|
static const int renderstyle_values[]={
|
||||||
STYLE_None, STYLE_Normal, STYLE_Fuzzy, STYLE_SoulTrans, STYLE_OptFuzzy,
|
STYLE_None, STYLE_Normal, STYLE_Fuzzy, STYLE_SoulTrans, STYLE_OptFuzzy,
|
||||||
STYLE_TranslucentStencil, STYLE_Translucent, STYLE_Add, STYLE_Shaded,
|
STYLE_TranslucentStencil, STYLE_Translucent, STYLE_Add, STYLE_Shaded,
|
||||||
STYLE_Shadow, STYLE_Subtract};
|
STYLE_Shadow, STYLE_Subtract, STYLE_AddStencil, STYLE_AddShaded};
|
||||||
|
|
||||||
// make this work for old style decorations, too.
|
// make this work for old style decorations, too.
|
||||||
if (!strnicmp(str, "style_", 6)) str+=6;
|
if (!strnicmp(str, "style_", 6)) str+=6;
|
||||||
|
|
Loading…
Reference in a new issue