mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-13 18:28:52 +01:00
Renamed TweenAttributes to TweenSets.
This commit is contained in:
parent
f9410748f1
commit
dafb0a9b51
@ -23,11 +23,11 @@ TweenSet::~TweenSet()
|
||||
|
||||
void TweenSet::DestroyTweens()
|
||||
{
|
||||
std::map<std::string, std::map<int, TweenSets *> >::iterator it = TweenMap.begin();
|
||||
std::map<std::string, std::map<int, TweenAttributes *> >::iterator it = TweenMap.begin();
|
||||
|
||||
while(it != TweenMap.end())
|
||||
{
|
||||
std::map<int, TweenSets *>::iterator it2 = (it->second).begin();
|
||||
std::map<int, TweenAttributes *>::iterator it2 = (it->second).begin();
|
||||
|
||||
while(it2 != (it->second).end())
|
||||
{
|
||||
@ -40,22 +40,22 @@ void TweenSet::DestroyTweens()
|
||||
}
|
||||
}
|
||||
|
||||
TweenSet::TweenSets *TweenSet::GetTween(std::string tween)
|
||||
TweenSet::TweenAttributes *TweenSet::GetTween(std::string tween)
|
||||
{
|
||||
return GetTween(tween, -1);
|
||||
}
|
||||
|
||||
TweenSet::TweenSets *TweenSet::GetTween(std::string tween, int index)
|
||||
TweenSet::TweenAttributes *TweenSet::GetTween(std::string tween, int index)
|
||||
{
|
||||
return FindTween(TweenMap[tween], index);
|
||||
}
|
||||
|
||||
void TweenSet::SetTween(std::string tween, int index, TweenSets *set)
|
||||
void TweenSet::SetTween(std::string tween, int index, TweenAttributes *set)
|
||||
{
|
||||
TweenMap[tween][index] = set;
|
||||
}
|
||||
|
||||
TweenSet::TweenSets *TweenSet::FindTween(std::map<int, TweenSets *> &tweens, int index)
|
||||
TweenSet::TweenAttributes *TweenSet::FindTween(std::map<int, TweenAttributes *> &tweens, int index)
|
||||
{
|
||||
if(tweens.find(index) == tweens.end())
|
||||
{
|
||||
@ -63,7 +63,7 @@ TweenSet::TweenSets *TweenSet::FindTween(std::map<int, TweenSets *> &tweens, int
|
||||
|
||||
if(tweens.find(index) == tweens.end())
|
||||
{
|
||||
TweenSets *set = new TweenSets();
|
||||
TweenAttributes *set = new TweenAttributes();
|
||||
tweens[index] = set;
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,21 +20,19 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
|
||||
class TweenSet
|
||||
{
|
||||
public:
|
||||
~TweenSet();
|
||||
typedef std::vector<std::vector<Tween *> *> TweenSets;
|
||||
typedef std::vector<std::vector<Tween *> *> TweenAttributes;
|
||||
|
||||
TweenSets *GetTween(std::string tween);
|
||||
TweenSets *GetTween(std::string tween, int index);
|
||||
void SetTween(std::string tween, int index, TweenSets *set);
|
||||
TweenAttributes *GetTween(std::string tween);
|
||||
TweenAttributes *GetTween(std::string tween, int index);
|
||||
void SetTween(std::string tween, int index, TweenAttributes *set);
|
||||
|
||||
private:
|
||||
TweenSets *FindTween(std::map<int, TweenSets *> &tweens, int index);
|
||||
TweenAttributes *FindTween(std::map<int, TweenAttributes *> &tweens, int index);
|
||||
void DestroyTweens();
|
||||
|
||||
std::map<std::string, std::map<int, TweenSets *> > TweenMap;
|
||||
std::map<std::string, std::map<int, TweenAttributes *> > TweenMap;
|
||||
};
|
||||
|
||||
@ -45,7 +45,7 @@ public:
|
||||
bool IsMenuScrolling();
|
||||
std::string GetCollectionName();
|
||||
void SetCollectionName(std::string collectionName);
|
||||
typedef std::vector<std::vector<Tween *> *> TweenSets;
|
||||
typedef std::vector<std::vector<Tween *> *> TweenAttributes;
|
||||
|
||||
TweenSet *GetTweens() { return Tweens; }
|
||||
|
||||
@ -119,7 +119,7 @@ private:
|
||||
bool IsTweenSequencingComplete();
|
||||
void ResetTweenSequence(std::vector<ViewInfo *> *tweens);
|
||||
TweenSet *Tweens;
|
||||
TweenSets *CurrentTweens;
|
||||
TweenAttributes *CurrentTweens;
|
||||
unsigned int CurrentTweenIndex;
|
||||
|
||||
bool CurrentTweenComplete;
|
||||
|
||||
@ -531,8 +531,8 @@ void ScrollingList::ResetTweens(Component *c, TweenSet *sets, ViewInfo *currentV
|
||||
//todo: delete properly, memory leak (big), proof of concept
|
||||
c->SetTweens(sets);
|
||||
|
||||
TweenSets *scrollTween = sets->GetTween("menuScroll");
|
||||
TweenSets::iterator it = scrollTween->begin();
|
||||
TweenAttributes *scrollTween = sets->GetTween("menuScroll");
|
||||
TweenAttributes::iterator it = scrollTween->begin();
|
||||
|
||||
while(it != scrollTween->end())
|
||||
{
|
||||
|
||||
@ -471,26 +471,26 @@ TweenSet *PageBuilder::CreateTweenInstance(xml_node<> *componentXml)
|
||||
{
|
||||
TweenSet *tweens = new TweenSet();
|
||||
|
||||
BuildTweenSets(tweens, componentXml, "onEnter", "enter");
|
||||
BuildTweenSets(tweens, componentXml, "onExit", "exit");
|
||||
BuildTweenSets(tweens, componentXml, "onIdle", "idle");
|
||||
BuildTweenSets(tweens, componentXml, "onHighlightEnter", "highlightEnter");
|
||||
BuildTweenSets(tweens, componentXml, "onHighlightExit", "highlightExit");
|
||||
BuildTweenSets(tweens, componentXml, "onMenuEnter", "menuEnter");
|
||||
BuildTweenSets(tweens, componentXml, "onMenuExit", "menuExit");
|
||||
BuildTweenAttributes(tweens, componentXml, "onEnter", "enter");
|
||||
BuildTweenAttributes(tweens, componentXml, "onExit", "exit");
|
||||
BuildTweenAttributes(tweens, componentXml, "onIdle", "idle");
|
||||
BuildTweenAttributes(tweens, componentXml, "onHighlightEnter", "highlightEnter");
|
||||
BuildTweenAttributes(tweens, componentXml, "onHighlightExit", "highlightExit");
|
||||
BuildTweenAttributes(tweens, componentXml, "onMenuEnter", "menuEnter");
|
||||
BuildTweenAttributes(tweens, componentXml, "onMenuExit", "menuExit");
|
||||
|
||||
return tweens;
|
||||
}
|
||||
|
||||
void PageBuilder::BuildTweenSets(TweenSet *tweens, xml_node<> *componentXml, std::string tagName, std::string tweenName)
|
||||
void PageBuilder::BuildTweenAttributes(TweenSet *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::TweenSets *sets = new TweenSet::TweenSets();
|
||||
GetTweenSets(componentXml, sets);
|
||||
TweenSet::TweenAttributes *sets = new TweenSet::TweenAttributes();
|
||||
GetTweenAttributes(componentXml, sets);
|
||||
tweens->SetTween(tweenName, index, sets);
|
||||
}
|
||||
}
|
||||
@ -810,7 +810,7 @@ void PageBuilder::BuildViewInfo(xml_node<> *componentXml, ViewInfo *info, xml_no
|
||||
}
|
||||
}
|
||||
|
||||
void PageBuilder::GetTweenSets(xml_node<> *node, std::vector<std::vector<Tween *> *> *tweenSets)
|
||||
void PageBuilder::GetTweenAttributes(xml_node<> *node, std::vector<std::vector<Tween *> *> *TweenAttributes)
|
||||
{
|
||||
if(node)
|
||||
{
|
||||
@ -818,7 +818,7 @@ void PageBuilder::GetTweenSets(xml_node<> *node, std::vector<std::vector<Tween *
|
||||
{
|
||||
std::vector<Tween *> *tweens = new std::vector<Tween *>();
|
||||
GetTweenSet(set, *tweens);
|
||||
tweenSets->push_back(tweens);
|
||||
TweenAttributes->push_back(tweens);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ private:
|
||||
bool BuildComponents(rapidxml::xml_node<> *layout, Page *page);
|
||||
void LoadTweens(Component *c, rapidxml::xml_node<> *componentXml);
|
||||
TweenSet *CreateTweenInstance(rapidxml::xml_node<> *componentXml);
|
||||
void BuildTweenSets(TweenSet *tweens, rapidxml::xml_node<> *componentXml, std::string tagName, std::string tweenName);
|
||||
void BuildTweenAttributes(TweenSet *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);
|
||||
@ -63,7 +63,7 @@ private:
|
||||
|
||||
rapidxml::xml_attribute<> *FindAttribute(rapidxml::xml_node<> *componentXml, std::string attribute, rapidxml::xml_node<> *defaultXml);
|
||||
|
||||
void GetTweenSets(rapidxml::xml_node<> *node, std::vector<std::vector<Tween *> *> *tweenSets);
|
||||
void GetTweenAttributes(rapidxml::xml_node<> *node, std::vector<std::vector<Tween *> *> *TweenAttributes);
|
||||
void GetTweenSet(rapidxml::xml_node<> *node, std::vector<Tween *> &tweens);
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user