- added A_SetRenderStyle function which replaces A_SetTranslucent. A_SetTranslucent had to be deprecated due to obsolete semantics of the renderstyle argument.

This commit is contained in:
Christoph Oelckers 2016-10-02 00:43:05 +02:00
parent ff0b879323
commit 80f2f5829f
3 changed files with 36 additions and 1 deletions

View file

@ -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

View file

@ -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);

View file

@ -689,4 +689,22 @@ enum
VRF_NOANGLE = VRF_NOANGLESTART|VRF_NOANGLEEND,
VRF_NOPITCH = VRF_NOPITCHSTART|VRF_NOPITCHEND,
};
};
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,
};