-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GUIReader::registerTypeAndCallBack for std::function and add CustomGUIReader for lua #7744
Conversation
fix compile error
[ci rebuild] |
2 similar comments
[ci rebuild] |
[ci rebuild] |
i can build success. why not there? |
It seems the error exist in lua-binding. |
@minggo ? |
@minggo i don't know. |
The error log is http://115.28.134.83:8000/job/cocos-2dx-pull-request-build/4682/node=android_mac/console. |
I have asked @samuele3hu to take a look. |
It's a bug of bindings-generator,it didn't consider the value of |
What did you mean |
En,I will check out this branch and modify it. |
@lite3 |
@@ -85,8 +90,8 @@ class CC_STUDIO_DLL GUIReader : public cocos2d::Ref | |||
ParseObjectMap _mapObject; | |||
|
|||
public: | |||
ParseCallBackMap getParseCallBackMap() { return _mapParseSelector; }; | |||
ParseObjectMap getParseObjectMap() { return _mapObject; }; | |||
ParseCallBackMap* getParseCallBackMap() { return &_mapParseSelector; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @lite3
Why should we change std::map from value to reference?
I think c++11 std::map has move semantic , it won't introduce extra copy performance penalty here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto map = reader->getParseCallBackMap();
- this map is copy, reader->_mapParseSelector. can not modify.
- move semantic used by temporary object. but the temporary map need malloc.
…into customguireader
@minggo the same problem at build failed. |
@lite3 , I check out your branch,and use the latest bindings-generator for cocos2dx_studio.ini, the result is successful.Why did you modify the bindings-generator. |
for bindings-generator, I write it at cocos2d/bindings-generator#131 now, i write it again. old regex: input string is |
@minggo please review |
Ok, i have asked @samuele3hu to review lua-binding codes. |
GUIReader::registerTypeAndCallBack for std::function and add CustomGUIReader for lua
GUIReader::registerTypeAndCallBack for std::function and add CustomGUIReader for lua
No description provided.