Test on a few methods/classes

This commit is contained in:
Leonard2 2016-11-07 00:30:26 +01:00
parent 26dc0c6df2
commit fb2a843c03
6 changed files with 41 additions and 3 deletions

View File

@ -1419,6 +1419,10 @@ public:
};
VMEXPORT_NATIVES_START(AActor, DThinker)
VMEXPORT_NATIVES_FUNC(DropInventory)
VMEXPORT_NATIVES_END(AActor)
class FActorIterator
{
public:

View File

@ -608,6 +608,8 @@ protected:
}
};
class AInventory;//
template<class T>
class DVMObject : public T
{
@ -638,6 +640,23 @@ private:
{
new((EInPlace *)mem) DVMObject<T>;
}
public:
void Destroy()
{
Printf("Destroy\n");
ExportedNatives<T>::Get()->Destroy<void, T>(this);
}
void Tick()
{
Printf("Tick\n");
ExportedNatives<T>::Get()->Tick<void, T>(this);
}
AInventory *DropInventory(AInventory *item)
{
Printf("DropInventory\n");
return ExportedNatives<T>::Get()->DropInventory<AInventory *, T>(this, item);
}
};
template<class T>
@ -655,6 +674,17 @@ ClassReg DVMObject<T>::RegistrationInfo =
};
template<class T> _DECLARE_TI(DVMObject<T>)
//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.

View File

@ -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;

View File

@ -108,6 +108,10 @@ private:
DThinker *NextThinker, *PrevThinker;
};
VMEXPORT_NATIVES_START(DThinker, DObject)
VMEXPORT_NATIVES_FUNC(Tick)
VMEXPORT_NATIVES_END(DThinker)
class FThinkerIterator
{
protected:

View File

@ -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)

View File

@ -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)