From d9719d23a1703b6a59eab9400749451ca136bf22 Mon Sep 17 00:00:00 2001 From: turanszkij Date: Sat, 27 Apr 2019 13:02:16 +0200 Subject: [PATCH] main component fade update --- WickedEngine/MainComponent.cpp | 25 +++++++++++++++++-------- WickedEngine/wiVersion.cpp | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/WickedEngine/MainComponent.cpp b/WickedEngine/MainComponent.cpp index 59ed2f768..b8c91e9d9 100644 --- a/WickedEngine/MainComponent.cpp +++ b/WickedEngine/MainComponent.cpp @@ -84,14 +84,23 @@ void MainComponent::ActivatePath(RenderPath* component, float fadeSeconds, const return; } - // Fade manager will activate on fadeout - fadeManager.Clear(); - fadeManager.Start(fadeSeconds, fadeColor, [this,component]() { + if (fadeSeconds > 0) + { + // Fade manager will activate on fadeout + fadeManager.Clear(); + fadeManager.Start(fadeSeconds, fadeColor, [this, component]() { - if (component == nullptr) - { - return; - } + if (activePath != nullptr) + { + activePath->Stop(); + } + + component->Start(); + activePath = component; + }); + } + else + { if (activePath != nullptr) { @@ -100,7 +109,7 @@ void MainComponent::ActivatePath(RenderPath* component, float fadeSeconds, const component->Start(); activePath = component; - }); + } } void MainComponent::Run() diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index 5c58da521..6c179e9dc 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wiVersion // minor features, major updates const int minor = 26; // minor bug fixes, alterations, refactors, updates - const int revision = 14; + const int revision = 15; long GetVersion()