mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Fix ogg beatmap/skin samples not loading
This commit is contained in:
BIN
osu.Game.Tests/Resources/Archives/ogg-beatmap.osz
Normal file
BIN
osu.Game.Tests/Resources/Archives/ogg-beatmap.osz
Normal file
Binary file not shown.
BIN
osu.Game.Tests/Resources/Archives/ogg-skin.osk
Normal file
BIN
osu.Game.Tests/Resources/Archives/ogg-skin.osk
Normal file
Binary file not shown.
37
osu.Game.Tests/Skins/TestSceneBeatmapSkinResources.cs
Normal file
37
osu.Game.Tests/Skins/TestSceneBeatmapSkinResources.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Audio.Track;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Audio;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.IO.Archives;
|
||||||
|
using osu.Game.Tests.Resources;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Skins
|
||||||
|
{
|
||||||
|
[HeadlessTest]
|
||||||
|
public class TestSceneBeatmapSkinResources : OsuTestScene
|
||||||
|
{
|
||||||
|
[Resolved]
|
||||||
|
private BeatmapManager beatmaps { get; set; }
|
||||||
|
|
||||||
|
private WorkingBeatmap beatmap;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
var imported = beatmaps.Import(new ZipArchiveReader(TestResources.OpenResource("Archives/ogg-beatmap.osz"))).Result;
|
||||||
|
beatmap = beatmaps.GetWorkingBeatmap(imported.Beatmaps[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestRetrieveOggSample() => AddAssert("sample is non-null", () => beatmap.Skin.GetSample(new SampleInfo("sample")) != null);
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestRetrieveOggTrack() => AddAssert("track is non-null", () => !(beatmap.Track is TrackVirtual));
|
||||||
|
}
|
||||||
|
}
|
33
osu.Game.Tests/Skins/TestSceneSkinResources.cs
Normal file
33
osu.Game.Tests/Skins/TestSceneSkinResources.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Audio;
|
||||||
|
using osu.Game.IO.Archives;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
using osu.Game.Tests.Resources;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Skins
|
||||||
|
{
|
||||||
|
[HeadlessTest]
|
||||||
|
public class TestSceneSkinResources : OsuTestScene
|
||||||
|
{
|
||||||
|
[Resolved]
|
||||||
|
private SkinManager skins { get; set; }
|
||||||
|
|
||||||
|
private ISkin skin;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
var imported = skins.Import(new ZipArchiveReader(TestResources.OpenResource("Archives/ogg-skin.osk"))).Result;
|
||||||
|
skin = skins.GetSkin(imported);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestRetrieveOggSample() => AddAssert("sample is non-null", () => skin.GetSample(new SampleInfo("sample")) != null);
|
||||||
|
}
|
||||||
|
}
|
@ -54,6 +54,8 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
Samples = audioManager?.GetSampleStore(storage);
|
Samples = audioManager?.GetSampleStore(storage);
|
||||||
Textures = new TextureStore(new TextureLoaderStore(storage));
|
Textures = new TextureStore(new TextureLoaderStore(storage));
|
||||||
|
|
||||||
|
(storage as ResourceStore<byte[]>)?.AddExtension("ogg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user