Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAndreas Jonsson

Posted 07 March 2013 - 11:58 AM

I wonder if it is not the templates in the autowrappers that are playing tricks on us.

 

Can you try with a manual implementation of the wrappers?

 

 

void Wrap_UIButton_factory(asIScriptGeneric *gen)
{
   *reinterpret_cast<UIButton**>(gen->GetAddressOfReturnLocation()) = new UIButton();
}
 
void Wrap_UIButton_addReference(asIScriptGeneric *gen)
{
  reinterpret_cast<UIButton*>(gen->GetObject())->addReference();
}
 
 
void Wrap_UIButton_removeReference(asIScriptGeneric *gen)
{
  reinterpret_cast<UIButton*>(gen->GetObject())->removeReference();
}
 
engine->getASEngine()->RegisterObjectBehaviour("UIButton", asBEHAVE_FACTORY, "UIButton@ f()", asFUNCTION(Wrap_UIButton_factory), asCALL_GENERIC);
engine->getASEngine()->RegisterObjectBehaviour("UIButton", asBEHAVE_ADDREF, "void f()",  asFUNCTION(Wrap_UIButton_addReference), asCALL_GENERIC);
engine->getASEngine()->RegisterObjectBehaviour("UIButton", asBEHAVE_RELEASE, "void f()",  asFUNCTION(Wrap_UIButton_removeReference), asCALL_GENERIC);


#1Andreas Jonsson

Posted 07 March 2013 - 11:57 AM

I wonder if it is not the templates in the autowrappers that are playing tricks on us.

 

Can you try with a manual implementation of the wrappers?

 

void Wrap_UIButton_factory(asIScriptGeneric *gen)
{
   *reinterpret_cast<UIButton**>(gen->GetAddressOfReturnValue()) = new UIButton();
}
 
void Wrap_UIButton_addReference(asIScriptGeneric *gen)
{
  reinterpret_cast<UIButton*>(gen->GetObject())->addReference();
}
 
 
void Wrap_UIButton_removeReference(asIScriptGeneric *gen)
{
  reinterpret_cast<UIButton*>(gen->GetObject())->removeReference();
}
 
engine->getASEngine()->RegisterObjectBehaviour("UIButton", asBEHAVE_FACTORY, "UIButton@ f()", asFUNCTION(Wrap_UIButton_factory), asCALL_GENERIC);
engine->getASEngine()->RegisterObjectBehaviour("UIButton", asBEHAVE_ADDREF, "void f()",  asFUNCTION(Wrap_UIButton_addReference), asCALL_GENERIC);
engine->getASEngine()->RegisterObjectBehaviour("UIButton", asBEHAVE_RELEASE, "void f()",  asFUNCTION(Wrap_UIButton_removeReference), asCALL_GENERIC);


PARTNERS