Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions source/funkin/Conductor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ class Conductor
*/
public var songPosition(default, null):Float = 0;

/**
* The offset between frame time and music time.
* Used in `getTimeWithDelta()` to get a more accurate music time when on higher framerates.
*/
var songPositionDelta(default, null):Float = 0;

var prevTimestamp:Float = 0;
var prevTime:Float = 0;

Expand Down Expand Up @@ -440,7 +434,6 @@ class Conductor
if (FlxG.sound.music != null && FlxG.sound.music.playing)
{
this.songPosition = Math.min(this.combinedOffset, 0).clamp(songPos, currentLength);
this.songPositionDelta += FlxG.elapsed * 1000 * FlxG.sound.music.pitch;
}
else
{
Expand Down Expand Up @@ -506,8 +499,6 @@ class Conductor
// which it doesn't do every frame!
if (prevTime != this.songPosition)
{
this.songPositionDelta = 0;

// Update the timestamp for use in-between frames
prevTime = this.songPosition;
prevTimestamp = Std.int(Timer.stamp() * 1000);
Expand All @@ -520,9 +511,10 @@ class Conductor
* Returns a more accurate music time for higher framerates.
* @return Float
*/
@:deprecated('Use songPosition directly instead.')
public function getTimeWithDelta():Float
{
return this.songPosition + this.songPositionDelta;
return this.songPosition;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/util/GRhythmUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ class GRhythmUtil
public static function getNoteY(strumTime:Float, scrollSpeed:Float, downscroll:Bool = false, ?conductorInUse:Conductor):Float
{
if (conductorInUse == null) conductorInUse = Conductor.instance;
return Constants.PIXELS_PER_MS * (conductorInUse.getTimeWithDelta() - strumTime) * scrollSpeed * (downscroll ? 1 : -1);
return Constants.PIXELS_PER_MS * (conductorInUse.songPosition - strumTime) * scrollSpeed * (downscroll ? 1 : -1);
}
}
Loading