Skip to content

Instantly share code, notes, and snippets.

@bamboo
Created May 19, 2011 15:08
Show Gist options
  • Save bamboo/980973 to your computer and use it in GitHub Desktop.
Save bamboo/980973 to your computer and use it in GitHub Desktop.
alchemy - struct instantiation
static AS3_Val Vector3f_DefaultValue() {
static AS3_Val (*DefaultValueShim)() = NULL;
if (DefaultValueShim == NULL) {
AS3_Val UnityEngine = AS3_String("UnityEngine");
AS3_Val Vector3_class = AS3_NSGetS(UnityEngine, "Vector3");
AS3_Val DefaultValue = AS3_GetS(Vector3_class, "DefaultValue");
DefaultValueShim = AS3_Shim(DefaultValue, null, "AS3ValType", false);
AS3_Release(DefaultValue);
AS3_Release(Vector3_class);
AS3_Release(UnityEngine);
}
return DefaultValueShim();
}
static AS3_Val Vector3f_To_AS3(const Vector3f& cppValue) {
AS3_Val returnValue = Vector3f_DefaultValue();
Vector3f_To_AS3(cppValue, returnValue);
return returnValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment