diff --git a/RetroFE/Source/CMakeLists.txt b/RetroFE/Source/CMakeLists.txt index c1be59a..6c35c18 100644 --- a/RetroFE/Source/CMakeLists.txt +++ b/RetroFE/Source/CMakeLists.txt @@ -86,7 +86,7 @@ set(RETROFE_HEADERS "${RETROFE_DIR}/Source/Execute/Launcher.h" "${RETROFE_DIR}/Source/Graphics/Animate/Tween.h" "${RETROFE_DIR}/Source/Graphics/Animate/TweenTypes.h" - "${RETROFE_DIR}/Source/Graphics/Animate/TweenSet.h" + "${RETROFE_DIR}/Source/Graphics/Animate/TweenSets.h" "${RETROFE_DIR}/Source/Graphics/ComponentItemBinding.h" "${RETROFE_DIR}/Source/Graphics/Component/Container.h" "${RETROFE_DIR}/Source/Graphics/Component/Component.h" @@ -133,7 +133,7 @@ set(RETROFE_SOURCES "${RETROFE_DIR}/Source/Graphics/Page.cpp" "${RETROFE_DIR}/Source/Graphics/ViewInfo.cpp" "${RETROFE_DIR}/Source/Graphics/Animate/Tween.cpp" - "${RETROFE_DIR}/Source/Graphics/Animate/TweenSet.cpp" + "${RETROFE_DIR}/Source/Graphics/Animate/TweenSets.cpp" "${RETROFE_DIR}/Source/Graphics/ComponentItemBindingBuilder.cpp" "${RETROFE_DIR}/Source/Graphics/ComponentItemBinding.cpp" "${RETROFE_DIR}/Source/Graphics/Component/Container.cpp" diff --git a/RetroFE/Source/Graphics/Animate/TweenSet.cpp b/RetroFE/Source/Graphics/Animate/TweenSets.cpp similarity index 78% rename from RetroFE/Source/Graphics/Animate/TweenSet.cpp rename to RetroFE/Source/Graphics/Animate/TweenSets.cpp index 320b07a..a964e7c 100644 --- a/RetroFE/Source/Graphics/Animate/TweenSet.cpp +++ b/RetroFE/Source/Graphics/Animate/TweenSets.cpp @@ -14,14 +14,14 @@ * along with RetroFE. If not, see . */ -#include "TweenSet.h" +#include "TweenSets.h" -TweenSet::~TweenSet() +TweenSets::~TweenSets() { DestroyTweens(); } -void TweenSet::DestroyTweens() +void TweenSets::DestroyTweens() { std::map >::iterator it = TweenMap.begin(); @@ -40,22 +40,22 @@ void TweenSet::DestroyTweens() } } -TweenSet::TweenAttributes *TweenSet::GetTween(std::string tween) +TweenSets::TweenAttributes *TweenSets::GetTween(std::string tween) { return GetTween(tween, -1); } -TweenSet::TweenAttributes *TweenSet::GetTween(std::string tween, int index) +TweenSets::TweenAttributes *TweenSets::GetTween(std::string tween, int index) { return FindTween(TweenMap[tween], index); } -void TweenSet::SetTween(std::string tween, int index, TweenAttributes *set) +void TweenSets::SetTween(std::string tween, int index, TweenAttributes *set) { TweenMap[tween][index] = set; } -TweenSet::TweenAttributes *TweenSet::FindTween(std::map &tweens, int index) +TweenSets::TweenAttributes *TweenSets::FindTween(std::map &tweens, int index) { if(tweens.find(index) == tweens.end()) { diff --git a/RetroFE/Source/Graphics/Animate/TweenSet.h b/RetroFE/Source/Graphics/Animate/TweenSets.h similarity index 94% rename from RetroFE/Source/Graphics/Animate/TweenSet.h rename to RetroFE/Source/Graphics/Animate/TweenSets.h index 707ba06..c28acc0 100644 --- a/RetroFE/Source/Graphics/Animate/TweenSet.h +++ b/RetroFE/Source/Graphics/Animate/TweenSets.h @@ -20,10 +20,10 @@ #include #include -class TweenSet +class TweenSets { public: - ~TweenSet(); + ~TweenSets(); typedef std::vector *> TweenAttributes; TweenAttributes *GetTween(std::string tween); diff --git a/RetroFE/Source/Graphics/Component/Component.cpp b/RetroFE/Source/Graphics/Component/Component.cpp index 5ea497b..f4ba4ee 100644 --- a/RetroFE/Source/Graphics/Component/Component.cpp +++ b/RetroFE/Source/Graphics/Component/Component.cpp @@ -343,11 +343,11 @@ bool Component::Animate(bool loop) else if(CurrentTweens) { bool currentDone = true; - std::vector *tweenSet = CurrentTweens->at(CurrentTweenIndex); + std::vector *TweenSets = CurrentTweens->at(CurrentTweenIndex); - for(unsigned int i = 0; i < tweenSet->size(); i++) + for(unsigned int i = 0; i < TweenSets->size(); i++) { - Tween *tween = tweenSet->at(i); + Tween *tween = TweenSets->at(i); float elapsedTime = ElapsedTweenTime; //todo: too many levels of nesting diff --git a/RetroFE/Source/Graphics/Component/Component.h b/RetroFE/Source/Graphics/Component/Component.h index a04ef78..5f5c7c9 100644 --- a/RetroFE/Source/Graphics/Component/Component.h +++ b/RetroFE/Source/Graphics/Component/Component.h @@ -21,7 +21,7 @@ #include "../MenuNotifierInterface.h" #include "../ViewInfo.h" #include "../Animate/Tween.h" -#include "../Animate/TweenSet.h" +#include "../Animate/TweenSets.h" #include "../../Collection/Item.h" class Component @@ -47,9 +47,9 @@ public: void SetCollectionName(std::string collectionName); typedef std::vector *> TweenAttributes; - TweenSet *GetTweens() { return Tweens; } + TweenSets *GetTweens() { return Tweens; } - void SetTweens(TweenSet *set) + void SetTweens(TweenSets *set) { Tweens = set; CurrentAnimationState = IDLE; @@ -118,7 +118,7 @@ private: bool Animate(bool loop); bool IsTweenSequencingComplete(); void ResetTweenSequence(std::vector *tweens); - TweenSet *Tweens; + TweenSets *Tweens; TweenAttributes *CurrentTweens; unsigned int CurrentTweenIndex; diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp index f5f8497..a7d6ffa 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp @@ -179,7 +179,7 @@ void ScrollingList::DestroyItems() } -void ScrollingList::SetPoints(std::vector *scrollPoints, std::vector *tweenPoints) +void ScrollingList::SetPoints(std::vector *scrollPoints, std::vector *tweenPoints) { ScrollPoints = scrollPoints; TweenPoints = tweenPoints; @@ -515,7 +515,7 @@ void ScrollingList::UpdateSprite(unsigned int spriteIndex, unsigned int pointInd CircularIncrement(spriteIndex, SpriteList); } -void ScrollingList::ResetTweens(Component *c, TweenSet *sets, ViewInfo *currentViewInfo, ViewInfo *nextViewInfo, double scrollTime) +void ScrollingList::ResetTweens(Component *c, TweenSets *sets, ViewInfo *currentViewInfo, ViewInfo *nextViewInfo, double scrollTime) { if(!c) { return; } if(!sets) { return; } diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.h b/RetroFE/Source/Graphics/Component/ScrollingList.h index c2c0c9c..6a6cd08 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.h +++ b/RetroFE/Source/Graphics/Component/ScrollingList.h @@ -58,7 +58,7 @@ public: void DeallocateTexture(ComponentItemBinding *s); void SetItems(std::vector *spriteList); void DestroyItems(); - void SetPoints(std::vector *scrollPoints, std::vector *tweenPoints); + void SetPoints(std::vector *scrollPoints, std::vector *tweenPoints); void SetScrollDirection(ScrollDirection direction); void PageUp(); void PageDown(); @@ -84,7 +84,7 @@ private: void AllocateSpritePoints(); void UpdateSprite(unsigned int spriteIndex, unsigned int pointIndex, bool newScroll, float dt, double nextScrollTime); unsigned int GetNextTween(unsigned int currentIndex, std::vector *list); - void ResetTweens(Component *c, TweenSet *sets, ViewInfo *currentViewInfo, ViewInfo *nextViewInfo, double scrollTime); + void ResetTweens(Component *c, TweenSets *sets, ViewInfo *currentViewInfo, ViewInfo *nextViewInfo, double scrollTime); enum ScrollState { @@ -96,7 +96,7 @@ private: std::vector *SpriteList; std::vector *ScrollPoints; - std::vector *TweenPoints; + std::vector *TweenPoints; std::vector NotificationComponents; float TweenEnterTime; bool Focus; diff --git a/RetroFE/Source/Graphics/PageBuilder.cpp b/RetroFE/Source/Graphics/PageBuilder.cpp index 5c41ece..18be6e3 100644 --- a/RetroFE/Source/Graphics/PageBuilder.cpp +++ b/RetroFE/Source/Graphics/PageBuilder.cpp @@ -23,7 +23,7 @@ #include "Component/ReloadableText.h" #include "Component/ReloadableMedia.h" #include "Component/ScrollingList.h" -#include "Animate/TweenSet.h" +#include "Animate/TweenSets.h" #include "Animate/TweenTypes.h" #include "../Sound/Sound.h" #include "../Collection/Item.h" @@ -467,9 +467,9 @@ void PageBuilder::LoadTweens(Component *c, xml_node<> *componentXml) c->SetTweens(CreateTweenInstance(componentXml)); } -TweenSet *PageBuilder::CreateTweenInstance(xml_node<> *componentXml) +TweenSets *PageBuilder::CreateTweenInstance(xml_node<> *componentXml) { - TweenSet *tweens = new TweenSet(); + TweenSets *tweens = new TweenSets(); BuildTweenAttributes(tweens, componentXml, "onEnter", "enter"); BuildTweenAttributes(tweens, componentXml, "onExit", "exit"); @@ -482,14 +482,14 @@ TweenSet *PageBuilder::CreateTweenInstance(xml_node<> *componentXml) return tweens; } -void PageBuilder::BuildTweenAttributes(TweenSet *tweens, xml_node<> *componentXml, std::string tagName, std::string tweenName) +void PageBuilder::BuildTweenAttributes(TweenSets *tweens, xml_node<> *componentXml, std::string tagName, std::string tweenName) { for(componentXml = componentXml->first_node(tagName.c_str()); componentXml; componentXml = componentXml->next_sibling(tagName.c_str())) { xml_attribute<> *indexXml = componentXml->first_attribute("menuIndex"); int index = (indexXml) ? Utils::ConvertInt(indexXml->value()) : -1; - TweenSet::TweenAttributes *sets = new TweenSet::TweenAttributes(); + TweenSets::TweenAttributes *sets = new TweenSets::TweenAttributes(); GetTweenAttributes(componentXml, sets); tweens->SetTween(tweenName, index, sets); } @@ -560,7 +560,7 @@ ScrollingList * PageBuilder::BuildMenu(xml_node<> *menuXml) void PageBuilder::BuildCustomMenu(ScrollingList *menu, xml_node<> *menuXml, xml_node<> *itemDefaults) { std::vector *points = new std::vector(); - std::vector *tweenPoints = new std::vector(); + std::vector *tweenPoints = new std::vector(); int i = 0; @@ -587,7 +587,7 @@ void PageBuilder::BuildCustomMenu(ScrollingList *menu, xml_node<> *menuXml, xml_ void PageBuilder::BuildVerticalMenu(ScrollingList *menu, xml_node<> *menuXml, xml_node<> *itemDefaults) { std::vector *points = new std::vector(); - std::vector *tweenPoints = new std::vector(); + std::vector *tweenPoints = new std::vector(); int selectedIndex = MENU_FIRST; std::map *> overrideItems; @@ -817,13 +817,13 @@ void PageBuilder::GetTweenAttributes(xml_node<> *node, std::vector *set = node->first_node("set"); set; set = set->next_sibling("set")) { std::vector *tweens = new std::vector(); - GetTweenSet(set, *tweens); + GetTweenSets(set, *tweens); TweenAttributes->push_back(tweens); } } } -void PageBuilder::GetTweenSet(xml_node<> *node, std::vector &tweens) +void PageBuilder::GetTweenSets(xml_node<> *node, std::vector &tweens) { xml_attribute<> *durationXml = node->first_attribute("duration"); diff --git a/RetroFE/Source/Graphics/PageBuilder.h b/RetroFE/Source/Graphics/PageBuilder.h index da59bef..300815f 100644 --- a/RetroFE/Source/Graphics/PageBuilder.h +++ b/RetroFE/Source/Graphics/PageBuilder.h @@ -53,8 +53,8 @@ private: void BuildViewInfo(rapidxml::xml_node<> *componentXml, ViewInfo *info, rapidxml::xml_node<> *defaultXml = NULL); bool BuildComponents(rapidxml::xml_node<> *layout, Page *page); void LoadTweens(Component *c, rapidxml::xml_node<> *componentXml); - TweenSet *CreateTweenInstance(rapidxml::xml_node<> *componentXml); - void BuildTweenAttributes(TweenSet *tweens, rapidxml::xml_node<> *componentXml, std::string tagName, std::string tweenName); + TweenSets *CreateTweenInstance(rapidxml::xml_node<> *componentXml); + void BuildTweenAttributes(TweenSets *tweens, rapidxml::xml_node<> *componentXml, std::string tagName, std::string tweenName); ScrollingList * BuildMenu(rapidxml::xml_node<> *menuXml); void BuildCustomMenu(ScrollingList *menu, rapidxml::xml_node<> *menuXml, rapidxml::xml_node<> *itemDefaults); void BuildVerticalMenu(ScrollingList *menu, rapidxml::xml_node<> *menuXml, rapidxml::xml_node<> *itemDefaults); @@ -64,7 +64,7 @@ private: rapidxml::xml_attribute<> *FindAttribute(rapidxml::xml_node<> *componentXml, std::string attribute, rapidxml::xml_node<> *defaultXml); void GetTweenAttributes(rapidxml::xml_node<> *node, std::vector *> *TweenAttributes); - void GetTweenSet(rapidxml::xml_node<> *node, std::vector &tweens); + void GetTweenSets(rapidxml::xml_node<> *node, std::vector &tweens); void LoadLayoutXml();