Added ability to perform reverse fades with A_SetBlend

This commit is contained in:
Major Cooke 2017-12-27 19:21:11 -06:00 committed by Rachael Alexanderson
commit fa0082aef6
3 changed files with 6 additions and 4 deletions

View file

@ -59,6 +59,7 @@ DFlashFader::DFlashFader (float r1, float g1, float b1, float a1,
void DFlashFader::OnDestroy ()
{
Blends[1][3] = 0.f; // Needed in order to cancel out the secondary fade.
SetBlend (1.f);
Super::OnDestroy();
}

View file

@ -3575,16 +3575,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetBlend)
PARAM_FLOAT (alpha);
PARAM_INT (tics);
PARAM_COLOR_DEF (color2);
PARAM_FLOAT_DEF (alpha2);
if (color == MAKEARGB(255,255,255,255))
color = 0;
if (color2 == MAKEARGB(255,255,255,255))
color2 = 0;
if (color2.a == 0)
color2 = color;
// if (color2.a == 0)
// color2 = color;
Create<DFlashFader>(color.r/255.f, color.g/255.f, color.b/255.f, float(alpha),
color2.r/255.f, color2.g/255.f, color2.b/255.f, 0.f,
color2.r/255.f, color2.g/255.f, color2.b/255.f, float(alpha2),
float(tics)/TICRATE, self);
return 0;
}