save profile data to memory card subdir so we don't clutter the root

This commit is contained in:
Chris Danford
2003-12-19 08:51:47 +00:00
parent 67a6fddcf3
commit 64f24895d7
6 changed files with 43 additions and 20 deletions
+20 -4
View File
@@ -162,15 +162,32 @@ bool ProfileManager::LoadDefaultProfileFromMachine( PlayerNumber pn )
bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn )
{
CString sDir = MEM_CARD_DIR[pn];
if( !FILEMAN->IsMounted(sDir) )
return false;
DEBUG_ASSERT( FILEMAN->IsMounted(sDir) ); // should be called only if we've already mounted
// tack on a subdirectory so that we don't write everything to the root
sDir += PREFSMAN->m_sMemoryCardProfileSubdir;
sDir += '/';
m_bUsingMemoryCard[pn] = true;
bool bResult;
bResult = LoadProfile( pn, sDir, false );
return bResult;
}
bool ProfileManager::CreateMemoryCardProfile( PlayerNumber pn )
{
CString sDir = MEM_CARD_DIR[pn];
DEBUG_ASSERT( FILEMAN->IsMounted(sDir) ); // should be called only if we've already mounted
// tack on a subdirectory so that we don't write everything to the root
sDir += PREFSMAN->m_sMemoryCardProfileSubdir;
sDir += '/';
return CreateProfile( sDir, NEW_MEM_CARD_NAME );
}
bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn )
{
#ifndef _XBOX
@@ -182,8 +199,7 @@ bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn )
if( LoadProfileFromMemoryCard(pn) )
return true;
CString sDir = MEM_CARD_DIR[pn];
CreateProfile( sDir, NEW_MEM_CARD_NAME );
CreateMemoryCardProfile( pn );
if( LoadProfileFromMemoryCard(pn) )
return true;
}