Merge pull request #14295 from xiaofeng11/v3_xf

Fix CodeIDE  can not start js project with simulator
This commit is contained in:
pandamicro 2015-11-03 17:37:01 +08:00
commit 0dabb4cfb7
1 changed files with 1 additions and 7 deletions

View File

@ -118,6 +118,7 @@ static void glfwDropFunc(GLFWwindow *window, int count, const char **files)
} }
else else
{ {
_project.setProjectDir([path cStringUsingEncoding:NSUTF8StringEncoding]);
_entryPath = [path cStringUsingEncoding:NSUTF8StringEncoding]; _entryPath = [path cStringUsingEncoding:NSUTF8StringEncoding];
} }
@ -214,13 +215,6 @@ static void glfwDropFunc(GLFWwindow *window, int count, const char **files)
solutionDir[i] = '/'; solutionDir[i] = '/';
} }
} }
int nPos = -1;
if (solutionDir[solutionDir.length() - 1] == '/')
nPos = solutionDir.rfind('/', solutionDir.length() - 2);
else
nPos = solutionDir.rfind('/');
if (nPos > 0)
solutionDir = solutionDir.substr(0, nPos + 1);
FileUtils::getInstance()->setDefaultResourceRootPath(solutionDir); FileUtils::getInstance()->setDefaultResourceRootPath(solutionDir);
FileUtils::getInstance()->addSearchPath(solutionDir); FileUtils::getInstance()->addSearchPath(solutionDir);
FileUtils::getInstance()->addSearchPath(tmpConfig.getProjectDir()); FileUtils::getInstance()->addSearchPath(tmpConfig.getProjectDir());