possibly fix timer issues

issue #2189
This commit is contained in:
tildearrow 2024-12-09 13:56:20 -05:00
parent ed903c6e0a
commit 79167c382f
4 changed files with 49 additions and 1 deletions

View file

@ -2000,8 +2000,17 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
if (!freelance) {
if (stepPlay!=1) {
if (!noAccum) {
double dt=divider*tickMult;
if (skipping) {
dt*=(double)virtualTempoN/(double)MAX(1,virtualTempoD);
}
totalTicksR++;
totalTicks+=1000000/(divider*tickMult);
totalTicks+=1000000/dt;
totalTicksOff+=fmod(1000000.0,dt);
while (totalTicksOff>=dt) {
totalTicksOff-=dt;
totalTicks++;
}
}
if (totalTicks>=1000000) {
totalTicks-=1000000;