1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Implemented basic hero movement animation & object fade-out

This commit is contained in:
Ivan Savenko
2023-02-18 17:37:09 +02:00
parent 4501036a04
commit 7cf00ba87d
15 changed files with 491 additions and 509 deletions

View File

@ -457,22 +457,10 @@ void CPlayerInterface::heroMoved(const TryMoveHero & details, bool verbose)
return;
}
adventureInt->centerOn(hero); //actualizing screen pos
adventureInt->minimap->redraw();
adventureInt->heroList->redraw();
auto waitFrame = [&]()
{
int frameNumber = GH.mainFPSmng->getFrameNumber();
auto unlockPim = vstd::makeUnlockGuard(*pim);
while(frameNumber == GH.mainFPSmng->getFrameNumber())
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
};
//main moving
while (CGI->mh->hasActiveAnimations())
waitFrame(); //for animation purposes
CGI->mh->waitForOngoingAnimations();
//finishing move
hero->isStanding = true;