From 87d60cd79e6161ad081c181df07adeec0b81042c Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew" Date: Sun, 21 Aug 2011 10:04:38 +0000 Subject: [PATCH] - Improper GetfileInstance calls were preventing from correctly initializing the JGEFileSystem (Todo: init earlier, prevent from calling GetfileInstance if not initialized ?) - fixed a problem with the test suite --- JGE/src/JFileSystem.cpp | 3 +++ JGE/src/JGE.cpp | 4 ++-- projects/mtg/bin/Res.txt | 8 +------- projects/mtg/src/TestSuiteAI.cpp | 1 + 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/JGE/src/JFileSystem.cpp b/JGE/src/JFileSystem.cpp index d1e934220..1b4f0680d 100644 --- a/JGE/src/JFileSystem.cpp +++ b/JGE/src/JFileSystem.cpp @@ -112,6 +112,9 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath) bool found = false; while (!found && std::getline(mfile, resPath)) { + if (!resPath.size()) + continue; + if (resPath[resPath.size() - 1] == '\r') resPath.erase(resPath.size() - 1); //Handle DOS files string testfile = resPath; diff --git a/JGE/src/JGE.cpp b/JGE/src/JGE.cpp index 5aabbaefe..c035d6d8c 100644 --- a/JGE/src/JGE.cpp +++ b/JGE/src/JGE.cpp @@ -348,7 +348,7 @@ void JGE::Init() sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG); JRenderer::GetInstance(); - JFileSystem::GetInstance(); + //JFileSystem::GetInstance(); Lazy loading //JSoundSystem::GetInstance(); let's do lazy loading mDone = false; @@ -442,7 +442,7 @@ void JGE::Init() mPaused = false; mCriticalAssert = false; JRenderer::GetInstance(); - JFileSystem::GetInstance(); + //JFileSystem::GetInstance(); Lazy loading JSoundSystem::GetInstance(); LeftClickedProcessed(); } diff --git a/projects/mtg/bin/Res.txt b/projects/mtg/bin/Res.txt index 74d0b00d2..d3f5a12fa 100644 --- a/projects/mtg/bin/Res.txt +++ b/projects/mtg/bin/Res.txt @@ -1,7 +1 @@ -./Res/ -ms0:/PSP/wagic_res/ -ms0:/wagic_res/ -../../wagic_res/ -../../../wagic_res/ -../wagic_res/ -wagic_res/ + diff --git a/projects/mtg/src/TestSuiteAI.cpp b/projects/mtg/src/TestSuiteAI.cpp index fb708aeb1..161df92b4 100644 --- a/projects/mtg/src/TestSuiteAI.cpp +++ b/projects/mtg/src/TestSuiteAI.cpp @@ -681,6 +681,7 @@ int TestSuite::load(const char * _filename) { if (!s.size()) continue; if (s[s.size() - 1] == '\r') s.erase(s.size() - 1); //Handle DOS files + if (!s.size()) continue; if (s[0] == '#') continue; std::transform(s.begin(), s.end(), s.begin(), ::tolower); if (s.compare("summoningsickness") == 0)