mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Update with async changes
This commit is contained in:
@ -22,7 +22,7 @@ namespace osu.Game.Graphics.Sprites
|
|||||||
|
|
||||||
protected override Drawable CreateFallbackCharacterDrawable()
|
protected override Drawable CreateFallbackCharacterDrawable()
|
||||||
{
|
{
|
||||||
var tex = GetTextureForCharacter('?');
|
var tex = GetTextureForCharacter('?').Result;
|
||||||
|
|
||||||
if (tex != null)
|
if (tex != null)
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.IO.Stores;
|
using osu.Framework.IO.Stores;
|
||||||
|
|
||||||
namespace osu.Game.IO.Archives
|
namespace osu.Game.IO.Archives
|
||||||
@ -28,7 +29,9 @@ namespace osu.Game.IO.Archives
|
|||||||
|
|
||||||
public abstract IEnumerable<string> Filenames { get; }
|
public abstract IEnumerable<string> Filenames { get; }
|
||||||
|
|
||||||
public virtual byte[] Get(string name)
|
public virtual byte[] Get(string name) => GetAsync(name).Result;
|
||||||
|
|
||||||
|
public async Task<byte[]> GetAsync(string name)
|
||||||
{
|
{
|
||||||
using (Stream input = GetStream(name))
|
using (Stream input = GetStream(name))
|
||||||
{
|
{
|
||||||
@ -36,7 +39,7 @@ namespace osu.Game.IO.Archives
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
byte[] buffer = new byte[input.Length];
|
byte[] buffer = new byte[input.Length];
|
||||||
input.Read(buffer, 0, buffer.Length);
|
await input.ReadAsync(buffer, 0, buffer.Length);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -108,10 +109,12 @@ namespace osu.Game.Skinning
|
|||||||
return path == null ? null : underlyingStore.GetStream(path);
|
return path == null ? null : underlyingStore.GetStream(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] IResourceStore<byte[]>.Get(string name)
|
byte[] IResourceStore<byte[]>.Get(string name) => GetAsync(name).Result;
|
||||||
|
|
||||||
|
public async Task<byte[]> GetAsync(string name)
|
||||||
{
|
{
|
||||||
string path = getPathForFile(name);
|
string path = getPathForFile(name);
|
||||||
return path == null ? null : underlyingStore.Get(path);
|
return path == null ? null : await underlyingStore.GetAsync(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IDisposable Support
|
#region IDisposable Support
|
||||||
|
Reference in New Issue
Block a user