We load lots of the same thing in OptionRows. Instead of loading each one

individually, just load one and copy it for the rest; this avoids doing
the whole "search, read redir, find refcounted" code path for every
option.  Don't load data from OptionRow::AfterImportOptions.
This commit is contained in:
Glenn Maynard
2005-07-15 05:34:54 +00:00
parent 7afc69b2fd
commit 5c441a5fdf
4 changed files with 29 additions and 17 deletions
+16 -6
View File
@@ -7,16 +7,26 @@
OptionsCursor::OptionsCursor()
{
this->AddChild( &m_sprMiddle );
this->AddChild( &m_sprLeft );
this->AddChild( &m_sprRight );
}
OptionsCursor::OptionsCursor( const OptionsCursor &cpy ):
ActorFrame( cpy ),
m_sprLeft( cpy.m_sprLeft ),
m_sprMiddle( cpy.m_sprMiddle ),
m_sprRight( cpy.m_sprRight )
{
/* Re-add children, or m_SubActors will point to cpy's children and not our own. */
m_SubActors.clear();
this->AddChild( &m_sprMiddle );
this->AddChild( &m_sprLeft );
this->AddChild( &m_sprRight );
}
void OptionsCursor::Load( CString sType, Element elem )
{
ASSERT( m_SubActors.empty() ); // don't load twice
this->AddChild( &m_sprMiddle );
this->AddChild( &m_sprLeft );
this->AddChild( &m_sprRight );
CString sPath = THEME->GetPathG( sType, ssprintf("%s 3x2",elem==cursor?"cursor":"underline") );
m_sprLeft.Load( sPath );