Updating scrollinglist copy constructor to include the selected sprite list index

This commit is contained in:
Don Honerbrink
2015-02-26 19:30:48 +00:00
parent 97635859d5
commit 510c85f6ad

View File

@@ -70,13 +70,13 @@ ScrollingList::ScrollingList(Configuration &c,
{ {
} }
ScrollingList::ScrollingList(const ScrollingList &copy) ScrollingList::ScrollingList(const ScrollingList &copy)
: Component(copy) : Component(copy)
, SpriteList(NULL) , SpriteList(NULL)
, TweenEnterTime(0) , TweenEnterTime(0)
, Focus(false) , Focus(false)
, FirstSpriteIndex(0) , FirstSpriteIndex(0)
, SelectedSpriteListIndex(0) , SelectedSpriteListIndex(copy.SelectedSpriteListIndex)
, ScrollStopRequested(true) , ScrollStopRequested(true)
, NotifyAllRequested(false) , NotifyAllRequested(false)
, CurrentScrollDirection(ScrollDirectionIdle) , CurrentScrollDirection(ScrollDirectionIdle)
@@ -100,24 +100,24 @@ ScrollingList::ScrollingList(const ScrollingList &copy)
if(copy.ScrollPoints) if(copy.ScrollPoints)
{ {
ScrollPoints = new std::vector<ViewInfo *>(); ScrollPoints = new std::vector<ViewInfo *>();
for(unsigned int i = 0; i < copy.ScrollPoints->size(); ++i) for(unsigned int i = 0; i < copy.ScrollPoints->size(); ++i)
{ {
ViewInfo *v = new ViewInfo(*copy.ScrollPoints->at(i)); ViewInfo *v = new ViewInfo(*copy.ScrollPoints->at(i));
ScrollPoints->push_back(v); ScrollPoints->push_back(v);
} }
} }
if(copy.TweenPoints) if(copy.TweenPoints)
{ {
TweenPoints = new std::vector<AnimationEvents *>(); TweenPoints = new std::vector<AnimationEvents *>();
for(unsigned int i = 0; i < copy.TweenPoints->size(); ++i) for(unsigned int i = 0; i < copy.TweenPoints->size(); ++i)
{ {
AnimationEvents *v = new AnimationEvents(*copy.TweenPoints->at(i)); AnimationEvents *v = new AnimationEvents(*copy.TweenPoints->at(i));
TweenPoints->push_back(v); TweenPoints->push_back(v);
} }
} }
} }
ScrollingList::~ScrollingList() ScrollingList::~ScrollingList()
{ {
@@ -689,11 +689,11 @@ bool ScrollingList::AllocateTexture(ComponentItemBinding *s)
Config.GetMediaPropertyAbsolutePath(GetCollectionName(), ImageType, false, imagePath); Config.GetMediaPropertyAbsolutePath(GetCollectionName(), ImageType, false, imagePath);
t = imageBuild.CreateImage(imagePath, item->GetName(), ScaleX, ScaleY); t = imageBuild.CreateImage(imagePath, item->GetName(), ScaleX, ScaleY);
if(!t) if(!t)
{ {
Config.GetMediaPropertyAbsolutePath(item->GetName(), ImageType, true, imagePath); Config.GetMediaPropertyAbsolutePath(item->GetName(), ImageType, true, imagePath);
t = imageBuild.CreateImage(imagePath, ImageType, ScaleX, ScaleY); t = imageBuild.CreateImage(imagePath, ImageType, ScaleX, ScaleY);
} }
if(!t && item->GetTitle() != item->GetFullTitle()) if(!t && item->GetTitle() != item->GetFullTitle())
{ {