Change softness mode switch statement to expression

This commit is contained in:
Jarrod Doyle 2024-10-29 18:14:44 +00:00
parent f6bcce9778
commit fe100bb938
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 11 additions and 32 deletions

View File

@ -528,38 +528,17 @@ public class LightMapper
return hit; return hit;
} }
strength = 0f; return mode switch {
var hit = false; SoftnessMode.Standard when light.QuadLit => FourPoint(4f, out strength),
switch (mode) SoftnessMode.HighFourPoint => FourPoint(4f, out strength),
{ SoftnessMode.HighFivePoint => FivePoint(4f, out strength),
case SoftnessMode.Standard when light.QuadLit: SoftnessMode.HighNinePoint => NinePoint(4f, out strength),
case SoftnessMode.HighFourPoint: SoftnessMode.MediumFourPoint => FourPoint(8f, out strength),
hit = FourPoint(4f, out strength); SoftnessMode.MediumFivePoint => FivePoint(8f, out strength),
break; SoftnessMode.MediumNinePoint => NinePoint(8f, out strength),
case SoftnessMode.HighFivePoint: SoftnessMode.LowFourPoint => FourPoint(16f, out strength),
hit = FivePoint(4f, out strength); _ => TracePixel(light, pos, polyCenter, plane, planeMapper, v2ds, out strength)
break; };
case SoftnessMode.HighNinePoint:
hit = NinePoint(4f, out strength);
break;
case SoftnessMode.MediumFourPoint:
hit = FourPoint(8f, out strength);
break;
case SoftnessMode.MediumFivePoint:
hit = FivePoint(8f, out strength);
break;
case SoftnessMode.MediumNinePoint:
hit = NinePoint(8f, out strength);
break;
case SoftnessMode.LowFourPoint:
hit = FourPoint(16f, out strength);
break;
case SoftnessMode.Standard:
hit = TracePixel(light, pos, polyCenter, plane, planeMapper, v2ds, out strength);
break;
}
return hit;
} }
private bool TracePixel( private bool TracePixel(