error C2440: ''type cast'' : cannot convert from ''void (__thiscall Door::*)(int)'' to ''void (__thiscall asCDummy::*)(void)'' Pointers to members have different representations; cannot cast between themThe same goes for if Scriptable inherits from Object, and Door inherits from Scriptable. However, if Door just inherits from Object, all is well, it compiles fine. Is this a limitation in angelscript or c++? or am I just going about it incorrectly? and is there a way around it, without having to redesign all my classes?
Multiple Inheritance Problem,
Members - Reputation: 122
Posted 08 April 2004 - 03:02 AM
Moderators - Reputation: 4402
Posted 08 April 2004 - 09:00 AM
AngelScript doesn''t support virtual methods yet, and even if it did you would probably have trouble with the multiple inheritance, as it requires yet another step when calling the methods.
I''m afraid that at the moment your best choice is to write proxy functions that will be able to figure out the correct way of calling the object methods. Example:
void Door_DoSomething(Door *door)
engine->RegisterObjectMethod("door", "void DoSomething()", asFUNCTION(Door_DoSomething), asCALL_CDECL_OBJLAST);
The other solution would be to redesign your classes, so that they don''t use virtual methods.
In the future I''m hoping to have support for virtual functions in AngelScript, but I think I will not be able to find a good solution for multiple inheritance because each compiler does it a different way.
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game