Split retrieving of beatmap and storyboard decoder

Storyboard works again. Not satisfied with the solution though.
This commit is contained in:
Aergwyn
2017-12-01 19:11:52 +01:00
parent db50ad794e
commit a49f3479a2
9 changed files with 151 additions and 104 deletions

View File

@ -495,7 +495,7 @@ namespace osu.Game.Beatmaps
BeatmapMetadata metadata;
using (var stream = new StreamReader(reader.GetStream(mapName)))
metadata = BeatmapDecoder.GetDecoder(stream).DecodeBeatmap(stream).Metadata;
metadata = Decoder.GetBeatmapDecoder(stream).DecodeBeatmap(stream).Metadata;
// check if a set already exists with the same online id.
beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID) ?? new BeatmapSetInfo
@ -518,7 +518,7 @@ namespace osu.Game.Beatmaps
raw.CopyTo(ms);
ms.Position = 0;
var decoder = BeatmapDecoder.GetDecoder(sr);
var decoder = Decoder.GetBeatmapDecoder(sr);
Beatmap beatmap = decoder.DecodeBeatmap(sr);
beatmap.BeatmapInfo.Path = name;
@ -571,7 +571,7 @@ namespace osu.Game.Beatmaps
{
using (var stream = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path))))
{
BeatmapDecoder decoder = BeatmapDecoder.GetDecoder(stream);
Decoder decoder = Decoder.GetBeatmapDecoder(stream);
return decoder.DecodeBeatmap(stream);
}
}
@ -620,9 +620,9 @@ namespace osu.Game.Beatmaps
try
{
BeatmapDecoder decoder;
Decoder decoder;
using (var stream = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path))))
decoder = BeatmapDecoder.GetDecoder(stream);
decoder = Decoder.GetStoryboardDecoder(stream);
using (var stream = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile))))
return decoder.DecodeStoryboard(stream);