merge from the cocos2d-x