I am trying to do a copy constructor on asOBJ_REF class. Seems the asBEHAVE_CONSTRUCT does not apply to asOBJ_REF classes.
Any ideas?
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
img2.Copy(img);
and it is fine
the
img2.Copy(@img);
would throw compile error.
I tried
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.