mirror of https://github.com/axmolengine/axmol.git
update runtime version
This commit is contained in:
parent
5982a4ec90
commit
3077e294b7
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"templateVersion":"1.6",
|
||||
"runtimeVersion":"1.6"
|
||||
}
|
||||
"templateVersion":"1.8",
|
||||
"runtimeVersion":"1.8"
|
||||
}
|
||||
|
|
|
@ -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<std::string> 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<std::string> 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue