Skip to content

Commit

Permalink
Rename Sclera to Limbal
Browse files Browse the repository at this point in the history
  • Loading branch information
Ottermandias committed Jul 16, 2024
1 parent 51c7fc8 commit 25491ad
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
36 changes: 18 additions & 18 deletions Glamourer/GameData/CustomizeParameterData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public struct CustomizeParameterData
public Vector3 HairSpecular;
public Vector3 HairHighlight;
public Vector3 LeftEye;
public float LeftScleraIntensity;
public float LeftLimbalIntensity;
public Vector3 RightEye;
public float RightScleraIntensity;
public float RightLimbalIntensity;
public Vector3 FeatureColor;
public float FacePaintUvMultiplier;
public float FacePaintUvOffset;
Expand All @@ -35,9 +35,9 @@ readonly get
CustomizeParameterFlag.HairSpecular => new CustomizeParameterValue(HairSpecular),
CustomizeParameterFlag.HairHighlight => new CustomizeParameterValue(HairHighlight),
CustomizeParameterFlag.LeftEye => new CustomizeParameterValue(LeftEye),
CustomizeParameterFlag.LeftScleraIntensity => new CustomizeParameterValue(LeftScleraIntensity),
CustomizeParameterFlag.LeftLimbalIntensity => new CustomizeParameterValue(LeftLimbalIntensity),
CustomizeParameterFlag.RightEye => new CustomizeParameterValue(RightEye),
CustomizeParameterFlag.RightScleraIntensity => new CustomizeParameterValue(RightScleraIntensity),
CustomizeParameterFlag.RightLimbalIntensity => new CustomizeParameterValue(RightLimbalIntensity),
CustomizeParameterFlag.FeatureColor => new CustomizeParameterValue(FeatureColor),
CustomizeParameterFlag.DecalColor => new CustomizeParameterValue(DecalColor),
CustomizeParameterFlag.FacePaintUvMultiplier => new CustomizeParameterValue(FacePaintUvMultiplier),
Expand All @@ -61,9 +61,9 @@ public bool Set(CustomizeParameterFlag flag, CustomizeParameterValue value)
CustomizeParameterFlag.HairSpecular => SetIfDifferent(ref HairSpecular, value.InternalTriple),
CustomizeParameterFlag.HairHighlight => SetIfDifferent(ref HairHighlight, value.InternalTriple),
CustomizeParameterFlag.LeftEye => SetIfDifferent(ref LeftEye, value.InternalTriple),
CustomizeParameterFlag.LeftScleraIntensity => SetIfDifferent(ref LeftScleraIntensity, value.Single),
CustomizeParameterFlag.LeftLimbalIntensity => SetIfDifferent(ref LeftLimbalIntensity, value.Single),
CustomizeParameterFlag.RightEye => SetIfDifferent(ref RightEye, value.InternalTriple),
CustomizeParameterFlag.RightScleraIntensity => SetIfDifferent(ref RightScleraIntensity, value.Single),
CustomizeParameterFlag.RightLimbalIntensity => SetIfDifferent(ref RightLimbalIntensity, value.Single),
CustomizeParameterFlag.FeatureColor => SetIfDifferent(ref FeatureColor, value.InternalTriple),
CustomizeParameterFlag.DecalColor => SetIfDifferent(ref DecalColor, value.InternalQuadruple),
CustomizeParameterFlag.FacePaintUvMultiplier => SetIfDifferent(ref FacePaintUvMultiplier, value.Single),
Expand All @@ -83,20 +83,20 @@ public readonly unsafe void Apply(ref CustomizeParameter parameters, CustomizePa
_ => new CustomizeParameterValue(SkinDiffuse, MuscleTone).XivQuadruple,
};

parameters.LeftColor = (flags & (CustomizeParameterFlag.LeftEye | CustomizeParameterFlag.LeftScleraIntensity)) switch
parameters.LeftColor = (flags & (CustomizeParameterFlag.LeftEye | CustomizeParameterFlag.LeftLimbalIntensity)) switch
{
0 => parameters.LeftColor,
CustomizeParameterFlag.LeftEye => new CustomizeParameterValue(LeftEye, parameters.LeftColor.W).XivQuadruple,
CustomizeParameterFlag.LeftScleraIntensity => parameters.LeftColor with { W = LeftScleraIntensity },
_ => new CustomizeParameterValue(LeftEye, LeftScleraIntensity).XivQuadruple,
CustomizeParameterFlag.LeftLimbalIntensity => parameters.LeftColor with { W = LeftLimbalIntensity },
_ => new CustomizeParameterValue(LeftEye, LeftLimbalIntensity).XivQuadruple,
};

parameters.RightColor = (flags & (CustomizeParameterFlag.RightEye | CustomizeParameterFlag.RightScleraIntensity)) switch
parameters.RightColor = (flags & (CustomizeParameterFlag.RightEye | CustomizeParameterFlag.RightLimbalIntensity)) switch
{
0 => parameters.RightColor,
CustomizeParameterFlag.RightEye => new CustomizeParameterValue(RightEye, parameters.RightColor.W).XivQuadruple,
CustomizeParameterFlag.RightScleraIntensity => parameters.RightColor with { W = RightScleraIntensity },
_ => new CustomizeParameterValue(RightEye, RightScleraIntensity).XivQuadruple,
CustomizeParameterFlag.RightLimbalIntensity => parameters.RightColor with { W = RightLimbalIntensity },
_ => new CustomizeParameterValue(RightEye, RightLimbalIntensity).XivQuadruple,
};

if (flags.HasFlag(CustomizeParameterFlag.SkinSpecular))
Expand Down Expand Up @@ -165,11 +165,11 @@ public readonly unsafe void ApplySingle(ref CustomizeParameter parameters, Custo
case CustomizeParameterFlag.FacePaintUvOffset:
GetUvOffsetWrite(ref parameters) = FacePaintUvOffset;
break;
case CustomizeParameterFlag.LeftScleraIntensity:
parameters.LeftColor.W = LeftScleraIntensity;
case CustomizeParameterFlag.LeftLimbalIntensity:
parameters.LeftColor.W = LeftLimbalIntensity;
break;
case CustomizeParameterFlag.RightScleraIntensity:
parameters.RightColor.W = RightScleraIntensity;
case CustomizeParameterFlag.RightLimbalIntensity:
parameters.RightColor.W = RightLimbalIntensity;
break;
}
}
Expand All @@ -187,9 +187,9 @@ public static unsafe CustomizeParameterData FromParameters(in CustomizeParameter
HairSpecular = new CustomizeParameterValue(parameter.HairFresnelValue0).InternalTriple,
HairHighlight = new CustomizeParameterValue(parameter.MeshColor).InternalTriple,
LeftEye = new CustomizeParameterValue(parameter.LeftColor).InternalTriple,
LeftScleraIntensity = new CustomizeParameterValue(parameter.LeftColor.W).Single,
LeftLimbalIntensity = new CustomizeParameterValue(parameter.LeftColor.W).Single,
RightEye = new CustomizeParameterValue(parameter.RightColor).InternalTriple,
RightScleraIntensity = new CustomizeParameterValue(parameter.RightColor.W).Single,
RightLimbalIntensity = new CustomizeParameterValue(parameter.RightColor.W).Single,
FeatureColor = new CustomizeParameterValue(parameter.OptionColor).InternalTriple,
DecalColor = FromParameter(decal),
};
Expand Down
12 changes: 6 additions & 6 deletions Glamourer/GameData/CustomizeParameterFlag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public enum CustomizeParameterFlag : ushort
FacePaintUvMultiplier = 0x0400,
FacePaintUvOffset = 0x0800,
DecalColor = 0x1000,
LeftScleraIntensity = 0x2000,
RightScleraIntensity = 0x4000,
LeftLimbalIntensity = 0x2000,
RightLimbalIntensity = 0x4000,
}

public static class CustomizeParameterExtensions
Expand All @@ -31,8 +31,8 @@ public static class CustomizeParameterExtensions
public const CustomizeParameterFlag RgbaQuadruples = CustomizeParameterFlag.DecalColor | CustomizeParameterFlag.LipDiffuse;

public const CustomizeParameterFlag Percentages = CustomizeParameterFlag.MuscleTone
| CustomizeParameterFlag.LeftScleraIntensity
| CustomizeParameterFlag.RightScleraIntensity;
| CustomizeParameterFlag.LeftLimbalIntensity
| CustomizeParameterFlag.RightLimbalIntensity;

public const CustomizeParameterFlag Values = CustomizeParameterFlag.FacePaintUvOffset | CustomizeParameterFlag.FacePaintUvMultiplier;

Expand Down Expand Up @@ -67,8 +67,8 @@ public static string ToName(this CustomizeParameterFlag flag)
CustomizeParameterFlag.FacePaintUvMultiplier => "Multiplier for Face Paint",
CustomizeParameterFlag.FacePaintUvOffset => "Offset of Face Paint",
CustomizeParameterFlag.DecalColor => "Face Paint Color",
CustomizeParameterFlag.LeftScleraIntensity => "Left Sclera Intensity",
CustomizeParameterFlag.RightScleraIntensity => "Right Sclera Intensity",
CustomizeParameterFlag.LeftLimbalIntensity => "Left Limbal Ring Intensity",
CustomizeParameterFlag.RightLimbalIntensity => "Right Limbal Ring Intensity",
_ => string.Empty,
};
}
4 changes: 2 additions & 2 deletions Glamourer/Gui/Tabs/DebugTab/AdvancedCustomizationDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ private static bool TryGetKnown(int type, int idx, out ReadOnlySpan<byte> text)
24 => "LeftEye.R"u8,
25 => "LeftEye.G"u8,
26 => "LeftEye.B"u8,
27 => "LeftSclera"u8,
27 => "LeftLimbal"u8,
28 => "RightEye.R"u8,
29 => "RightEye.G"u8,
30 => "RightEye.B"u8,
31 => "RightSclera"u8,
31 => "RightLimbal"u8,
32 => "Feature.R"u8,
33 => "Feature.G"u8,
34 => "Feature.B"u8,
Expand Down
16 changes: 8 additions & 8 deletions Glamourer/State/StateIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ public static implicit operator StateIndex(CustomizeParameterFlag param)
CustomizeParameterFlag.HairSpecular => new StateIndex(ParamHairSpecular),
CustomizeParameterFlag.HairHighlight => new StateIndex(ParamHairHighlight),
CustomizeParameterFlag.LeftEye => new StateIndex(ParamLeftEye),
CustomizeParameterFlag.LeftScleraIntensity => new StateIndex(ParamLeftScleraIntensity),
CustomizeParameterFlag.LeftLimbalIntensity => new StateIndex(ParamLeftLimbalIntensity),
CustomizeParameterFlag.RightEye => new StateIndex(ParamRightEye),
CustomizeParameterFlag.RightScleraIntensity => new StateIndex(ParamRightScleraIntensity),
CustomizeParameterFlag.RightLimbalIntensity => new StateIndex(ParamRightLimbalIntensity),
CustomizeParameterFlag.FeatureColor => new StateIndex(ParamFeatureColor),
CustomizeParameterFlag.FacePaintUvMultiplier => new StateIndex(ParamFacePaintUvMultiplier),
CustomizeParameterFlag.FacePaintUvOffset => new StateIndex(ParamFacePaintUvOffset),
Expand Down Expand Up @@ -201,10 +201,10 @@ public static implicit operator StateIndex(CustomizeParameterFlag param)
public const int ParamHairSpecular = ParamHairDiffuse + 1;
public const int ParamHairHighlight = ParamHairSpecular + 1;
public const int ParamLeftEye = ParamHairHighlight + 1;
public const int ParamLeftScleraIntensity = ParamLeftEye + 1;
public const int ParamRightEye = ParamLeftScleraIntensity + 1;
public const int ParamRightScleraIntensity = ParamRightEye + 1;
public const int ParamFeatureColor = ParamRightScleraIntensity + 1;
public const int ParamLeftLimbalIntensity = ParamLeftEye + 1;
public const int ParamRightEye = ParamLeftLimbalIntensity + 1;
public const int ParamRightLimbalIntensity = ParamRightEye + 1;
public const int ParamFeatureColor = ParamRightLimbalIntensity + 1;
public const int ParamFacePaintUvMultiplier = ParamFeatureColor + 1;
public const int ParamFacePaintUvOffset = ParamFacePaintUvMultiplier + 1;
public const int ParamDecalColor = ParamFacePaintUvOffset + 1;
Expand Down Expand Up @@ -313,9 +313,9 @@ public object GetFlag()
ParamHairSpecular => CustomizeParameterFlag.HairSpecular,
ParamHairHighlight => CustomizeParameterFlag.HairHighlight,
ParamLeftEye => CustomizeParameterFlag.LeftEye,
ParamLeftScleraIntensity => CustomizeParameterFlag.LeftScleraIntensity,
ParamLeftLimbalIntensity => CustomizeParameterFlag.LeftLimbalIntensity,
ParamRightEye => CustomizeParameterFlag.RightEye,
ParamRightScleraIntensity => CustomizeParameterFlag.RightScleraIntensity,
ParamRightLimbalIntensity => CustomizeParameterFlag.RightLimbalIntensity,
ParamFeatureColor => CustomizeParameterFlag.FeatureColor,
ParamFacePaintUvMultiplier => CustomizeParameterFlag.FacePaintUvMultiplier,
ParamFacePaintUvOffset => CustomizeParameterFlag.FacePaintUvOffset,
Expand Down

0 comments on commit 25491ad

Please sign in to comment.