diff --git a/src/gamedata/r_defs.h b/src/gamedata/r_defs.h index 8c551ba0c8..4987ee6fc5 100644 --- a/src/gamedata/r_defs.h +++ b/src/gamedata/r_defs.h @@ -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 diff --git a/src/gamedata/textures/texturemanager.cpp b/src/gamedata/textures/texturemanager.cpp index 3f1225f401..589f787b39 100644 --- a/src/gamedata/textures/texturemanager.cpp +++ b/src/gamedata/textures/texturemanager.cpp @@ -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")) { @@ -723,18 +726,20 @@ void FTextureManager::ParseColorization(FScanner& sc) tm.BlendColor = V_GetColor(NULL, sc) & 0xffffff; sc.MustGetToken(','); sc.MustGetString(); - static const char* opts[] = {"none", "alpha", "screen", "overlay", "hardlight", nullptr}; + 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()) { diff --git a/src/rendering/hwrenderer/scene/hw_renderstate.h b/src/rendering/hwrenderer/scene/hw_renderstate.h index d725d820d3..42092b2e1a 100644 --- a/src/rendering/hwrenderer/scene/hw_renderstate.h +++ b/src/rendering/hwrenderer/scene/hw_renderstate.h @@ -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; } diff --git a/wadsrc/static/zscript/mapdata.zs b/wadsrc/static/zscript/mapdata.zs index d3fd0d21b5..3628ca7508 100644 --- a/wadsrc/static/zscript/mapdata.zs +++ b/wadsrc/static/zscript/mapdata.zs @@ -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;