Commit f53368b6 authored by Gerhard Stein's avatar Gerhard Stein

Fixes with search paths

parent e6907eb7
......@@ -62,8 +62,10 @@ bool CSettings::saveDrvCfg()
Configuration.Parse();
int i = 1;
for(searchpathlist::const_iterator p = tSearchPaths.begin(); p != tSearchPaths.end(); p++, i++)
Configuration.WriteString("FileHandling", "SearchPath" + itoa(i), *p);
CVidConfig &VidConf = gVideoDriver.getVidConfig();
Configuration.SetKeyword("Video", "fullscreen", VidConf.Fullscreen);
Configuration.SetKeyword("Video", "OpenGL", VidConf.m_opengl);
......
......@@ -216,22 +216,42 @@ bool GameDownloader::checkForMissingGames( std::vector< std::string > &missingLi
// Load game catalogue
if( !loadCatalogue(gameCatalogueStr) )
{
// If not found search within for subdirectories
std::set<std::string> dirs;
FileListAdder fileListAdder;
GetFileList(dirs, fileListAdder, ".", false, FM_DIR);
for(std::set<std::string>::iterator i = dirs.begin(); i != dirs.end(); ++i)
// try with search paths
for(searchpathlist::const_iterator p = tSearchPaths.begin(); p != tSearchPaths.end(); p++)
{
const std::string newPath = JoinPaths(*i, gameCatalogueStr);
std::string newPath = *p;
ReplaceFileVariables(newPath);
newPath = JoinPaths(newPath, gameCatalogueStr);
gLogging.ftextOut("Looking at: %s<br>", newPath.c_str() );
gLogging.ftextOut("Looking at: %s<br>", newPath.c_str() );
if(loadCatalogue(newPath))
{
cataFound = true;
break;
}
}
if(!cataFound)
{
// If not found search within for subdirectories
std::set<std::string> dirs;
FileListAdder fileListAdder;
GetFileList(dirs, fileListAdder, ".", false, FM_DIR);
for(std::set<std::string>::iterator i = dirs.begin(); i != dirs.end(); ++i)
{
const std::string newPath = JoinPaths(*i, gameCatalogueStr);
gLogging.ftextOut("Looking at: %s<br>", newPath.c_str() );
if(loadCatalogue(newPath))
{
cataFound = true;
break;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment