1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 02:42:54 +08:00

Merge branch 'master' into gameplay-clock-container

This commit is contained in:
Dean Herbert 2019-03-08 12:32:48 +09:00 committed by GitHub
commit 75e94eba35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 121 additions and 100 deletions

View File

@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public class CatchModAutoplay : ModAutoplay<CatchHitObject>
{
protected override Score CreateReplayScore(Beatmap<CatchHitObject> beatmap) => new Score
public override Score CreateReplayScore(IBeatmap beatmap) => new Score
{
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!salad!" } },
Replay = new CatchAutoGenerator(beatmap).Generate(),

View File

@ -6,17 +6,20 @@ using System.Linq;
using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
using osu.Game.Replays;
using osu.Game.Rulesets.Catch.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Replays;
namespace osu.Game.Rulesets.Catch.Replays
{
internal class CatchAutoGenerator : AutoGenerator<CatchHitObject>
internal class CatchAutoGenerator : AutoGenerator
{
public const double RELEASE_DELAY = 20;
public CatchAutoGenerator(Beatmap<CatchHitObject> beatmap)
public new CatchBeatmap Beatmap => (CatchBeatmap)base.Beatmap;
public CatchAutoGenerator(IBeatmap beatmap)
: base(beatmap)
{
Replay = new Replay();

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Mania.Mods
{
public class ManiaModAutoplay : ModAutoplay<ManiaHitObject>
{
protected override Score CreateReplayScore(Beatmap<ManiaHitObject> beatmap) => new Score
public override Score CreateReplayScore(IBeatmap beatmap) => new Score
{
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!topus!" } },
Replay = new ManiaAutoGenerator((ManiaBeatmap)beatmap).Generate(),

View File

@ -5,13 +5,12 @@ using System.Collections.Generic;
using System.Linq;
using osu.Game.Replays;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Replays;
namespace osu.Game.Rulesets.Mania.Replays
{
internal class ManiaAutoGenerator : AutoGenerator<ManiaHitObject>
internal class ManiaAutoGenerator : AutoGenerator
{
public const double RELEASE_DELAY = 20;

View File

@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
path = new SmoothPath
{
Anchor = Anchor.Centre,
PathWidth = 1
PathRadius = 1
},
marker = new CircularContainer
{

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
InternalChild = body = new ManualSliderBody
{
AccentColour = Color4.Transparent,
PathWidth = slider.Scale * 64
PathRadius = slider.Scale * 64
};
}
@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
body.BorderColour = colours.Yellow;
PositionBindable.BindValueChanged(_ => updatePosition(), true);
ScaleBindable.BindValueChanged(scale => body.PathWidth = scale.NewValue * 64, true);
ScaleBindable.BindValueChanged(scale => body.PathRadius = scale.NewValue * 64, true);
}
private void updatePosition() => Position = slider.StackedPosition;

View File

@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).Append(typeof(OsuModSpunOut)).ToArray();
protected override Score CreateReplayScore(Beatmap<OsuHitObject> beatmap) => new Score
public override Score CreateReplayScore(IBeatmap beatmap) => new Score
{
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
Replay = new OsuAutoGenerator(beatmap).Generate()

View File

@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
Body = new SnakingSliderBody(s)
{
PathWidth = s.Scale * 64,
PathRadius = s.Scale * 64,
},
ticks = new Container<DrawableSliderTick> { RelativeSizeAxes = Axes.Both },
repeatPoints = new Container<DrawableRepeatPoint> { RelativeSizeAxes = Axes.Both },
@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
scaleBindable.BindValueChanged(scale =>
{
Body.PathWidth = scale.NewValue * 64;
Body.PathRadius = scale.NewValue * 64;
Ball.Scale = new Vector2(scale.NewValue);
});

View File

@ -19,10 +19,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private readonly BufferedContainer container;
public float PathWidth
public float PathRadius
{
get => path.PathWidth;
set => path.PathWidth = value;
get => path.PathRadius;
set => path.PathRadius = value;
}
/// <summary>

View File

@ -10,12 +10,15 @@ using System.Linq;
using osu.Framework.Graphics;
using osu.Game.Replays;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Replays
{
public class OsuAutoGenerator : OsuAutoGeneratorBase
{
public new OsuBeatmap Beatmap => (OsuBeatmap)base.Beatmap;
#region Parameters
/// <summary>
@ -42,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Replays
#region Construction / Initialisation
public OsuAutoGenerator(Beatmap<OsuHitObject> beatmap)
public OsuAutoGenerator(IBeatmap beatmap)
: base(beatmap)
{
// Already superhuman, but still somewhat realistic

View File

@ -3,7 +3,6 @@
using osuTK;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.Objects;
using System;
using System.Collections.Generic;
using osu.Game.Replays;
@ -12,7 +11,7 @@ using osu.Game.Rulesets.Replays;
namespace osu.Game.Rulesets.Osu.Replays
{
public abstract class OsuAutoGeneratorBase : AutoGenerator<OsuHitObject>
public abstract class OsuAutoGeneratorBase : AutoGenerator
{
#region Constants
@ -35,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Replays
protected Replay Replay;
protected List<ReplayFrame> Frames => Replay.Frames;
protected OsuAutoGeneratorBase(Beatmap<OsuHitObject> beatmap)
protected OsuAutoGeneratorBase(IBeatmap beatmap)
: base(beatmap)
{
Replay = new Replay();

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
{
private int currentIndex;
private Shader shader;
private IShader shader;
private Texture texture;
private Vector2 size => texture.Size * Scale;
@ -35,7 +35,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
public override bool IsPresent => true;
private readonly TrailDrawNodeSharedData trailDrawNodeSharedData = new TrailDrawNodeSharedData();
private const int max_sprites = 2048;
private readonly TrailPart[] parts = new TrailPart[max_sprites];
@ -55,7 +54,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
tNode.Texture = texture;
tNode.Size = size;
tNode.Time = time;
tNode.Shared = trailDrawNodeSharedData;
for (int i = 0; i < parts.Length; ++i)
if (parts[i].InvalidationID > tNode.Parts[i].InvalidationID)
@ -81,7 +79,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
[BackgroundDependencyLoader]
private void load(ShaderManager shaders, TextureStore textures)
{
shader = shaders?.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE);
shader = shaders.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE);
texture = textures.Get(@"Cursor/cursortrail");
Scale = new Vector2(1 / texture.ScaleAdjust);
}
@ -167,22 +165,18 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
public bool WasUpdated;
}
private class TrailDrawNodeSharedData
{
public VertexBuffer<TexturedTrailVertex> VertexBuffer;
}
private class TrailDrawNode : DrawNode
{
public Shader Shader;
public IShader Shader;
public Texture Texture;
public float Time;
public TrailDrawNodeSharedData Shared;
public readonly TrailPart[] Parts = new TrailPart[max_sprites];
public Vector2 Size;
private readonly VertexBuffer<TexturedTrailVertex> vertexBuffer = new QuadVertexBuffer<TexturedTrailVertex>(max_sprites, BufferUsageHint.DynamicDraw);
public TrailDrawNode()
{
for (int i = 0; i < max_sprites; i++)
@ -194,9 +188,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
public override void Draw(Action<TexturedVertex2D> vertexAction)
{
if (Shared.VertexBuffer == null)
Shared.VertexBuffer = new QuadVertexBuffer<TexturedTrailVertex>(max_sprites, BufferUsageHint.DynamicDraw);
Shader.GetUniform<float>("g_FadeClock").UpdateValue(ref Time);
int updateStart = -1, updateEnd = 0;
@ -218,7 +209,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
new Quad(pos.X - Size.X / 2, pos.Y - Size.Y / 2, Size.X, Size.Y),
DrawColourInfo.Colour,
null,
v => Shared.VertexBuffer.Vertices[end++] = new TexturedTrailVertex
v => vertexBuffer.Vertices[end++] = new TexturedTrailVertex
{
Position = v.Position,
TexturePosition = v.TexturePosition,
@ -230,24 +221,31 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
}
else if (updateStart != -1)
{
Shared.VertexBuffer.UpdateRange(updateStart * 4, updateEnd * 4);
vertexBuffer.UpdateRange(updateStart * 4, updateEnd * 4);
updateStart = -1;
}
}
// Update all remaining vertices that have been changed.
if (updateStart != -1)
Shared.VertexBuffer.UpdateRange(updateStart * 4, updateEnd * 4);
vertexBuffer.UpdateRange(updateStart * 4, updateEnd * 4);
base.Draw(vertexAction);
Shader.Bind();
Texture.TextureGL.Bind();
Shared.VertexBuffer.Draw();
vertexBuffer.Draw();
Shader.Unbind();
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
vertexBuffer.Dispose();
}
}
[StructLayout(LayoutKind.Sequential)]

View File

@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModAutoplay : ModAutoplay<TaikoHitObject>
{
protected override Score CreateReplayScore(Beatmap<TaikoHitObject> beatmap) => new Score
public override Score CreateReplayScore(IBeatmap beatmap) => new Score
{
ScoreInfo = new ScoreInfo { User = new User { Username = "mekkadosu!" } },
Replay = new TaikoAutoGenerator(beatmap).Generate(),

View File

@ -9,14 +9,17 @@ using osu.Game.Replays;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Taiko.Beatmaps;
namespace osu.Game.Rulesets.Taiko.Replays
{
public class TaikoAutoGenerator : AutoGenerator<TaikoHitObject>
public class TaikoAutoGenerator : AutoGenerator
{
public new TaikoBeatmap Beatmap => (TaikoBeatmap)base.Beatmap;
private const double swell_hit_speed = 50;
public TaikoAutoGenerator(Beatmap<TaikoHitObject> beatmap)
public TaikoAutoGenerator(IBeatmap beatmap)
: base(beatmap)
{
Replay = new Replay();

View File

@ -113,6 +113,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
[TestCase(normal)]
[TestCase(marathon)]
[Ignore("temporarily disabled pending DeepEqual fix (https://github.com/jamesfoster/DeepEqual/pull/35)")]
// Currently fails:
// [TestCase(with_sb)]
public void TestParity(string beatmap)

View File

@ -1,10 +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 System;
using System.ComponentModel;
using System.Linq;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
namespace osu.Game.Tests.Visual
@ -14,15 +16,27 @@ namespace osu.Game.Tests.Visual
{
protected override Player CreatePlayer(Ruleset ruleset)
{
// We create a dummy RulesetContainer just to get the replay - we don't want to use mods here
// to simulate setting a replay rather than having the replay already set for us
Beatmap.Value.Mods.Value = Beatmap.Value.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() });
var dummyRulesetContainer = ruleset.CreateRulesetContainerWith(Beatmap.Value);
var beatmap = Beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo);
// Reset the mods
Beatmap.Value.Mods.Value = Beatmap.Value.Mods.Value.Where(m => !(m is ModAutoplay));
return new ScoreAccessibleReplayPlayer(ruleset.GetAutoplayMod().CreateReplayScore(beatmap));
}
return new ReplayPlayer(dummyRulesetContainer.ReplayScore);
protected override void AddCheckSteps(Func<Player> player)
{
base.AddCheckSteps(player);
AddUntilStep(() => ((ScoreAccessibleReplayPlayer)player()).ScoreProcessor.TotalScore.Value > 0, "score above zero");
AddUntilStep(() => ((ScoreAccessibleReplayPlayer)player()).HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 0), "key counter counted keys");
}
private class ScoreAccessibleReplayPlayer : ReplayPlayer
{
public new ScoreProcessor ScoreProcessor => base.ScoreProcessor;
public new HUDOverlay HUDOverlay => base.HUDOverlay;
public ScoreAccessibleReplayPlayer(Score score)
: base(score)
{
}
}
}
}

View File

@ -64,7 +64,7 @@ namespace osu.Game.Graphics.Backgrounds
private readonly SortedList<TriangleParticle> parts = new SortedList<TriangleParticle>(Comparer<TriangleParticle>.Default);
private Shader shader;
private IShader shader;
private readonly Texture texture;
public Triangles()
@ -75,7 +75,7 @@ namespace osu.Game.Graphics.Backgrounds
[BackgroundDependencyLoader]
private void load(ShaderManager shaders)
{
shader = shaders?.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);
shader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);
}
protected override void LoadComplete()
@ -180,8 +180,6 @@ namespace osu.Game.Graphics.Backgrounds
protected override DrawNode CreateDrawNode() => new TrianglesDrawNode();
private readonly TrianglesDrawNodeSharedData sharedData = new TrianglesDrawNodeSharedData();
protected override void ApplyDrawNode(DrawNode node)
{
base.ApplyDrawNode(node);
@ -191,27 +189,21 @@ namespace osu.Game.Graphics.Backgrounds
trianglesNode.Shader = shader;
trianglesNode.Texture = texture;
trianglesNode.Size = DrawSize;
trianglesNode.Shared = sharedData;
trianglesNode.Parts.Clear();
trianglesNode.Parts.AddRange(parts);
}
private class TrianglesDrawNodeSharedData
{
public readonly LinearBatch<TexturedVertex2D> VertexBatch = new LinearBatch<TexturedVertex2D>(100 * 3, 10, PrimitiveType.Triangles);
}
private class TrianglesDrawNode : DrawNode
{
public Shader Shader;
public IShader Shader;
public Texture Texture;
public TrianglesDrawNodeSharedData Shared;
public readonly List<TriangleParticle> Parts = new List<TriangleParticle>();
public Vector2 Size;
private readonly LinearBatch<TexturedVertex2D> vertexBatch = new LinearBatch<TexturedVertex2D>(100 * 3, 10, PrimitiveType.Triangles);
public override void Draw(Action<TexturedVertex2D> vertexAction)
{
base.Draw(vertexAction);
@ -239,12 +231,19 @@ namespace osu.Game.Graphics.Backgrounds
triangle,
colourInfo,
null,
Shared.VertexBatch.AddAction,
vertexBatch.AddAction,
Vector2.Divide(localInflationAmount, size));
}
Shader.Unbind();
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
vertexBatch.Dispose();
}
}
protected struct TriangleParticle : IComparable<TriangleParticle>

View File

@ -69,7 +69,7 @@ namespace osu.Game.Graphics.UserInterface
{
Masking = true,
RelativeSizeAxes = Axes.Both,
Child = path = new SmoothPath { RelativeSizeAxes = Axes.Both, PathWidth = 1 }
Child = path = new SmoothPath { RelativeSizeAxes = Axes.Both, PathRadius = 1 }
});
}
@ -102,9 +102,10 @@ namespace osu.Game.Graphics.UserInterface
for (int i = 0; i < values.Length; i++)
{
float x = (i + count - values.Length) / (float)(count - 1) * DrawWidth - 1;
float y = GetYPosition(values[i]) * DrawHeight - 1;
// the -1 is for inner offset in path (actually -PathWidth)
// Make sure that we are accounting for path width when calculating vertex positions
// We need to apply 2x the path radius to account for it because the full diameter of the line accounts into height
float x = (i + count - values.Length) / (float)(count - 1) * (DrawWidth - 2 * path.PathRadius);
float y = GetYPosition(values[i]) * (DrawHeight - 2 * path.PathRadius);
path.AddVertex(new Vector2(x, y));
}
}

View File

@ -124,6 +124,7 @@ namespace osu.Game.Online.Multiplayer
if (other.Host.Value != null && Host.Value?.Id != other.Host.Value.Id)
Host.Value = other.Host.Value;
ChannelId.Value = other.ChannelId.Value;
Status.Value = other.Status.Value;
Availability.Value = other.Availability.Value;
Type.Value = other.Type.Value;

View File

@ -14,10 +14,6 @@ namespace osu.Game.Rulesets.Mods
public abstract class ModAutoplay<T> : ModAutoplay, IApplicableToRulesetContainer<T>
where T : HitObject
{
protected virtual Score CreateReplayScore(Beatmap<T> beatmap) => new Score { Replay = new Replay() };
public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0;
public virtual void ApplyToRulesetContainer(RulesetContainer<T> rulesetContainer) => rulesetContainer.SetReplayScore(CreateReplayScore(rulesetContainer.Beatmap));
}
@ -31,5 +27,9 @@ namespace osu.Game.Rulesets.Mods
public override double ScoreMultiplier => 1;
public bool AllowFail => false;
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) };
public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0;
public virtual Score CreateReplayScore(IBeatmap beatmap) => new Score { Replay = new Replay() };
}
}

View File

@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mods
public abstract class Flashlight : Drawable
{
internal BindableInt Combo;
private Shader shader;
private IShader shader;
protected override DrawNode CreateDrawNode() => new FlashlightDrawNode();
@ -139,7 +139,7 @@ namespace osu.Game.Rulesets.Mods
private class FlashlightDrawNode : DrawNode
{
public Shader Shader;
public IShader Shader;
public Quad ScreenSpaceDrawQuad;
public Vector2 FlashlightPosition;
public Vector2 FlashlightSize;

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.Game.Rulesets.Objects;
using osu.Game.Beatmaps;
using osu.Game.Replays;
namespace osu.Game.Rulesets.Replays
{
public abstract class AutoGenerator<T> : IAutoGenerator
where T : HitObject
public abstract class AutoGenerator : IAutoGenerator
{
/// <summary>
/// Creates the auto replay and returns it.
@ -21,11 +19,11 @@ namespace osu.Game.Rulesets.Replays
/// <summary>
/// The beatmap we're making.
/// </summary>
protected Beatmap<T> Beatmap;
protected IBeatmap Beatmap;
#endregion
protected AutoGenerator(Beatmap<T> beatmap)
protected AutoGenerator(IBeatmap beatmap)
{
Beatmap = beatmap;
}

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets
/// <returns>An enumerable of constructed <see cref="Mod"/>s</returns>
public virtual IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods) => new Mod[] { };
public Mod GetAutoplayMod() => GetAllMods().First(mod => mod is ModAutoplay);
public ModAutoplay GetAutoplayMod() => GetAllMods().OfType<ModAutoplay>().First();
protected Ruleset(RulesetInfo rulesetInfo = null)
{

View File

@ -89,7 +89,7 @@ namespace osu.Game.Screens
/// </summary>
public class ShaderPrecompiler : Drawable
{
private readonly List<Shader> loadTargets = new List<Shader>();
private readonly List<IShader> loadTargets = new List<IShader>();
public bool FinishedCompiling { get; private set; }
@ -106,7 +106,7 @@ namespace osu.Game.Screens
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE));
}
protected virtual bool AllLoaded => loadTargets.All(s => s.Loaded);
protected virtual bool AllLoaded => loadTargets.All(s => s.IsLoaded);
protected override void Update()
{

View File

@ -63,7 +63,7 @@ namespace osu.Game.Screens.Menu
private readonly float[] frequencyAmplitudes = new float[256];
private Shader shader;
private IShader shader;
private readonly Texture texture;
public LogoVisualisation()
@ -131,8 +131,6 @@ namespace osu.Game.Screens.Menu
protected override DrawNode CreateDrawNode() => new VisualisationDrawNode();
private readonly VisualiserSharedData sharedData = new VisualiserSharedData();
protected override void ApplyDrawNode(DrawNode node)
{
base.ApplyDrawNode(node);
@ -142,29 +140,23 @@ namespace osu.Game.Screens.Menu
visNode.Shader = shader;
visNode.Texture = texture;
visNode.Size = DrawSize.X;
visNode.Shared = sharedData;
visNode.Colour = AccentColour;
visNode.AudioData = frequencyAmplitudes;
}
private class VisualiserSharedData
{
public readonly QuadBatch<TexturedVertex2D> VertexBatch = new QuadBatch<TexturedVertex2D>(100, 10);
}
private class VisualisationDrawNode : DrawNode
{
public Shader Shader;
public IShader Shader;
public Texture Texture;
public VisualiserSharedData Shared;
//Asuming the logo is a circle, we don't need a second dimension.
public float Size;
public Color4 Colour;
public float[] AudioData;
private readonly QuadBatch<TexturedVertex2D> vertexBatch = new QuadBatch<TexturedVertex2D>(100, 10);
public override void Draw(Action<TexturedVertex2D> vertexAction)
{
base.Draw(vertexAction);
@ -209,7 +201,7 @@ namespace osu.Game.Screens.Menu
rectangle,
colourInfo,
null,
Shared.VertexBatch.AddAction,
vertexBatch.AddAction,
//barSize by itself will make it smooth more in the X axis than in the Y axis, this reverts that.
Vector2.Divide(inflation, barSize.Yx));
}
@ -218,6 +210,13 @@ namespace osu.Game.Screens.Menu
Shader.Unbind();
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
vertexBatch.Dispose();
}
}
}
}

View File

@ -28,13 +28,15 @@ namespace osu.Game.Screens.Multi.Match.Components
{
base.LoadComplete();
roomId.BindValueChanged(_ => updateChannel(), true);
channelId.BindValueChanged(_ => updateChannel(), true);
}
private void updateChannel()
{
if (roomId.Value != null)
Channel.Value = channelManager?.JoinChannel(new Channel { Id = channelId.Value, Type = ChannelType.Multiplayer, Name = $"#mp_{roomId.Value}" });
if (roomId.Value == null || channelId.Value == 0)
return;
Channel.Value = channelManager?.JoinChannel(new Channel { Id = channelId.Value, Type = ChannelType.Multiplayer, Name = $"#lazermp_{roomId.Value}" });
}
}
}

View File

@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.301.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.307.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -105,12 +105,12 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.301.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.301.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.307.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.307.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2019.208.0" ExcludeAssets="all" />
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2019.307.0" ExcludeAssets="all" />
</ItemGroup>
</Project>

View File

@ -262,6 +262,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IL/@EntryIndexedValue">IL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IPC/@EntryIndexedValue">IPC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JIT/@EntryIndexedValue">JIT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LTRB/@EntryIndexedValue">LTRB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD5</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NS/@EntryIndexedValue">NS</s:String>