TakeDamage can only give 0.5 hearts
#8
How CAN tolua work with overloaded functions?
We use the exact same method of binding the functions manually and we DO have to analyse the parameter types ourselves.

For example I see there are two cEntity::AddPosition overloads exported to tolua. They are registered like this:
Code:
tolua_function(tolua_S,"AddPosition",tolua_AllToLua_cEntity_AddPosition00);
tolua_function(tolua_S,"AddPosition",tolua_AllToLua_cEntity_AddPosition01);

No extra information has been given about the signature of the function so it cannot be handled by "tolua_function" itself. However two different function pointers are now bound to the same function name.
I do not know for sure, but I suspect the last statement just overwrites the first one, or the last one is ignored because the function is already registered.

tolua_AllToLua_cEntity_AddPosition00/01 are already specialized for their overloaded counterparts so there is no actual overloading done in there, they can only call one C++ function.

Either we're doing something wrong, or tolua does not really support overloading functions
Reply
Thanks given by:


Messages In This Thread
TakeDamage can only give 0.5 hearts - by NiLSPACE - 04-09-2013, 12:39 AM
RE: TakeDamage can only give 0.5 hearts - by xoft - 04-09-2013, 01:12 AM
RE: TakeDamage can only give 0.5 hearts - by xoft - 04-09-2013, 02:05 AM
RE: TakeDamage can only give 0.5 hearts - by xoft - 04-09-2013, 04:45 AM
RE: TakeDamage can only give 0.5 hearts - by FakeTruth - 04-09-2013, 05:37 AM
RE: TakeDamage can only give 0.5 hearts - by xoft - 04-09-2013, 06:14 AM



Users browsing this thread: 3 Guest(s)