1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fixed animation skipping with no sound mod and enemy having first turn

This commit is contained in:
Ivan Savenko 2022-12-30 11:56:26 +02:00
parent 0c78e47dce
commit f8dec3861b

View File

@ -451,7 +451,7 @@ void CGuiHandler::renderFrame()
bool acquiredTheLockOnPim = false; //for tracking whether pim mutex locking succeeded
while(!terminate_cond->get() && !(acquiredTheLockOnPim = CPlayerInterface::pim->try_lock())) //try acquiring long until it succeeds or we are told to terminate
boost::this_thread::sleep(boost::posix_time::milliseconds(15));
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
if(acquiredTheLockOnPim)
{
@ -623,8 +623,8 @@ void CFramerateManager::framerateDelay()
currentTicks = SDL_GetTicks();
// recalculate timeElapsed for external calls via getElapsed()
// limit it to 1000 ms to avoid breaking animation in case of huge lag (e.g. triggered breakpoint)
timeElapsed = std::min<ui32>(currentTicks - lastticks, 1000);
// limit it to 100 ms to avoid breaking animation in case of huge lag (e.g. triggered breakpoint)
timeElapsed = std::min<ui32>(currentTicks - lastticks, 100);
lastticks = SDL_GetTicks();