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();
|
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
|
// Save attacks
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
@@ -126,32 +149,6 @@ CString Character::GetStageIconPath() const
|
|||||||
return as[0];
|
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()
|
bool Character::Has2DElems()
|
||||||
{
|
{
|
||||||
if( DoesFileExist(m_sCharDir + "2DFail/BGAnimation.ini") ) // check 2D Idle BGAnim exists
|
if( DoesFileExist(m_sCharDir + "2DFail/BGAnimation.ini") ) // check 2D Idle BGAnim exists
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ public:
|
|||||||
bool Load( CString sCharDir ); // return true if success
|
bool Load( CString sCharDir ); // return true if success
|
||||||
|
|
||||||
CString GetTakingABreakPath() const;
|
CString GetTakingABreakPath() const;
|
||||||
CString GetCardPath() const;
|
CString GetCardPath() const { return m_sCardPath; }
|
||||||
CString GetIconPath() const;
|
CString GetIconPath() const { return m_sIconPath; }
|
||||||
|
|
||||||
CString GetModelPath() const;
|
CString GetModelPath() const;
|
||||||
CString GetRestAnimationPath() const;
|
CString GetRestAnimationPath() const;
|
||||||
@@ -49,6 +49,9 @@ public:
|
|||||||
CString m_sCharacterID;
|
CString m_sCharacterID;
|
||||||
private:
|
private:
|
||||||
CString m_sDisplayName;
|
CString m_sDisplayName;
|
||||||
|
CString m_sCardPath;
|
||||||
|
CString m_sIconPath;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// All the stuff below will be filled in if this character is playable in Rave mode
|
// All the stuff below will be filled in if this character is playable in Rave mode
|
||||||
|
|||||||
Reference in New Issue
Block a user