1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-25 18:57:18 +08:00

Change how values are applied to (hopefully) simplify things

This commit is contained in:
Dean Herbert 2025-02-14 18:35:27 +09:00
parent 74eae3cda3
commit 4e043e7cab
No known key found for this signature in database
3 changed files with 8 additions and 4 deletions

View File

@ -116,7 +116,8 @@ namespace osu.Game.Graphics.Containers
protected override void Update()
{
TargetDrawSize = new Vector2(1024, 1024 / (game?.BaseAspectRatio ?? 1f));
if (game != null)
TargetDrawSize = game.ScalingContainerTargetDrawSize;
Scale = new Vector2(CurrentScale);
Size = new Vector2(1 / CurrentScale);

View File

@ -72,6 +72,7 @@ using osu.Game.Skinning;
using osu.Game.Updater;
using osu.Game.Users;
using osu.Game.Utils;
using osuTK;
using osuTK.Graphics;
using Sentry;
@ -814,9 +815,10 @@ namespace osu.Game
protected virtual UpdateManager CreateUpdateManager() => new UpdateManager();
/// <summary>
/// The base aspect ratio to use in all <see cref="ScalingContainer"/>s.
/// Adjust the globally applied <see cref="DrawSizePreservingFillContainer.TargetDrawSize"/> in every <see cref="ScalingContainer"/>.
/// Useful for changing how the game handles different aspect ratios.
/// </summary>
protected internal virtual float BaseAspectRatio => 4f / 3f;
protected internal virtual Vector2 ScalingContainerTargetDrawSize { get; } = new Vector2(1024, 768);
protected override Container CreateScalingContainer() => new ScalingContainer(ScalingMode.Everything);

View File

@ -11,6 +11,7 @@ using osu.Game;
using osu.Game.Screens;
using osu.Game.Updater;
using osu.Game.Utils;
using osuTK;
using UIKit;
namespace osu.iOS
@ -22,7 +23,7 @@ namespace osu.iOS
public override bool HideUnlicensedContent => true;
protected override float BaseAspectRatio => (float)(UIScreen.MainScreen.Bounds.Width / UIScreen.MainScreen.Bounds.Height);
protected override Vector2 ScalingContainerTargetDrawSize => new Vector2(1024, 1024 * DrawHeight / DrawWidth);
public OsuGameIOS(AppDelegate appDelegate)
{