From 80f2f5829f50a6ae7094c6b8989d680dee59375e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 2 Oct 2016 00:43:05 +0200 Subject: [PATCH] - added A_SetRenderStyle function which replaces A_SetTranslucent. A_SetTranslucent had to be deprecated due to obsolete semantics of the renderstyle argument. --- src/thingdef/thingdef_codeptr.cpp | 16 ++++++++++++++++ wadsrc/static/actors/actor.txt | 1 + wadsrc/static/actors/constants.txt | 20 +++++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 153c3b5970..ee64df4d08 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -3322,6 +3322,22 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTranslucent) return 0; } +//=========================================================================== +// +// A_SetRenderStyle +// +//=========================================================================== +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRenderStyle) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_FLOAT(alpha); + PARAM_INT_OPT(mode) { mode = 0; } + + self->Alpha = clamp(alpha, 0., 1.); + self->RenderStyle = ERenderStyle(mode); + return 0; +} + //=========================================================================== // // A_FadeIn diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 3354b91d63..fc73b02f38 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -218,6 +218,7 @@ ACTOR Actor native //: Thinker native void A_LogInt(int whattoprint); native void A_LogFloat(float whattoprint); native void A_SetTranslucent(float alpha, int style = 0); + native void A_SetRenderStyle(float alpha, int style = 0); action native A_FadeIn(float reduce = 0.1, int flags = 0); action native A_FadeOut(float reduce = 0.1, int flags = 1); //bool remove == true native void A_FadeTo(float target, float amount = 0.1, int flags = 0); diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index bd6d656434..dce2488c25 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -689,4 +689,22 @@ enum VRF_NOANGLE = VRF_NOANGLESTART|VRF_NOANGLEEND, VRF_NOPITCH = VRF_NOPITCHSTART|VRF_NOPITCHEND, -}; \ No newline at end of file +}; + +enum +{ + STYLE_None, + STYLE_Normal, + STYLE_Fuzzy, + STYLE_SoulTrans, + STYLE_OptFuzzy, + STYLE_Stencil, + STYLE_Translucent, + STYLE_Add, + STYLE_Shaded, + STYLE_TranslucentStencil, + STYLE_Shadow, + STYLE_Subtract, + STYLE_AddStencil, + STYLE_AddShaded, +};