Erwan
- 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:
6
projects/mtg/bin/Res.txt
Normal file
6
projects/mtg/bin/Res.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
ms0:/PSP/wagic_res/
|
||||
ms0:/wagic_res/
|
||||
../../wagic_res/
|
||||
../../../wagic_res/
|
||||
../wagic_res/
|
||||
wagic_res/
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user