read memory card names in the mount thread

MemoryCardDrivers: fix Mount doesn't clear the right mount point before trying to mount
This commit is contained in:
Chris Danford
2004-04-23 04:17:02 +00:00
parent 93e9377ea2
commit 82c910711c
5 changed files with 61 additions and 15 deletions
+26 -11
View File
@@ -133,21 +133,36 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn, bool bLoadNames
// mount slot
if( MEMCARDMAN->GetCardState(pn) == MEMORY_CARD_STATE_READY )
{
CString sDir = MEM_CARD_MOUNT_POINT[pn];
if( bLoadNamesOnly )
{
CString sMemCardDir = MEM_CARD_MOUNT_POINT[pn];
CString sProfileDir = sMemCardDir + PREFSMAN->m_sMemoryCardProfileSubdir + '/';
// tack on a subdirectory so that we don't write everything to the root
sDir += PREFSMAN->m_sMemoryCardProfileSubdir;
sDir += '/';
m_sProfileDir[pn] = sProfileDir;
m_bWasLoadedFromMemoryCard[pn] = true;
bool bResult;
bResult = LoadProfile( pn, sDir, true, bLoadNamesOnly );
if( bResult )
m_Profile[pn].InitAll();
m_Profile[pn].m_sDisplayName = MEMCARDMAN->GetName(pn);
return true;
CreateMemoryCardProfile( pn );
}
else
{
CString sDir = MEM_CARD_MOUNT_POINT[pn];
// tack on a subdirectory so that we don't write everything to the root
sDir += PREFSMAN->m_sMemoryCardProfileSubdir;
sDir += '/';
bool bResult;
bResult = LoadProfile( pn, sDir, true, bLoadNamesOnly );
if( bResult )
return true;
bResult = LoadProfile( pn, sDir, true, bLoadNamesOnly );
return bResult;
CreateMemoryCardProfile( pn );
bResult = LoadProfile( pn, sDir, true, bLoadNamesOnly );
return bResult;
}
}
#endif
return false;