1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Scale smoke radius based on texture width

This commit is contained in:
Alden Wu 2022-09-19 00:07:22 -07:00
parent 3eb28881e4
commit 8204090e47
2 changed files with 3 additions and 6 deletions

View File

@ -65,7 +65,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
public LegacySmoke(ISkin skin)
{
this.skin = skin;
Radius = 3;
}
protected override void LoadComplete()
@ -164,12 +163,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
fraction = 1 - MathF.Pow(1 - fraction, 5);
float angle = fraction * (finalAngle - initialAngle) + initialAngle;
return toVector2(angle);
return new Vector2(MathF.Sin(angle), -MathF.Cos(angle));
}
private float nextRotation() => max_rotation * ((float)rotationRNG.NextDouble() * 2 - 1);
private Vector2 toVector2(float angle) => new Vector2(MathF.Sin(angle), -MathF.Cos(angle));
}
}
}

View File

@ -26,11 +26,11 @@ namespace osu.Game.Rulesets.Osu.Skinning
public IShader? TextureShader { get; private set; }
public IShader? RoundedTextureShader { get; private set; }
private float radius = 1;
private float? radius;
protected float Radius
{
get => radius;
get => radius ?? Texture?.DisplayWidth * 0.165f ?? 3;
set
{
if (radius == value)