1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00

Invert flashlight dim

This commit is contained in:
David Zhao 2019-04-12 11:23:40 +09:00
parent 664a4ba540
commit 846a4835ca
2 changed files with 9 additions and 9 deletions

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Osu.Mods
else else
trackingSliders--; trackingSliders--;
flashlight.FlashlightLightness = trackingSliders > 0 ? 0.2f : 1.0f; flashlight.FlashlightDim = trackingSliders > 0 ? 0.8f : 0.0f;
} }
private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition

View File

@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Mods
flashNode.ScreenSpaceDrawQuad = ScreenSpaceDrawQuad; flashNode.ScreenSpaceDrawQuad = ScreenSpaceDrawQuad;
flashNode.FlashlightPosition = Vector2Extensions.Transform(FlashlightPosition, DrawInfo.Matrix); flashNode.FlashlightPosition = Vector2Extensions.Transform(FlashlightPosition, DrawInfo.Matrix);
flashNode.FlashlightSize = Vector2Extensions.Transform(FlashlightSize, DrawInfo.Matrix); flashNode.FlashlightSize = Vector2Extensions.Transform(FlashlightSize, DrawInfo.Matrix);
flashNode.FlashlightLightness = FlashlightLightness; flashNode.FlashlightDim = FlashlightDim;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -138,16 +138,16 @@ namespace osu.Game.Rulesets.Mods
} }
} }
private float flashlightLightness = 1.0f; private float flashlightDim;
public float FlashlightLightness public float FlashlightDim
{ {
get => flashlightLightness; get => flashlightDim;
set set
{ {
if (flashlightLightness == value) return; if (flashlightDim == value) return;
flashlightLightness = value; flashlightDim = value;
Invalidate(Invalidation.DrawNode); Invalidate(Invalidation.DrawNode);
} }
} }
@ -159,7 +159,7 @@ namespace osu.Game.Rulesets.Mods
public Quad ScreenSpaceDrawQuad; public Quad ScreenSpaceDrawQuad;
public Vector2 FlashlightPosition; public Vector2 FlashlightPosition;
public Vector2 FlashlightSize; public Vector2 FlashlightSize;
public float FlashlightLightness; public float FlashlightDim;
public override void Draw(Action<TexturedVertex2D> vertexAction) public override void Draw(Action<TexturedVertex2D> vertexAction)
{ {
@ -169,7 +169,7 @@ namespace osu.Game.Rulesets.Mods
Shader.GetUniform<Vector2>("flashlightPos").UpdateValue(ref FlashlightPosition); Shader.GetUniform<Vector2>("flashlightPos").UpdateValue(ref FlashlightPosition);
Shader.GetUniform<Vector2>("flashlightSize").UpdateValue(ref FlashlightSize); Shader.GetUniform<Vector2>("flashlightSize").UpdateValue(ref FlashlightSize);
Shader.GetUniform<float>("flashlightLightness").UpdateValue(ref FlashlightLightness); Shader.GetUniform<float>("flashlightDim").UpdateValue(ref FlashlightDim);
Texture.WhitePixel.DrawQuad(ScreenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: vertexAction); Texture.WhitePixel.DrawQuad(ScreenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: vertexAction);