I am trying to do a copy constructor on asOBJ_REF class. Seems the asBEHAVE_CONSTRUCT does not apply to asOBJ_REF classes.
I settled so far for
RegisterObjectMethod("image", "void Copy(const image &in)", asMETHOD(CByteImage,Copy), asCALL_THISCALL); assert( r >= 0 );
However my image class asBEHAVE_FACTORY is all object handles, but I seems not to be able to make the Copy accept the object handles as argument.
so I can go
and it is fine
would throw compile error.
RegisterObjectMethod("image", "void Copy(const image @&in)", asMETHOD(CByteImage,Copy), asCALL_THISCALL); assert( r >= 0 );
and while it is accepted, the runtime runs into what seems an endless loop (well it does returns after 7 sec which is probably some protection in the angelscript), so I don't think this is how I am supposed to do it.
Any help & ideas?
BTW, speeds are pretty awesome. I use it for image processing (the looping through the pixels is the main toll) and the scripted version vs native code is about 10-12x slower. So if native version would be 35ms,, the scripted version would be for example 450 ms. I think that is pretty amazing.
Edited by Oscar1, 13 May 2013 - 10:02 AM.