File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /home/ilauncher/Documentos/funkin.art
Original file line number Diff line number Diff line change 1+ /home/ilauncher/Documentos/funkin.assets
Original file line number Diff line number Diff line change @@ -3016,12 +3016,18 @@ class PlayState extends MusicBeatSubState
30163016 opponentStrumline .handleSkippedNotes ();
30173017 }
30183018
3019+ private var oldFrameTimestamp : Int64 = 0 ;
3020+ private var newFrameTimestamp : Int64 = 0 ;
3021+
30193022 /**
30203023 * PreciseInputEvents are put into a queue between update() calls,
30213024 * and then processed here.
30223025 */
30233026 function processInputQueue (): Void
30243027 {
3028+ oldFrameTimestamp = newFrameTimestamp ;
3029+ newFrameTimestamp = PreciseInputManager .getCurrentTimestamp ();
3030+
30253031 if (inputPressQueue .length + inputReleaseQueue .length == 0 ) return ;
30263032
30273033 // Ignore inputs during cutscenes.
@@ -3108,8 +3114,8 @@ class PlayState extends MusicBeatSubState
31083114 function goodNoteHit (note : NoteSprite , input : PreciseInputEvent ): Void
31093115 {
31103116 // Calculate the input latency (do this as late as possible).
3111- // trace('Compare: ${PreciseInputManager.getCurrentTimestamp() } - ${input.timestamp }');
3112- var inputLatencyNs : Int64 = PreciseInputManager . getCurrentTimestamp () - input . timestamp ;
3117+ // trace('Compare: ${input.timestamp } - ${oldFrameTimestamp }');
3118+ var inputLatencyNs : Int64 = input . timestamp - oldFrameTimestamp ;
31133119 var inputLatencyMs : Float = inputLatencyNs .toFloat () / Constants .NS_PER_MS ;
31143120 // trace('Input: ${daNote.noteData.getDirectionName()} pressed ${inputLatencyMs}ms ago!');
31153121
You can’t perform that action at this time.
0 commit comments