don't make lots of GetDirListing calls
This commit is contained in:
+23
-26
@@ -20,6 +20,29 @@ bool Character::Load( CString sCharDir )
|
||||
m_sCharacterID = as.back();
|
||||
}
|
||||
|
||||
{
|
||||
CStringArray as;
|
||||
GetDirListing( m_sCharDir+"card.png", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.jpg", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.gif", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.bmp", as, false, true );
|
||||
if( as.empty() )
|
||||
m_sCardPath = "";
|
||||
else
|
||||
m_sCardPath = as[0];
|
||||
}
|
||||
|
||||
{
|
||||
CStringArray as;
|
||||
GetDirListing( m_sCharDir+"icon.png", as, false, true );
|
||||
GetDirListing( m_sCharDir+"icon.jpg", as, false, true );
|
||||
GetDirListing( m_sCharDir+"icon.gif", as, false, true );
|
||||
GetDirListing( m_sCharDir+"icon.bmp", as, false, true );
|
||||
if( as.empty() )
|
||||
m_sIconPath = "";
|
||||
else
|
||||
m_sIconPath = as[0];
|
||||
}
|
||||
|
||||
// Save attacks
|
||||
IniFile ini;
|
||||
@@ -126,32 +149,6 @@ CString Character::GetStageIconPath() const
|
||||
return as[0];
|
||||
}
|
||||
|
||||
CString Character::GetCardPath() const
|
||||
{
|
||||
CStringArray as;
|
||||
GetDirListing( m_sCharDir+"card.png", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.jpg", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.gif", as, false, true );
|
||||
GetDirListing( m_sCharDir+"card.bmp", as, false, true );
|
||||
if( as.empty() )
|
||||
return "";
|
||||
else
|
||||
return as[0];
|
||||
}
|
||||
|
||||
CString Character::GetIconPath() const
|
||||
{
|
||||
CStringArray as;
|
||||
GetDirListing( m_sCharDir+"icon.png", as, false, true );
|
||||
GetDirListing( m_sCharDir+"icon.jpg", as, false, true );
|
||||
GetDirListing( m_sCharDir+"icon.gif", as, false, true );
|
||||
GetDirListing( m_sCharDir+"icon.bmp", as, false, true );
|
||||
if( as.empty() )
|
||||
return "";
|
||||
else
|
||||
return as[0];
|
||||
}
|
||||
|
||||
bool Character::Has2DElems()
|
||||
{
|
||||
if( DoesFileExist(m_sCharDir + "2DFail/BGAnimation.ini") ) // check 2D Idle BGAnim exists
|
||||
|
||||
Reference in New Issue
Block a user