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

Merge branch 'master' into relax

This commit is contained in:
Dan Balasescu 2018-08-21 12:11:10 +09:00 committed by GitHub
commit c4264794e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 12 deletions

View File

@ -63,7 +63,7 @@ namespace osu.Desktop
{
bool continueExecution = Interlocked.Decrement(ref allowableExceptions) >= 0;
Logger.Log($"Unhandled exception has been {(continueExecution ? "allowed with {allowableExceptions} more allowable exceptions" : "denied")} .");
Logger.Log($"Unhandled exception has been {(continueExecution ? $"allowed with {allowableExceptions} more allowable exceptions" : "denied")} .");
// restore the stock of allowable exceptions after a short delay.
Task.Delay(1000).ContinueWith(_ => Interlocked.Increment(ref allowableExceptions));

View File

@ -197,7 +197,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
if (Shared.VertexBuffer == null)
Shared.VertexBuffer = new QuadVertexBuffer<TexturedTrailVertex>(max_sprites, BufferUsageHint.DynamicDraw);
Shader.GetUniform<float>("g_FadeClock").Value = Time;
Shader.GetUniform<float>("g_FadeClock").UpdateValue(ref Time);
int updateStart = -1, updateEnd = 0;
for (int i = 0; i < Parts.Length; ++i)

View File

@ -31,7 +31,7 @@ namespace osu.Game.Beatmaps.Formats
if (ShouldSkipLine(line))
continue;
if (line.StartsWith(@"[") && line.EndsWith(@"]"))
if (line.StartsWith(@"[", StringComparison.Ordinal) && line.EndsWith(@"]", StringComparison.Ordinal))
{
if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section))
{
@ -53,7 +53,7 @@ namespace osu.Game.Beatmaps.Formats
}
}
protected virtual bool ShouldSkipLine(string line) => string.IsNullOrWhiteSpace(line) || line.StartsWith("//");
protected virtual bool ShouldSkipLine(string line) => string.IsNullOrWhiteSpace(line) || line.StartsWith("//", StringComparison.Ordinal);
protected virtual void ParseLine(T output, Section section, string line)
{

View File

@ -60,7 +60,7 @@ namespace osu.Game.Beatmaps.Formats
private void handleEvents(string line)
{
var depth = 0;
while (line.StartsWith(" ") || line.StartsWith("_"))
while (line.StartsWith(" ", StringComparison.Ordinal) || line.StartsWith("_", StringComparison.Ordinal))
{
++depth;
line = line.Substring(1);

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Drawing.Imaging;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
@ -19,6 +18,7 @@ using osu.Game.Configuration;
using osu.Game.Input.Bindings;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
using SixLabors.ImageSharp;
namespace osu.Game.Graphics
{
@ -90,7 +90,7 @@ namespace osu.Game.Graphics
waitDelegate.Cancel();
}
using (var bitmap = await host.TakeScreenshotAsync())
using (var image = await host.TakeScreenshotAsync())
{
Interlocked.Decrement(ref screenShotTasks);
@ -102,10 +102,10 @@ namespace osu.Game.Graphics
switch (screenshotFormat.Value)
{
case ScreenshotFormat.Png:
bitmap.Save(stream, ImageFormat.Png);
image.SaveAsPng(stream);
break;
case ScreenshotFormat.Jpg:
bitmap.Save(stream, ImageFormat.Jpeg);
image.SaveAsJpeg(stream);
break;
default:
throw new ArgumentOutOfRangeException(nameof(screenshotFormat));

View File

@ -504,7 +504,25 @@ namespace osu.Game
// schedule is here to ensure that all component loads are done after LoadComplete is run (and thus all dependencies are cached).
// with some better organisation of LoadComplete to do construction and dependency caching in one step, followed by calls to loadComponentSingleFile,
// we could avoid the need for scheduling altogether.
Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(t => LoadComponentAsync(d, add).Wait()) ?? LoadComponentAsync(d, add); });
Schedule(() =>
{
if (asyncLoadStream != null)
{
//chain with existing load stream
asyncLoadStream = asyncLoadStream.ContinueWith(async t =>
{
try
{
await LoadComponentAsync(d, add);
}
catch (OperationCanceledException)
{
}
});
}
else
asyncLoadStream = LoadComponentAsync(d, add);
});
}
public bool OnPressed(GlobalAction action)

View File

@ -278,7 +278,7 @@ namespace osu.Game.Screens.Menu
if (logo != null)
{
if (logoTracking && iconFacade.IsLoaded)
if (logoTracking && logo.RelativePositionAxes == Axes.None && iconFacade.IsLoaded)
logo.Position = logoTrackingPosition;
iconFacade.Width = logo.SizeForFlow * 0.5f;

View File

@ -63,6 +63,12 @@ namespace osu.Game.Screens.Play.HUD
};
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
mods.UnbindAll();
}
protected override void LoadComplete()
{
base.LoadComplete();

View File

@ -460,6 +460,8 @@ namespace osu.Game.Screens.Select
{
base.Dispose(isDisposing);
Ruleset.UnbindAll();
if (beatmaps != null)
{
beatmaps.ItemAdded -= onBeatmapSetAdded;

View File

@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="ppy.osu.Framework" Version="2018.815.0" />
<PackageReference Include="ppy.osu.Framework" Version="2018.820.1" />
<PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="SharpRaven" Version="2.4.0" />