From 218b5625bfa59594bc51d16a12392ae5dfc94223 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Mon, 2 Nov 2015 17:36:47 +0800 Subject: [PATCH] Fix can not start js project with simulator in CodeIDE --- .../runtime-src/proj.ios_mac/mac/SimulatorApp.mm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm b/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm index 67470ca27f..bc5ea77aa3 100755 --- a/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm +++ b/tools/simulator/frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm @@ -118,6 +118,7 @@ static void glfwDropFunc(GLFWwindow *window, int count, const char **files) } else { + _project.setProjectDir([path cStringUsingEncoding:NSUTF8StringEncoding]); _entryPath = [path cStringUsingEncoding:NSUTF8StringEncoding]; } @@ -214,13 +215,6 @@ static void glfwDropFunc(GLFWwindow *window, int count, const char **files) 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()->addSearchPath(solutionDir); FileUtils::getInstance()->addSearchPath(tmpConfig.getProjectDir());