1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:57:24 +08:00

Merge pull request #27506 from peppy/update-framework

Update framework
This commit is contained in:
Bartłomiej Dach 2024-03-06 08:43:24 +01:00 committed by GitHub
commit 0d4515d26e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 58 additions and 57 deletions

View File

@ -10,7 +10,7 @@
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2024.223.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2024.306.0" />
</ItemGroup>
<PropertyGroup>
<!-- Fody does not handle Android build well, and warns when unchanged.

View File

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.9" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

View File

@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Osu.Mods
// multiply the SPM by 1.01 to ensure that the spinner is completed. if the calculation is left exact,
// some spinners may not complete due to very minor decimal loss during calculation
float rotationSpeed = (float)(1.01 * spinner.HitObject.SpinsRequired / spinner.HitObject.Duration);
spinner.RotationTracker.AddRotation(MathUtils.RadiansToDegrees((float)rateIndependentElapsedTime * rotationSpeed * MathF.PI * 2.0f));
spinner.RotationTracker.AddRotation(float.RadiansToDegrees((float)rateIndependentElapsedTime * rotationSpeed * MathF.PI * 2.0f));
}
}
}

View File

@ -146,7 +146,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
break;
}
float aimRotation = MathUtils.RadiansToDegrees(MathF.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X));
float aimRotation = float.RadiansToDegrees(MathF.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X));
while (Math.Abs(aimRotation - Arrow.Rotation) > 180)
aimRotation += aimRotation < Arrow.Rotation ? 360 : -360;

View File

@ -342,7 +342,7 @@ namespace osu.Game.Rulesets.Osu.Replays
// 0.05 rad/ms, or ~477 RPM, as per stable.
// the redundant conversion from RPM to rad/ms is here for ease of testing custom SPM specs.
const float spin_rpm = 0.05f / (2 * MathF.PI) * 60000;
float radsPerMillisecond = MathUtils.DegreesToRadians(spin_rpm * 360) / 60000;
float radsPerMillisecond = float.DegreesToRadians(spin_rpm * 360) / 60000;
switch (h)
{

View File

@ -47,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
Origin = Anchor.Centre,
Colour = Color4.White.Opacity(0.25f),
RelativeSizeAxes = Axes.Both,
Current = { Value = arc_fill },
Progress = arc_fill,
Rotation = 90 - arc_fill * 180,
InnerRadius = arc_radius,
RoundedCaps = true,
@ -71,9 +71,9 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
background.Alpha = spinner.Progress >= 1 ? 0 : 1;
fill.Alpha = (float)Interpolation.DampContinuously(fill.Alpha, spinner.Progress > 0 && spinner.Progress < 1 ? 1 : 0, 40f, (float)Math.Abs(Time.Elapsed));
fill.Current.Value = (float)Interpolation.DampContinuously(fill.Current.Value, spinner.Progress >= 1 ? 0 : arc_fill * spinner.Progress, 40f, (float)Math.Abs(Time.Elapsed));
fill.Progress = (float)Interpolation.DampContinuously(fill.Progress, spinner.Progress >= 1 ? 0 : arc_fill * spinner.Progress, 40f, (float)Math.Abs(Time.Elapsed));
fill.Rotation = (float)(90 - fill.Current.Value * 180);
fill.Rotation = (float)(90 - fill.Progress * 180);
}
private partial class ProgressFill : CircularProgress

View File

@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Current = { Value = arc_fill },
Progress = arc_fill,
Rotation = -arc_fill * 180,
InnerRadius = arc_radius,
RoundedCaps = true,
@ -44,10 +44,10 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
base.Update();
fill.Current.Value = (float)Interpolation.DampContinuously(fill.Current.Value, spinner.Progress >= 1 ? arc_fill_complete : arc_fill, 40f, (float)Math.Abs(Time.Elapsed));
fill.Progress = (float)Interpolation.DampContinuously(fill.Progress, spinner.Progress >= 1 ? arc_fill_complete : arc_fill, 40f, (float)Math.Abs(Time.Elapsed));
fill.InnerRadius = (float)Interpolation.DampContinuously(fill.InnerRadius, spinner.Progress >= 1 ? arc_radius * 2.2f : arc_radius, 40f, (float)Math.Abs(Time.Elapsed));
fill.Rotation = (float)(-fill.Current.Value * 180);
fill.Rotation = (float)(-fill.Progress * 180);
}
}
}

View File

@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
if (mousePosition is Vector2 pos)
{
float thisAngle = -MathUtils.RadiansToDegrees(MathF.Atan2(pos.X - DrawSize.X / 2, pos.Y - DrawSize.Y / 2));
float thisAngle = -float.RadiansToDegrees(MathF.Atan2(pos.X - DrawSize.X / 2, pos.Y - DrawSize.Y / 2));
float delta = lastAngle == null ? 0 : thisAngle - lastAngle.Value;
// Normalise the delta to -180 .. 180

View File

@ -246,7 +246,7 @@ namespace osu.Game.Rulesets.Osu.Statistics
// Likewise sin(pi/2)=1 and sin(3pi/2)=-1, whereas we actually want these values to appear on the bottom/top respectively, so the y-coordinate also needs to be inverted.
//
// We also need to apply the anti-clockwise rotation.
double rotatedAngle = finalAngle - MathUtils.DegreesToRadians(rotation);
double rotatedAngle = finalAngle - float.DegreesToRadians(rotation);
var rotatedCoordinate = -1 * new Vector2((float)Math.Cos(rotatedAngle), (float)Math.Sin(rotatedAngle));
Vector2 localCentre = new Vector2(points_per_dimension - 1) / 2;

View File

@ -121,7 +121,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private TextureUpload upscale(TextureUpload textureUpload)
{
var image = Image.LoadPixelData(textureUpload.Data.ToArray(), textureUpload.Width, textureUpload.Height);
var image = Image.LoadPixelData(textureUpload.Data, textureUpload.Width, textureUpload.Height);
// The original texture upload will no longer be returned or used.
textureUpload.Dispose();

View File

@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps
// The original texture upload will no longer be returned or used.
textureUpload.Dispose();
Size size = image.Size();
Size size = image.Size;
// Assume that panel backgrounds are always displayed using `FillMode.Fill`.
// Also assume that all backgrounds are wider than they are tall, so the

View File

@ -86,11 +86,15 @@ namespace osu.Game.Beatmaps.Drawables.Cards
Dimmed.BindValueChanged(_ => updateState());
playButton.Playing.BindValueChanged(_ => updateState(), true);
((IBindable<double>)progress.Current).BindTo(playButton.Progress);
FinishTransforms(true);
}
protected override void Update()
{
base.Update();
progress.Progress = playButton.Progress.Value;
}
private void updateState()
{
bool shouldDim = Dimmed.Value || playButton.Playing.Value;

View File

@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Beatmaps.Legacy;
using osu.Game.IO;
using osu.Game.Storyboards;
@ -230,7 +229,7 @@ namespace osu.Game.Beatmaps.Formats
{
float startValue = Parsing.ParseFloat(split[4]);
float endValue = split.Length > 5 ? Parsing.ParseFloat(split[5]) : startValue;
timelineGroup?.Rotation.Add(easing, startTime, endTime, MathUtils.RadiansToDegrees(startValue), MathUtils.RadiansToDegrees(endValue));
timelineGroup?.Rotation.Add(easing, startTime, endTime, float.RadiansToDegrees(startValue), float.RadiansToDegrees(endValue));
break;
}

View File

@ -157,7 +157,7 @@ namespace osu.Game.Graphics.Cursor
if (dragRotationState == DragRotationState.Rotating && distance > 0)
{
Vector2 offset = e.MousePosition - positionMouseDown;
float degrees = MathUtils.RadiansToDegrees(MathF.Atan2(-offset.X, offset.Y)) + 24.3f;
float degrees = float.RadiansToDegrees(MathF.Atan2(-offset.X, offset.Y)) + 24.3f;
// Always rotate in the direction of least distance
float diff = (degrees - activeCursor.Rotation) % 360;

View File

@ -1,14 +1,12 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Extensions;
namespace osu.Game.Graphics.UserInterface
{
public partial class OsuNumberBox : OsuTextBox
{
protected override bool AllowIme => false;
protected override bool CanAddCharacter(char character) => character.IsAsciiDigit();
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);
}
}

View File

@ -8,7 +8,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Toolkit.HighPerformance;
using osu.Framework.Extensions;
using osu.Framework.IO.Stores;
using SharpCompress.Archives.Zip;
using SixLabors.ImageSharp.Memory;
@ -36,7 +35,7 @@ namespace osu.Game.IO.Archives
var owner = MemoryAllocator.Default.Allocate<byte>((int)entry.Size);
using (Stream s = entry.OpenEntryStream())
s.ReadToFill(owner.Memory.Span);
s.ReadExactly(owner.Memory.Span);
return new MemoryOwnerMemoryStream(owner);
}

View File

@ -13,7 +13,6 @@ using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Input.Handlers.Tablet;
using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK;
@ -196,7 +195,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
var matrix = Matrix3.Identity;
MatrixExtensions.TranslateFromLeft(ref matrix, offset);
MatrixExtensions.RotateFromLeft(ref matrix, MathUtils.DegreesToRadians(rotation.Value));
MatrixExtensions.RotateFromLeft(ref matrix, float.DegreesToRadians(rotation.Value));
usableAreaQuad *= matrix;

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
@ -69,7 +68,7 @@ namespace osu.Game.Overlays.Settings
{
protected override bool AllowIme => false;
protected override bool CanAddCharacter(char character) => character.IsAsciiDigit();
protected override bool CanAddCharacter(char character) => char.IsAsciiDigit(character);
public new void NotifyInputError() => base.NotifyInputError();
}

View File

@ -235,7 +235,7 @@ namespace osu.Game.Overlays.Volume
Bindable.BindValueChanged(volume => { this.TransformTo(nameof(DisplayVolume), volume.NewValue, 400, Easing.OutQuint); }, true);
bgProgress.Current.Value = 0.75f;
bgProgress.Progress = 0.75f;
}
private int? displayVolumeInt;
@ -265,8 +265,8 @@ namespace osu.Game.Overlays.Volume
text.Text = intValue.ToString(CultureInfo.CurrentCulture);
}
volumeCircle.Current.Value = displayVolume * 0.75f;
volumeCircleGlow.Current.Value = displayVolume * 0.75f;
volumeCircle.Progress = displayVolume * 0.75f;
volumeCircleGlow.Progress = displayVolume * 0.75f;
if (intVolumeChanged && IsLoaded)
Scheduler.AddOnce(playTickSound);

View File

@ -140,7 +140,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
Colour = this.baseColour = baseColour;
Current.Value = 1;
Progress = 1;
}
protected override void Update()

View File

@ -366,7 +366,7 @@ namespace osu.Game.Screens.Edit.Timing
new CircularProgress
{
RelativeSizeAxes = Axes.Both,
Current = { Value = 1f / light_count - angular_light_gap },
Progress = 1f / light_count - angular_light_gap,
Colour = colourProvider.Background2,
},
fillContent = new Container
@ -379,7 +379,7 @@ namespace osu.Game.Screens.Edit.Timing
new CircularProgress
{
RelativeSizeAxes = Axes.Both,
Current = { Value = 1f / light_count - angular_light_gap },
Progress = 1f / light_count - angular_light_gap,
Blending = BlendingParameters.Additive
},
// Please do not try and make sense of this.
@ -388,7 +388,7 @@ namespace osu.Game.Screens.Edit.Timing
Glow = new CircularProgress
{
RelativeSizeAxes = Axes.Both,
Current = { Value = 1f / light_count - 0.01f },
Progress = 1f / light_count - 0.01f,
Blending = BlendingParameters.Additive
}.WithEffect(new GlowEffect
{

View File

@ -14,7 +14,6 @@ using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Rendering.Vertices;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osuTK;
using osuTK.Graphics;
@ -209,13 +208,13 @@ namespace osu.Game.Screens.Menu
if (audioData[i] < amplitude_dead_zone)
continue;
float rotation = MathUtils.DegreesToRadians(i / (float)bars_per_visualiser * 360 + j * 360 / visualiser_rounds);
float rotation = float.DegreesToRadians(i / (float)bars_per_visualiser * 360 + j * 360 / visualiser_rounds);
float rotationCos = MathF.Cos(rotation);
float rotationSin = MathF.Sin(rotation);
// taking the cos and sin to the 0..1 range
var barPosition = new Vector2(rotationCos / 2 + 0.5f, rotationSin / 2 + 0.5f) * size;
var barSize = new Vector2(size * MathF.Sqrt(2 * (1 - MathF.Cos(MathUtils.DegreesToRadians(360f / bars_per_visualiser)))) / 2f, bar_length * audioData[i]);
var barSize = new Vector2(size * MathF.Sqrt(2 * (1 - MathF.Cos(float.DegreesToRadians(360f / bars_per_visualiser)))) / 2f, bar_length * audioData[i]);
// The distance between the position and the sides of the bar.
var bottomOffset = new Vector2(-rotationSin * barSize.X / 2, rotationCos * barSize.X / 2);
// The distance between the bottom side of the bar and the top side.

View File

@ -198,9 +198,14 @@ namespace osu.Game.Screens.Play.HUD
bind();
}
protected override void Update()
{
base.Update();
circularProgress.Progress = Progress.Value;
}
private void bind()
{
((IBindable<double>)circularProgress.Current).BindTo(Progress);
Progress.ValueChanged += progress =>
{
icon.Scale = new Vector2(1 + (float)progress.NewValue * 0.2f);

View File

@ -152,7 +152,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
Colour = OsuColour.Gray(47),
Alpha = 0.5f,
InnerRadius = accuracy_circle_radius + 0.01f, // Extends a little bit into the circle
Current = { Value = 1 },
Progress = 1,
},
accuracyCircle = new CircularProgress
{
@ -273,7 +273,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
if (targetAccuracy < 1 && targetAccuracy >= visual_alignment_offset)
targetAccuracy -= visual_alignment_offset;
accuracyCircle.FillTo(targetAccuracy, ACCURACY_TRANSFORM_DURATION, ACCURACY_TRANSFORM_EASING);
accuracyCircle.ProgressTo(targetAccuracy, ACCURACY_TRANSFORM_DURATION, ACCURACY_TRANSFORM_EASING);
if (withFlair)
{
@ -364,7 +364,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
.FadeOut(800, Easing.Out);
accuracyCircle
.FillTo(accuracyS - GRADE_SPACING_PERCENTAGE / 2 - visual_alignment_offset, 70, Easing.OutQuint);
.ProgressTo(accuracyS - GRADE_SPACING_PERCENTAGE / 2 - visual_alignment_offset, 70, Easing.OutQuint);
badges.Single(b => b.Rank == getRank(ScoreRank.S))
.FadeOut(70, Easing.OutQuint);

View File

@ -67,7 +67,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
{
public double RevealProgress
{
set => Current.Value = Math.Clamp(value, startProgress, endProgress) - startProgress;
set => Progress = Math.Clamp(value, startProgress, endProgress) - startProgress;
}
private readonly double startProgress;

View File

@ -72,14 +72,14 @@ namespace osu.Game.Skinning
circularProgress.Scale = new Vector2(-1, 1);
circularProgress.Anchor = Anchor.TopRight;
circularProgress.Colour = new Colour4(199, 255, 47, 153);
circularProgress.Current.Value = 1 - progress;
circularProgress.Progress = 1 - progress;
}
else
{
circularProgress.Scale = new Vector2(1);
circularProgress.Anchor = Anchor.TopLeft;
circularProgress.Colour = new Colour4(255, 255, 255, 153);
circularProgress.Current.Value = progress;
circularProgress.Progress = progress;
}
}
}

View File

@ -73,7 +73,7 @@ namespace osu.Game.Skinning
private TextureUpload convertToGrayscale(TextureUpload textureUpload)
{
var image = Image.LoadPixelData(textureUpload.Data.ToArray(), textureUpload.Width, textureUpload.Height);
var image = Image.LoadPixelData(textureUpload.Data, textureUpload.Width, textureUpload.Height);
// stable uses `0.299 * r + 0.587 * g + 0.114 * b`
// (https://github.com/peppy/osu-stable-reference/blob/013c3010a9d495e3471a9c59518de17006f9ad89/osu!/Graphics/Textures/pTexture.cs#L138-L153)

View File

@ -61,7 +61,7 @@ namespace osu.Game.Skinning
if (textureUpload.Height > max_supported_texture_size || textureUpload.Width > max_supported_texture_size)
{
var image = Image.LoadPixelData(textureUpload.Data.ToArray(), textureUpload.Width, textureUpload.Height);
var image = Image.LoadPixelData(textureUpload.Data, textureUpload.Width, textureUpload.Height);
// The original texture upload will no longer be returned or used.
textureUpload.Dispose();

View File

@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Utils;
using osu.Game.Rulesets.Objects.Types;
using osuTK;
@ -28,8 +27,8 @@ namespace osu.Game.Utils
point.Y -= origin.Y;
Vector2 ret;
ret.X = point.X * MathF.Cos(MathUtils.DegreesToRadians(angle)) + point.Y * MathF.Sin(MathUtils.DegreesToRadians(angle));
ret.Y = point.X * -MathF.Sin(MathUtils.DegreesToRadians(angle)) + point.Y * MathF.Cos(MathUtils.DegreesToRadians(angle));
ret.X = point.X * MathF.Cos(float.DegreesToRadians(angle)) + point.Y * MathF.Sin(float.DegreesToRadians(angle));
ret.Y = point.X * -MathF.Sin(float.DegreesToRadians(angle)) + point.Y * MathF.Cos(float.DegreesToRadians(angle));
ret.X += origin.X;
ret.Y += origin.Y;

View File

@ -20,8 +20,8 @@
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="DiffPlex" Version="1.7.1" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.57" />
<PackageReference Include="DiffPlex" Version="1.7.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.59" />
<PackageReference Include="Humanizer" Version="2.14.1" />
<PackageReference Include="MessagePack" Version="2.5.140" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.15" />
@ -35,14 +35,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="11.5.0" />
<PackageReference Include="ppy.osu.Framework" Version="2024.223.0" />
<PackageReference Include="Realm" Version="11.7.0" />
<PackageReference Include="ppy.osu.Framework" Version="2024.306.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2024.207.0" />
<PackageReference Include="Sentry" Version="3.41.3" />
<!-- Held back due to 0.34.0 failing AOT compilation on ZstdSharp.dll dependency. -->
<PackageReference Include="SharpCompress" Version="0.36.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.7" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.8" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="TagLibSharp" Version="2.3.0" />

View File

@ -23,6 +23,6 @@
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.iOS" Version="2024.223.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2024.306.0" />
</ItemGroup>
</Project>