Fix realm backed store not being initialised for some tests

This commit is contained in:
Dean Herbert 2022-03-23 14:21:35 +09:00
parent a5acd38fd5
commit e56d13d8be
1 changed files with 9 additions and 17 deletions

View File

@ -63,26 +63,18 @@ protected Skin(SkinInfo skin, [CanBeNull] IStorageResourceProvider resources, [C
{
if (resources != null)
{
if (resources.RealmAccess != null)
{
SkinInfo = skin.ToLive(resources.RealmAccess);
SkinInfo = resources.RealmAccess != null
? skin.ToLive(resources.RealmAccess)
: skin.ToLiveUnmanaged();
storage ??= new RealmBackedResourceStore(skin, resources.Files, new[] { @"ogg" });
}
else
{
SkinInfo = skin.ToLiveUnmanaged();
}
storage ??= new RealmBackedResourceStore(skin, resources.Files, new[] { @"ogg" });
if (storage != null)
{
var samples = resources.AudioManager?.GetSampleStore(storage);
if (samples != null)
samples.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY;
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");