diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp
index 8ed3545..1aca5de 100644
--- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp
+++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp
@@ -14,6 +14,7 @@
* along with RetroFE. If not, see .
*/
+
#include "ScrollingList.h"
#include "../Animate/Tween.h"
#include "../Animate/TweenSet.h"
@@ -26,7 +27,7 @@
#include "VideoComponent.h"
#include "ReloadableMedia.h"
#include "Text.h"
-#include "../../Database/Configuration.h" // todo: decouple the GUI from the data
+#include "../../Database/Configuration.h"
#include "../../Collection/Item.h"
#include "../../Utility/Utils.h"
#include "../../Utility/Log.h"
@@ -38,280 +39,301 @@
#include
#include
-//todo: remove coupling from configuration data (if possible)
-ScrollingList::ScrollingList(Configuration &c,
- Page &p,
- bool layoutMode,
- float scaleX,
- float scaleY,
- Font *font,
- std::string layoutKey,
- std::string imageType)
- : Component(p)
- , horizontalScroll(false)
- , layoutMode_(layoutMode)
- , spriteList_(NULL)
- , scrollPoints_(NULL)
- , tweenPoints_(NULL)
- , itemIndex_(0)
- , componentIndex_(0)
- , selectedOffsetIndex_(0)
- , scrollAcceleration_(0)
- , startScrollTime_(0.500)
- , scrollPeriod_(0)
- , config_(c)
- , scaleX_(scaleX)
- , scaleY_(scaleY)
- , fontInst_(font)
- , layoutKey_(layoutKey)
- , imageType_(imageType)
- , items_(NULL)
+
+ScrollingList::ScrollingList( Configuration &c,
+ Page &p,
+ bool layoutMode,
+ float scaleX,
+ float scaleY,
+ Font *font,
+ std::string layoutKey,
+ std::string imageType )
+ : Component(p )
+ , horizontalScroll(false )
+ , layoutMode_(layoutMode )
+ , spriteList_(NULL )
+ , scrollPoints_(NULL )
+ , tweenPoints_(NULL )
+ , itemIndex_(0 )
+ , selectedOffsetIndex_(0 )
+ , scrollAcceleration_(0 )
+ , startScrollTime_(0.500 )
+ , scrollPeriod_(0 )
+ , config_(c )
+ , scaleX_(scaleX )
+ , scaleY_(scaleY )
+ , fontInst_(font )
+ , layoutKey_(layoutKey )
+ , imageType_(imageType )
+ , items_(NULL )
{
}
-ScrollingList::ScrollingList(const ScrollingList ©)
- : Component(copy)
- , horizontalScroll(copy.horizontalScroll)
- , layoutMode_(copy.layoutMode_)
- , spriteList_(NULL)
- , itemIndex_(0)
- , componentIndex_(0)
- , selectedOffsetIndex_(copy.selectedOffsetIndex_)
- , scrollAcceleration_(copy.scrollAcceleration_)
- , startScrollTime_(copy.startScrollTime_)
- , scrollPeriod_(copy.startScrollTime_)
- , config_(copy.config_)
- , scaleX_(copy.scaleX_)
- , scaleY_(copy.scaleY_)
- , fontInst_(copy.fontInst_)
- , layoutKey_(copy.layoutKey_)
- , imageType_(copy.imageType_)
- , items_(NULL)
+
+ScrollingList::ScrollingList( const ScrollingList © )
+ : Component(copy )
+ , horizontalScroll(copy.horizontalScroll )
+ , layoutMode_(copy.layoutMode_ )
+ , spriteList_(NULL )
+ , itemIndex_(0 )
+ , selectedOffsetIndex_(copy.selectedOffsetIndex_ )
+ , scrollAcceleration_(copy.scrollAcceleration_ )
+ , startScrollTime_(copy.startScrollTime_ )
+ , scrollPeriod_(copy.startScrollTime_ )
+ , config_(copy.config_ )
+ , scaleX_(copy.scaleX_ )
+ , scaleY_(copy.scaleY_ )
+ , fontInst_(copy.fontInst_ )
+ , layoutKey_(copy.layoutKey_ )
+ , imageType_(copy.imageType_ )
+ , items_(NULL )
{
scrollPoints_ = NULL;
- tweenPoints_ = NULL;
+ tweenPoints_ = NULL;
- setPoints(copy.scrollPoints_, copy.tweenPoints_);
+ setPoints( copy.scrollPoints_, copy.tweenPoints_ );
}
-ScrollingList::~ScrollingList()
+ScrollingList::~ScrollingList( )
{
- destroyItems();
+ destroyItems( );
}
-void ScrollingList::setItems(std::vector- *items)
+void ScrollingList::setItems( std::vector
- *items )
{
items_ = items;
- if(items_)
+ if ( items_ )
{
- itemIndex_ = loopDecrement(0, selectedOffsetIndex_, items_->size());
+ itemIndex_ = loopDecrement( 0, selectedOffsetIndex_, items_->size( ) );
}
}
-unsigned int ScrollingList::loopIncrement(unsigned int offset, unsigned int i, unsigned int size)
-{
- if(size == 0) return 0;
- return (offset + i) % size;
-}
-unsigned int ScrollingList::loopDecrement(unsigned int offset, unsigned int i, unsigned int size)
+unsigned int ScrollingList::loopIncrement( unsigned int offset, unsigned int i, unsigned int size )
{
- if(size == 0) return 0;
- return ((offset % size) - (i % size) + size) % size;
+ if ( size == 0 ) return 0;
+ return (offset + i ) % size;
}
-void ScrollingList::setScrollAcceleration(float value)
+unsigned int ScrollingList::loopDecrement( unsigned int offset, unsigned int i, unsigned int size )
+{
+ if ( size == 0 ) return 0;
+ return ((offset % size ) - (i % size ) + size ) % size;
+}
+
+
+void ScrollingList::setScrollAcceleration( float value )
{
scrollAcceleration_ = value;
}
-void ScrollingList::setStartScrollTime(float value)
+
+void ScrollingList::setStartScrollTime( float value )
{
startScrollTime_ = value;
}
-void ScrollingList::deallocateSpritePoints()
+
+void ScrollingList::deallocateSpritePoints( )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- deallocateTexture(i);
+ deallocateTexture( i );
}
}
-void ScrollingList::allocateSpritePoints()
+
+void ScrollingList::allocateSpritePoints( )
{
- if(!items_ || items_->size() == 0) return;
- if(!scrollPoints_) return;
- if(components_.size() == 0) return;
+ if ( !items_ || items_->size( ) == 0 ) return;
+ if ( !scrollPoints_ ) return;
+ if ( components_.size( ) == 0 ) return;
- for(unsigned int i = 0; i < scrollPoints_->size(); ++i)
+ for ( unsigned int i = 0; i < scrollPoints_->size( ); ++i )
{
- unsigned int index = loopIncrement(itemIndex_, i, items_->size());
- unsigned int oindex = loopIncrement(componentIndex_, i, components_.size());
- Item *item = items_->at(index);
+ unsigned int index = loopIncrement( itemIndex_, i, items_->size( ) );
+ Item *item = items_->at( index );
- Component *o = components_.at(oindex);
+ Component *old = components_.at( i );
- allocateTexture(oindex, item);
+ allocateTexture( i, item );
- Component *c = components_.at(oindex);
+ Component *c = components_.at( i );
- ViewInfo *current = scrollPoints_->at(oindex);
+ ViewInfo *view = scrollPoints_->at( i );
- unsigned int nextI = loopIncrement(oindex, 1, scrollPoints_->size());
- ViewInfo *next = scrollPoints_->at(nextI);
+ resetTweens( c, tweenPoints_->at( i ), view, view, 0 );
- resetTweens(c, tweenPoints_->at(i), current, next, 0);
-
- if(o)
+ if ( old )
{
- c->baseViewInfo = o->baseViewInfo;
- delete o;
+ c->baseViewInfo = old->baseViewInfo;
+ delete old;
}
}
}
-void ScrollingList::destroyItems()
-{
- for(unsigned int i = 0; i < components_.size(); ++i)
- {
- delete components_.at(i);
- components_.at(i) = NULL;
- }
- componentIndex_ = 0;
+void ScrollingList::destroyItems( )
+{
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
+ {
+ delete components_.at( i );
+ components_.at( i ) = NULL;
+ }
}
-void ScrollingList::setPoints(std::vector *scrollPoints, std::vector *tweenPoints)
+void ScrollingList::setPoints( std::vector *scrollPoints, std::vector *tweenPoints )
{
scrollPoints_ = scrollPoints;
- tweenPoints_ = tweenPoints;
+ tweenPoints_ = tweenPoints;
// empty out the list as we will resize it
- components_.clear();
+ components_.clear( );
int size = 0;
- if(scrollPoints) size = scrollPoints_->size();
- components_.resize(size);
-
- if(items_)
+ if ( scrollPoints )
{
- itemIndex_ = loopDecrement(0, selectedOffsetIndex_, items_->size());
+ size = scrollPoints_->size( );
+ }
+ components_.resize( size );
+
+ if ( items_ )
+ {
+ itemIndex_ = loopDecrement( 0, selectedOffsetIndex_, items_->size( ) );
}
}
-unsigned int ScrollingList::getScrollOffsetIndex()
+
+unsigned int ScrollingList::getScrollOffsetIndex( )
{
- return itemIndex_;
+ return loopIncrement( itemIndex_, selectedOffsetIndex_, items_->size( ) );
}
-void ScrollingList::setScrollOffsetIndex(unsigned int index)
+
+void ScrollingList::setScrollOffsetIndex( unsigned int index )
{
- itemIndex_ = index;
+ itemIndex_ = loopDecrement( index, selectedOffsetIndex_, items_->size( ) );
}
-void ScrollingList::setSelectedIndex(int selectedIndex)
+
+void ScrollingList::setSelectedIndex( int selectedIndex )
{
selectedOffsetIndex_ = selectedIndex;
}
-Item *ScrollingList::getItemByOffset(int offset)
+
+Item *ScrollingList::getItemByOffset( int offset )
{
- if(!items_ || items_->size() == 0) return NULL;
- unsigned int index = getSelectedIndex();
- if(offset > 0) {
- index = loopIncrement(index, offset, items_->size());
+
+ if ( !items_ || items_->size( ) == 0 ) return NULL;
+
+ unsigned int index = getSelectedIndex( );
+ if ( offset >= 0 )
+ {
+ index = loopIncrement( index, offset, items_->size( ) );
}
- else if(offset < 0) {
- index = loopDecrement(index, offset*-1, items_->size());
+ else
+ {
+ index = loopDecrement( index, offset*-1, items_->size( ) );
}
- return items_->at(index);
+ return items_->at( index );
+
}
-Item *ScrollingList::getSelectedItem()
+Item *ScrollingList::getSelectedItem( )
{
- if(!items_ || items_->size() == 0) return NULL;
- unsigned index = loopIncrement(itemIndex_, selectedOffsetIndex_, items_->size());
- return items_->at(index);
+ if ( !items_ || items_->size( ) == 0 ) return NULL;
+ return items_->at( loopIncrement( itemIndex_, selectedOffsetIndex_, items_->size( ) ) );
}
-void ScrollingList::pageUp()
+void ScrollingList::pageUp( )
{
- if(components_.size() == 0) return;
- itemIndex_ = loopDecrement(itemIndex_, components_.size(), items_->size());
+ if ( components_.size( ) == 0 ) return;
+ itemIndex_ = loopDecrement( itemIndex_, components_.size( ), items_->size( ) );
}
-void ScrollingList::pageDown()
+
+void ScrollingList::pageDown( )
{
- if(components_.size() == 0) return;
- itemIndex_ = loopIncrement(itemIndex_, components_.size(), items_->size());
+ if ( components_.size( ) == 0 ) return;
+ itemIndex_ = loopIncrement( itemIndex_, components_.size( ), items_->size( ) );
}
-void ScrollingList::random()
+
+void ScrollingList::random( )
{
- if(!items_ || items_->size() == 0) return;
- itemIndex_ = rand() % items_->size();
+ if ( !items_ || items_->size( ) == 0 ) return;
+ itemIndex_ = rand( ) % items_->size( );
}
-void ScrollingList::letterUp()
+
+void ScrollingList::letterUp( )
{
- letterChange(true);
+ letterChange( true );
}
-void ScrollingList::letterDown()
+
+void ScrollingList::letterDown( )
{
- letterChange(false);
+ letterChange( false );
}
-void ScrollingList::letterChange(bool increment)
+
+void ScrollingList::letterChange( bool increment )
{
- if(!items_ || items_->size() == 0) return;
+ if ( !items_ || items_->size( ) == 0 ) return;
- std::string startname = items_->at((itemIndex_+selectedOffsetIndex_)%items_->size())->lowercaseFullTitle();
+ std::string startname = items_->at( (itemIndex_+selectedOffsetIndex_ ) % items_->size( ) )->lowercaseFullTitle( );
- for(unsigned int i = 0; i < items_->size(); ++i)
+ for ( unsigned int i = 0; i < items_->size( ); ++i )
{
unsigned int index = 0;
- if(increment) index = loopIncrement(itemIndex_, i, items_->size());
- else index = loopDecrement(itemIndex_, i, items_->size());
+ if ( increment )
+ {
+ index = loopIncrement( itemIndex_, i, items_->size( ) );
+ }
+ else
+ {
+ index = loopDecrement( itemIndex_, i, items_->size( ) );
+ }
- std::string endname = items_->at((index+selectedOffsetIndex_)%items_->size())->lowercaseFullTitle();
+ std::string endname = items_->at( (index+selectedOffsetIndex_ ) % items_->size( ) )->lowercaseFullTitle( );
// check if we are changing characters from a-z, or changing from alpha character to non-alpha character
- if((isalpha(startname[0]) ^ isalpha(endname[0])) ||
- (isalpha(startname[0]) && isalpha(endname[0]) && startname[0] != endname[0]))
+ if ((isalpha(startname[0] ) ^ isalpha(endname[0] ) ) ||
+ (isalpha(startname[0] ) && isalpha(endname[0] ) && startname[0] != endname[0] ) )
{
itemIndex_ = index;
break;
}
}
- if (!increment) // For decrement, find the first game of the new letter
+ if ( !increment ) // For decrement, find the first game of the new letter
{
- startname = items_->at((itemIndex_+selectedOffsetIndex_)%items_->size())->lowercaseFullTitle();
+ startname = items_->at( (itemIndex_+selectedOffsetIndex_ ) % items_->size( ) )->lowercaseFullTitle( );
- for(unsigned int i = 0; i < items_->size(); ++i)
+ for ( unsigned int i = 0; i < items_->size( ); ++i )
{
- unsigned int index = loopDecrement(itemIndex_, i, items_->size());
+ unsigned int index = loopDecrement( itemIndex_, i, items_->size( ) );
- std::string endname = items_->at((index+selectedOffsetIndex_)%items_->size())->lowercaseFullTitle();
+ std::string endname = items_->at( (index+selectedOffsetIndex_ ) % items_->size( ) )->lowercaseFullTitle( );
// check if we are changing characters from a-z, or changing from alpha character to non-alpha character
- if((isalpha(startname[0]) ^ isalpha(endname[0])) ||
- (isalpha(startname[0]) && isalpha(endname[0]) && startname[0] != endname[0]))
+ if ((isalpha(startname[0] ) ^ isalpha(endname[0] ) ) ||
+ (isalpha(startname[0] ) && isalpha(endname[0] ) && startname[0] != endname[0] ) )
{
- itemIndex_ = loopIncrement(index,1,items_->size());
+ itemIndex_ = loopIncrement( index,1,items_->size( ) );
break;
}
}
@@ -320,185 +342,182 @@ void ScrollingList::letterChange(bool increment)
}
-void ScrollingList::allocateGraphicsMemory()
+void ScrollingList::allocateGraphicsMemory( )
{
- Component::allocateGraphicsMemory();
+ Component::allocateGraphicsMemory( );
scrollPeriod_ = startScrollTime_;
- allocateSpritePoints();
+ allocateSpritePoints( );
}
-void ScrollingList::freeGraphicsMemory()
+void ScrollingList::freeGraphicsMemory( )
{
- Component::freeGraphicsMemory();
+ Component::freeGraphicsMemory( );
scrollPeriod_ = 0;
- deallocateSpritePoints();
+ deallocateSpritePoints( );
}
-void ScrollingList::triggerEnterEvent()
+void ScrollingList::triggerEnterEvent( )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c) c->triggerEvent( "enter" );
+ Component *c = components_.at( i );
+ if ( c ) c->triggerEvent( "enter" );
}
}
-void ScrollingList::triggerExitEvent()
+void ScrollingList::triggerExitEvent( )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c) c->triggerEvent( "exit" );
+ Component *c = components_.at(i );
+ if ( c ) c->triggerEvent( "exit" );
}
}
void ScrollingList::triggerMenuEnterEvent( int menuIndex )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c) c->triggerEvent( "menuEnter", menuIndex );
+ Component *c = components_.at( i );
+ if ( c ) c->triggerEvent( "menuEnter", menuIndex );
}
}
void ScrollingList::triggerMenuExitEvent( int menuIndex )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c) c->triggerEvent( "menuExit", menuIndex );
+ Component *c = components_.at( i );
+ if ( c ) c->triggerEvent( "menuExit", menuIndex );
}
}
void ScrollingList::triggerGameEnterEvent( int menuIndex )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c) c->triggerEvent( "gameEnter", menuIndex );
+ Component *c = components_.at( i );
+ if ( c ) c->triggerEvent( "gameEnter", menuIndex );
}
}
void ScrollingList::triggerGameExitEvent( int menuIndex )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c) c->triggerEvent( "gameExit", menuIndex );
+ Component *c = components_.at( i );
+ if ( c ) c->triggerEvent( "gameExit", menuIndex );
}
}
void ScrollingList::triggerHighlightEnterEvent( int menuIndex )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c) c->triggerEvent( "highlightEnter", menuIndex );
+ Component *c = components_.at( i );
+ if ( c ) c->triggerEvent( "highlightEnter", menuIndex );
}
}
void ScrollingList::triggerHighlightExitEvent( int menuIndex )
{
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c) c->triggerEvent( "highlightExit", menuIndex );
+ Component *c = components_.at( i );
+ if ( c ) c->triggerEvent( "highlightExit", menuIndex );
}
}
-void ScrollingList::update(float dt)
+void ScrollingList::update( float dt )
{
// Check if scrollPeriod_ has been properly initialised already or if something went wrong
// while updating the scrollPeriod_
- if(scrollPeriod_ < scrollAcceleration_)
+ if ( scrollPeriod_ < scrollAcceleration_ )
{
scrollPeriod_ = startScrollTime_;
}
- Component::update(dt);
+ Component::update( dt );
- if(components_.size() == 0) return;
- if(!items_) return;
+ if (components_.size( ) == 0 ) return;
+ if (!items_ ) return;
- for(unsigned int i = 0; i < scrollPoints_->size(); i++)
+ for ( unsigned int i = 0; i < scrollPoints_->size( ); i++ )
{
- unsigned int cindex = loopIncrement(componentIndex_, i, components_.size());
- Component *c = components_.at(cindex);
- if(c) c->update(dt);
+ Component *c = components_.at( i );
+ if ( c ) c->update(dt );
}
}
-unsigned int ScrollingList::getSelectedIndex()
-{
- if(!items_) return 0;
- return loopIncrement(itemIndex_, selectedOffsetIndex_, items_->size());
-}
-void ScrollingList::setSelectedIndex(unsigned int index)
+unsigned int ScrollingList::getSelectedIndex( )
{
- if(!items_) return;
- itemIndex_ = loopDecrement(index, selectedOffsetIndex_, items_->size());
+ if ( !items_ ) return 0;
+ return loopIncrement( itemIndex_, selectedOffsetIndex_, items_->size( ) );
}
-unsigned int ScrollingList::getSize()
+void ScrollingList::setSelectedIndex( unsigned int index )
{
- if(!items_) return 0;
-
- return items_->size();
+ if ( !items_ ) return;
+ itemIndex_ = loopDecrement( index, selectedOffsetIndex_, items_->size( ) );
}
-void ScrollingList::resetTweens(Component *c, AnimationEvents *sets, ViewInfo *currentViewInfo, ViewInfo *nextViewInfo, double scrollTime)
-{
- if(!c) return;
- if(!sets) return;
- if(!currentViewInfo) return;
- if(!nextViewInfo) return;
- currentViewInfo->ImageHeight = c->baseViewInfo.ImageHeight;
- currentViewInfo->ImageWidth = c->baseViewInfo.ImageWidth;
- nextViewInfo->ImageHeight = c->baseViewInfo.ImageHeight;
- nextViewInfo->ImageWidth = c->baseViewInfo.ImageWidth;
+unsigned int ScrollingList::getSize( )
+{
+ if ( !items_ ) return 0;
+ return items_->size( );
+}
+
+
+void ScrollingList::resetTweens( Component *c, AnimationEvents *sets, ViewInfo *currentViewInfo, ViewInfo *nextViewInfo, double scrollTime )
+{
+ if ( !c ) return;
+ if ( !sets ) return;
+ if ( !currentViewInfo ) return;
+ if ( !nextViewInfo ) return;
+
+ currentViewInfo->ImageHeight = c->baseViewInfo.ImageHeight;
+ currentViewInfo->ImageWidth = c->baseViewInfo.ImageWidth;
+ nextViewInfo->ImageHeight = c->baseViewInfo.ImageHeight;
+ nextViewInfo->ImageWidth = c->baseViewInfo.ImageWidth;
nextViewInfo->BackgroundAlpha = c->baseViewInfo.BackgroundAlpha;
- //todo: delete properly, memory leak (big), proof of concept
- c->setTweens(sets);
+ c->setTweens(sets );
- Animation *scrollTween = sets->getAnimation("menuScroll");
- scrollTween->Clear();
+ Animation *scrollTween = sets->getAnimation("menuScroll" );
+ scrollTween->Clear( );
c->baseViewInfo = *currentViewInfo;
- TweenSet *set = new TweenSet();
- set->push(new Tween(TWEEN_PROPERTY_HEIGHT, EASE_INOUT_QUADRATIC, currentViewInfo->Height, nextViewInfo->Height, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_WIDTH, EASE_INOUT_QUADRATIC, currentViewInfo->Width, nextViewInfo->Width, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_ANGLE, EASE_INOUT_QUADRATIC, currentViewInfo->Angle, nextViewInfo->Angle, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_ALPHA, EASE_INOUT_QUADRATIC, currentViewInfo->Alpha, nextViewInfo->Alpha, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_X, EASE_INOUT_QUADRATIC, currentViewInfo->X, nextViewInfo->X, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_Y, EASE_INOUT_QUADRATIC, currentViewInfo->Y, nextViewInfo->Y, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_X_ORIGIN, EASE_INOUT_QUADRATIC, currentViewInfo->XOrigin, nextViewInfo->XOrigin, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_Y_ORIGIN, EASE_INOUT_QUADRATIC, currentViewInfo->YOrigin, nextViewInfo->YOrigin, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_X_OFFSET, EASE_INOUT_QUADRATIC, currentViewInfo->XOffset, nextViewInfo->XOffset, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_Y_OFFSET, EASE_INOUT_QUADRATIC, currentViewInfo->YOffset, nextViewInfo->YOffset, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_FONT_SIZE, EASE_INOUT_QUADRATIC, currentViewInfo->FontSize, nextViewInfo->FontSize, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_BACKGROUND_ALPHA, EASE_INOUT_QUADRATIC, currentViewInfo->BackgroundAlpha, nextViewInfo->BackgroundAlpha, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_MAX_WIDTH, EASE_INOUT_QUADRATIC, currentViewInfo->MaxWidth, nextViewInfo->MaxWidth, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_MAX_HEIGHT, EASE_INOUT_QUADRATIC, currentViewInfo->MaxHeight, nextViewInfo->MaxHeight, scrollTime));
- set->push(new Tween(TWEEN_PROPERTY_LAYER, EASE_INOUT_QUADRATIC, currentViewInfo->Layer, nextViewInfo->Layer, scrollTime));
- scrollTween->Push(set);
+ TweenSet *set = new TweenSet( );
+ set->push(new Tween(TWEEN_PROPERTY_HEIGHT, EASE_INOUT_QUADRATIC, currentViewInfo->Height, nextViewInfo->Height, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_WIDTH, EASE_INOUT_QUADRATIC, currentViewInfo->Width, nextViewInfo->Width, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_ANGLE, EASE_INOUT_QUADRATIC, currentViewInfo->Angle, nextViewInfo->Angle, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_ALPHA, EASE_INOUT_QUADRATIC, currentViewInfo->Alpha, nextViewInfo->Alpha, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_X, EASE_INOUT_QUADRATIC, currentViewInfo->X, nextViewInfo->X, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_Y, EASE_INOUT_QUADRATIC, currentViewInfo->Y, nextViewInfo->Y, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_X_ORIGIN, EASE_INOUT_QUADRATIC, currentViewInfo->XOrigin, nextViewInfo->XOrigin, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_Y_ORIGIN, EASE_INOUT_QUADRATIC, currentViewInfo->YOrigin, nextViewInfo->YOrigin, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_X_OFFSET, EASE_INOUT_QUADRATIC, currentViewInfo->XOffset, nextViewInfo->XOffset, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_Y_OFFSET, EASE_INOUT_QUADRATIC, currentViewInfo->YOffset, nextViewInfo->YOffset, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_FONT_SIZE, EASE_INOUT_QUADRATIC, currentViewInfo->FontSize, nextViewInfo->FontSize, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_BACKGROUND_ALPHA, EASE_INOUT_QUADRATIC, currentViewInfo->BackgroundAlpha, nextViewInfo->BackgroundAlpha, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_MAX_WIDTH, EASE_INOUT_QUADRATIC, currentViewInfo->MaxWidth, nextViewInfo->MaxWidth, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_MAX_HEIGHT, EASE_INOUT_QUADRATIC, currentViewInfo->MaxHeight, nextViewInfo->MaxHeight, scrollTime ) );
+ set->push(new Tween(TWEEN_PROPERTY_LAYER, EASE_INOUT_QUADRATIC, currentViewInfo->Layer, nextViewInfo->Layer, scrollTime ) );
+ scrollTween->Push( set );
}
-bool ScrollingList::allocateTexture(unsigned int index, Item *item)
+bool ScrollingList::allocateTexture( unsigned int index, Item *item )
{
- if(index >= components_.size()) return false;
-
- //todo: will create a runtime fault if not of the right type
- //todo: remove coupling from knowing the collection name
+ if ( index >= components_.size( ) ) return false;
std::string videoKey ="collections." + collectionName + ".media.video";
std::string imagePath;
@@ -509,237 +528,252 @@ bool ScrollingList::allocateTexture(unsigned int index, Item *item)
ImageBuilder imageBuild;
std::string layoutName;
- config_.getProperty("layout", layoutName);
+ config_.getProperty( "layout", layoutName );
// check collection path for art based on gamename
- if (layoutMode_)
+ if ( layoutMode_ )
{
- imagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, "collections", collectionName);
- imagePath = Utils::combinePath(imagePath, "medium_artwork", imageType_);
+ imagePath = Utils::combinePath( Configuration::absolutePath, "layouts", layoutName, "collections", collectionName );
+ imagePath = Utils::combinePath( imagePath, "medium_artwork", imageType_ );
}
else
{
- config_.getMediaPropertyAbsolutePath(collectionName, imageType_, false, imagePath);
+ config_.getMediaPropertyAbsolutePath( collectionName, imageType_, false, imagePath );
}
- t = imageBuild.CreateImage(imagePath, page, item->name, scaleX_, scaleY_);
+ t = imageBuild.CreateImage( imagePath, page, item->name, scaleX_, scaleY_ );
// check sub-collection path for art based on gamename
- if(!t)
+ if ( !t )
{
- if (layoutMode_)
+ if ( layoutMode_ )
{
- imagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, "collections", item->collectionInfo->name);
- imagePath = Utils::combinePath(imagePath, "medium_artwork", imageType_);
+ imagePath = Utils::combinePath( Configuration::absolutePath, "layouts", layoutName, "collections", item->collectionInfo->name );
+ imagePath = Utils::combinePath( imagePath, "medium_artwork", imageType_ );
}
else
{
- config_.getMediaPropertyAbsolutePath(item->collectionInfo->name, imageType_, false, imagePath);
+ config_.getMediaPropertyAbsolutePath( item->collectionInfo->name, imageType_, false, imagePath );
}
- t = imageBuild.CreateImage(imagePath, page, item->name, scaleX_, scaleY_);
+ t = imageBuild.CreateImage( imagePath, page, item->name, scaleX_, scaleY_ );
}
- // check collection path for art based on game name (full title)
- if(!t && item->title != item->fullTitle)
+ // check collection path for art based on game name (full title )
+ if ( !t && item->title != item->fullTitle )
{
- if (layoutMode_)
+ if ( layoutMode_ )
{
- imagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, "collections", collectionName);
- imagePath = Utils::combinePath(imagePath, "medium_artwork", imageType_);
+ imagePath = Utils::combinePath( Configuration::absolutePath, "layouts", layoutName, "collections", collectionName );
+ imagePath = Utils::combinePath( imagePath, "medium_artwork", imageType_ );
}
else
{
- config_.getMediaPropertyAbsolutePath(collectionName, imageType_, false, imagePath);
+ config_.getMediaPropertyAbsolutePath( collectionName, imageType_, false, imagePath );
}
- t = imageBuild.CreateImage(imagePath, page, item->fullTitle, scaleX_, scaleY_);
+ t = imageBuild.CreateImage( imagePath, page, item->fullTitle, scaleX_, scaleY_ );
}
- // check sub-collection path for art based on game name (full title)
- if(!t && item->title != item->fullTitle)
+ // check sub-collection path for art based on game name (full title )
+ if ( !t && item->title != item->fullTitle )
{
- if (layoutMode_)
+ if ( layoutMode_ )
{
- imagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, "collections", item->collectionInfo->name);
- imagePath = Utils::combinePath(imagePath, "medium_artwork", imageType_);
+ imagePath = Utils::combinePath( Configuration::absolutePath, "layouts", layoutName, "collections", item->collectionInfo->name );
+ imagePath = Utils::combinePath( imagePath, "medium_artwork", imageType_ );
}
else
{
- config_.getMediaPropertyAbsolutePath(item->collectionInfo->name, imageType_, false, imagePath);
+ config_.getMediaPropertyAbsolutePath( item->collectionInfo->name, imageType_, false, imagePath );
}
- t = imageBuild.CreateImage(imagePath, page, item->fullTitle, scaleX_, scaleY_);
+ t = imageBuild.CreateImage( imagePath, page, item->fullTitle, scaleX_, scaleY_ );
}
// check collection path for art based on parent game name
- if(!t && item->cloneof != "")
+ if ( !t && item->cloneof != "" )
{
- if (layoutMode_)
+ if ( layoutMode_ )
{
- imagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, "collections", collectionName);
- imagePath = Utils::combinePath(imagePath, "medium_artwork", imageType_);
+ imagePath = Utils::combinePath( Configuration::absolutePath, "layouts", layoutName, "collections", collectionName );
+ imagePath = Utils::combinePath( imagePath, "medium_artwork", imageType_ );
}
else
{
- config_.getMediaPropertyAbsolutePath(collectionName, imageType_, false, imagePath);
+ config_.getMediaPropertyAbsolutePath( collectionName, imageType_, false, imagePath );
}
- t = imageBuild.CreateImage(imagePath, page, item->cloneof, scaleX_, scaleY_);
+ t = imageBuild.CreateImage( imagePath, page, item->cloneof, scaleX_, scaleY_ );
}
// check sub-collection path for art based on parent game name
- if(!t && item->cloneof != "")
+ if ( !t && item->cloneof != "" )
{
- if (layoutMode_)
+ if ( layoutMode_ )
{
- imagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, "collections", item->collectionInfo->name);
- imagePath = Utils::combinePath(imagePath, "medium_artwork", imageType_);
+ imagePath = Utils::combinePath( Configuration::absolutePath, "layouts", layoutName, "collections", item->collectionInfo->name );
+ imagePath = Utils::combinePath( imagePath, "medium_artwork", imageType_ );
}
else
{
- config_.getMediaPropertyAbsolutePath(item->collectionInfo->name, imageType_, false, imagePath);
+ config_.getMediaPropertyAbsolutePath( item->collectionInfo->name, imageType_, false, imagePath );
}
- t = imageBuild.CreateImage(imagePath, page, item->cloneof, scaleX_, scaleY_);
+ t = imageBuild.CreateImage( imagePath, page, item->cloneof, scaleX_, scaleY_ );
}
// check collection path for art based on system name
- if(!t)
+ if ( !t )
{
- if (layoutMode_)
+ if ( layoutMode_ )
{
- imagePath = Utils::combinePath(Configuration::absolutePath, "layouts", layoutName, "collections", item->name);
- imagePath = Utils::combinePath(imagePath, "system_artwork");
+ imagePath = Utils::combinePath( Configuration::absolutePath, "layouts", layoutName, "collections", item->name );
+ imagePath = Utils::combinePath( imagePath, "system_artwork" );
}
else
{
- config_.getMediaPropertyAbsolutePath(item->name, imageType_, true, imagePath);
+ config_.getMediaPropertyAbsolutePath( item->name, imageType_, true, imagePath );
}
- t = imageBuild.CreateImage(imagePath, page, imageType_, scaleX_, scaleY_);
+ t = imageBuild.CreateImage( imagePath, page, imageType_, scaleX_, scaleY_ );
}
- if (!t)
+ if ( !t )
{
- t = new Text(item->title, page, fontInst_, scaleX_, scaleY_);
+ t = new Text(item->title, page, fontInst_, scaleX_, scaleY_ );
}
- if(t)
+ if ( t )
{
- components_.at(index) = t;
+ components_.at( index ) = t;
}
return true;
}
-void ScrollingList::deallocateTexture(unsigned int index)
+
+void ScrollingList::deallocateTexture( unsigned int index )
{
- if(components_.size() <= index) return;
+ if ( components_.size( ) <= index ) return;
- Component *s = components_.at(index);
+ Component *s = components_.at( index );
- if(s)
+ if ( s )
{
- s->freeGraphicsMemory();
+ s->freeGraphicsMemory( );
}
}
-void ScrollingList::draw()
+void ScrollingList::draw( )
{
//todo: Poor design implementation.
- // caller should instead call ScrollingList::Draw(unsigned int layer)
+ // caller should instead call ScrollingList::Draw( unsigned int layer )
}
-void ScrollingList::draw(unsigned int layer)
+
+void ScrollingList::draw( unsigned int layer )
{
- if(components_.size() == 0) return;
+ if ( components_.size( ) == 0 ) return;
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c && c->baseViewInfo.Layer == layer) c->draw();
+ Component *c = components_.at( i );
+ if ( c && c->baseViewInfo.Layer == layer ) c->draw( );
}
}
-bool ScrollingList::isIdle()
+bool ScrollingList::isIdle( )
{
- if(!Component::isIdle()) return false;
+ if ( !Component::isIdle( ) ) return false;
- for(unsigned int i = 0; i < components_.size(); ++i)
+ for ( unsigned int i = 0; i < components_.size( ); ++i )
{
- Component *c = components_.at(i);
- if(c && !c->isIdle()) return false;
+ Component *c = components_.at( i );
+ if ( c && !c->isIdle( ) ) return false;
}
return true;
}
-void ScrollingList::resetScrollPeriod()
+void ScrollingList::resetScrollPeriod( )
{
scrollPeriod_ = startScrollTime_;
return;
}
-void ScrollingList::updateScrollPeriod()
+void ScrollingList::updateScrollPeriod( )
{
scrollPeriod_ -= scrollAcceleration_;
- if(scrollPeriod_ < scrollAcceleration_)
+ if ( scrollPeriod_ < scrollAcceleration_ )
{
scrollPeriod_ = scrollAcceleration_;
}
}
-void ScrollingList::scroll(bool forward)
+void ScrollingList::scroll( bool forward )
{
- if(!items_ || items_->size() == 0) return;
+ if ( !items_ || items_->size( ) == 0 ) return;
+ if ( !scrollPoints_ || scrollPoints_->size( ) == 0 ) return;
- if(forward)
+ // Replace the item that's scrolled out
+ if ( forward )
{
- Item *i = items_->at(loopIncrement(itemIndex_, scrollPoints_->size(), items_->size()));
- deallocateTexture(componentIndex_);
- allocateTexture(componentIndex_, i);
+ Item *i = items_->at( loopIncrement( itemIndex_, scrollPoints_->size( ), items_->size( ) ) );
+ itemIndex_ = loopIncrement( itemIndex_, 1, items_->size( ) );
+ deallocateTexture( 0 );
+ allocateTexture( 0, i );
}
else
{
- Item *i = items_->at(loopDecrement(itemIndex_, 1, items_->size()));
- deallocateTexture(loopDecrement(componentIndex_, 1, components_.size()));
- allocateTexture(loopDecrement(componentIndex_, 1, components_.size()), i);
+ Item *i = items_->at( loopDecrement( itemIndex_, 1, items_->size( ) ) );
+ itemIndex_ = loopDecrement( itemIndex_, 1, items_->size( ) );
+ deallocateTexture( loopDecrement( 0, 1, components_.size( ) ) );
+ allocateTexture( loopDecrement( 0, 1, components_.size( ) ), i );
}
- for(unsigned int i = 0; i < scrollPoints_->size(); i++)
+ // Set the animations
+ for ( unsigned int i = 0; i < scrollPoints_->size( ); i++ )
{
- unsigned int cindex = loopIncrement(componentIndex_, i, components_.size());
-
- Component *c = components_.at(cindex);
-
- unsigned int nextI = 0;
- if(forward)
+ unsigned int nextI;
+ if ( forward )
{
- nextI = loopDecrement(i, 1, scrollPoints_->size());
+ nextI = loopDecrement( i, 1, scrollPoints_->size( ) );
}
else
{
- nextI = loopIncrement(i, 1, scrollPoints_->size());
+ nextI = loopIncrement( i, 1, scrollPoints_->size( ) );
}
- ViewInfo *currentvi = scrollPoints_->at(i);
- ViewInfo *nextvi = scrollPoints_->at(nextI);
+ Component *c = components_.at( i );
- resetTweens
- (c, tweenPoints_->at(nextI), currentvi, nextvi, scrollPeriod_);
- c->baseViewInfo.font = nextvi->font; // Use the font settings of the next index
- c->triggerEvent( "menuScroll" );
+ resetTweens( c, tweenPoints_->at( nextI ), scrollPoints_->at( i ), scrollPoints_->at( nextI ), scrollPeriod_ );
+ c->baseViewInfo.font = scrollPoints_->at( nextI )->font; // Use the font settings of the next index
+ c->triggerEvent( "menuScroll" );
}
- if(forward)
+ // Reorder the components
+ Component *c = components_.at( 0 );
+ if ( forward )
{
- itemIndex_ = loopIncrement(itemIndex_, 1, items_->size());
- componentIndex_ = loopIncrement(componentIndex_, 1, components_.size());
+ for ( unsigned int i = scrollPoints_->size( ); i > 0; i-- )
+ {
+ unsigned int prevI = loopDecrement( i, 1, scrollPoints_->size( ) );
+ Component *store = components_.at( prevI );
+ components_[prevI] = c;
+ c = store;
+
+ }
}
else
{
- itemIndex_ = loopDecrement(itemIndex_, 1, items_->size());
- componentIndex_ = loopDecrement(componentIndex_, 1, components_.size());
+ for ( unsigned int i = 0; i < scrollPoints_->size( ); i++ )
+ {
+ unsigned int nextI = loopIncrement( i, 1, scrollPoints_->size( ) );
+ Component *store = components_.at( nextI );
+ components_[nextI] = c;
+ c = store;
+
+ }
}
return;
diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.h b/RetroFE/Source/Graphics/Component/ScrollingList.h
index 5d88d9c..12a7246 100644
--- a/RetroFE/Source/Graphics/Component/ScrollingList.h
+++ b/RetroFE/Source/Graphics/Component/ScrollingList.h
@@ -15,6 +15,7 @@
*/
#pragma once
+
#include
#include "Component.h"
#include "../Animate/Tween.h"
@@ -24,75 +25,73 @@
#include
-//todo: This scrolling implementation needs to be overhauled
-// It needs to have a common interface to support different menu types
-// (It was originally sandbox code that creeped into here)
-
class Configuration;
class Font;
class ScrollingList : public Component
{
+
public:
- ScrollingList(Configuration &c,
- Page &p,
- bool layoutMode,
- float scaleX,
- float scaleY,
- Font *font,
- std::string layoutKey,
- std::string imageType);
- ScrollingList(const ScrollingList ©);
- virtual ~ScrollingList();
- void triggerEnterEvent();
- void triggerExitEvent();
- void triggerMenuEnterEvent(int menuIndex = -1);
- void triggerMenuExitEvent(int menuIndex = -1);
- void triggerGameEnterEvent(int menuIndex = -1);
- void triggerGameExitEvent(int menuIndex = -1);
- void triggerHighlightEnterEvent(int menuIndex = -1);
- void triggerHighlightExitEvent(int menuIndex = -1);
+ ScrollingList( Configuration &c,
+ Page &p,
+ bool layoutMode,
+ float scaleX,
+ float scaleY,
+ Font *font,
+ std::string layoutKey,
+ std::string imageType );
- bool allocateTexture(unsigned int index, Item *i);
- void deallocateTexture(unsigned int index);
- void setItems(std::vector
- *items);
- void destroyItems();
- void setPoints(std::vector *scrollPoints, std::vector *tweenPoints);
- unsigned int getSelectedIndex();
- void setSelectedIndex(unsigned int index);
- unsigned int getSize();
- void pageUp();
- void pageDown();
- void letterUp();
- void letterDown();
- void letterChange(bool increment);
- void random();
- bool isIdle();
- unsigned int getScrollOffsetIndex();
- void setScrollOffsetIndex(unsigned int index);
- void setSelectedIndex(int selectedIndex);
- Item *getItemByOffset(int offset);
- Item *getSelectedItem();
- void allocateGraphicsMemory();
- void freeGraphicsMemory();
- void update(float dt);
- void draw();
- void draw(unsigned int layer);
- void setScrollAcceleration(float value);
- void setStartScrollTime(float value);
+ ScrollingList( const ScrollingList © );
+ virtual ~ScrollingList( );
+ void triggerEnterEvent( );
+ void triggerExitEvent( );
+ void triggerMenuEnterEvent( int menuIndex = -1 );
+ void triggerMenuExitEvent( int menuIndex = -1 );
+ void triggerGameEnterEvent( int menuIndex = -1 );
+ void triggerGameExitEvent( int menuIndex = -1 );
+ void triggerHighlightEnterEvent( int menuIndex = -1 );
+ void triggerHighlightExitEvent( int menuIndex = -1 );
+
+ bool allocateTexture( unsigned int index, Item *i );
+ void deallocateTexture( unsigned int index );
+ void setItems( std::vector
- *items );
+ void destroyItems( );
+ void setPoints( std::vector *scrollPoints, std::vector *tweenPoints );
+ unsigned int getSelectedIndex( );
+ void setSelectedIndex( unsigned int index );
+ unsigned int getSize( );
+ void pageUp( );
+ void pageDown( );
+ void letterUp( );
+ void letterDown( );
+ void letterChange( bool increment );
+ void random( );
+ bool isIdle( );
+ unsigned int getScrollOffsetIndex( );
+ void setScrollOffsetIndex( unsigned int index );
+ void setSelectedIndex( int selectedIndex );
+ Item *getItemByOffset( int offset );
+ Item *getSelectedItem( );
+ void allocateGraphicsMemory( );
+ void freeGraphicsMemory( );
+ void update( float dt );
+ void draw( );
+ void draw( unsigned int layer );
+ void setScrollAcceleration( float value );
+ void setStartScrollTime( float value );
bool horizontalScroll;
- void deallocateSpritePoints();
- void allocateSpritePoints();
- void resetScrollPeriod();
- void updateScrollPeriod();
- void scroll(bool forward);
-
+ void deallocateSpritePoints( );
+ void allocateSpritePoints( );
+ void resetScrollPeriod( );
+ void updateScrollPeriod( );
+ void scroll( bool forward );
private:
- void resetTweens(Component *c, AnimationEvents *sets, ViewInfo *currentViewInfo, ViewInfo *nextViewInfo, double scrollTime);
- unsigned int loopIncrement(unsigned int offset, unsigned int i, unsigned int size);
- unsigned int loopDecrement(unsigned int offset, unsigned int i, unsigned int size);
+
+ void resetTweens( Component *c, AnimationEvents *sets, ViewInfo *currentViewInfo, ViewInfo *nextViewInfo, double scrollTime );
+ unsigned int loopIncrement( unsigned int offset, unsigned int i, unsigned int size );
+ unsigned int loopDecrement( unsigned int offset, unsigned int i, unsigned int size );
bool layoutMode_;
std::vector *spriteList_;
@@ -100,24 +99,20 @@ private:
std::vector *tweenPoints_;
unsigned int itemIndex_;
- unsigned int componentIndex_;
unsigned int selectedOffsetIndex_;
float scrollAcceleration_;
float startScrollTime_;
float scrollPeriod_;
-
+
Configuration &config_;
- float scaleX_;
- float scaleY_;
- Font *fontInst_;
- std::string layoutKey_;
- std::string imageType_;
+ float scaleX_;
+ float scaleY_;
+ Font *fontInst_;
+ std::string layoutKey_;
+ std::string imageType_;
-
- std::vector
- *items_;
+ std::vector
- *items_;
std::vector components_;
-
-
-};
+};
diff --git a/RetroFE/Source/Graphics/Page.cpp b/RetroFE/Source/Graphics/Page.cpp
index aadebee..4e90ba4 100644
--- a/RetroFE/Source/Graphics/Page.cpp
+++ b/RetroFE/Source/Graphics/Page.cpp
@@ -529,11 +529,11 @@ void Page::selectRandom()
if(activeMenu_.size() > 0 && activeMenu_[0])
{
activeMenu_[0]->random();
- unsigned int index = activeMenu_[0]->getSelectedIndex();
+ unsigned int index = activeMenu_[0]->getScrollOffsetIndex();
for(std::vector::iterator it = activeMenu_.begin(); it != activeMenu_.end(); it++)
{
ScrollingList *menu = *it;
- menu->setSelectedIndex(index);
+ menu->setScrollOffsetIndex(index);
}
}
}
diff --git a/RetroFE/Source/Version.cpp b/RetroFE/Source/Version.cpp
index 9ea280d..0358094 100644
--- a/RetroFE/Source/Version.cpp
+++ b/RetroFE/Source/Version.cpp
@@ -21,7 +21,7 @@
std::string retrofe_version_major = "0";
std::string retrofe_version_minor = "8";
-std::string retrofe_version_build = "9";
+std::string retrofe_version_build = "10";
std::string Version::getString( )