1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Merge branch 'vcmi/master' into 'vcmi/develop'

This commit is contained in:
Ivan Savenko
2023-09-15 13:59:02 +03:00
118 changed files with 9641 additions and 492 deletions

View File

@ -234,8 +234,9 @@ void MapViewController::afterRender()
if(!hero)
hero = boat->hero;
if(movementContext->progress >= 1.0)
if(movementContext->progress >= 0.999)
{
logGlobal->debug("Ending movement animation");
setViewCenter(hero->getSightCenter());
removeObject(context->getObject(movementContext->target));
@ -245,20 +246,23 @@ void MapViewController::afterRender()
}
}
if(teleportContext && teleportContext->progress >= 1.0)
if(teleportContext && teleportContext->progress >= 0.999)
{
logGlobal->debug("Ending teleport animation");
activateAdventureContext(teleportContext->animationTime);
}
if(fadingOutContext && fadingOutContext->progress <= 0.0)
if(fadingOutContext && fadingOutContext->progress <= 0.001)
{
logGlobal->debug("Ending fade out animation");
removeObject(context->getObject(fadingOutContext->target));
activateAdventureContext(fadingOutContext->animationTime);
}
if(fadingInContext && fadingInContext->progress >= 1.0)
if(fadingInContext && fadingInContext->progress >= 0.999)
{
logGlobal->debug("Ending fade in animation");
activateAdventureContext(fadingInContext->animationTime);
}
}
@ -316,6 +320,7 @@ bool MapViewController::isEventVisible(const CGHeroInstance * obj, const int3 &
void MapViewController::fadeOutObject(const CGObjectInstance * obj)
{
logGlobal->debug("Starting fade out animation");
fadingOutContext = std::make_shared<MapRendererAdventureFadingContext>(*state);
fadingOutContext->animationTime = adventureContext->animationTime;
adventureContext = fadingOutContext;
@ -335,6 +340,7 @@ void MapViewController::fadeOutObject(const CGObjectInstance * obj)
void MapViewController::fadeInObject(const CGObjectInstance * obj)
{
logGlobal->debug("Starting fade in animation");
fadingInContext = std::make_shared<MapRendererAdventureFadingContext>(*state);
fadingInContext->animationTime = adventureContext->animationTime;
adventureContext = fadingInContext;
@ -473,6 +479,7 @@ void MapViewController::onAfterHeroTeleported(const CGHeroInstance * obj, const
if(isEventVisible(obj, from, dest))
{
logGlobal->debug("Starting teleport animation");
teleportContext = std::make_shared<MapRendererAdventureTransitionContext>(*state);
teleportContext->animationTime = adventureContext->animationTime;
adventureContext = teleportContext;
@ -507,6 +514,7 @@ void MapViewController::onHeroMoved(const CGHeroInstance * obj, const int3 & fro
if(movementTime > 1)
{
logGlobal->debug("Starting movement animation");
movementContext = std::make_shared<MapRendererAdventureMovingContext>(*state);
movementContext->animationTime = adventureContext->animationTime;
adventureContext = movementContext;