1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 21:42:58 +08:00

Merge pull request #11225 from peppy/fix-texture-loader-usages

This commit is contained in:
Bartłomiej Dach 2020-12-21 19:11:03 +01:00 committed by GitHub
commit 34149bb8a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics.OpenGL.Textures;
using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores;
using osu.Framework.Platform;
using osu.Game.Rulesets.Configuration;
namespace osu.Game.Rulesets.UI
@ -46,7 +47,7 @@ namespace osu.Game.Rulesets.UI
if (resources != null)
{
TextureStore = new TextureStore(new TextureLoaderStore(new NamespacedResourceStore<byte[]>(resources, @"Textures")));
TextureStore = new TextureStore(parent.Get<GameHost>().CreateTextureLoaderStore(new NamespacedResourceStore<byte[]>(resources, @"Textures")));
CacheAs(TextureStore = new FallbackTextureStore(TextureStore, parent.Get<TextureStore>()));
SampleStore = parent.Get<AudioManager>().GetSampleStore(new NamespacedResourceStore<byte[]>(resources, @"Samples"));

View File

@ -8,6 +8,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Textures;
using osu.Framework.Platform;
using osu.Game.IO;
using osu.Game.Screens.Play;
@ -59,12 +60,12 @@ namespace osu.Game.Storyboards.Drawables
}
[BackgroundDependencyLoader(true)]
private void load(FileStore fileStore, GameplayClock clock, CancellationToken? cancellationToken)
private void load(FileStore fileStore, GameplayClock clock, CancellationToken? cancellationToken, GameHost host)
{
if (clock != null)
Clock = clock;
dependencies.Cache(new TextureStore(new TextureLoaderStore(fileStore.Store), false, scaleAdjust: 1));
dependencies.Cache(new TextureStore(host.CreateTextureLoaderStore(fileStore.Store), false, scaleAdjust: 1));
foreach (var layer in Storyboard.Layers)
{