- 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

@ -89,6 +89,31 @@ FSerializer &Serialize(FSerializer &arc, const char *key, line_t &line, line_t *
}
//==========================================================================
//
//
//
//==========================================================================
FSerializer& Serialize(FSerializer& arc, const char* key, TextureManipulation& part, TextureManipulation *def)
{
if (arc.canSkip() && def != nullptr && !memcmp(&part, def, sizeof(part)))
{
return arc;
}
if (arc.BeginObject(key))
{
arc("addcolor", part.AddColor, def->AddColor)
("yoffset", part.ModulateColor, def->ModulateColor)
("xscale", part.BlendColor, def->BlendColor)
("yscale", part.DesaturationFactor, def->DesaturationFactor)
.EndObject();
}
return arc;
}
//==========================================================================
//
//
@ -114,6 +139,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, side_t::part &part, si
("color1", part.SpecialColors[0], def->SpecialColors[0])
("color2", part.SpecialColors[1], def->SpecialColors[1])
("addcolor", part.AdditiveColor, def->AdditiveColor)
("texturefx", part.TextureFx, def->TextureFx)
.EndObject();
}
return arc;
@ -212,6 +238,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, sector_t::splane &p, s
("alpha", p.alpha, def->alpha)
("glowcolor", p.GlowColor, def->GlowColor)
("glowheight", p.GlowHeight, def->GlowHeight)
("texturefx", p.TextureFx, def->TextureFx)
.EndObject();
}
return arc;