From b127b12b4ec8de91e3e5f04c95671ac9c2c17e47 Mon Sep 17 00:00:00 2001 From: Pieter Hulshoff Date: Sun, 12 Jun 2016 09:25:24 +0200 Subject: [PATCH] Added support for animation type "layer". --- RetroFE/Source/Graphics/Animate/Tween.cpp | 1 + RetroFE/Source/Graphics/Animate/TweenTypes.h | 1 + RetroFE/Source/Graphics/Component/Component.cpp | 7 +++++++ RetroFE/Source/Graphics/Component/ScrollingList.cpp | 1 + 4 files changed, 10 insertions(+) diff --git a/RetroFE/Source/Graphics/Animate/Tween.cpp b/RetroFE/Source/Graphics/Animate/Tween.cpp index 9568dde..afa5cde 100644 --- a/RetroFE/Source/Graphics/Animate/Tween.cpp +++ b/RetroFE/Source/Graphics/Animate/Tween.cpp @@ -53,6 +53,7 @@ bool Tween::getTweenProperty(std::string name, TweenProperty &property) tweenPropertyMap_["backgroundalpha"] = TWEEN_PROPERTY_BACKGROUND_ALPHA; tweenPropertyMap_["maxwidth"] = TWEEN_PROPERTY_MAX_WIDTH; tweenPropertyMap_["maxheight"] = TWEEN_PROPERTY_MAX_HEIGHT; + tweenPropertyMap_["layer"] = TWEEN_PROPERTY_LAYER; tweenPropertyMap_["nop"] = TWEEN_PROPERTY_NOP; } diff --git a/RetroFE/Source/Graphics/Animate/TweenTypes.h b/RetroFE/Source/Graphics/Animate/TweenTypes.h index 8d27931..f1c9bb8 100644 --- a/RetroFE/Source/Graphics/Animate/TweenTypes.h +++ b/RetroFE/Source/Graphics/Animate/TweenTypes.h @@ -57,5 +57,6 @@ enum TweenProperty TWEEN_PROPERTY_BACKGROUND_ALPHA, TWEEN_PROPERTY_MAX_WIDTH, TWEEN_PROPERTY_MAX_HEIGHT, + TWEEN_PROPERTY_LAYER, TWEEN_PROPERTY_NOP, }; diff --git a/RetroFE/Source/Graphics/Component/Component.cpp b/RetroFE/Source/Graphics/Component/Component.cpp index 5f9518a..fae7648 100644 --- a/RetroFE/Source/Graphics/Component/Component.cpp +++ b/RetroFE/Source/Graphics/Component/Component.cpp @@ -302,6 +302,13 @@ bool Component::animate() baseViewInfo.MaxHeight = tween->animate(elapsedTime, storeViewInfo_.MaxHeight); break; + case TWEEN_PROPERTY_LAYER: + if (tween->startDefined) + baseViewInfo.Layer = static_cast(tween->animate(elapsedTime)); + else + baseViewInfo.Layer = static_cast(tween->animate(elapsedTime, storeViewInfo_.Layer)); + break; + case TWEEN_PROPERTY_NOP: break; } diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp index 05df980..43d0766 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp @@ -570,6 +570,7 @@ void ScrollingList::resetTweens(Component *c, AnimationEvents *sets, ViewInfo *c set->push(new Tween(TWEEN_PROPERTY_BACKGROUND_ALPHA, EASE_INOUT_QUADRATIC, currentViewInfo->BackgroundAlpha, nextViewInfo->BackgroundAlpha, scrollTime)); set->push(new Tween(TWEEN_PROPERTY_MAX_WIDTH, EASE_INOUT_QUADRATIC, currentViewInfo->MaxWidth, nextViewInfo->MaxWidth, scrollTime)); set->push(new Tween(TWEEN_PROPERTY_MAX_HEIGHT, EASE_INOUT_QUADRATIC, currentViewInfo->MaxHeight, nextViewInfo->MaxHeight, scrollTime)); + set->push(new Tween(TWEEN_PROPERTY_LAYER, EASE_INOUT_QUADRATIC, currentViewInfo->Layer, nextViewInfo->Layer, scrollTime)); scrollTween->Push(set); }