mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-01-09 21:56:55 +00:00
fix some interesting issues with this
redundant trace removal
This commit is contained in:
parent
b03c8a9cf8
commit
4d73e0cc47
|
@ -412,8 +412,17 @@ class Conductor
|
||||||
var oldBeat:Float = this.currentBeat;
|
var oldBeat:Float = this.currentBeat;
|
||||||
var oldStep:Float = this.currentStep;
|
var oldStep:Float = this.currentStep;
|
||||||
|
|
||||||
|
// If the song is playing, limit the song position to the length of the song or beginning of the song.
|
||||||
|
if (FlxG.sound.music != null && FlxG.sound.music.playing)
|
||||||
|
{
|
||||||
|
this.songPosition = Math.min(currentLength, Math.max(0, songPos));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.songPosition = songPos;
|
||||||
|
}
|
||||||
|
|
||||||
// Set the song position we are at (for purposes of calculating note positions, etc).
|
// Set the song position we are at (for purposes of calculating note positions, etc).
|
||||||
this.songPosition = Math.min(currentLength, Math.max(0, songPos));
|
|
||||||
|
|
||||||
currentTimeChange = timeChanges[0];
|
currentTimeChange = timeChanges[0];
|
||||||
if (this.songPosition > 0.0)
|
if (this.songPosition > 0.0)
|
||||||
|
|
|
@ -29,11 +29,6 @@ class Countdown
|
||||||
*/
|
*/
|
||||||
public static var soundSuffix:String = '';
|
public static var soundSuffix:String = '';
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the countdown has finished.
|
|
||||||
*/
|
|
||||||
public static var finished:Bool = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Which alternate graphic on countdown to use.
|
* Which alternate graphic on countdown to use.
|
||||||
* You can set this via script.
|
* You can set this via script.
|
||||||
|
@ -58,7 +53,6 @@ class Countdown
|
||||||
*/
|
*/
|
||||||
public static function performCountdown():Bool
|
public static function performCountdown():Bool
|
||||||
{
|
{
|
||||||
finished = false;
|
|
||||||
countdownStep = BEFORE;
|
countdownStep = BEFORE;
|
||||||
var cancelled:Bool = propagateCountdownEvent(countdownStep);
|
var cancelled:Bool = propagateCountdownEvent(countdownStep);
|
||||||
if (cancelled)
|
if (cancelled)
|
||||||
|
@ -107,7 +101,6 @@ class Countdown
|
||||||
|
|
||||||
if (countdownStep == AFTER)
|
if (countdownStep == AFTER)
|
||||||
{
|
{
|
||||||
finished = true;
|
|
||||||
stopCountdown();
|
stopCountdown();
|
||||||
}
|
}
|
||||||
}, 5); // Before, 3, 2, 1, GO!, After
|
}, 5); // Before, 3, 2, 1, GO!, After
|
||||||
|
|
|
@ -687,7 +687,11 @@ class PlayState extends MusicBeatSubState
|
||||||
}
|
}
|
||||||
|
|
||||||
Conductor.instance.mapTimeChanges(currentChart.timeChanges);
|
Conductor.instance.mapTimeChanges(currentChart.timeChanges);
|
||||||
Conductor.instance.update((Conductor.instance.beatLengthMs * -5) + startTimestamp);
|
var pre:Float = (Conductor.instance.beatLengthMs * -5) + startTimestamp;
|
||||||
|
|
||||||
|
trace('Attempting to start at ' + pre);
|
||||||
|
|
||||||
|
Conductor.instance.update(pre);
|
||||||
|
|
||||||
// The song is now loaded. We can continue to initialize the play state.
|
// The song is now loaded. We can continue to initialize the play state.
|
||||||
initCameras();
|
initCameras();
|
||||||
|
@ -915,7 +919,7 @@ class PlayState extends MusicBeatSubState
|
||||||
{
|
{
|
||||||
// Do NOT apply offsets at this point, because they already got applied the previous frame!
|
// Do NOT apply offsets at this point, because they already got applied the previous frame!
|
||||||
Conductor.instance.update(Conductor.instance.songPosition + elapsed * 1000, false);
|
Conductor.instance.update(Conductor.instance.songPosition + elapsed * 1000, false);
|
||||||
if (Conductor.instance.songPosition - Conductor.instance.instrumentalOffset >= (startTimestamp) && Countdown.finished)
|
if (Conductor.instance.songPosition >= (startTimestamp + Conductor.instance.instrumentalOffset))
|
||||||
{
|
{
|
||||||
trace("started song at " + Conductor.instance.songPosition);
|
trace("started song at " + Conductor.instance.songPosition);
|
||||||
startSong();
|
startSong();
|
||||||
|
@ -1395,17 +1399,18 @@ class PlayState extends MusicBeatSubState
|
||||||
// activeNotes.sort(SortUtil.byStrumtime, FlxSort.DESCENDING);
|
// activeNotes.sort(SortUtil.byStrumtime, FlxSort.DESCENDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
var correctSync:Float = Math.min(FlxG.sound.music.length, Math.max(0, Conductor.instance.songPosition - Conductor.instance.instrumentalOffset));
|
if (FlxG.sound.music != null)
|
||||||
|
|
||||||
if (!startingSong
|
|
||||||
&& FlxG.sound.music != null
|
|
||||||
&& (Math.abs(FlxG.sound.music.time - correctSync) > 100 || Math.abs(vocals.checkSyncError(correctSync)) > 100))
|
|
||||||
{
|
{
|
||||||
trace("VOCALS NEED RESYNC");
|
var correctSync:Float = Math.min(FlxG.sound.music.length, Math.max(0, Conductor.instance.songPosition - Conductor.instance.instrumentalOffset));
|
||||||
if (vocals != null) trace(vocals.checkSyncError(correctSync));
|
|
||||||
trace(FlxG.sound.music.time);
|
if (!startingSong && (Math.abs(FlxG.sound.music.time - correctSync) > 100 || Math.abs(vocals.checkSyncError(correctSync)) > 100))
|
||||||
trace(correctSync);
|
{
|
||||||
resyncVocals();
|
trace("VOCALS NEED RESYNC");
|
||||||
|
if (vocals != null) trace(vocals.checkSyncError(correctSync));
|
||||||
|
trace(FlxG.sound.music.time);
|
||||||
|
trace(correctSync);
|
||||||
|
resyncVocals();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only bop camera if zoom level is below 135%
|
// Only bop camera if zoom level is below 135%
|
||||||
|
|
Loading…
Reference in a new issue