From 157eaadf61526992aaa236e789ba84d2e9f20c05 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 24 Jun 2012 13:30:43 +0200 Subject: [PATCH] workaround for time jumps (they are coming from portaudio/ffmpeg stream position calculation) --- Vocaluxe/Base/CGame.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index 17ed07ca..a00ccc1d 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -218,18 +218,25 @@ namespace Vocaluxe.Base _Player[i].SongFinished = false; } _OldBeatD = -100; + _Beat = -100; + _CurrentBeat = -100; + _CurrentBeatD = -100; } public static void UpdatePoints(float Time) { - bool DEBUG_HIT = false; + bool DEBUG_HIT = true; CSong song = _GameMode.GetSong(); if (song == null) return; - _Beat = GetBeatFromTime(Time, song.BPM, song.Gap); + float b = GetBeatFromTime(Time, song.BPM, song.Gap); + if (b <= _Beat) + return; + + _Beat = b; _CurrentBeat = (int)Math.Floor(_Beat); _MidBeatD = -0.5f + GetBeatFromTime(Time, song.BPM, song.Gap + CConfig.MicDelay/1000f);