mirror of
https://github.com/ppy/osu
synced 2025-01-04 13:22:08 +00:00
Fix extensions not being specified in time for realm file caching
This commit is contained in:
parent
a7f63fb034
commit
e1236e07ad
@ -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);
|
||||
}
|
||||
|
||||
|
@ -60,19 +60,15 @@ 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();
|
||||
}
|
||||
|
||||
if (storage != null)
|
||||
{
|
||||
var samples = resources.AudioManager?.GetSampleStore(storage);
|
||||
if (samples != null)
|
||||
samples.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY;
|
||||
@ -80,6 +76,7 @@ namespace osu.Game.Skinning
|
||||
Samples = samples;
|
||||
Textures = new TextureStore(resources.CreateTextureLoaderStore(storage));
|
||||
}
|
||||
}
|
||||
|
||||
configurationStream ??= storage?.GetStream(@"skin.ini");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user