Merge pull request #10564 from SunLightJuly/v3_fix

support packages manager
This commit is contained in:
minggo 2015-02-25 09:56:49 +08:00
commit 0e303536f7
2 changed files with 17 additions and 2 deletions

View File

@ -22,6 +22,13 @@ void AppDelegate::initGLContextAttrs()
GLView::setGLContextAttrs(glContextAttrs); GLView::setGLContextAttrs(glContextAttrs);
} }
// If you want to use packages manager to install more packages,
// don't modify or remove this function
static int register_all_packages()
{
return 0; //flag for packages manager
}
bool AppDelegate::applicationDidFinishLaunching() { bool AppDelegate::applicationDidFinishLaunching() {
// initialize director // initialize director
auto director = Director::getInstance(); auto director = Director::getInstance();
@ -37,6 +44,8 @@ bool AppDelegate::applicationDidFinishLaunching() {
// set FPS. the default value is 1.0/60 if you don't call this // set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60); director->setAnimationInterval(1.0 / 60);
register_all_packages();
// create a scene. it's an autorelease object // create a scene. it's an autorelease object
auto scene = HelloWorld::createScene(); auto scene = HelloWorld::createScene();

View File

@ -43,6 +43,13 @@ void AppDelegate::initGLContextAttrs()
GLView::setGLContextAttrs(glContextAttrs); GLView::setGLContextAttrs(glContextAttrs);
} }
// If you want to use packages manager to install more packages,
// don't modify or remove this function
static int register_all_packages()
{
return 0; //flag for packages manager
}
bool AppDelegate::applicationDidFinishLaunching() bool AppDelegate::applicationDidFinishLaunching()
{ {
// set default FPS // set default FPS
@ -54,8 +61,7 @@ bool AppDelegate::applicationDidFinishLaunching()
lua_State* L = engine->getLuaStack()->getLuaState(); lua_State* L = engine->getLuaStack()->getLuaState();
lua_module_register(L); lua_module_register(L);
// If you want to use Quick-Cocos2d-X, please uncomment below code register_all_packages();
// register_all_quick_manual(L);
LuaStack* stack = engine->getLuaStack(); LuaStack* stack = engine->getLuaStack();
stack->setXXTEAKeyAndSign("2dxLua", strlen("2dxLua"), "XXTEA", strlen("XXTEA")); stack->setXXTEAKeyAndSign("2dxLua", strlen("2dxLua"), "XXTEA", strlen("XXTEA"));