mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Fix sample store creation mutating shared resource store
This commit is contained in:
parent
a8f828d203
commit
c5e1f54185
@ -150,6 +150,8 @@ namespace osu.Game.Tests.Rulesets
|
||||
public IBindable<double> AggregateTempo => throw new NotImplementedException();
|
||||
|
||||
public int PlaybackConcurrency { get; set; }
|
||||
|
||||
public void AddExtension(string extension) => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private class TestShaderManager : ShaderManager
|
||||
|
@ -157,6 +157,8 @@ namespace osu.Game.Rulesets.UI
|
||||
set => throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public void AddExtension(string extension) => throw new NotSupportedException();
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (primary.IsNotNull()) primary.Dispose();
|
||||
|
@ -69,12 +69,15 @@ namespace osu.Game.Skinning
|
||||
storage ??= realmBackedStorage = new RealmBackedResourceStore<SkinInfo>(SkinInfo, resources.Files, resources.RealmAccess);
|
||||
|
||||
var samples = resources.AudioManager?.GetSampleStore(storage);
|
||||
|
||||
if (samples != null)
|
||||
{
|
||||
samples.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY;
|
||||
|
||||
// osu-stable performs audio lookups in order of wav -> mp3 -> ogg.
|
||||
// The GetSampleStore() call above internally adds wav and mp3, so ogg is added at the end to ensure expected ordering.
|
||||
(storage as ResourceStore<byte[]>)?.AddExtension("ogg");
|
||||
// osu-stable performs audio lookups in order of wav -> mp3 -> ogg.
|
||||
// The GetSampleStore() call above internally adds wav and mp3, so ogg is added at the end to ensure expected ordering.
|
||||
samples.AddExtension(@"ogg");
|
||||
}
|
||||
|
||||
Samples = samples;
|
||||
Textures = new TextureStore(resources.Renderer, new MaxDimensionLimitedTextureLoaderStore(resources.CreateTextureLoaderStore(storage)));
|
||||
|
Loading…
Reference in New Issue
Block a user