Moved implementations from header files to cpp files. Removed unused functions.

This commit is contained in:
Don Honerbrink 2015-02-17 16:39:13 -06:00
parent 86200ad731
commit 1f8441a0ce
5 changed files with 34 additions and 45 deletions

View File

@ -86,7 +86,6 @@ private:
bool Animate(bool loop); bool Animate(bool loop);
bool IsTweenSequencingComplete(); bool IsTweenSequencingComplete();
void ResetTweenSequence(std::vector<ViewInfo *> *tweens);
TweenSets *Tweens; TweenSets *Tweens;
TweenSets::TweenAttributes *CurrentTweens; TweenSets::TweenAttributes *CurrentTweens;

View File

@ -50,5 +50,3 @@ private:
std::map<unsigned int, GlyphInfoBuild *> Atlas; std::map<unsigned int, GlyphInfoBuild *> Atlas;
SDL_Texture *Texture; SDL_Texture *Texture;
}; };

View File

@ -92,6 +92,28 @@ Page::~Page()
} }
} }
bool Page::IsMenusFull()
{
return (MenuDepth > Menus.size());
}
void Page::SetLoadSound(Sound *chunk)
{
LoadSoundChunk = chunk;
}
void Page::SetUnloadSound(Sound *chunk)
{
UnloadSoundChunk = chunk;
}
void Page::SetHighlightSound(Sound *chunk)
{
HighlightSoundChunk = chunk;
}
void Page::SetSelectSound(Sound *chunk)
{
SelectSoundChunk = chunk;
}
void Page::OnNewItemSelected(Item *item) void Page::OnNewItemSelected(Item *item)
{ {
SelectedItem = item; SelectedItem = item;
@ -108,6 +130,10 @@ void Page::PushMenu(ScrollingList *s)
} }
} }
unsigned int Page::GetMenuDepth()
{
return MenuDepth;
}
void Page::SetStatusTextComponent(Text *t) void Page::SetStatusTextComponent(Text *t)
{ {
@ -580,4 +606,3 @@ void Page::LaunchExit()
} }
} }
} }

View File

@ -45,40 +45,20 @@ public:
virtual ~Page(); virtual ~Page();
virtual void OnNewItemSelected(Item *); virtual void OnNewItemSelected(Item *);
bool PushCollection(CollectionInfo *collection); bool PushCollection(CollectionInfo *collection);
bool IsMenusFull()
{
return (MenuDepth > Menus.size());
}
bool PopCollection(); bool PopCollection();
void PushMenu(ScrollingList *s); void PushMenu(ScrollingList *s);
bool IsMenusFull();
void SetLoadSound(Sound *chunk) void SetLoadSound(Sound *chunk);
{ void SetUnloadSound(Sound *chunk);
LoadSoundChunk = chunk; void SetHighlightSound(Sound *chunk);
} void SetSelectSound(Sound *chunk);
void SetUnloadSound(Sound *chunk)
{
UnloadSoundChunk = chunk;
}
void SetHighlightSound(Sound *chunk)
{
HighlightSoundChunk = chunk;
}
void SetSelectSound(Sound *chunk)
{
SelectSoundChunk = chunk;
}
bool AddComponent(Component *c); bool AddComponent(Component *c);
void PageScroll(ScrollDirection direction); void PageScroll(ScrollDirection direction);
void Start(); void Start();
void StartComponents(); void StartComponents();
void Stop(); void Stop();
void SetScrolling(ScrollDirection direction); void SetScrolling(ScrollDirection direction);
unsigned int GetMenuDepth() unsigned int GetMenuDepth();
{
return MenuDepth;
}
Item *GetSelectedItem(); Item *GetSelectedItem();
Item *GetPendingSelectedItem(); Item *GetPendingSelectedItem();
void RemoveSelectedItem(); void RemoveSelectedItem();

View File

@ -45,9 +45,9 @@ private:
SDL_Color FontColor; SDL_Color FontColor;
std::string Font; std::string Font;
int FontSize; int FontSize;
FontCache *FC; //todo: don't need Font itself, just need cache instances FontCache *FC;
void LoadReloadableImages(rapidxml::xml_node<> *layout, std::string tagName, Page *page);
void LoadReloadableImages(rapidxml::xml_node<> *layout, std::string tagName, Page *page);
float GetVerticalAlignment(rapidxml::xml_attribute<> *attribute, float valueIfNull); float GetVerticalAlignment(rapidxml::xml_attribute<> *attribute, float valueIfNull);
float GetHorizontalAlignment(rapidxml::xml_attribute<> *attribute, float valueIfNull); float GetHorizontalAlignment(rapidxml::xml_attribute<> *attribute, float valueIfNull);
void BuildViewInfo(rapidxml::xml_node<> *componentXml, ViewInfo *info, rapidxml::xml_node<> *defaultXml = NULL); void BuildViewInfo(rapidxml::xml_node<> *componentXml, ViewInfo *info, rapidxml::xml_node<> *defaultXml = NULL);
@ -58,22 +58,9 @@ private:
ScrollingList * BuildMenu(rapidxml::xml_node<> *menuXml); ScrollingList * BuildMenu(rapidxml::xml_node<> *menuXml);
void BuildCustomMenu(ScrollingList *menu, rapidxml::xml_node<> *menuXml, rapidxml::xml_node<> *itemDefaults); void BuildCustomMenu(ScrollingList *menu, rapidxml::xml_node<> *menuXml, rapidxml::xml_node<> *itemDefaults);
void BuildVerticalMenu(ScrollingList *menu, rapidxml::xml_node<> *menuXml, rapidxml::xml_node<> *itemDefaults); void BuildVerticalMenu(ScrollingList *menu, rapidxml::xml_node<> *menuXml, rapidxml::xml_node<> *itemDefaults);
int ParseMenuPosition(std::string strIndex); int ParseMenuPosition(std::string strIndex);
rapidxml::xml_attribute<> *FindAttribute(rapidxml::xml_node<> *componentXml, std::string attribute, rapidxml::xml_node<> *defaultXml); 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 GetTweenAttributes(rapidxml::xml_node<> *node, std::vector<std::vector<Tween *> *> *TweenAttributes);
void GetTweenSets(rapidxml::xml_node<> *node, std::vector<Tween *> &tweens); void GetTweenSets(rapidxml::xml_node<> *node, std::vector<Tween *> &tweens);
void LoadLayoutXml();
void LoadAnimations(std::string keyPrefix, Component &component, ViewInfo *defaults);
std::vector<ViewInfo *> * BuildTweenPoints(std::string iteratorPrefix, ViewInfo *defaults);
Component * LoadComponent(std::string keyPrefix);
ScrollingList * LoadMenu();
ViewInfo * CreateMenuItemInfo(rapidxml::xml_node<> *component, rapidxml::xml_node<> *defaults, float y); ViewInfo * CreateMenuItemInfo(rapidxml::xml_node<> *component, rapidxml::xml_node<> *defaults, float y);
void LoadListItems(std::string keyPrefix, std::vector<ViewInfo *> *tweenPointList, ViewInfo *defaults, int &selectedItemIndex);
void UpdateViewInfoFromTag(std::string keyPrefix, ViewInfo *p, ViewInfo *defaults);
}; };