-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ppy#7889 from smoogipoo/fix-ogg-samples
Fix ogg beatmap/skin samples not loading
- Loading branch information
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. 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)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. 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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters