mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add back legacy custom sample banks
This commit is contained in:
@ -8,6 +8,7 @@ using OpenTK.Graphics;
|
||||
using osu.Game.Tests.Resources;
|
||||
using System.Linq;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
@ -211,5 +212,21 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
Assert.IsTrue(hitObjects[1].Samples.Any(s => s.Name == SampleInfo.HIT_CLAP));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDecodeCustomSamples()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||
using (var resStream = Resource.OpenResource("custom-samples.osu"))
|
||||
using (var stream = new StreamReader(resStream))
|
||||
{
|
||||
var hitObjects = decoder.Decode(stream).HitObjects;
|
||||
|
||||
Assert.AreEqual(0, ((LegacyDecoder<Beatmap>.LegacySampleControlPoint)hitObjects[0].SampleControlPoint).CustomSampleBank);
|
||||
Assert.AreEqual(1, ((LegacyDecoder<Beatmap>.LegacySampleControlPoint)hitObjects[1].SampleControlPoint).CustomSampleBank);
|
||||
Assert.AreEqual(2, ((LegacyDecoder<Beatmap>.LegacySampleControlPoint)hitObjects[2].SampleControlPoint).CustomSampleBank);
|
||||
Assert.AreEqual(0, ((LegacyDecoder<Beatmap>.LegacySampleControlPoint)hitObjects[3].SampleControlPoint).CustomSampleBank);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user