Prettify debug output from rebuildSearchPath

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5421 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-07-08 13:01:09 +00:00
parent 40b6a5acf7
commit 9bc09663f0
1 changed files with 12 additions and 9 deletions

View File

@ -246,12 +246,12 @@ BOOL rebuildSearchPath( searchPathMode mode, BOOL force )
switch ( mode ) switch ( mode )
{ {
case mod_clean: case mod_clean:
debug( LOG_WZ, "rebuildSearchPath: Cleaning up" ); debug(LOG_WZ, "Cleaning up");
while( curSearchPath ) while( curSearchPath )
{ {
#ifdef DEBUG #ifdef DEBUG
debug( LOG_WZ, "rebuildSearchPath: Removing [%s] from search path", curSearchPath->path ); debug(LOG_WZ, "Removing [%s] from search path", curSearchPath->path);
#endif // DEBUG #endif // DEBUG
// Remove maps and mods // Remove maps and mods
removeSubdirs( curSearchPath->path, "maps", NULL ); removeSubdirs( curSearchPath->path, "maps", NULL );
@ -282,12 +282,12 @@ BOOL rebuildSearchPath( searchPathMode mode, BOOL force )
} }
break; break;
case mod_campaign: case mod_campaign:
debug( LOG_WZ, "rebuildSearchPath: Switching to campaign mods" ); debug(LOG_WZ, "Switching to campaign mods");
while( curSearchPath ) while( curSearchPath )
{ {
#ifdef DEBUG #ifdef DEBUG
debug( LOG_WZ, "rebuildSearchPath: Adding [%s] to search path", curSearchPath->path ); debug(LOG_WZ, "Adding [%s] to search path", curSearchPath->path);
#endif // DEBUG #endif // DEBUG
// Add global and campaign mods // Add global and campaign mods
PHYSFS_addToSearchPath( curSearchPath->path, PHYSFS_APPEND ); PHYSFS_addToSearchPath( curSearchPath->path, PHYSFS_APPEND );
@ -296,7 +296,10 @@ BOOL rebuildSearchPath( searchPathMode mode, BOOL force )
addSubdirs( curSearchPath->path, "mods/global/autoload", PHYSFS_APPEND, NULL ); addSubdirs( curSearchPath->path, "mods/global/autoload", PHYSFS_APPEND, NULL );
addSubdirs( curSearchPath->path, "mods/campaign", PHYSFS_APPEND, campaign_mods ); addSubdirs( curSearchPath->path, "mods/campaign", PHYSFS_APPEND, campaign_mods );
addSubdirs( curSearchPath->path, "mods/campaign/autoload", PHYSFS_APPEND, NULL ); addSubdirs( curSearchPath->path, "mods/campaign/autoload", PHYSFS_APPEND, NULL );
PHYSFS_removeFromSearchPath( curSearchPath->path ); if (!PHYSFS_removeFromSearchPath( curSearchPath->path ))
{
debug(LOG_ERROR, "Failed to remove path %s again", curSearchPath->path);
}
// Add base files // Add base files
sstrcpy(tmpstr, curSearchPath->path); sstrcpy(tmpstr, curSearchPath->path);
@ -310,12 +313,12 @@ BOOL rebuildSearchPath( searchPathMode mode, BOOL force )
} }
break; break;
case mod_multiplay: case mod_multiplay:
debug( LOG_WZ, "rebuildSearchPath: Switching to multiplay mods" ); debug(LOG_WZ, "Switching to multiplay mods");
while( curSearchPath ) while( curSearchPath )
{ {
#ifdef DEBUG #ifdef DEBUG
debug( LOG_WZ, "rebuildSearchPath: Adding [%s] to search path", curSearchPath->path ); debug(LOG_WZ, "Adding [%s] to search path", curSearchPath->path);
#endif // DEBUG #endif // DEBUG
// Add maps and global and multiplay mods // Add maps and global and multiplay mods
PHYSFS_addToSearchPath( curSearchPath->path, PHYSFS_APPEND ); PHYSFS_addToSearchPath( curSearchPath->path, PHYSFS_APPEND );
@ -346,12 +349,12 @@ BOOL rebuildSearchPath( searchPathMode mode, BOOL force )
} }
break; break;
default: default:
debug( LOG_ERROR, "rebuildSearchPath: Can't switch to unknown mods %i", mode ); debug(LOG_ERROR, "Can't switch to unknown mods %i", mode);
return false; return false;
} }
// User's home dir must be first so we allways see what we write // User's home dir must be first so we allways see what we write
PHYSFS_removeFromSearchPath( PHYSFS_getWriteDir() ); PHYSFS_removeFromSearchPath(PHYSFS_getWriteDir());
PHYSFS_addToSearchPath( PHYSFS_getWriteDir(), PHYSFS_PREPEND ); PHYSFS_addToSearchPath( PHYSFS_getWriteDir(), PHYSFS_PREPEND );
#ifdef DEBUG #ifdef DEBUG