mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
- fixed the colorization parser.
This commit is contained in:
parent
3530bc5945
commit
77469e0512
4 changed files with 13 additions and 8 deletions
|
@ -1208,7 +1208,7 @@ struct side_t
|
|||
uint32_t LeftSide, RightSide; // [RH] Group walls into loops
|
||||
uint16_t TexelLength;
|
||||
int16_t Light;
|
||||
uint8_t Flags;
|
||||
uint16_t Flags;
|
||||
int UDMFIndex; // needed to access custom UDMF fields which are stored in loading order.
|
||||
FLightNode * lighthead; // all dynamic lights that may affect this wall
|
||||
seg_t **segs; // all segs belonging to this sidedef in ascending order. Used for precise rendering
|
||||
|
|
|
@ -692,12 +692,14 @@ void FTextureManager::AddHiresTextures (int wadnum)
|
|||
void FTextureManager::ParseColorization(FScanner& sc)
|
||||
{
|
||||
TextureManipulation tm = {};
|
||||
tm.ModulateColor = 0x01ffffff;
|
||||
sc.MustGetString();
|
||||
FName cname = sc.String;
|
||||
sc.MustGetToken('{');
|
||||
while (!sc.CheckToken('}'))
|
||||
{
|
||||
if (sc.Compare("desaturation"))
|
||||
sc.MustGetString();
|
||||
if (sc.Compare("DesaturationFactor"))
|
||||
{
|
||||
sc.MustGetFloat();
|
||||
tm.DesaturationFactor = (float)sc.Float;
|
||||
|
@ -716,6 +718,7 @@ void FTextureManager::ParseColorization(FScanner& sc)
|
|||
sc.MustGetNumber();
|
||||
tm.ModulateColor.a = sc.Number;
|
||||
}
|
||||
else tm.ModulateColor.a = 1;
|
||||
}
|
||||
else if (sc.Compare("BlendColor"))
|
||||
{
|
||||
|
@ -725,16 +728,18 @@ void FTextureManager::ParseColorization(FScanner& sc)
|
|||
sc.MustGetString();
|
||||
static const char* opts[] = { "none", "alpha", "screen", "overlay", "hardlight", nullptr };
|
||||
tm.AddColor.a = (tm.AddColor.a & ~TextureManipulation::BlendMask) | sc.MustMatchString(opts);
|
||||
if (sc.CheckToken(','))
|
||||
if (sc.Compare("alpha"))
|
||||
{
|
||||
sc.MustGetToken(',');
|
||||
sc.MustGetFloat();
|
||||
tm.BlendColor.a = (uint8_t)clamp(sc.Float, 0., 1.) * 255;
|
||||
tm.BlendColor.a = (uint8_t)(clamp(sc.Float, 0., 1.) * 255);
|
||||
}
|
||||
}
|
||||
else if (sc.Compare("invert"))
|
||||
{
|
||||
tm.AddColor.a |= TextureManipulation::InvertBit;
|
||||
}
|
||||
else sc.ScriptError("Unknown token '%s'", sc.String);
|
||||
}
|
||||
if (tm.CheckIfEnabled())
|
||||
{
|
||||
|
|
|
@ -157,7 +157,7 @@ struct FVector4PalEntry
|
|||
r = newvalue.r * normScale;
|
||||
g = newvalue.g * normScale;
|
||||
b = newvalue.b * normScale;
|
||||
a = newvalue.a;
|
||||
a = 1;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ struct Side native play
|
|||
//DBaseDecal* AttachedDecals; // [RH] Decals bound to the wall
|
||||
native readonly Line linedef;
|
||||
native int16 Light;
|
||||
native uint8 Flags;
|
||||
native uint16 Flags;
|
||||
|
||||
native TextureID GetTexture(int which);
|
||||
native void SetTexture(int which, TextureID tex);
|
||||
|
@ -159,7 +159,7 @@ struct Line native play
|
|||
native uint activation; // activation type
|
||||
native int special;
|
||||
native int args[5]; // <--- hexen-style arguments (expanded to ZDoom's full width)
|
||||
native double alpha; // <--- translucency (0=invisible, FRACUNIT=opaque)
|
||||
native double alpha; // <--- translucency (0=invisible, 1.0=opaque)
|
||||
native readonly Side sidedef[2];
|
||||
native readonly double bbox[4]; // bounding box, for the extent of the LineDef.
|
||||
native readonly Sector frontsector, backsector;
|
||||
|
|
Loading…
Reference in a new issue