- moved declaration of native fields into the respective class definitions.
This bypasses a declaration in the script in favor of a simpler implementation. In order to work it is always necessary to have an offset table to map the variables to, but doing it fully on the native side only requires adding the type to the declaration.
This commit is contained in:
parent
c9dad70408
commit
9563045305
9 changed files with 171 additions and 125 deletions
|
|
@ -62,6 +62,7 @@ ClassReg DObject::RegistrationInfo =
|
|||
NULL, // ParentType
|
||||
NULL, // Pointers
|
||||
&DObject::InPlaceConstructor, // ConstructNative
|
||||
&DObject::InitNativeFields,
|
||||
sizeof(DObject), // SizeOf
|
||||
CLASSREG_PClass, // MetaClassNum
|
||||
};
|
||||
|
|
@ -344,6 +345,18 @@ DObject::~DObject ()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void DObject::InitNativeFields()
|
||||
{
|
||||
auto meta = RUNTIME_CLASS(DObject);
|
||||
meta->AddNativeField("bDestroyed", TypeSInt32, myoffsetof(DObject, ObjectFlags), VARF_ReadOnly, OF_EuthanizeMe);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void DObject::Destroy ()
|
||||
{
|
||||
ObjectFlags = (ObjectFlags & ~OF_Fixed) | OF_EuthanizeMe;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue