mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-05-19 01:05:41 -04:00
Merge branch 'master' into feature/scripted-stages
This commit is contained in:
commit
10bafff63e
3 changed files with 29 additions and 1 deletions
source/funkin
|
@ -22,6 +22,8 @@ class NoteSplash extends FlxSprite
|
||||||
|
|
||||||
setupNoteSplash(x, y, noteData);
|
setupNoteSplash(x, y, noteData);
|
||||||
|
|
||||||
|
antialiasing = true;
|
||||||
|
|
||||||
// alpha = 0.75;
|
// alpha = 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,31 @@ class VoicesGroup extends FlxTypedGroup<FlxSound>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the largest deviation from the desired time inside this VoicesGroup.
|
||||||
|
*
|
||||||
|
* @param targetTime The time to check against.
|
||||||
|
* If none is provided, it checks the time of all members against the first member of this VoicesGroup.
|
||||||
|
* @return The largest deviation from the target time found.
|
||||||
|
*/
|
||||||
|
public function checkSyncError(?targetTime:Float):Float
|
||||||
|
{
|
||||||
|
var error:Float = 0;
|
||||||
|
|
||||||
|
forEachAlive(function(snd)
|
||||||
|
{
|
||||||
|
if (targetTime == null)
|
||||||
|
targetTime = snd.time;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var diff:Float = snd.time - targetTime;
|
||||||
|
if (Math.abs(diff) > Math.abs(error))
|
||||||
|
error = diff;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
// prob a better / cleaner way to do all these forEach stuff?
|
// prob a better / cleaner way to do all these forEach stuff?
|
||||||
public function pause()
|
public function pause()
|
||||||
{
|
{
|
||||||
|
|
|
@ -2511,8 +2511,9 @@ class PlayState extends MusicBeatState
|
||||||
override function stepHit()
|
override function stepHit()
|
||||||
{
|
{
|
||||||
super.stepHit();
|
super.stepHit();
|
||||||
|
|
||||||
if (Math.abs(FlxG.sound.music.time - (Conductor.songPosition - Conductor.offset)) > 20
|
if (Math.abs(FlxG.sound.music.time - (Conductor.songPosition - Conductor.offset)) > 20
|
||||||
|| (SONG.needsVoices && Math.abs(vocals.time - (Conductor.songPosition - Conductor.offset)) > 20))
|
|| Math.abs(vocals.checkSyncError(Conductor.songPosition - Conductor.offset)) > 20)
|
||||||
{
|
{
|
||||||
resyncVocals();
|
resyncVocals();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue