From 2f3270fa0baf9b043ee71f05c7657b5b4c7fc478 Mon Sep 17 00:00:00 2001 From: yinjimmy Date: Fri, 9 Jan 2015 12:32:54 +0800 Subject: [PATCH] Fix: can not load Lua project with command `cocos run -p mac -m release` --- .../runtime-src/Classes/AppDelegate.cpp | 31 ++++++------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp index 9450522f13..30d69c3a95 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -54,7 +54,7 @@ void AppDelegate::initGLContextAttrs() bool AppDelegate::applicationDidFinishLaunching() { // -#if ((CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_CODE_IDE_DEBUG_SUPPORT > 0)) +#if ((CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) && (COCOS2D_DEBUG > 0)) _project.setDebuggerType(kCCRuntimeDebuggerCodeIDE); #endif @@ -188,25 +188,18 @@ void StartupCall::startup() } updateConfigParser(project); - if (FileUtils::getInstance()->isFileExist(path)) + updatePreviewFuncForPath(path); + + // launch + if (project.getDebuggerType() == kCCRuntimeDebuggerNone) { - updatePreviewFuncForPath(path); - - // launch - if (project.getDebuggerType() == kCCRuntimeDebuggerNone) - { - _previewFunc(path); - } - else - { - // NOTE:Please don't remove this call if you want to debug with Cocos Code IDE - initRuntime(project.getProjectDir()); - startRuntime(); - } + _previewFunc(path); } else { - CCLOG("[ERROR]: %s is not exist.", path.c_str()); + // NOTE:Please don't remove this call if you want to debug with Cocos Code IDE + initRuntime(project.getProjectDir()); + startRuntime(); } // track start event @@ -358,12 +351,6 @@ void StartupCall::updatePreviewFuncForPath(const std::string &path) // set loader _previewFunc = [](const std::string &path) { CCLOG("[WARNING]: unsupport %s", path.c_str()); }; - if (!FileUtils::getInstance()->isFileExist(path)) - { - CCLOG("[ERROR]: %s is not exist.", path.c_str()); - return ; - } - if (endWithString(path, ".lua")) { _launchEvent = "lua";