mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-16 11:53:45 +00:00
Keep the consistency in Conductor
This commit is contained in:
parent
6e5783ce8b
commit
6b42da0902
|
@ -430,7 +430,7 @@ class Conductor
|
||||||
else if (currentTimeChange != null && this.songPosition > 0.0)
|
else if (currentTimeChange != null && this.songPosition > 0.0)
|
||||||
{
|
{
|
||||||
// roundDecimal prevents representing 8 as 7.9999999
|
// roundDecimal prevents representing 8 as 7.9999999
|
||||||
this.currentStepTime = FlxMath.roundDecimal((currentTimeChange.beatTime * 4) + (this.songPosition - currentTimeChange.timeStamp) / stepLengthMs, 6);
|
this.currentStepTime = FlxMath.roundDecimal((currentTimeChange.beatTime * Constants.STEPS_PER_BEAT) + (this.songPosition - currentTimeChange.timeStamp) / stepLengthMs, 6);
|
||||||
this.currentBeatTime = currentStepTime / Constants.STEPS_PER_BEAT;
|
this.currentBeatTime = currentStepTime / Constants.STEPS_PER_BEAT;
|
||||||
this.currentMeasureTime = currentStepTime / stepsPerMeasure;
|
this.currentMeasureTime = currentStepTime / stepsPerMeasure;
|
||||||
this.currentStep = Math.floor(currentStepTime);
|
this.currentStep = Math.floor(currentStepTime);
|
||||||
|
@ -564,7 +564,7 @@ class Conductor
|
||||||
if (ms >= timeChange.timeStamp)
|
if (ms >= timeChange.timeStamp)
|
||||||
{
|
{
|
||||||
lastTimeChange = timeChange;
|
lastTimeChange = timeChange;
|
||||||
resultStep = lastTimeChange.beatTime * 4;
|
resultStep = lastTimeChange.beatTime * Constants.STEPS_PER_BEAT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -600,7 +600,7 @@ class Conductor
|
||||||
var lastTimeChange:SongTimeChange = timeChanges[0];
|
var lastTimeChange:SongTimeChange = timeChanges[0];
|
||||||
for (timeChange in timeChanges)
|
for (timeChange in timeChanges)
|
||||||
{
|
{
|
||||||
if (stepTime >= timeChange.beatTime * 4)
|
if (stepTime >= timeChange.beatTime * Constants.STEPS_PER_BEAT)
|
||||||
{
|
{
|
||||||
lastTimeChange = timeChange;
|
lastTimeChange = timeChange;
|
||||||
resultMs = lastTimeChange.timeStamp;
|
resultMs = lastTimeChange.timeStamp;
|
||||||
|
@ -613,7 +613,7 @@ class Conductor
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastStepLengthMs:Float = ((Constants.SECS_PER_MIN / lastTimeChange.bpm) * Constants.MS_PER_SEC) / timeSignatureNumerator;
|
var lastStepLengthMs:Float = ((Constants.SECS_PER_MIN / lastTimeChange.bpm) * Constants.MS_PER_SEC) / timeSignatureNumerator;
|
||||||
resultMs += (stepTime - lastTimeChange.beatTime * 4) * lastStepLengthMs;
|
resultMs += (stepTime - lastTimeChange.beatTime * Constants.STEPS_PER_BEAT) * lastStepLengthMs;
|
||||||
|
|
||||||
return resultMs;
|
return resultMs;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue