- added new renderstyles AddStencil and AddShaded.

This commit is contained in:
Christoph Oelckers 2014-05-13 21:16:06 +02:00
parent ca4179caa3
commit 30f57c0b8e
7 changed files with 44 additions and 16 deletions

View file

@ -605,7 +605,13 @@ void APowerInvisibility::DoEffect ()
case (NAME_Stencil):
Owner->RenderStyle = STYLE_Stencil;
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_Translucent):
Owner->RenderStyle = STYLE_Translucent;
@ -685,7 +691,13 @@ int APowerInvisibility::AlterWeaponSprite (visstyle_t *vis)
case (NAME_Stencil):
vis->RenderStyle = STYLE_Stencil;
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_Translucent):
default:

View file

@ -30,6 +30,7 @@ xx(Cumulative)
xx(Fuzzy)
xx(Opaque)
xx(Stencil)
xx(AddStencil)
// Render styles
xx(Normal)
@ -37,6 +38,7 @@ xx(SoulTrans)
xx(OptFuzzy)
xx(Add)
xx(Shaded)
xx(AddShaded)
xx(TranslucentStencil)
xx(Shadow)
xx(Subtract)

View file

@ -3542,6 +3542,8 @@ static const int LegacyRenderStyleIndices[] =
3, // STYLE_SoulTrans,
4, // STYLE_OptFuzzy,
5, // STYLE_Stencil,
6, // STYLE_AddStencil
7, // STYLE_AddShaded
64, // STYLE_Translucent
65, // STYLE_Add,
66, // STYLE_Shaded,

View file

@ -658,6 +658,9 @@ public:
case NAME_Stencil:
th->RenderStyle = STYLE_Stencil;
break;
case NAME_AddStencil:
th->RenderStyle = STYLE_AddStencil;
break;
case NAME_Translucent:
th->RenderStyle = STYLE_Translucent;
break;
@ -668,6 +671,9 @@ public:
case NAME_Shaded:
th->RenderStyle = STYLE_Shaded;
break;
case NAME_AddShaded:
th->RenderStyle = STYLE_AddShaded;
break;
case NAME_TranslucentStencil:
th->RenderStyle = STYLE_TranslucentStencil;
break;

View file

@ -47,18 +47,20 @@ CVAR (Int, r_drawfuzz, 1, CVAR_ARCHIVE)
#ifndef __APPLE__
FRenderStyle LegacyRenderStyles[STYLE_Count] =
{
/* STYLE_None */ {{ STYLEOP_None, STYLEALPHA_Zero, STYLEALPHA_Zero, 0 }},
/* STYLE_Normal */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_Alpha1 }},
/* STYLE_Fuzzy */ {{ STYLEOP_Fuzz, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 }},
/* STYLE_SoulTrans */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_TransSoulsAlpha }},
/* STYLE_OptFuzzy */ {{ STYLEOP_FuzzOrAdd, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 }},
/* STYLE_Stencil */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_Alpha1 | STYLEF_ColorIsFixed }},
/* STYLE_Translucent */ {{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 }},
/* 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 }},
/* STYLE_Subtract*/ {{ STYLEOP_RevSub, STYLEALPHA_Src, STYLEALPHA_One, 0 }},
{ { STYLEOP_None, STYLEALPHA_Zero, STYLEALPHA_Zero, 0 } }, /* STYLE_None */
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_Alpha1 } }, /* STYLE_Normal */
{ { STYLEOP_Fuzz, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 } }, /* STYLE_Fuzzy */
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_TransSoulsAlpha } }, /* STYLE_SoulTrans */
{ { STYLEOP_FuzzOrAdd, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 } }, /* STYLE_OptFuzzy */
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_Alpha1 | STYLEF_ColorIsFixed } }, /* STYLE_Stencil */
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, 0 } }, /* STYLE_Translucent */
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_One, 0 } }, /* STYLE_Add */
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_RedIsAlpha | STYLEF_ColorIsFixed } }, /* STYLE_Shaded */
{ { STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed } }, /* STYLE_TranslucentStencil */
{ { STYLEOP_Shadow, 0, 0, 0 } }, /* STYLE_Shadow */
{ { 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
FRenderStyle LegacyRenderStyles[STYLE_Count];
@ -77,6 +79,8 @@ static const BYTE Styles[STYLE_Count * 4] =
STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed,
STYLEOP_Shadow, 0, 0, 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

View file

@ -50,6 +50,8 @@ enum ERenderStyle
STYLE_TranslucentStencil,
STYLE_Shadow,
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
};

View file

@ -797,12 +797,12 @@ DEFINE_PROPERTY(renderstyle, S, Actor)
PROP_STRING_PARM(str, 0);
static const char * renderstyles[]={
"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[]={
STYLE_None, STYLE_Normal, STYLE_Fuzzy, STYLE_SoulTrans, STYLE_OptFuzzy,
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.
if (!strnicmp(str, "style_", 6)) str+=6;