Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#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