CFBStreamedPairOfTotals: Fix jumping to end of animation

This commit is contained in:
Luke Street 2021-03-27 18:48:02 -04:00
parent 02af2c32c0
commit ee590e670d
1 changed files with 13 additions and 6 deletions

View File

@ -202,9 +202,9 @@ void CFBStreamedPairOfTotals::SetTime(CBitLevelLoader& loader, const CCharAnimTi
prior = cur; prior = cur;
priorTime = curTime; priorTime = curTime;
x78_t = 0.f; x78_t = 0.f;
} else } else {
x78_t = (time - priorTime) / (curTime - priorTime); x78_t = (time - priorTime) / (curTime - priorTime);
}
break; break;
} }
++cur; ++cur;
@ -218,14 +218,21 @@ void CFBStreamedPairOfTotals::SetTime(CBitLevelLoader& loader, const CCharAnimTi
loader.Reset(); loader.Reset();
} }
if (next != -1) if (prior != -1 && next == -1) {
while (u32(next) > Next().x1c_curKey) next = cur;
}
if (next != -1) {
while (u32(next) > Next().x1c_curKey) {
DoIncrement(loader); DoIncrement(loader);
}
}
if (!Prior().IsCalculated()) if (!Prior().IsCalculated()) {
Prior().CalculateDown(); Prior().CalculateDown();
if (!Next().IsCalculated()) }
if (!Next().IsCalculated()) {
Next().CalculateDown(); Next().CalculateDown();
}
} }
void CFBStreamedPairOfTotals::DoIncrement(CBitLevelLoader& loader) { void CFBStreamedPairOfTotals::DoIncrement(CBitLevelLoader& loader) {