diff --git a/templates/lua-template-runtime/.settings/version.json b/templates/lua-template-runtime/.settings/version.json index f6683a7df6..0369027256 100644 --- a/templates/lua-template-runtime/.settings/version.json +++ b/templates/lua-template-runtime/.settings/version.json @@ -1,4 +1,4 @@ { - "templateVersion":"1.6", - "runtimeVersion":"1.6" -} \ No newline at end of file + "templateVersion":"1.8", + "runtimeVersion":"1.8" +} diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp index 56300c969c..d7d2dd95a3 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/runtime/Runtime.cpp @@ -94,7 +94,7 @@ std::string& replaceAll(std::string& str, const std::string& old_value, const st const char* getRuntimeVersion() { - return "1.7"; + return "1.8"; } int lua_cocos2dx_runtime_addSearchPath(lua_State* tolua_S) @@ -115,7 +115,7 @@ int lua_cocos2dx_runtime_addSearchPath(lua_State* tolua_S) cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_addSearchPath'", nullptr); return 0; @@ -123,7 +123,7 @@ int lua_cocos2dx_runtime_addSearchPath(lua_State* tolua_S) #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1 || argc == 2) + if (argc == 1 || argc == 2) { std::string arg0; bool arg1 = false; @@ -148,7 +148,7 @@ int lua_cocos2dx_runtime_addSearchPath(lua_State* tolua_S) { cobj->addSearchPath(arg0, arg1); } - + #if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) // add project path to search path cobj->addSearchPath(g_projectPath + arg0, arg1); @@ -185,7 +185,7 @@ int lua_cocos2dx_runtime_setSearchPaths(lua_State* tolua_S) cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_runtime_setSearchPaths'", nullptr); return 0; @@ -193,7 +193,7 @@ int lua_cocos2dx_runtime_setSearchPaths(lua_State* tolua_S) #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) + if (argc == 1) { std::vector vecPaths, writePaths; @@ -211,7 +211,7 @@ int lua_cocos2dx_runtime_setSearchPaths(lua_State* tolua_S) writePaths.push_back(FileServer::getShareInstance()->getWritePath() + vecPaths[i]); } } - + #if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) vecPaths.insert(vecPaths.end(), projPath.begin(), projPath.end()); #endif @@ -222,7 +222,7 @@ int lua_cocos2dx_runtime_setSearchPaths(lua_State* tolua_S) { vecPaths.insert(vecPaths.end(), originPath.begin(), originPath.end()); } - + cobj->setSearchPaths(vecPaths); return 0; } @@ -252,7 +252,7 @@ void initRuntime(const std::string& workPath) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) vector searchPathArray = FileUtils::getInstance()->getSearchPaths(); - + if (workPath.empty()) { extern std::string getCurAppPath(); @@ -269,10 +269,10 @@ void initRuntime(const std::string& workPath) { g_projectPath = workPath; } - + // add project's root directory to search path searchPathArray.insert(searchPathArray.begin(), g_projectPath); - + // add writable path to search path searchPathArray.insert(searchPathArray.begin(), FileServer::getShareInstance()->getWritePath()); FileUtils::getInstance()->setSearchPaths(searchPathArray); @@ -330,4 +330,4 @@ void resetDesignResolution() { cocos2d::Size size = ConfigParser::getInstance()->getInitViewSize(); Director::getInstance()->getOpenGLView()->setDesignResolutionSize(size.width, size.height, ResolutionPolicy::EXACT_FIT); -} \ No newline at end of file +} diff --git a/templates/lua-template-runtime/runtime/config.json b/templates/lua-template-runtime/runtime/config.json index b64a3dbbfa..6c926c8cb7 100644 --- a/templates/lua-template-runtime/runtime/config.json +++ b/templates/lua-template-runtime/runtime/config.json @@ -1,5 +1,5 @@ { - "version":"v3-lua-runtime-1.7", + "version":"v3-lua-runtime-1.8", "zip_file_size":"39063553", "repo_name":"cocos-runtime-bin", "repo_parent":"https://github.com/chukong/"