File tree Expand file tree Collapse file tree 2 files changed +41
-3
lines changed 
tools/simulator/frameworks/runtime-src Expand file tree Collapse file tree 2 files changed +41
-3
lines changed Original file line number Diff line number Diff line change @@ -205,10 +205,29 @@ - (void) parseCocosProjectConfig:(ProjectConfig*)config
205205
206206 //  set project directory as search root path
207207 FileUtils::getInstance ()->setDefaultResourceRootPath (tmpConfig.getProjectDir ());
208-  
208+  string solutionDir = tmpConfig.getProjectDir ();
209+  if  (!solutionDir.empty ())
210+  {
211+  for  (int  i = 0 ; i < solutionDir.size (); ++i)
212+  {
213+  if  (solutionDir[i] == ' \\ ' 
214+  {
215+  solutionDir[i] = ' /' 
216+  }
217+  }
218+  int  nPos = -1 ;
219+  if  (solutionDir[solutionDir.length () - 1 ] == ' /' 
220+  nPos = solutionDir.rfind (' /' length () - 2 );
221+  else 
222+  nPos = solutionDir.rfind (' /' 
223+  if  (nPos > 0 )
224+  solutionDir = solutionDir.substr (0 , nPos + 1 );
225+  FileUtils::getInstance ()->addSearchPath (solutionDir);
226+  }
227+ 
209228 //  parse config.json
210229 auto  parser = ConfigParser::getInstance ();
211-  auto  configPath = tmpConfig. getProjectDir () .append (CONFIG_FILE);
230+  auto  configPath = solutionDir .append (CONFIG_FILE);
212231 parser->readConfig (configPath);
213232
214233 //  set information
Original file line number Diff line number Diff line change @@ -720,10 +720,29 @@ void SimulatorWin::parseCocosProjectConfig(ProjectConfig &config)
720720
721721 //  set project directory as search root path
722722 FileUtils::getInstance ()->setDefaultResourceRootPath (tmpConfig.getProjectDir ().c_str ());
723+  string solutionDir = tmpConfig.getProjectDir ();
724+  if  (!solutionDir.empty ())
725+  {
726+  for  (int  i = 0 ; i < solutionDir.size (); ++i)
727+  {
728+  if  (solutionDir[i] == ' \\ ' 
729+  {
730+  solutionDir[i] = ' /' 
731+  }
732+  }
733+  int  nPos = -1 ;
734+  if  (solutionDir[solutionDir.length () - 1 ] == ' /' 
735+  nPos = solutionDir.rfind (' /' length () - 2 );
736+  else 
737+  nPos = solutionDir.rfind (' /' 
738+  if  (nPos > 0 )
739+  solutionDir = solutionDir.substr (0 , nPos + 1 );
740+  FileUtils::getInstance ()->addSearchPath (solutionDir);
741+  }
723742
724743 //  parse config.json
725744 auto  parser = ConfigParser::getInstance ();
726-  auto  configPath = tmpConfig. getProjectDir () .append (CONFIG_FILE);
745+  auto  configPath = solutionDir .append (CONFIG_FILE);
727746 parser->readConfig (configPath);
728747
729748 //  set information
                         You can’t perform that action at this time. 
           
                  
0 commit comments