diff --git a/projects/mtg/bin/Res.txt b/projects/mtg/bin/Res.txt new file mode 100644 index 000000000..af6beddc8 --- /dev/null +++ b/projects/mtg/bin/Res.txt @@ -0,0 +1,6 @@ +ms0:/PSP/wagic_res/ +ms0:/wagic_res/ +../../wagic_res/ +../../../wagic_res/ +../wagic_res/ +wagic_res/ diff --git a/projects/mtg/src/GameApp.cpp b/projects/mtg/src/GameApp.cpp index 53d40055a..7bf04814d 100644 --- a/projects/mtg/src/GameApp.cpp +++ b/projects/mtg/src/GameApp.cpp @@ -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(); }