- fix for issue 539 . It is now possible to provide several possible paths in Res.txt, the game will use the first one that matches. If none of them works, it reverts to the oldschool "Res" folder
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-12-02 12:56:18 +00:00
parent bcca766cb6
commit 15d504c160
2 changed files with 15 additions and 3 deletions

6
projects/mtg/bin/Res.txt Normal file
View File

@@ -0,0 +1,6 @@
ms0:/PSP/wagic_res/
ms0:/wagic_res/
../../wagic_res/
../../../wagic_res/
../wagic_res/
wagic_res/

View File

@@ -94,12 +94,18 @@ void GameApp::Create()
string resPath;
if (mfile)
{
if (std::getline(mfile, resPath))
bool found = false;
while (!found && std::getline(mfile, resPath))
{
if (resPath[resPath.size() - 1] == '\r')
resPath.erase(resPath.size() - 1); //Handle DOS files
//TODO ERROR Handling if file does not exist
JFileSystem::GetInstance()->SetResourceRoot(trim(resPath));
string testfile = resPath;
testfile.append("graphics/simon.dat");
if (fileExists(testfile.c_str()))
{
JFileSystem::GetInstance()->SetResourceRoot(trim(resPath));
found = true;
}
}
mfile.close();
}