Renamed TweenSet to TweenSets

This commit is contained in:
emb 2015-02-15 23:14:51 -06:00
parent dafb0a9b51
commit 10b65d7021
9 changed files with 35 additions and 35 deletions

View File

@ -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"

View File

@ -14,14 +14,14 @@
* along with RetroFE. If not, see <http://www.gnu.org/licenses/>.
*/
#include "TweenSet.h"
#include "TweenSets.h"
TweenSet::~TweenSet()
TweenSets::~TweenSets()
{
DestroyTweens();
}
void TweenSet::DestroyTweens()
void TweenSets::DestroyTweens()
{
std::map<std::string, std::map<int, TweenAttributes *> >::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<int, TweenAttributes *> &tweens, int index)
TweenSets::TweenAttributes *TweenSets::FindTween(std::map<int, TweenAttributes *> &tweens, int index)
{
if(tweens.find(index) == tweens.end())
{

View File

@ -20,10 +20,10 @@
#include <vector>
#include <map>
class TweenSet
class TweenSets
{
public:
~TweenSet();
~TweenSets();
typedef std::vector<std::vector<Tween *> *> TweenAttributes;
TweenAttributes *GetTween(std::string tween);

View File

@ -343,11 +343,11 @@ bool Component::Animate(bool loop)
else if(CurrentTweens)
{
bool currentDone = true;
std::vector<Tween *> *tweenSet = CurrentTweens->at(CurrentTweenIndex);
std::vector<Tween *> *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

View File

@ -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<std::vector<Tween *> *> 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<ViewInfo *> *tweens);
TweenSet *Tweens;
TweenSets *Tweens;
TweenAttributes *CurrentTweens;
unsigned int CurrentTweenIndex;

View File

@ -179,7 +179,7 @@ void ScrollingList::DestroyItems()
}
void ScrollingList::SetPoints(std::vector<ViewInfo *> *scrollPoints, std::vector<TweenSet *> *tweenPoints)
void ScrollingList::SetPoints(std::vector<ViewInfo *> *scrollPoints, std::vector<TweenSets *> *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; }

View File

@ -58,7 +58,7 @@ public:
void DeallocateTexture(ComponentItemBinding *s);
void SetItems(std::vector<ComponentItemBinding *> *spriteList);
void DestroyItems();
void SetPoints(std::vector<ViewInfo *> *scrollPoints, std::vector<TweenSet *> *tweenPoints);
void SetPoints(std::vector<ViewInfo *> *scrollPoints, std::vector<TweenSets *> *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<ViewInfo *> *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<ComponentItemBinding *> *SpriteList;
std::vector<ViewInfo *> *ScrollPoints;
std::vector<TweenSet *> *TweenPoints;
std::vector<TweenSets *> *TweenPoints;
std::vector<MenuNotifierInterface *> NotificationComponents;
float TweenEnterTime;
bool Focus;

View File

@ -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<ViewInfo *> *points = new std::vector<ViewInfo *>();
std::vector<TweenSet *> *tweenPoints = new std::vector<TweenSet *>();
std::vector<TweenSets *> *tweenPoints = new std::vector<TweenSets *>();
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<ViewInfo *> *points = new std::vector<ViewInfo *>();
std::vector<TweenSet *> *tweenPoints = new std::vector<TweenSet *>();
std::vector<TweenSets *> *tweenPoints = new std::vector<TweenSets *>();
int selectedIndex = MENU_FIRST;
std::map<int, xml_node<> *> overrideItems;
@ -817,13 +817,13 @@ void PageBuilder::GetTweenAttributes(xml_node<> *node, std::vector<std::vector<T
for(xml_node<> *set = node->first_node("set"); set; set = set->next_sibling("set"))
{
std::vector<Tween *> *tweens = new std::vector<Tween *>();
GetTweenSet(set, *tweens);
GetTweenSets(set, *tweens);
TweenAttributes->push_back(tweens);
}
}
}
void PageBuilder::GetTweenSet(xml_node<> *node, std::vector<Tween *> &tweens)
void PageBuilder::GetTweenSets(xml_node<> *node, std::vector<Tween *> &tweens)
{
xml_attribute<> *durationXml = node->first_attribute("duration");

View File

@ -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<std::vector<Tween *> *> *TweenAttributes);
void GetTweenSet(rapidxml::xml_node<> *node, std::vector<Tween *> &tweens);
void GetTweenSets(rapidxml::xml_node<> *node, std::vector<Tween *> &tweens);
void LoadLayoutXml();