sync with upstream (cocos2d/cocos2d-x)