mirror of
https://github.com/ppy/osu
synced 2025-03-22 10:56:54 +00:00
Merge branch 'master' into improve-sequential-algo-perf
This commit is contained in:
commit
3374cb4cad
@ -20,6 +20,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
|
|
||||||
[TestCase("convert-samples")]
|
[TestCase("convert-samples")]
|
||||||
[TestCase("mania-samples")]
|
[TestCase("mania-samples")]
|
||||||
|
[TestCase("slider-convert-samples")]
|
||||||
public void Test(string name) => base.Test(name);
|
public void Test(string name) => base.Test(name);
|
||||||
|
|
||||||
protected override IEnumerable<SampleConvertValue> CreateConvertValue(HitObject hitObject)
|
protected override IEnumerable<SampleConvertValue> CreateConvertValue(HitObject hitObject)
|
||||||
@ -29,13 +30,16 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
StartTime = hitObject.StartTime,
|
StartTime = hitObject.StartTime,
|
||||||
EndTime = hitObject.GetEndTime(),
|
EndTime = hitObject.GetEndTime(),
|
||||||
Column = ((ManiaHitObject)hitObject).Column,
|
Column = ((ManiaHitObject)hitObject).Column,
|
||||||
NodeSamples = getSampleNames((hitObject as HoldNote)?.NodeSamples)
|
Samples = getSampleNames(hitObject.Samples),
|
||||||
|
NodeSamples = getNodeSampleNames((hitObject as HoldNote)?.NodeSamples)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private IList<IList<string>> getSampleNames(List<IList<HitSampleInfo>> hitSampleInfo)
|
private IList<string> getSampleNames(IList<HitSampleInfo> hitSampleInfo)
|
||||||
=> hitSampleInfo?.Select(samples =>
|
=> hitSampleInfo.Select(sample => sample.LookupNames.First()).ToList();
|
||||||
(IList<string>)samples.Select(sample => sample.LookupNames.First()).ToList())
|
|
||||||
|
private IList<IList<string>> getNodeSampleNames(List<IList<HitSampleInfo>> hitSampleInfo)
|
||||||
|
=> hitSampleInfo?.Select(getSampleNames)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
protected override Ruleset CreateRuleset() => new ManiaRuleset();
|
protected override Ruleset CreateRuleset() => new ManiaRuleset();
|
||||||
@ -51,14 +55,19 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
public double StartTime;
|
public double StartTime;
|
||||||
public double EndTime;
|
public double EndTime;
|
||||||
public int Column;
|
public int Column;
|
||||||
|
public IList<string> Samples;
|
||||||
public IList<IList<string>> NodeSamples;
|
public IList<IList<string>> NodeSamples;
|
||||||
|
|
||||||
public bool Equals(SampleConvertValue other)
|
public bool Equals(SampleConvertValue other)
|
||||||
=> Precision.AlmostEquals(StartTime, other.StartTime, conversion_lenience)
|
=> Precision.AlmostEquals(StartTime, other.StartTime, conversion_lenience)
|
||||||
&& Precision.AlmostEquals(EndTime, other.EndTime, conversion_lenience)
|
&& Precision.AlmostEquals(EndTime, other.EndTime, conversion_lenience)
|
||||||
&& samplesEqual(NodeSamples, other.NodeSamples);
|
&& samplesEqual(Samples, other.Samples)
|
||||||
|
&& nodeSamplesEqual(NodeSamples, other.NodeSamples);
|
||||||
|
|
||||||
private static bool samplesEqual(ICollection<IList<string>> firstSampleList, ICollection<IList<string>> secondSampleList)
|
private static bool samplesEqual(ICollection<string> firstSampleList, ICollection<string> secondSampleList)
|
||||||
|
=> firstSampleList.SequenceEqual(secondSampleList);
|
||||||
|
|
||||||
|
private static bool nodeSamplesEqual(ICollection<IList<string>> firstSampleList, ICollection<IList<string>> secondSampleList)
|
||||||
{
|
{
|
||||||
if (firstSampleList == null && secondSampleList == null)
|
if (firstSampleList == null && secondSampleList == null)
|
||||||
return true;
|
return true;
|
||||||
|
@ -483,9 +483,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
|
|||||||
if (!(HitObject is IHasPathWithRepeats curveData))
|
if (!(HitObject is IHasPathWithRepeats curveData))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
double segmentTime = (EndTime - HitObject.StartTime) / spanCount;
|
// mathematically speaking this should be a whole number always, but floating-point arithmetic is not so kind
|
||||||
|
var index = (int)Math.Round(SegmentDuration == 0 ? 0 : (time - HitObject.StartTime) / SegmentDuration, MidpointRounding.AwayFromZero);
|
||||||
int index = (int)(segmentTime == 0 ? 0 : (time - HitObject.StartTime) / segmentTime);
|
|
||||||
|
|
||||||
// avoid slicing the list & creating copies, if at all possible.
|
// avoid slicing the list & creating copies, if at all possible.
|
||||||
return index == 0 ? curveData.NodeSamples : curveData.NodeSamples.Skip(index).ToList();
|
return index == 0 ? curveData.NodeSamples : curveData.NodeSamples.Skip(index).ToList();
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
["normal-hitnormal"],
|
["normal-hitnormal"],
|
||||||
["soft-hitnormal"],
|
["soft-hitnormal"],
|
||||||
["drum-hitnormal"]
|
["drum-hitnormal"]
|
||||||
]
|
],
|
||||||
|
"Samples": ["drum-hitnormal"]
|
||||||
}, {
|
}, {
|
||||||
"StartTime": 1875.0,
|
"StartTime": 1875.0,
|
||||||
"EndTime": 2750.0,
|
"EndTime": 2750.0,
|
||||||
@ -17,14 +18,16 @@
|
|||||||
"NodeSamples": [
|
"NodeSamples": [
|
||||||
["soft-hitnormal"],
|
["soft-hitnormal"],
|
||||||
["drum-hitnormal"]
|
["drum-hitnormal"]
|
||||||
]
|
],
|
||||||
|
"Samples": ["drum-hitnormal"]
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
"StartTime": 3750.0,
|
"StartTime": 3750.0,
|
||||||
"Objects": [{
|
"Objects": [{
|
||||||
"StartTime": 3750.0,
|
"StartTime": 3750.0,
|
||||||
"EndTime": 3750.0,
|
"EndTime": 3750.0,
|
||||||
"Column": 3
|
"Column": 3,
|
||||||
|
"Samples": ["normal-hitnormal"]
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
@ -13,4 +13,4 @@ SliderTickRate:1
|
|||||||
|
|
||||||
[HitObjects]
|
[HitObjects]
|
||||||
88,99,1000,6,0,L|306:259,2,245,0|0|0,1:0|2:0|3:0,0:0:0:0:
|
88,99,1000,6,0,L|306:259,2,245,0|0|0,1:0|2:0|3:0,0:0:0:0:
|
||||||
259,118,3750,1,0,0:0:0:0:
|
259,118,3750,1,0,1:0:0:0:
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
"NodeSamples": [
|
"NodeSamples": [
|
||||||
["normal-hitnormal"],
|
["normal-hitnormal"],
|
||||||
[]
|
[]
|
||||||
]
|
],
|
||||||
|
"Samples": ["normal-hitnormal"]
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
"StartTime": 2000.0,
|
"StartTime": 2000.0,
|
||||||
@ -19,7 +20,8 @@
|
|||||||
"NodeSamples": [
|
"NodeSamples": [
|
||||||
["drum-hitnormal"],
|
["drum-hitnormal"],
|
||||||
[]
|
[]
|
||||||
]
|
],
|
||||||
|
"Samples": ["drum-hitnormal"]
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"Mappings": [{
|
||||||
|
"StartTime": 8470.0,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 8470.0,
|
||||||
|
"EndTime": 8470.0,
|
||||||
|
"Column": 0,
|
||||||
|
"Samples": ["normal-hitnormal", "normal-hitclap"]
|
||||||
|
}, {
|
||||||
|
"StartTime": 8626.470587768974,
|
||||||
|
"EndTime": 8626.470587768974,
|
||||||
|
"Column": 1,
|
||||||
|
"Samples": ["normal-hitnormal"]
|
||||||
|
}, {
|
||||||
|
"StartTime": 8782.941175537948,
|
||||||
|
"EndTime": 8782.941175537948,
|
||||||
|
"Column": 2,
|
||||||
|
"Samples": ["normal-hitnormal", "normal-hitclap"]
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
osu file format v14
|
||||||
|
|
||||||
|
[Difficulty]
|
||||||
|
HPDrainRate:6
|
||||||
|
CircleSize:4
|
||||||
|
OverallDifficulty:8
|
||||||
|
ApproachRate:9.5
|
||||||
|
SliderMultiplier:2.00000000596047
|
||||||
|
SliderTickRate:1
|
||||||
|
|
||||||
|
[TimingPoints]
|
||||||
|
0,312.941176470588,4,1,0,100,1,0
|
||||||
|
|
||||||
|
[HitObjects]
|
||||||
|
82,216,8470,6,0,P|52:161|99:113,2,100,8|0|8,1:0|1:0|1:0,0:0:0:0:
|
@ -767,7 +767,7 @@ namespace osu.Game
|
|||||||
Text = "Subsequent messages have been logged. Click to view log files.",
|
Text = "Subsequent messages have been logged. Click to view log files.",
|
||||||
Activated = () =>
|
Activated = () =>
|
||||||
{
|
{
|
||||||
Host.Storage.GetStorageForDirectory("logs").OpenInNativeExplorer();
|
Storage.GetStorageForDirectory("logs").OpenInNativeExplorer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -70,19 +70,13 @@ namespace osu.Game.Screens.Ranking
|
|||||||
{
|
{
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new VerticalScrollContainer
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new OsuScrollContainer
|
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
ScrollbarVisible = false,
|
ScrollbarVisible = false,
|
||||||
Child = new Container
|
Child = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Height = screen_height,
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
scorePanelList = new ScorePanelList
|
scorePanelList = new ScorePanelList
|
||||||
@ -103,8 +97,6 @@ namespace osu.Game.Screens.Ranking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
@ -277,5 +269,23 @@ namespace osu.Game.Screens.Ranking
|
|||||||
detachedPanel = null;
|
detachedPanel = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class VerticalScrollContainer : OsuScrollContainer
|
||||||
|
{
|
||||||
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
|
private readonly Container content;
|
||||||
|
|
||||||
|
public VerticalScrollContainer()
|
||||||
|
{
|
||||||
|
base.Content.Add(content = new Container { RelativeSizeAxes = Axes.X });
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
content.Height = Math.Max(screen_height, DrawHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,6 @@ namespace osu.Game.Screens.Select
|
|||||||
var metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
|
var metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
|
||||||
|
|
||||||
CacheDrawnFrameBuffer = true;
|
CacheDrawnFrameBuffer = true;
|
||||||
RedrawOnScale = false;
|
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user