1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 06:39:54 +08:00

Fix extensions not being specified in time for realm file caching

This commit is contained in:
Dean Herbert
2022-03-23 13:36:33 +09:00
Unverified
parent a7f63fb034
commit e1236e07ad
3 changed files with 20 additions and 15 deletions
+3 -2
View File
@@ -21,8 +21,9 @@ namespace osu.Game.Skinning
protected override bool AllowManiaSkin => false;
protected override bool UseCustomSampleBanks => true;
public LegacyBeatmapSkin(BeatmapInfo beatmapInfo, IStorageResourceProvider resources, [CanBeNull] IResourceStore<byte[]> storage = null)
: base(createSkinInfo(beatmapInfo), storage ?? new RealmBackedResourceStore(beatmapInfo.BeatmapSet, resources.Files), resources, beatmapInfo.Path)
public LegacyBeatmapSkin(BeatmapInfo beatmapInfo, [CanBeNull] IStorageResourceProvider resources, [CanBeNull] IResourceStore<byte[]> storage = null)
: base(createSkinInfo(beatmapInfo), storage ?? (resources != null ? new RealmBackedResourceStore(beatmapInfo.BeatmapSet, resources.Files, new[] { @"ogg" }) : null), resources,
beatmapInfo.Path)
{
// Disallow default colours fallback on beatmap skins to allow using parent skin combo colours. (via SkinProvidingContainer)
Configuration.AllowDefaultComboColoursFallback = false;
@@ -13,9 +13,16 @@ namespace osu.Game.Skinning
{
private readonly Dictionary<string, string> fileToStoragePathMapping = new Dictionary<string, string>();
public RealmBackedResourceStore(IHasRealmFiles source, IResourceStore<byte[]> underlyingStore)
public RealmBackedResourceStore(IHasRealmFiles source, IResourceStore<byte[]> underlyingStore, string[] extensions = null)
: base(underlyingStore)
{
// Must be initialised before the file cache.
if (extensions != null)
{
foreach (string extension in extensions)
AddExtension(extension);
}
initialiseFileCache(source);
}
+9 -12
View File
@@ -60,25 +60,22 @@ namespace osu.Game.Skinning
{
SkinInfo = skin.ToLive(resources.RealmAccess);
if (storage == null)
{
var realmStorage = new RealmBackedResourceStore(skin, resources.Files);
realmStorage.AddExtension("ogg");
storage = realmStorage;
}
storage ??= new RealmBackedResourceStore(skin, resources.Files, new[] { @"ogg" });
}
else
{
SkinInfo = skin.ToLiveUnmanaged();
}
var samples = resources.AudioManager?.GetSampleStore(storage);
if (samples != null)
samples.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY;
if (storage != null)
{
var samples = resources.AudioManager?.GetSampleStore(storage);
if (samples != null)
samples.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY;
Samples = samples;
Textures = new TextureStore(resources.CreateTextureLoaderStore(storage));
Samples = samples;
Textures = new TextureStore(resources.CreateTextureLoaderStore(storage));
}
}
configurationStream ??= storage?.GetStream(@"skin.ini");