Create PREFSMAN and mount any additional paths it mentions earlier.
Remove DWIPath from prefs. Add AdditionalFolders to prefs (replaces DWIPath, essentially). Store CStrings instead of CStringArrays in prefsman, and split them on use.
This commit is contained in:
@@ -405,7 +405,6 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
|
||||
ini.GetValue( "Options", "ShowSelectGroup", m_bShowSelectGroup );
|
||||
ini.GetValue( "Options", "ShowNative", m_bShowNative );
|
||||
ini.GetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
|
||||
ini.GetValue( "Options", "DWIPath", m_DWIPath );
|
||||
ini.GetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
|
||||
ini.GetValue( "Options", "TexturePreload", m_bTexturePreload );
|
||||
ini.GetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
|
||||
@@ -498,13 +497,10 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
|
||||
|
||||
ini.GetValue( "Editor", "ShowBGChangesPlay", m_bEditorShowBGChangesPlay );
|
||||
|
||||
CString sAdditionalSongFolders;
|
||||
if( ini.GetValue( "Options", "AdditionalSongFolders", sAdditionalSongFolders ) )
|
||||
{
|
||||
FixSlashesInPlace( sAdditionalSongFolders );
|
||||
m_asAdditionalSongFolders.clear();
|
||||
split( sAdditionalSongFolders, ",", m_asAdditionalSongFolders, true );
|
||||
}
|
||||
ini.GetValue( "Options", "AdditionalSongFolders", m_sAdditionalSongFolders );
|
||||
ini.GetValue( "Options", "AdditionalFolders", m_sAdditionalFolders );
|
||||
FixSlashesInPlace(m_sAdditionalSongFolders);
|
||||
FixSlashesInPlace(m_sAdditionalFolders);
|
||||
|
||||
ini.GetValue( "Debug", "Logging", m_bLogging );
|
||||
ini.GetValue( "Debug", "ForceLogFlush", m_bForceLogFlush );
|
||||
@@ -629,7 +625,6 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
||||
ini.SetValue( "Options", "ShowSelectGroup", m_bShowSelectGroup );
|
||||
ini.SetValue( "Options", "ShowNative", m_bShowNative );
|
||||
ini.SetValue( "Options", "ArcadeOptionsNavigation", m_bArcadeOptionsNavigation );
|
||||
ini.SetValue( "Options", "DWIPath", m_DWIPath );
|
||||
ini.SetValue( "Options", "DelayedTextureDelete", m_bDelayedTextureDelete );
|
||||
ini.SetValue( "Options", "TexturePreload", m_bTexturePreload );
|
||||
ini.SetValue( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
|
||||
@@ -728,7 +723,8 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
||||
if(m_sMovieDrivers != DEFAULT_MOVIE_DRIVER_LIST)
|
||||
ini.SetValue ( "Options", "MovieDrivers", m_sMovieDrivers );
|
||||
|
||||
ini.SetValue( "Options", "AdditionalSongFolders", join(",", m_asAdditionalSongFolders) );
|
||||
ini.SetValue( "Options", "AdditionalSongFolders", m_sAdditionalSongFolders);
|
||||
ini.SetValue( "Options", "AdditionalFolders", m_sAdditionalFolders);
|
||||
|
||||
ini.SetValue( "Debug", "Logging", m_bLogging );
|
||||
ini.SetValue( "Debug", "ForceLogFlush", m_bForceLogFlush );
|
||||
|
||||
@@ -209,8 +209,8 @@ public:
|
||||
/* 0 = no; 1 = yes; -1 = auto (do whatever is appropriate for the arch). */
|
||||
int m_iBoostAppPriority;
|
||||
|
||||
CStringArray m_asAdditionalSongFolders;
|
||||
CString m_DWIPath;
|
||||
CString m_sAdditionalSongFolders;
|
||||
CString m_sAdditionalFolders;
|
||||
|
||||
CString m_sLastSeenVideoDriver;
|
||||
CString m_sLastSeenInputDevices;
|
||||
|
||||
@@ -890,6 +890,26 @@ int main(int argc, char* argv[])
|
||||
|
||||
/* Whew--we should be able to crash safely now! */
|
||||
|
||||
//
|
||||
// load preferences and mount any alternative trees.
|
||||
//
|
||||
PREFSMAN = new PrefsManager;
|
||||
|
||||
/* Set up alternative filesystem trees. */
|
||||
if( PREFSMAN->m_sAdditionalFolders != "" )
|
||||
{
|
||||
CStringArray dirs;
|
||||
split( PREFSMAN->m_sAdditionalFolders, ",", dirs, true );
|
||||
for( unsigned i=0; i < dirs.size(); i++)
|
||||
FILEMAN->Mount( "dir", dirs[i], "" );
|
||||
}
|
||||
if( PREFSMAN->m_sAdditionalSongFolders != "" )
|
||||
{
|
||||
CStringArray dirs;
|
||||
split( PREFSMAN->m_sAdditionalSongFolders, ",", dirs, true );
|
||||
for( unsigned i=0; i < dirs.size(); i++)
|
||||
FILEMAN->Mount( "dir", dirs[i], "Songs" );
|
||||
}
|
||||
MountTreeOfZips( ZIPS_DIR );
|
||||
|
||||
atexit(SDL_Quit); /* Clean up on exit */
|
||||
@@ -902,7 +922,6 @@ int main(int argc, char* argv[])
|
||||
// Create game objects
|
||||
//
|
||||
GAMESTATE = new GameState;
|
||||
PREFSMAN = new PrefsManager;
|
||||
|
||||
LOG->ShowLogOutput( PREFSMAN->m_bShowLogOutput );
|
||||
LOG->SetLogging( PREFSMAN->m_bLogging );
|
||||
@@ -934,12 +953,6 @@ int main(int argc, char* argv[])
|
||||
|
||||
CheckSettings();
|
||||
|
||||
/* Set up alternative filesystem trees. */
|
||||
for( unsigned i=0; i<PREFSMAN->m_asAdditionalSongFolders.size(); i++ )
|
||||
FILEMAN->Mount( "dir", PREFSMAN->m_asAdditionalSongFolders[i], "Songs" );
|
||||
if( PREFSMAN->m_DWIPath != "" )
|
||||
FILEMAN->Mount( "dir", PREFSMAN->m_DWIPath, "" );
|
||||
|
||||
GAMEMAN = new GameManager;
|
||||
THEME = new ThemeManager;
|
||||
ANNOUNCER = new AnnouncerManager;
|
||||
|
||||
Reference in New Issue
Block a user