OpenTESArena
OpenTESArena copied to clipboard
Last frame of entity animations might be sticking for an extra game frame
This is easier to see at a lower FPS like 10 or 15. I wanted to avoid a while loop there since that would probably be too slow for thousands of entities.
https://github.com/afritz1/OpenTESArena/blob/f75383f6a302655049193001330738608bdabec5/OpenTESArena/src/Entities/EntityAnimationInstance.cpp#L167
I might be misunderstanding the problem and this is just how it would be due to beat frequencies or something? Anyway, changing it to this seems to have no change:
this->currentSeconds += dt;
if (looping)
{
while (this->currentSeconds >= totalSeconds)
{
this->currentSeconds -= totalSeconds;
}
}
I think this was fixed with the software renderer part 1 refactor. It's still kind of noticeable but it isn't always the last frame, so I think it's a beat frequency thing that varies based on the difference between the entity's frame rate and the game's, which is okay.