Skip to content

Commit

Permalink
Merge pull request #580 from LumpBloom7/stereo-placement-fix
Browse files Browse the repository at this point in the history
Fix sample playback position issues
  • Loading branch information
LumpBloom7 authored Apr 30, 2024
2 parents 6f185cd + 23ee2cb commit 875441d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public bool Auto
// Used for the animation update
protected readonly Bindable<double> AnimationDuration = new Bindable<double>(1000);

protected override float SamplePlaybackPosition => Position.X / (SentakkiPlayfield.INTERSECTDISTANCE * 2);
protected override float SamplePlaybackPosition => (Position.X / (SentakkiPlayfield.INTERSECTDISTANCE * 2)) + 0.5f;

public DrawableSentakkiHitObject()
: this(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Sentakki.Objects.Drawables
{
public partial class DrawableSlideBody : DrawableSentakkiLanedHitObject
{
private new DrawableSlide ParentHitObject => (DrawableSlide)base.ParentHitObject;
public new DrawableSlide ParentHitObject => (DrawableSlide)base.ParentHitObject;
public new SlideBody HitObject => (SlideBody)base.HitObject;

// This slide body can only be interacted with iff the slidetap associated with this slide is judged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Sentakki.UI;

namespace osu.Game.Rulesets.Sentakki.Objects.Drawables
{
Expand All @@ -20,6 +21,7 @@ public partial class DrawableSlideCheckpoint : DrawableSentakkiHitObject
public override bool DisplayResult => false;

private new DrawableSlideBody ParentHitObject => (DrawableSlideBody)base.ParentHitObject;
private int slideOriginLane => ParentHitObject.ParentHitObject.HitObject.Lane;

// Used to determine the node order
public int ThisIndex;
Expand All @@ -37,6 +39,8 @@ public partial class DrawableSlideCheckpoint : DrawableSentakkiHitObject

private Container<DrawableSlideCheckpointNode> nodes = null!;

protected override float SamplePlaybackPosition => (SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, slideOriginLane).X / (SentakkiPlayfield.INTERSECTDISTANCE * 2)) + .5f;

public DrawableSlideCheckpoint()
: this(null)
{
Expand Down Expand Up @@ -70,7 +74,7 @@ protected override void OnApply()

protected override void CheckForResult(bool userTriggered, double timeOffset)
{
// Counting hit notes manually to avoid LINQ alloc overhead
// Counting hit notes manually to avoid LINQ alloc overhead
int hitNotes = 0;

foreach (var node in nodes)
Expand Down

0 comments on commit 875441d

Please sign in to comment.