mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-07 14:39:02 +01:00
Cleanup from old sandbox code. Moved component implementation from header file to source file.
This commit is contained in:
parent
10b65d7021
commit
5d455d1174
@ -16,6 +16,10 @@
|
||||
|
||||
#include "TweenSets.h"
|
||||
|
||||
TweenSets::TweenSets()
|
||||
{
|
||||
}
|
||||
|
||||
TweenSets::~TweenSets()
|
||||
{
|
||||
DestroyTweens();
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
class TweenSets
|
||||
{
|
||||
public:
|
||||
TweenSets();
|
||||
~TweenSets();
|
||||
typedef std::vector<std::vector<Tween *> *> TweenAttributes;
|
||||
|
||||
|
||||
@ -146,6 +146,40 @@ void Component::SetCollectionName(std::string collectionName)
|
||||
CollectionName = collectionName;
|
||||
}
|
||||
|
||||
TweenSets *Component::GetTweens()
|
||||
{
|
||||
return Tweens;
|
||||
}
|
||||
|
||||
void Component::SetTweens(TweenSets *set)
|
||||
{
|
||||
Tweens = set;
|
||||
CurrentAnimationState = IDLE;
|
||||
CurrentTweenIndex = 0;
|
||||
CurrentTweenComplete = false;
|
||||
ElapsedTweenTime = 0;
|
||||
}
|
||||
|
||||
ViewInfo *Component::GetBaseViewInfo()
|
||||
{
|
||||
return &BaseViewInfo;
|
||||
}
|
||||
void Component::UpdateBaseViewInfo(ViewInfo &info)
|
||||
{
|
||||
BaseViewInfo = info;
|
||||
}
|
||||
|
||||
bool Component::IsScrollActive() const
|
||||
{
|
||||
return ScrollActive;
|
||||
}
|
||||
|
||||
void Component::SetScrollActive(bool scrollActive)
|
||||
{
|
||||
ScrollActive = scrollActive;
|
||||
}
|
||||
|
||||
|
||||
void Component::Update(float dt)
|
||||
{
|
||||
ElapsedTweenTime += dt;
|
||||
|
||||
@ -45,43 +45,15 @@ public:
|
||||
bool IsMenuScrolling();
|
||||
std::string GetCollectionName();
|
||||
void SetCollectionName(std::string collectionName);
|
||||
typedef std::vector<std::vector<Tween *> *> TweenAttributes;
|
||||
|
||||
TweenSets *GetTweens() { return Tweens; }
|
||||
|
||||
void SetTweens(TweenSets *set)
|
||||
{
|
||||
Tweens = set;
|
||||
CurrentAnimationState = IDLE;
|
||||
CurrentTweenIndex = 0;
|
||||
CurrentTweenComplete = false;
|
||||
ElapsedTweenTime = 0;
|
||||
}
|
||||
|
||||
virtual void Update(float dt);
|
||||
|
||||
virtual void Draw();
|
||||
|
||||
ViewInfo *GetBaseViewInfo()
|
||||
{
|
||||
return &BaseViewInfo;
|
||||
}
|
||||
void UpdateBaseViewInfo(ViewInfo &info)
|
||||
{
|
||||
BaseViewInfo = info;
|
||||
}
|
||||
|
||||
bool IsScrollActive() const
|
||||
{
|
||||
return ScrollActive;
|
||||
}
|
||||
|
||||
void SetScrollActive(bool scrollActive)
|
||||
{
|
||||
ScrollActive = scrollActive;
|
||||
}
|
||||
|
||||
|
||||
TweenSets *GetTweens();
|
||||
void SetTweens(TweenSets *set);
|
||||
ViewInfo *GetBaseViewInfo();
|
||||
void UpdateBaseViewInfo(ViewInfo &info);
|
||||
bool IsScrollActive() const;
|
||||
void SetScrollActive(bool scrollActive);
|
||||
|
||||
protected:
|
||||
std::string CollectionName;
|
||||
@ -119,7 +91,7 @@ private:
|
||||
bool IsTweenSequencingComplete();
|
||||
void ResetTweenSequence(std::vector<ViewInfo *> *tweens);
|
||||
TweenSets *Tweens;
|
||||
TweenAttributes *CurrentTweens;
|
||||
TweenSets::TweenAttributes *CurrentTweens;
|
||||
unsigned int CurrentTweenIndex;
|
||||
|
||||
bool CurrentTweenComplete;
|
||||
|
||||
@ -531,8 +531,8 @@ void ScrollingList::ResetTweens(Component *c, TweenSets *sets, ViewInfo *current
|
||||
//todo: delete properly, memory leak (big), proof of concept
|
||||
c->SetTweens(sets);
|
||||
|
||||
TweenAttributes *scrollTween = sets->GetTween("menuScroll");
|
||||
TweenAttributes::iterator it = scrollTween->begin();
|
||||
TweenSets::TweenAttributes *scrollTween = sets->GetTween("menuScroll");
|
||||
TweenSets::TweenAttributes::iterator it = scrollTween->begin();
|
||||
|
||||
while(it != scrollTween->end())
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user