diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.cpp b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.cpp index 5a91d00b2f..9b07cc7b96 100644 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.cpp +++ b/templates/lua-template-default/frameworks/runtime-src/Classes/ide-support/RuntimeLuaImpl.cpp @@ -296,6 +296,7 @@ void RuntimeLuaImpl::startScript(const std::string& strDebugArg) const ProjectConfig &project = RuntimeEngine::getInstance()->getProjectConfig(); // set search path + stack->addSearchPath(project.getProjectDir().c_str()); string path = FileUtils::getInstance()->fullPathForFilename(project.getScriptFileRealPath().c_str()); size_t pos; while ((pos = path.find_first_of("\\")) != std::string::npos) diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp index 271679cf1b..fff9f825a6 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp +++ b/templates/lua-template-default/frameworks/runtime-src/proj.android/jni/hellolua/main.cpp @@ -4,6 +4,7 @@ #include #include #include "ide-support/SimpleConfigParser.h" +#include "ide-support/CodeIDESupport.h" #define LOG_TAG "main" #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) @@ -24,7 +25,7 @@ extern "C" bool Java_org_cocos2dx_lua_AppActivity_nativeIsDebug(JNIEnv *env, jobject thisz) { -#if COCOS2D_DEBUG > 0 +#if (COCOS2D_DEBUG > 0) && (CC_CODE_IDE_DEBUG_SUPPORT > 0) return true; #else return false; diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.win32/build-cfg.json b/templates/lua-template-default/frameworks/runtime-src/proj.win32/build-cfg.json index 3182771c29..07c6788bbf 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.win32/build-cfg.json +++ b/templates/lua-template-default/frameworks/runtime-src/proj.win32/build-cfg.json @@ -11,6 +11,10 @@ { "from": "../../../config.json", "to": "" + }, + { + "from": "../Classes/ide-support/lang", + "to": "" } ], "must_copy_resources": [ diff --git a/templates/lua-template-runtime/.project b/templates/lua-template-runtime/.project new file mode 100644 index 0000000000..960dbfb595 --- /dev/null +++ b/templates/lua-template-runtime/.project @@ -0,0 +1,13 @@ + + + HelloLua + + + + + + + org.ccdt.cocosproject + org.eclipse.koneki.ldt.nature + + diff --git a/templates/lua-template-runtime/.settings/version.json b/templates/lua-template-runtime/.settings/version.json new file mode 100644 index 0000000000..2fbe762c1d --- /dev/null +++ b/templates/lua-template-runtime/.settings/version.json @@ -0,0 +1,4 @@ +{ + "templateVersion":"2.0", + "runtimeVersion":"2.0" +} \ No newline at end of file diff --git a/templates/lua-template-runtime/cocos-project-template.json b/templates/lua-template-runtime/cocos-project-template.json new file mode 100644 index 0000000000..fa03afca47 --- /dev/null +++ b/templates/lua-template-runtime/cocos-project-template.json @@ -0,0 +1,189 @@ +{ + "do_default": { + "exclude_from_template": [ + "frameworks/runtime-src", + "runtime/config.json", + "runtime/version.json" + ], + "project_replace_project_name": { + "src_project_name": "HelloLua", + "files": [ + "config.json", + ".project" + ] + }, + "append_dir": [ + { + "from": "cocos/scripting/lua-bindings/script", + "to": "src/cocos", + "exclude": [] + }, + { + "from": "templates/lua-template-default/src", + "to": "src", + "exclude": [] + }, + { + "from": "templates/lua-template-default/res", + "to": "res", + "exclude": [] + }, + { + "from": "external/win32-specific/gles/prebuilt", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/win32-specific/icon/prebuilt", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/win32-specific/MP3Decoder/prebuilt", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/win32-specific/OggDecoder/prebuilt", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/win32-specific/OpenalSoft/prebuilt", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/win32-specific/zlib/prebuilt", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/curl/prebuilt/win32", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/lua/luajit/prebuilt/win32", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/websockets/prebuilt/win32", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/sqlite3/libraries/win32", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + }, + { + "from": "external/tiff/prebuilt/win32", + "to": "runtime/win32", + "include": [ + "*.dll" + ] + } + + ] + }, + "do_add_native_support": { + "append_from_template": { + "from": "../lua-template-default/frameworks/runtime-src", + "to": "frameworks/runtime-src", + "exclude": [ + "proj.android/bin", + "proj.android/assets", + "proj.android/libs", + "proj.ios_mac/HelloLua.xcodeproj/project.xcworkspace", + "proj.ios_mac/HelloLua.xcodeproj/xcuserdata", + "proj.win32/Debug.win32", + "proj.win32/Release.win32", + "proj.win32/HelloLua.sdf" + ] + }, + "append_x_engine": { + "from": ".", + "to": "frameworks/cocos2d-x" + }, + "append_dir": [ + { + "from": "tools/simulator/libsimulator", + "to": "frameworks/cocos2d-x/tools/simulator/libsimulator", + "exclude": [ + "proj.win32/Debug", + "proj.win32/Release" + ] + } + ], + "project_rename": { + "src_project_name": "HelloLua", + "files": [ + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj" + ] + }, + "project_replace_project_name": { + "src_project_name": "HelloLua", + "files": [ + "config.json", + ".project", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", + "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", + "frameworks/runtime-src/proj.win32/main.cpp", + "frameworks/runtime-src/proj.android/.project", + "frameworks/runtime-src/proj.android/AndroidManifest.xml", + "frameworks/runtime-src/proj.android/build.xml", + "frameworks/runtime-src/proj.android/res/values/strings.xml", + "frameworks/runtime-src/proj.ios_mac/ios/main.m", + "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", + "frameworks/runtime-src/proj.ios_mac/mac/SimulatorApp.mm", + "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj" + ] + }, + "project_replace_package_name": { + "src_package_name": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.android/AndroidManifest.xml" + ] + }, + "project_replace_mac_bundleid": { + "src_bundle_id": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid": { + "src_bundle_id": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.ios_mac/ios/Info.plist" + ] + } + } +} diff --git a/templates/lua-template-runtime/config.json b/templates/lua-template-runtime/config.json new file mode 100644 index 0000000000..d50247cdda --- /dev/null +++ b/templates/lua-template-runtime/config.json @@ -0,0 +1,59 @@ +{ + "init_cfg":{ + "isLandscape": true, + "isWindowTop": false, + "name": "HelloLua", + "width": 960, + "height": 640, + "entry": "src/main.lua", + "consolePort": 6010, + "uploadPort": 6020 + }, + "simulator_screen_size": [ + { + "title": "iPhone 3Gs (480x320)", + "width": 480, + "height": 320 + }, + { + "title": "iPhone 4 (960x640)", + "width": 960, + "height": 640 + }, + { + "title": "iPhone 5 (1136x640)", + "width": 1136, + "height": 640 + }, + { + "title": "iPad (1024x768)", + "width": 1024, + "height": 768 + }, + { + "title": "iPad Retina (2048x1536)", + "width": 2048, + "height": 1536 + }, + { + "title": "Android (800x480)", + "width": 800, + "height": 480 + }, + { + "title": "Android (854x480)", + "width": 854, + "height": 480 + }, + { + "title": "Android (1280x720)", + "width": 1280, + "height": 720 + }, + { + "title": "Android (1920x1080)", + "width": 1920, + "height": 1080 + } + ] +} diff --git a/tools/simulator/libsimulator/lib/runtime/Runtime.cpp b/tools/simulator/libsimulator/lib/runtime/Runtime.cpp index a06fbc61f7..b21627b2a3 100644 --- a/tools/simulator/libsimulator/lib/runtime/Runtime.cpp +++ b/tools/simulator/libsimulator/lib/runtime/Runtime.cpp @@ -253,7 +253,7 @@ void RuntimeEngine::start() if (_project.getDebuggerType() == kCCRuntimeDebuggerNone) { setupRuntime(); - startScript(_project.getScriptFileRealPath()); + startScript(""); } else {