Remove another CMap.
This commit is contained in:
@@ -113,12 +113,26 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
|
|||||||
GetDirListing( ssprintf("%s\\%s\\*.jpg", sDir, sGroupDirName), arrayGroupBanners );
|
GetDirListing( ssprintf("%s\\%s\\*.jpg", sDir, sGroupDirName), arrayGroupBanners );
|
||||||
GetDirListing( ssprintf("%s\\%s\\*.gif", sDir, sGroupDirName), arrayGroupBanners );
|
GetDirListing( ssprintf("%s\\%s\\*.gif", sDir, sGroupDirName), arrayGroupBanners );
|
||||||
GetDirListing( ssprintf("%s\\%s\\*.bmp", sDir, sGroupDirName), arrayGroupBanners );
|
GetDirListing( ssprintf("%s\\%s\\*.bmp", sDir, sGroupDirName), arrayGroupBanners );
|
||||||
|
CString sBannerPath;
|
||||||
|
|
||||||
if( arrayGroupBanners.GetSize() > 0 )
|
if( arrayGroupBanners.GetSize() > 0 )
|
||||||
{
|
{
|
||||||
m_mapGroupToBannerPath[sGroupDirName] = ssprintf("%s\\%s\\%s", sDir, sGroupDirName, arrayGroupBanners[0] );
|
sBannerPath = ssprintf("%s\\%s\\%s", sDir, sGroupDirName, arrayGroupBanners[0] );
|
||||||
LOG->Trace( ssprintf("Group banner for '%s' is '%s'.", sGroupDirName, m_mapGroupToBannerPath[sGroupDirName]) );
|
LOG->Trace( ssprintf("Group banner for '%s' is '%s'.", sGroupDirName, sBannerPath) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add this group to the group array. */
|
||||||
|
int j;
|
||||||
|
for(j = 0; j < m_arrayGroupNames.GetSize(); ++j)
|
||||||
|
if( sGroupDirName == m_arrayGroupNames[j] ) break;
|
||||||
|
|
||||||
|
if( j == m_arrayGroupNames.GetSize() )
|
||||||
|
{
|
||||||
|
m_arrayGroupNames.Add( sGroupDirName );
|
||||||
|
m_GroupBannerPaths.Add(sBannerPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Find all Song folders in this group directory
|
// Find all Song folders in this group directory
|
||||||
CStringArray arraySongDirs;
|
CStringArray arraySongDirs;
|
||||||
GetDirListing( ssprintf("%s\\%s\\*.*", sDir, sGroupDirName), arraySongDirs, true );
|
GetDirListing( ssprintf("%s\\%s\\*.*", sDir, sGroupDirName), arraySongDirs, true );
|
||||||
@@ -206,7 +220,7 @@ void SongManager::FreeSongArray()
|
|||||||
SAFE_DELETE( m_pSongs[i] );
|
SAFE_DELETE( m_pSongs[i] );
|
||||||
m_pSongs.RemoveAll();
|
m_pSongs.RemoveAll();
|
||||||
|
|
||||||
m_mapGroupToBannerPath.RemoveAll();
|
m_GroupBannerPaths.RemoveAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -334,12 +348,14 @@ void SongManager::SaveStatisticsToDisk()
|
|||||||
|
|
||||||
CString SongManager::GetGroupBannerPath( CString sGroupName )
|
CString SongManager::GetGroupBannerPath( CString sGroupName )
|
||||||
{
|
{
|
||||||
CString sPath;
|
int i;
|
||||||
|
for(i = 0; i < m_arrayGroupNames.GetSize(); ++i)
|
||||||
|
if( sGroupName == m_arrayGroupNames[i] ) break;
|
||||||
|
|
||||||
if( m_mapGroupToBannerPath.Lookup( sGroupName, sPath ) )
|
if( i == m_arrayGroupNames.GetSize() )
|
||||||
return sPath;
|
|
||||||
else
|
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
return m_GroupBannerPaths[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
void SongManager::GetGroupNames( CStringArray &AddTo )
|
void SongManager::GetGroupNames( CStringArray &AddTo )
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ protected:
|
|||||||
bool GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
|
bool GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
|
||||||
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out );
|
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out );
|
||||||
|
|
||||||
CMapStringToString m_mapGroupToBannerPath; // each song group has a banner associated with it
|
|
||||||
CStringArray m_arrayGroupNames;
|
CStringArray m_arrayGroupNames;
|
||||||
|
CStringArray m_GroupBannerPaths; // each song group has a banner associated with it
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user