From fb2a843c031b0e2d36ad4043b9f412dda826ec99 Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Mon, 7 Nov 2016 00:30:26 +0100 Subject: [PATCH] Test on a few methods/classes --- src/actor.h | 4 ++++ src/dobject.h | 30 ++++++++++++++++++++++++++++++ src/dthinker.cpp | 2 +- src/dthinker.h | 4 ++++ src/p_mobj.cpp | 2 +- src/p_user.cpp | 2 +- 6 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/actor.h b/src/actor.h index 833cd2c0a..6f5ba46a3 100644 --- a/src/actor.h +++ b/src/actor.h @@ -1419,6 +1419,10 @@ public: }; +VMEXPORT_NATIVES_START(AActor, DThinker) + VMEXPORT_NATIVES_FUNC(DropInventory) +VMEXPORT_NATIVES_END(AActor) + class FActorIterator { public: diff --git a/src/dobject.h b/src/dobject.h index 24ba4997c..183d17dd2 100644 --- a/src/dobject.h +++ b/src/dobject.h @@ -608,6 +608,8 @@ protected: } }; +class AInventory;// + template class DVMObject : public T { @@ -638,6 +640,23 @@ private: { new((EInPlace *)mem) DVMObject; } + +public: + void Destroy() + { + Printf("Destroy\n"); + ExportedNatives::Get()->Destroy(this); + } + void Tick() + { + Printf("Tick\n"); + ExportedNatives::Get()->Tick(this); + } + AInventory *DropInventory(AInventory *item) + { + Printf("DropInventory\n"); + return ExportedNatives::Get()->DropInventory(this, item); + } }; template @@ -655,6 +674,17 @@ ClassReg DVMObject::RegistrationInfo = }; template _DECLARE_TI(DVMObject) +//Initial list +VMEXPORTED_NATIVES_START + VMEXPORTED_NATIVES_FUNC(Destroy) + VMEXPORTED_NATIVES_FUNC(Tick) + VMEXPORTED_NATIVES_FUNC(DropInventory) +VMEXPORTED_NATIVES_END + +VMEXPORT_NATIVES_START(DObject, void) + VMEXPORT_NATIVES_FUNC(Destroy) +VMEXPORT_NATIVES_END(DObject) + // When you write to a pointer to an Object, you must call this for // proper bookkeeping in case the Object holding this pointer has // already been processed by the GC. diff --git a/src/dthinker.cpp b/src/dthinker.cpp index 9c87c46b4..912b5642e 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -47,7 +47,7 @@ extern cycle_t BotSupportCycles; extern cycle_t ActionCycles; extern int BotWTG; -IMPLEMENT_CLASS(DThinker, false, false, false, false) +IMPLEMENT_CLASS(DThinker, false, false, false, true) DThinker *NextToThink; diff --git a/src/dthinker.h b/src/dthinker.h index 95985c2fb..e1020544c 100644 --- a/src/dthinker.h +++ b/src/dthinker.h @@ -108,6 +108,10 @@ private: DThinker *NextThinker, *PrevThinker; }; +VMEXPORT_NATIVES_START(DThinker, DObject) + VMEXPORT_NATIVES_FUNC(Tick) +VMEXPORT_NATIVES_END(DThinker) + class FThinkerIterator { protected: diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 0fb8794cf..7c973351f 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -131,7 +131,7 @@ CVAR (Int, cl_bloodtype, 0, CVAR_ARCHIVE); // CODE -------------------------------------------------------------------- -IMPLEMENT_CLASS(AActor, false, true, true, false) +IMPLEMENT_CLASS(AActor, false, true, true, true) IMPLEMENT_POINTERS_START(AActor) IMPLEMENT_POINTER(target) diff --git a/src/p_user.cpp b/src/p_user.cpp index 0b7d9c354..f4e52ac2f 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -622,7 +622,7 @@ void player_t::SendPitchLimits() const // //=========================================================================== -IMPLEMENT_CLASS(APlayerPawn, false, true, false, false) +IMPLEMENT_CLASS(APlayerPawn, false, true, false, true) IMPLEMENT_POINTERS_START(APlayerPawn) IMPLEMENT_POINTER(InvFirst)