mirror of
https://github.com/osukey/osukey.git
synced 2025-06-29 23:28:00 +09:00
Merge branch 'master' into fix-editor-tap-timing-crash
This commit is contained in:
commit
60422be9af
@ -35,6 +35,8 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
private void load(CatchInputManager catchInputManager, OsuColour colours)
|
private void load(CatchInputManager catchInputManager, OsuColour colours)
|
||||||
{
|
{
|
||||||
const float width = 0.15f;
|
const float width = 0.15f;
|
||||||
|
// Ratio between normal move area height and total input height
|
||||||
|
const float normal_area_height_ratio = 0.45f;
|
||||||
|
|
||||||
keyBindingContainer = catchInputManager.KeyBindingContainer;
|
keyBindingContainer = catchInputManager.KeyBindingContainer;
|
||||||
|
|
||||||
@ -54,18 +56,18 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
Width = width,
|
Width = width,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
leftDashBox = new InputArea(TouchCatchAction.DashLeft, trackedActionSources)
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Width = 0.5f,
|
|
||||||
},
|
|
||||||
leftBox = new InputArea(TouchCatchAction.MoveLeft, trackedActionSources)
|
leftBox = new InputArea(TouchCatchAction.MoveLeft, trackedActionSources)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Width = 0.5f,
|
Height = normal_area_height_ratio,
|
||||||
Colour = colours.Gray9,
|
Colour = colours.Gray9,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.BottomRight,
|
||||||
|
},
|
||||||
|
leftDashBox = new InputArea(TouchCatchAction.DashLeft, trackedActionSources)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Height = 1 - normal_area_height_ratio,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -80,15 +82,15 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
rightBox = new InputArea(TouchCatchAction.MoveRight, trackedActionSources)
|
rightBox = new InputArea(TouchCatchAction.MoveRight, trackedActionSources)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Width = 0.5f,
|
Height = normal_area_height_ratio,
|
||||||
Colour = colours.Gray9,
|
Colour = colours.Gray9,
|
||||||
|
Anchor = Anchor.BottomRight,
|
||||||
|
Origin = Anchor.BottomRight,
|
||||||
},
|
},
|
||||||
rightDashBox = new InputArea(TouchCatchAction.DashRight, trackedActionSources)
|
rightDashBox = new InputArea(TouchCatchAction.DashRight, trackedActionSources)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Width = 0.5f,
|
Height = 1 - normal_area_height_ratio,
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -83,5 +83,41 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
AddAssert("first barline ommited", () => barlines.All(b => b.StartTime != start_time));
|
AddAssert("first barline ommited", () => barlines.All(b => b.StartTime != start_time));
|
||||||
AddAssert("second barline generated", () => barlines.Any(b => b.StartTime == start_time + (beat_length * time_signature_numerator)));
|
AddAssert("second barline generated", () => barlines.Any(b => b.StartTime == start_time + (beat_length * time_signature_numerator)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestNegativeStartTimeTimingPoint()
|
||||||
|
{
|
||||||
|
const double beat_length = 250;
|
||||||
|
|
||||||
|
const int time_signature_numerator = 4;
|
||||||
|
|
||||||
|
var beatmap = new Beatmap<TaikoHitObject>
|
||||||
|
{
|
||||||
|
HitObjects =
|
||||||
|
{
|
||||||
|
new Hit
|
||||||
|
{
|
||||||
|
Type = HitType.Centre,
|
||||||
|
StartTime = 1000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Difficulty = new BeatmapDifficulty { SliderTickRate = 4 },
|
||||||
|
Ruleset = new TaikoRuleset().RulesetInfo
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
beatmap.ControlPointInfo.Add(-100, new TimingControlPoint
|
||||||
|
{
|
||||||
|
BeatLength = beat_length,
|
||||||
|
TimeSignature = new TimeSignature(time_signature_numerator)
|
||||||
|
});
|
||||||
|
|
||||||
|
var barlines = new BarLineGenerator<BarLine>(beatmap).BarLines;
|
||||||
|
|
||||||
|
AddAssert("bar line generated at t=900", () => barlines.Any(line => line.StartTime == 900));
|
||||||
|
AddAssert("bar line generated at t=1900", () => barlines.Any(line => line.StartTime == 1900));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,10 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
if (beatmap.HitObjects.Count == 0)
|
if (beatmap.HitObjects.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
HitObject firstObject = beatmap.HitObjects.First();
|
||||||
HitObject lastObject = beatmap.HitObjects.Last();
|
HitObject lastObject = beatmap.HitObjects.Last();
|
||||||
|
|
||||||
|
double firstHitTime = firstObject.StartTime;
|
||||||
double lastHitTime = 1 + lastObject.GetEndTime();
|
double lastHitTime = 1 + lastObject.GetEndTime();
|
||||||
|
|
||||||
var timingPoints = beatmap.ControlPointInfo.TimingPoints;
|
var timingPoints = beatmap.ControlPointInfo.TimingPoints;
|
||||||
@ -41,12 +44,31 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
EffectControlPoint currentEffectPoint = beatmap.ControlPointInfo.EffectPointAt(currentTimingPoint.Time);
|
EffectControlPoint currentEffectPoint = beatmap.ControlPointInfo.EffectPointAt(currentTimingPoint.Time);
|
||||||
int currentBeat = 0;
|
int currentBeat = 0;
|
||||||
|
|
||||||
|
// Don't generate barlines before the hit object or t=0 (whichever is earliest). Some beatmaps use very unrealistic values here (although none are ranked).
|
||||||
|
// I'm not sure we ever want barlines to appear before the first hitobject, but let's keep some degree of compatibility for now.
|
||||||
|
// Of note, this will still differ from stable if the first timing control point is t<0 and is not near the first hitobject.
|
||||||
|
double generationStartTime = Math.Min(0, firstHitTime);
|
||||||
|
|
||||||
// Stop on the next timing point, or if there is no next timing point stop slightly past the last object
|
// Stop on the next timing point, or if there is no next timing point stop slightly past the last object
|
||||||
double endTime = i < timingPoints.Count - 1 ? timingPoints[i + 1].Time : lastHitTime + currentTimingPoint.BeatLength * currentTimingPoint.TimeSignature.Numerator;
|
double endTime = i < timingPoints.Count - 1 ? timingPoints[i + 1].Time : lastHitTime + currentTimingPoint.BeatLength * currentTimingPoint.TimeSignature.Numerator;
|
||||||
|
|
||||||
double startTime = currentTimingPoint.Time;
|
|
||||||
double barLength = currentTimingPoint.BeatLength * currentTimingPoint.TimeSignature.Numerator;
|
double barLength = currentTimingPoint.BeatLength * currentTimingPoint.TimeSignature.Numerator;
|
||||||
|
|
||||||
|
double startTime;
|
||||||
|
|
||||||
|
if (currentTimingPoint.Time > generationStartTime)
|
||||||
|
{
|
||||||
|
startTime = currentTimingPoint.Time;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If the timing point starts before the minimum allowable time for bar lines,
|
||||||
|
// we still need to compute a start time for generation that is actually properly aligned with the timing point.
|
||||||
|
int barCount = (int)Math.Ceiling((generationStartTime - currentTimingPoint.Time) / barLength);
|
||||||
|
|
||||||
|
startTime = currentTimingPoint.Time + barCount * barLength;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentEffectPoint.OmitFirstBarLine)
|
if (currentEffectPoint.OmitFirstBarLine)
|
||||||
{
|
{
|
||||||
startTime += barLength;
|
startTime += barLength;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user