I defined the pkg file with
…
void registerFunctionOnClick(LUA_FUNCTION fun);
…
but in the generated cpp, it shows
…
LUA_FUNCTION funcID = * ((LUA_FUNCTION*) tolua_tousertype(tolua_S,2,0));
…
not what I want it to be
LUA_FUNCTION funcID funcID = ( toluafix_ref_function(tolua_S,2,0) );
The file is located in tools\tolua**.php
If you read it, it might become apparent to you it just replaces some strings in the .cpp file that it generates with tolua**. For example: *((LUA_FUNCTION*) is replaced by (
You might want to do the same thing, at the very least you have to be aware that the output that tolua++ generates is not perfect, so you will have to tweak it a bit before things like passing function handlers from lua becomes possible.
No problem.
>
The file is located in tools oluauild.php
If you read it, it might become apparent to you it just replaces some strings in the .cpp file that it generates with tolua. For example: *((LUA_FUNCTION*) is replaced by (
>
You might want to do the same thing, at the very least you have to be aware that the output that tolua*+ generates is not perfect, so you will have to tweak it a bit before things like passing function handlers from lua becomes possible.
yes, yes, I think I konw what you mean.
But I still don’t konw how to executive build.php to replace what I want.
It reads in build.php:
HOW TO USE:
$cd cocos2d-x/tools/tolua*+
$ php build.php