- added the ability to attach a constructor or destructor to an internally defined struct.
There are a few which require explicit native construction or destruction that need to be exported to the VM, e.g. FCheckPosition. The VM cannot handle this directly, it needs two special functions to be attached to handle such elements.
This commit is contained in:
parent
ca2ac4e4fd
commit
5ef9429ae4
10 changed files with 132 additions and 13 deletions
|
|
@ -50,6 +50,8 @@
|
|||
#include "zstring.h"
|
||||
#include "d_event.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "vm.h"
|
||||
#include "p_checkposition.h"
|
||||
|
||||
static TArray<FPropertyInfo*> properties;
|
||||
static TArray<AFuncDesc> AFTable;
|
||||
|
|
@ -856,6 +858,14 @@ void InitThingdef()
|
|||
qsort(&AFTable[0], AFTable.Size(), sizeof(AFTable[0]), funccmp);
|
||||
}
|
||||
|
||||
// Add the constructor and destructor to FCheckPosition.
|
||||
auto fcp = NewStruct("FCheckPosition", nullptr);
|
||||
fcp->mConstructor = *FindFunction(fcp, "_Constructor")->VMPointer;
|
||||
fcp->mDestructor = *FindFunction(fcp, "_Destructor")->VMPointer;
|
||||
fcp->Size = sizeof(FCheckPosition);
|
||||
fcp->Align = alignof(FCheckPosition);
|
||||
|
||||
|
||||
FieldTable.Clear();
|
||||
if (FieldTable.Size() == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue