- hooked up the colorization feature.

It can now be used from UDMF and ZScript.
To avoid clutter it doesn't allow setting the values individually but requires definition of a data record in TEXTURES.

colorization
{
    DesaturationFactor <float>
    Invert
    AddColor <color>
    ModulateColor <color>
    BlendColor <color>, <mode> [, <alpha>]
}

Mode for BlendColor can be Alpha (normal translucent blending), as well as 3 special values taken from Build engine games: Screen, Overlay and HardLight.
This commit is contained in:
Christoph Oelckers 2019-12-22 16:08:34 +01:00
commit 9b9fd35107
10 changed files with 265 additions and 79 deletions

View file

@ -652,6 +652,24 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetAdditiveColor, SetAdditiveColor)
return 0;
}
static void SetColorization(sector_t* self, int pos, int cname)
{
if (pos >= 0 && pos < 2)
{
self->SetTextureFx(pos, TexMan.GetTextureManipulation(ENamedName(cname)));
}
}
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetColorization, SetColorization)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos);
PARAM_INT(color);
SetColorization(self, pos, color);
return 0;
}
static void SetFogDensity(sector_t *self, int dens)
{
self->Colormap.FogDensity = dens;
@ -1749,6 +1767,25 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)
return 0;
}
static void SetWallColorization(side_t* self, int pos, int cname)
{
if (pos >= 0 && pos < 2)
{
self->SetTextureFx(pos, TexMan.GetTextureManipulation(ENamedName(cname)));
}
}
DEFINE_ACTION_FUNCTION_NATIVE(_Side, SetColorization, SetWallColorization)
{
PARAM_SELF_STRUCT_PROLOGUE(side_t);
PARAM_INT(pos);
PARAM_INT(color);
SetWallColorization(self, pos, color);
return 0;
}
static int SideIndex(side_t *self)
{
return self->Index();