Separate the pointer list from the implement macro

This commit is contained in:
Leonard2 2016-11-05 17:08:54 +01:00
parent 701ffb868b
commit 0b3585c83f
39 changed files with 341 additions and 228 deletions

View file

@ -16,13 +16,15 @@
#include "d_player.h" #include "d_player.h"
IMPLEMENT_POINTY_CLASS(DBot) IMPLEMENT_POINTY_CLASS(DBot)
DECLARE_POINTER(dest)
DECLARE_POINTER(prev) IMPLEMENT_POINTERS_START(DBot)
DECLARE_POINTER(enemy) IMPLEMENT_POINTER(dest)
DECLARE_POINTER(missile) IMPLEMENT_POINTER(prev)
DECLARE_POINTER(mate) IMPLEMENT_POINTER(enemy)
DECLARE_POINTER(last_mate) IMPLEMENT_POINTER(missile)
END_POINTERS IMPLEMENT_POINTER(mate)
IMPLEMENT_POINTER(last_mate)
IMPLEMENT_POINTERS_END
DBot::DBot () DBot::DBot ()
: DThinker(STAT_BOT) : DThinker(STAT_BOT)

View file

@ -231,9 +231,11 @@ DehInfo deh =
// from the original actor's defaults. The original actor is then changed to // from the original actor's defaults. The original actor is then changed to
// spawn the new class. // spawn the new class.
IMPLEMENT_POINTY_CLASS (ADehackedPickup) IMPLEMENT_POINTY_CLASS(ADehackedPickup)
DECLARE_POINTER (RealPickup)
END_POINTERS IMPLEMENT_POINTERS_START(ADehackedPickup)
IMPLEMENT_POINTER(RealPickup)
IMPLEMENT_POINTERS_END
TArray<PClassActor *> TouchedActors; TArray<PClassActor *> TouchedActors;

View file

@ -119,9 +119,11 @@ protected:
DDecalThinker () : DThinker (STAT_DECALTHINKER) {} DDecalThinker () : DThinker (STAT_DECALTHINKER) {}
}; };
IMPLEMENT_POINTY_CLASS (DDecalThinker) IMPLEMENT_POINTY_CLASS(DDecalThinker)
DECLARE_POINTER (TheDecal)
END_POINTERS IMPLEMENT_POINTERS_START(DDecalThinker)
IMPLEMENT_POINTER(TheDecal)
IMPLEMENT_POINTERS_END
void DDecalThinker::Serialize(FSerializer &arc) void DDecalThinker::Serialize(FSerializer &arc)
{ {

View file

@ -151,11 +151,6 @@ protected: \
#define HAS_FIELDS \ #define HAS_FIELDS \
static void InitNativeFields(); static void InitNativeFields();
// Taking the address of a field in an object at address 1 instead of
// address 0 keeps GCC from complaining about possible misuse of offsetof.
#define DECLARE_POINTER(field) (size_t)&((ThisClass*)1)->field - 1,
#define END_POINTERS ~(size_t)0 };
#if defined(_MSC_VER) #if defined(_MSC_VER)
# pragma section(".creg$u",read) # pragma section(".creg$u",read)
# define _DECLARE_TI(cls) __declspec(allocate(".creg$u")) ClassReg * const cls::RegistrationInfoPtr = &cls::RegistrationInfo; # define _DECLARE_TI(cls) __declspec(allocate(".creg$u")) ClassReg * const cls::RegistrationInfoPtr = &cls::RegistrationInfo;
@ -182,12 +177,10 @@ protected: \
#define IMPLEMENT_POINTY_CLASS(cls) \ #define IMPLEMENT_POINTY_CLASS(cls) \
_IMP_CREATE_OBJ(cls) \ _IMP_CREATE_OBJ(cls) \
_IMP_PCLASS(cls,cls::PointerOffsets,cls::InPlaceConstructor, nullptr) \ _IMP_PCLASS(cls,cls::PointerOffsets,cls::InPlaceConstructor, nullptr) \
const size_t cls::PointerOffsets[] = {
#define IMPLEMENT_POINTY_CLASS_WITH_FIELDS(cls) \ #define IMPLEMENT_POINTY_CLASS_WITH_FIELDS(cls) \
_IMP_CREATE_OBJ(cls) \ _IMP_CREATE_OBJ(cls) \
_IMP_PCLASS(cls,cls::PointerOffsets,cls::InPlaceConstructor, cls::InitNativeFields) \ _IMP_PCLASS(cls,cls::PointerOffsets,cls::InPlaceConstructor, cls::InitNativeFields) \
const size_t cls::PointerOffsets[] = {
#define IMPLEMENT_CLASS(cls) \ #define IMPLEMENT_CLASS(cls) \
_IMP_CREATE_OBJ(cls) \ _IMP_CREATE_OBJ(cls) \
@ -202,7 +195,12 @@ protected: \
#define IMPLEMENT_ABSTRACT_POINTY_CLASS(cls) \ #define IMPLEMENT_ABSTRACT_POINTY_CLASS(cls) \
_IMP_PCLASS(cls,cls::PointerOffsets,nullptr,nullptr) \ _IMP_PCLASS(cls,cls::PointerOffsets,nullptr,nullptr) \
const size_t cls::PointerOffsets[] = {
// Taking the address of a field in an object at address 1 instead of
// address 0 keeps GCC from complaining about possible misuse of offsetof.
#define IMPLEMENT_POINTERS_START(cls) const size_t cls::PointerOffsets[] = {
#define IMPLEMENT_POINTER(field) (size_t)&((ThisClass*)1)->field - 1,
#define IMPLEMENT_POINTERS_END ~(size_t)0 };
enum EObjectFlags enum EObjectFlags
{ {

View file

@ -188,8 +188,10 @@ PClassClass::PClassClass()
/* PType ******************************************************************/ /* PType ******************************************************************/
IMPLEMENT_ABSTRACT_POINTY_CLASS(PType) IMPLEMENT_ABSTRACT_POINTY_CLASS(PType)
DECLARE_POINTER(HashNext)
END_POINTERS IMPLEMENT_POINTERS_START(PType)
IMPLEMENT_POINTER(HashNext)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -643,8 +645,10 @@ IMPLEMENT_ABSTRACT_CLASS(PCompoundType)
/* PNamedType *************************************************************/ /* PNamedType *************************************************************/
IMPLEMENT_ABSTRACT_POINTY_CLASS(PNamedType) IMPLEMENT_ABSTRACT_POINTY_CLASS(PNamedType)
DECLARE_POINTER(Outer)
END_POINTERS IMPLEMENT_POINTERS_START(PNamedType)
IMPLEMENT_POINTER(Outer)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -1457,8 +1461,10 @@ bool PStatePointer::ReadValue(FSerializer &ar, const char *key, void *addr) cons
/* PPointer ***************************************************************/ /* PPointer ***************************************************************/
IMPLEMENT_POINTY_CLASS(PPointer) IMPLEMENT_POINTY_CLASS(PPointer)
DECLARE_POINTER(PointedType)
END_POINTERS IMPLEMENT_POINTERS_START(PPointer)
IMPLEMENT_POINTER(PointedType)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -1586,8 +1592,10 @@ PPointer *NewPointer(PType *type, bool isconst)
/* PClassPointer **********************************************************/ /* PClassPointer **********************************************************/
IMPLEMENT_POINTY_CLASS(PClassPointer) IMPLEMENT_POINTY_CLASS(PClassPointer)
DECLARE_POINTER(ClassRestriction)
END_POINTERS IMPLEMENT_POINTERS_START(PClassPointer)
IMPLEMENT_POINTER(ClassRestriction)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -1665,8 +1673,10 @@ PClassPointer *NewClassPointer(PClass *restrict)
/* PEnum ******************************************************************/ /* PEnum ******************************************************************/
IMPLEMENT_POINTY_CLASS(PEnum) IMPLEMENT_POINTY_CLASS(PEnum)
DECLARE_POINTER(ValueType)
END_POINTERS IMPLEMENT_POINTERS_START(PEnum)
IMPLEMENT_POINTER(ValueType)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -1716,8 +1726,10 @@ PEnum *NewEnum(FName name, PTypeBase *outer)
/* PArray *****************************************************************/ /* PArray *****************************************************************/
IMPLEMENT_POINTY_CLASS(PArray) IMPLEMENT_POINTY_CLASS(PArray)
DECLARE_POINTER(ElementType)
END_POINTERS IMPLEMENT_POINTERS_START(PArray)
IMPLEMENT_POINTER(ElementType)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -1913,8 +1925,10 @@ PVector *NewVector(unsigned int size)
/* PDynArray **************************************************************/ /* PDynArray **************************************************************/
IMPLEMENT_POINTY_CLASS(PDynArray) IMPLEMENT_POINTY_CLASS(PDynArray)
DECLARE_POINTER(ElementType)
END_POINTERS IMPLEMENT_POINTERS_START(PDynArray)
IMPLEMENT_POINTER(ElementType)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -1994,9 +2008,11 @@ PDynArray *NewDynArray(PType *type)
/* PMap *******************************************************************/ /* PMap *******************************************************************/
IMPLEMENT_POINTY_CLASS(PMap) IMPLEMENT_POINTY_CLASS(PMap)
DECLARE_POINTER(KeyType)
DECLARE_POINTER(ValueType) IMPLEMENT_POINTERS_START(PMap)
END_POINTERS IMPLEMENT_POINTER(KeyType)
IMPLEMENT_POINTER(ValueType)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -2486,8 +2502,10 @@ unsigned PFunction::AddVariant(PPrototype *proto, TArray<DWORD> &argflags, TArra
/* PClass *****************************************************************/ /* PClass *****************************************************************/
IMPLEMENT_POINTY_CLASS(PClass) IMPLEMENT_POINTY_CLASS(PClass)
DECLARE_POINTER(ParentClass)
END_POINTERS IMPLEMENT_POINTERS_START(PClass)
IMPLEMENT_POINTER(ParentClass)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -3407,12 +3425,18 @@ IMPLEMENT_ABSTRACT_CLASS(PSymbol);
IMPLEMENT_CLASS(PSymbolConst); IMPLEMENT_CLASS(PSymbolConst);
IMPLEMENT_CLASS(PSymbolConstNumeric); IMPLEMENT_CLASS(PSymbolConstNumeric);
IMPLEMENT_CLASS(PSymbolConstString); IMPLEMENT_CLASS(PSymbolConstString);
IMPLEMENT_POINTY_CLASS(PSymbolType) IMPLEMENT_POINTY_CLASS(PSymbolType)
DECLARE_POINTER(Type)
END_POINTERS IMPLEMENT_POINTERS_START(PSymbolType)
IMPLEMENT_POINTER(Type)
IMPLEMENT_POINTERS_END
IMPLEMENT_POINTY_CLASS(PSymbolVMFunction) IMPLEMENT_POINTY_CLASS(PSymbolVMFunction)
DECLARE_POINTER(Function)
END_POINTERS IMPLEMENT_POINTERS_START(PSymbolVMFunction)
IMPLEMENT_POINTER(Function)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(PSymbolTreeNode) IMPLEMENT_CLASS(PSymbolTreeNode)
//========================================================================== //==========================================================================

View file

@ -71,9 +71,11 @@ void DSectorEffect::Serialize(FSerializer &arc)
arc("sector", m_Sector); arc("sector", m_Sector);
} }
IMPLEMENT_POINTY_CLASS (DMover) IMPLEMENT_POINTY_CLASS(DMover)
DECLARE_POINTER(interpolation)
END_POINTERS IMPLEMENT_POINTERS_START(DMover)
IMPLEMENT_POINTER(interpolation)
IMPLEMENT_POINTERS_END
DMover::DMover () DMover::DMover ()
{ {

View file

@ -72,8 +72,10 @@
//========================================================================== //==========================================================================
IMPLEMENT_POINTY_CLASS(DFsSection) IMPLEMENT_POINTY_CLASS(DFsSection)
DECLARE_POINTER(next)
END_POINTERS IMPLEMENT_POINTERS_START(DFsSection)
IMPLEMENT_POINTER(next)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //

View file

@ -75,23 +75,23 @@ AActor *trigger_obj;
// //
//========================================================================== //==========================================================================
#define DECLARE_16_POINTERS(v, i) \ #define IMPLEMENT_16_POINTERS(v, i) \
DECLARE_POINTER(v[i]) \ IMPLEMENT_POINTER(v[i]) \
DECLARE_POINTER(v[i+1]) \ IMPLEMENT_POINTER(v[i+1]) \
DECLARE_POINTER(v[i+2]) \ IMPLEMENT_POINTER(v[i+2]) \
DECLARE_POINTER(v[i+3]) \ IMPLEMENT_POINTER(v[i+3]) \
DECLARE_POINTER(v[i+4]) \ IMPLEMENT_POINTER(v[i+4]) \
DECLARE_POINTER(v[i+5]) \ IMPLEMENT_POINTER(v[i+5]) \
DECLARE_POINTER(v[i+6]) \ IMPLEMENT_POINTER(v[i+6]) \
DECLARE_POINTER(v[i+7]) \ IMPLEMENT_POINTER(v[i+7]) \
DECLARE_POINTER(v[i+8]) \ IMPLEMENT_POINTER(v[i+8]) \
DECLARE_POINTER(v[i+9]) \ IMPLEMENT_POINTER(v[i+9]) \
DECLARE_POINTER(v[i+10]) \ IMPLEMENT_POINTER(v[i+10]) \
DECLARE_POINTER(v[i+11]) \ IMPLEMENT_POINTER(v[i+11]) \
DECLARE_POINTER(v[i+12]) \ IMPLEMENT_POINTER(v[i+12]) \
DECLARE_POINTER(v[i+13]) \ IMPLEMENT_POINTER(v[i+13]) \
DECLARE_POINTER(v[i+14]) \ IMPLEMENT_POINTER(v[i+14]) \
DECLARE_POINTER(v[i+15]) \ IMPLEMENT_POINTER(v[i+15]) \
//========================================================================== //==========================================================================
// //
@ -100,29 +100,31 @@ AActor *trigger_obj;
//========================================================================== //==========================================================================
IMPLEMENT_POINTY_CLASS(DFsScript) IMPLEMENT_POINTY_CLASS(DFsScript)
DECLARE_POINTER(parent)
DECLARE_POINTER(trigger) IMPLEMENT_POINTERS_START(DFsScript)
DECLARE_16_POINTERS(sections, 0) IMPLEMENT_POINTER(parent)
DECLARE_POINTER(sections[16]) IMPLEMENT_POINTER(trigger)
DECLARE_16_POINTERS(variables, 0) IMPLEMENT_16_POINTERS(sections, 0)
DECLARE_16_POINTERS(children, 0) IMPLEMENT_POINTER(sections[16])
DECLARE_16_POINTERS(children, 16) IMPLEMENT_16_POINTERS(variables, 0)
DECLARE_16_POINTERS(children, 32) IMPLEMENT_16_POINTERS(children, 0)
DECLARE_16_POINTERS(children, 48) IMPLEMENT_16_POINTERS(children, 16)
DECLARE_16_POINTERS(children, 64) IMPLEMENT_16_POINTERS(children, 32)
DECLARE_16_POINTERS(children, 80) IMPLEMENT_16_POINTERS(children, 48)
DECLARE_16_POINTERS(children, 96) IMPLEMENT_16_POINTERS(children, 64)
DECLARE_16_POINTERS(children, 112) IMPLEMENT_16_POINTERS(children, 80)
DECLARE_16_POINTERS(children, 128) IMPLEMENT_16_POINTERS(children, 96)
DECLARE_16_POINTERS(children, 144) IMPLEMENT_16_POINTERS(children, 112)
DECLARE_16_POINTERS(children, 160) IMPLEMENT_16_POINTERS(children, 128)
DECLARE_16_POINTERS(children, 176) IMPLEMENT_16_POINTERS(children, 144)
DECLARE_16_POINTERS(children, 192) IMPLEMENT_16_POINTERS(children, 160)
DECLARE_16_POINTERS(children, 208) IMPLEMENT_16_POINTERS(children, 176)
DECLARE_16_POINTERS(children, 224) IMPLEMENT_16_POINTERS(children, 192)
DECLARE_16_POINTERS(children, 240) IMPLEMENT_16_POINTERS(children, 208)
DECLARE_POINTER(children[256]) IMPLEMENT_16_POINTERS(children, 224)
END_POINTERS IMPLEMENT_16_POINTERS(children, 240)
IMPLEMENT_POINTER(children[256])
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -268,11 +270,13 @@ void DFsScript::ParseScript(char *position)
//========================================================================== //==========================================================================
IMPLEMENT_POINTY_CLASS(DRunningScript) IMPLEMENT_POINTY_CLASS(DRunningScript)
DECLARE_POINTER(prev)
DECLARE_POINTER(next) IMPLEMENT_POINTERS_START(DRunningScript)
DECLARE_POINTER(trigger) IMPLEMENT_POINTER(prev)
DECLARE_16_POINTERS(variables, 0) IMPLEMENT_POINTER(next)
END_POINTERS IMPLEMENT_POINTER(trigger)
IMPLEMENT_16_POINTERS(variables, 0)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //
@ -375,10 +379,13 @@ void DRunningScript::Serialize(FSerializer &arc)
// The main thinker // The main thinker
// //
//========================================================================== //==========================================================================
IMPLEMENT_POINTY_CLASS(DFraggleThinker) IMPLEMENT_POINTY_CLASS(DFraggleThinker)
DECLARE_POINTER(RunningScripts)
DECLARE_POINTER(LevelScript) IMPLEMENT_POINTERS_START(DFraggleThinker)
END_POINTERS IMPLEMENT_POINTER(RunningScripts)
IMPLEMENT_POINTER(LevelScript)
IMPLEMENT_POINTERS_END
TObjPtr<DFraggleThinker> DFraggleThinker::ActiveThinker; TObjPtr<DFraggleThinker> DFraggleThinker::ActiveThinker;

View file

@ -180,9 +180,11 @@ AActor* actorvalue(const svalue_t &svalue)
//========================================================================== //==========================================================================
IMPLEMENT_POINTY_CLASS(DFsVariable) IMPLEMENT_POINTY_CLASS(DFsVariable)
DECLARE_POINTER (next)
DECLARE_POINTER (actor) IMPLEMENT_POINTERS_START(DFsVariable)
END_POINTERS IMPLEMENT_POINTER(next)
IMPLEMENT_POINTER(actor)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //

View file

@ -31,9 +31,11 @@ public:
TObjPtr<AActor> DirtClump; TObjPtr<AActor> DirtClump;
}; };
IMPLEMENT_POINTY_CLASS (AThrustFloor) IMPLEMENT_POINTY_CLASS(AThrustFloor)
DECLARE_POINTER (DirtClump)
END_POINTERS IMPLEMENT_POINTERS_START(AThrustFloor)
IMPLEMENT_POINTER(DirtClump)
IMPLEMENT_POINTERS_END
void AThrustFloor::Serialize(FSerializer &arc) void AThrustFloor::Serialize(FSerializer &arc)
{ {

View file

@ -305,8 +305,10 @@ private:
}; };
IMPLEMENT_POINTY_CLASS(DCorpsePointer) IMPLEMENT_POINTY_CLASS(DCorpsePointer)
DECLARE_POINTER(Corpse)
END_POINTERS IMPLEMENT_POINTERS_START(DCorpsePointer)
IMPLEMENT_POINTER(Corpse)
IMPLEMENT_POINTERS_END
CUSTOM_CVAR(Int, sv_corpsequeuesize, 64, CVAR_ARCHIVE|CVAR_SERVERINFO) CUSTOM_CVAR(Int, sv_corpsequeuesize, 64, CVAR_ARCHIVE|CVAR_SERVERINFO)
{ {

View file

@ -58,10 +58,12 @@ static int ImpactCount;
CVAR (Bool, cl_spreaddecals, true, CVAR_ARCHIVE) CVAR (Bool, cl_spreaddecals, true, CVAR_ARCHIVE)
IMPLEMENT_POINTY_CLASS (DBaseDecal) IMPLEMENT_POINTY_CLASS(DBaseDecal)
DECLARE_POINTER(WallPrev)
DECLARE_POINTER(WallNext) IMPLEMENT_POINTERS_START(DBaseDecal)
END_POINTERS IMPLEMENT_POINTER(WallPrev)
IMPLEMENT_POINTER(WallNext)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS (DImpactDecal) IMPLEMENT_CLASS (DImpactDecal)

View file

@ -3,9 +3,11 @@
#include "d_player.h" #include "d_player.h"
#include "serializer.h" #include "serializer.h"
IMPLEMENT_POINTY_CLASS (DFlashFader) IMPLEMENT_POINTY_CLASS(DFlashFader)
DECLARE_POINTER (ForWho)
END_POINTERS IMPLEMENT_POINTERS_START(DFlashFader)
IMPLEMENT_POINTER(ForWho)
IMPLEMENT_POINTERS_END
DFlashFader::DFlashFader () DFlashFader::DFlashFader ()
{ {

View file

@ -650,9 +650,11 @@ void AMorphProjectile::Serialize(FSerializer &arc)
// Morphed Monster (you must subclass this to do something useful) --------- // Morphed Monster (you must subclass this to do something useful) ---------
IMPLEMENT_POINTY_CLASS (AMorphedMonster) IMPLEMENT_POINTY_CLASS(AMorphedMonster)
DECLARE_POINTER (UnmorphedMe)
END_POINTERS IMPLEMENT_POINTERS_START(AMorphedMonster)
IMPLEMENT_POINTER(UnmorphedMe)
IMPLEMENT_POINTERS_END
void AMorphedMonster::Serialize(FSerializer &arc) void AMorphedMonster::Serialize(FSerializer &arc)
{ {

View file

@ -66,9 +66,11 @@ public:
TObjPtr<AInterpolationPoint> Next; TObjPtr<AInterpolationPoint> Next;
}; };
IMPLEMENT_POINTY_CLASS (AInterpolationPoint) IMPLEMENT_POINTY_CLASS(AInterpolationPoint)
DECLARE_POINTER (Next)
END_POINTERS IMPLEMENT_POINTERS_START(AInterpolationPoint)
IMPLEMENT_POINTER(Next)
IMPLEMENT_POINTERS_END
void AInterpolationPoint::Serialize(FSerializer &arc) void AInterpolationPoint::Serialize(FSerializer &arc)
{ {
@ -176,10 +178,12 @@ protected:
int HoldTime; int HoldTime;
}; };
IMPLEMENT_POINTY_CLASS (APathFollower) IMPLEMENT_POINTY_CLASS(APathFollower)
DECLARE_POINTER (PrevNode)
DECLARE_POINTER (CurrNode) IMPLEMENT_POINTERS_START(APathFollower)
END_POINTERS IMPLEMENT_POINTER(PrevNode)
IMPLEMENT_POINTER(CurrNode)
IMPLEMENT_POINTERS_END
void APathFollower::Serialize(FSerializer &arc) void APathFollower::Serialize(FSerializer &arc)
{ {
@ -592,9 +596,11 @@ protected:
TObjPtr<AActor> Activator; TObjPtr<AActor> Activator;
}; };
IMPLEMENT_POINTY_CLASS (AMovingCamera) IMPLEMENT_POINTY_CLASS(AMovingCamera)
DECLARE_POINTER (Activator)
END_POINTERS IMPLEMENT_POINTERS_START(AMovingCamera)
IMPLEMENT_POINTER(Activator)
IMPLEMENT_POINTERS_END
void AMovingCamera::Serialize(FSerializer &arc) void AMovingCamera::Serialize(FSerializer &arc)
{ {

View file

@ -470,9 +470,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
int AInventory::StaticLastMessageTic; int AInventory::StaticLastMessageTic;
const char *AInventory::StaticLastMessage; const char *AInventory::StaticLastMessage;
IMPLEMENT_POINTY_CLASS (AInventory) IMPLEMENT_POINTY_CLASS(AInventory)
DECLARE_POINTER (Owner)
END_POINTERS IMPLEMENT_POINTERS_START(AInventory)
IMPLEMENT_POINTER(Owner)
IMPLEMENT_POINTERS_END
//=========================================================================== //===========================================================================
// //

View file

@ -14,9 +14,11 @@
static FRandom pr_quake ("Quake"); static FRandom pr_quake ("Quake");
IMPLEMENT_POINTY_CLASS (DEarthquake) IMPLEMENT_POINTY_CLASS(DEarthquake)
DECLARE_POINTER (m_Spot)
END_POINTERS IMPLEMENT_POINTERS_START(DEarthquake)
IMPLEMENT_POINTER(m_Spot)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //

View file

@ -81,8 +81,10 @@ public:
}; };
IMPLEMENT_POINTY_CLASS(ASoundSequenceSlot) IMPLEMENT_POINTY_CLASS(ASoundSequenceSlot)
DECLARE_POINTER(Sequence)
END_POINTERS IMPLEMENT_POINTERS_START(ASoundSequenceSlot)
IMPLEMENT_POINTER(Sequence)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //

View file

@ -24,10 +24,11 @@ void AWeaponHolder::Serialize(FSerializer &arc)
("pieceweapon", PieceWeapon); ("pieceweapon", PieceWeapon);
} }
IMPLEMENT_POINTY_CLASS(AWeaponPiece)
IMPLEMENT_POINTY_CLASS (AWeaponPiece) IMPLEMENT_POINTERS_START(AWeaponPiece)
DECLARE_POINTER (FullWeapon) IMPLEMENT_POINTER(FullWeapon)
END_POINTERS IMPLEMENT_POINTERS_END
void AWeaponPiece::Serialize(FSerializer &arc) void AWeaponPiece::Serialize(FSerializer &arc)

View file

@ -21,11 +21,13 @@
#define BONUSADD 6 #define BONUSADD 6
IMPLEMENT_POINTY_CLASS (AWeapon) IMPLEMENT_POINTY_CLASS(AWeapon)
DECLARE_POINTER (Ammo1)
DECLARE_POINTER (Ammo2) IMPLEMENT_POINTERS_START(AWeapon)
DECLARE_POINTER (SisterWeapon) IMPLEMENT_POINTER(Ammo1)
END_POINTERS IMPLEMENT_POINTER(Ammo2)
IMPLEMENT_POINTER(SisterWeapon)
IMPLEMENT_POINTERS_END
FString WeaponSection; FString WeaponSection;
TArray<FString> KeyConfWeapons; TArray<FString> KeyConfWeapons;

View file

@ -44,9 +44,11 @@
EXTERN_CVAR(Int, con_scaletext) EXTERN_CVAR(Int, con_scaletext)
int active_con_scaletext(); int active_con_scaletext();
IMPLEMENT_POINTY_CLASS (DHUDMessage) IMPLEMENT_POINTY_CLASS(DHUDMessage)
DECLARE_POINTER(Next)
END_POINTERS IMPLEMENT_POINTERS_START(DHUDMessage)
IMPLEMENT_POINTER(Next)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS (DHUDMessageFadeOut) IMPLEMENT_CLASS (DHUDMessageFadeOut)
IMPLEMENT_CLASS (DHUDMessageFadeInOut) IMPLEMENT_CLASS (DHUDMessageFadeInOut)

View file

@ -1532,10 +1532,12 @@ private:
}; };
IMPLEMENT_POINTY_CLASS(DSBarInfo) IMPLEMENT_POINTY_CLASS(DSBarInfo)
DECLARE_POINTER(ammo1)
DECLARE_POINTER(ammo2) IMPLEMENT_POINTERS_START(DSBarInfo)
DECLARE_POINTER(armor) IMPLEMENT_POINTER(ammo1)
END_POINTERS IMPLEMENT_POINTER(ammo2)
IMPLEMENT_POINTER(armor)
IMPLEMENT_POINTERS_END
DBaseStatusBar *CreateCustomStatusBar (int script) DBaseStatusBar *CreateCustomStatusBar (int script)
{ {

View file

@ -63,10 +63,12 @@
#define POWERUPICONSIZE 32 #define POWERUPICONSIZE 32
IMPLEMENT_POINTY_CLASS(DBaseStatusBar) IMPLEMENT_POINTY_CLASS(DBaseStatusBar)
DECLARE_POINTER(Messages[0])
DECLARE_POINTER(Messages[1]) IMPLEMENT_POINTERS_START(DBaseStatusBar)
DECLARE_POINTER(Messages[2]) IMPLEMENT_POINTER(Messages[0])
END_POINTERS IMPLEMENT_POINTER(Messages[1])
IMPLEMENT_POINTER(Messages[2])
IMPLEMENT_POINTERS_END
EXTERN_CVAR (Bool, am_showmonsters) EXTERN_CVAR (Bool, am_showmonsters)
EXTERN_CVAR (Bool, am_showsecrets) EXTERN_CVAR (Bool, am_showsecrets)

View file

@ -154,8 +154,10 @@ int GetSpriteIndex(const char * spritename, bool add)
} }
IMPLEMENT_POINTY_CLASS(PClassActor) IMPLEMENT_POINTY_CLASS(PClassActor)
DECLARE_POINTER(DropItems)
END_POINTERS IMPLEMENT_POINTERS_START(PClassActor)
IMPLEMENT_POINTER(DropItems)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //

View file

@ -59,9 +59,12 @@ IMPLEMENT_CLASS(DIntermissionScreenFader)
IMPLEMENT_CLASS(DIntermissionScreenText) IMPLEMENT_CLASS(DIntermissionScreenText)
IMPLEMENT_CLASS(DIntermissionScreenCast) IMPLEMENT_CLASS(DIntermissionScreenCast)
IMPLEMENT_CLASS(DIntermissionScreenScroller) IMPLEMENT_CLASS(DIntermissionScreenScroller)
IMPLEMENT_POINTY_CLASS(DIntermissionController) IMPLEMENT_POINTY_CLASS(DIntermissionController)
DECLARE_POINTER(mScreen)
END_POINTERS IMPLEMENT_POINTERS_START(DIntermissionController)
IMPLEMENT_POINTER(mScreen)
IMPLEMENT_POINTERS_END
extern int NoWipe; extern int NoWipe;

View file

@ -1034,8 +1034,10 @@ public:
}; };
IMPLEMENT_POINTY_CLASS(DSuicider) IMPLEMENT_POINTY_CLASS(DSuicider)
DECLARE_POINTER(Pawn)
END_POINTERS IMPLEMENT_POINTERS_START(DSuicider)
IMPLEMENT_POINTER(Pawn)
IMPLEMENT_POINTERS_END
void cht_Suicide (player_t *plyr) void cht_Suicide (player_t *plyr)
{ {

View file

@ -91,9 +91,11 @@ static bool MenuEnabled = true;
// //
//============================================================================ //============================================================================
IMPLEMENT_POINTY_CLASS (DMenu) IMPLEMENT_POINTY_CLASS(DMenu)
DECLARE_POINTER(mParentMenu)
END_POINTERS IMPLEMENT_POINTERS_START(DMenu)
IMPLEMENT_POINTER(mParentMenu)
IMPLEMENT_POINTERS_END
DMenu::DMenu(DMenu *parent) DMenu::DMenu(DMenu *parent)
{ {

View file

@ -1369,9 +1369,11 @@ private:
DPlaneWatcher() {} DPlaneWatcher() {}
}; };
IMPLEMENT_POINTY_CLASS (DPlaneWatcher) IMPLEMENT_POINTY_CLASS(DPlaneWatcher)
DECLARE_POINTER (Activator)
END_POINTERS IMPLEMENT_POINTERS_START(DPlaneWatcher)
IMPLEMENT_POINTER(Activator)
IMPLEMENT_POINTERS_END
DPlaneWatcher::DPlaneWatcher (AActor *it, line_t *line, int lineSide, bool ceiling, DPlaneWatcher::DPlaneWatcher (AActor *it, line_t *line, int lineSide, bool ceiling,
int tag, int height, int special, int tag, int height, int special,
@ -2858,10 +2860,12 @@ void FBehavior::StaticStopMyScripts (AActor *actor)
//---- The ACS Interpreter ----// //---- The ACS Interpreter ----//
IMPLEMENT_POINTY_CLASS (DACSThinker) IMPLEMENT_POINTY_CLASS(DACSThinker)
DECLARE_POINTER(LastScript)
DECLARE_POINTER(Scripts) IMPLEMENT_POINTERS_START(DACSThinker)
END_POINTERS IMPLEMENT_POINTER(LastScript)
IMPLEMENT_POINTER(Scripts)
IMPLEMENT_POINTERS_END
TObjPtr<DACSThinker> DACSThinker::ActiveThinker; TObjPtr<DACSThinker> DACSThinker::ActiveThinker;
@ -2987,11 +2991,13 @@ void DACSThinker::StopScriptsFor (AActor *actor)
} }
} }
IMPLEMENT_POINTY_CLASS (DLevelScript) IMPLEMENT_POINTY_CLASS(DLevelScript)
DECLARE_POINTER(next)
DECLARE_POINTER(prev) IMPLEMENT_POINTERS_START(DLevelScript)
DECLARE_POINTER(activator) IMPLEMENT_POINTER(next)
END_POINTERS IMPLEMENT_POINTER(prev)
IMPLEMENT_POINTER(activator)
IMPLEMENT_POINTERS_END
//========================================================================== //==========================================================================
// //

View file

@ -815,10 +815,12 @@ bool EV_DoDonut (int tag, line_t *line, double pillarspeed, double slimespeed)
// //
//========================================================================== //==========================================================================
IMPLEMENT_POINTY_CLASS (DElevator) IMPLEMENT_POINTY_CLASS(DElevator)
DECLARE_POINTER(m_Interp_Floor)
DECLARE_POINTER(m_Interp_Ceiling) IMPLEMENT_POINTERS_START(DElevator)
END_POINTERS IMPLEMENT_POINTER(m_Interp_Floor)
IMPLEMENT_POINTER(m_Interp_Ceiling)
IMPLEMENT_POINTERS_END
DElevator::DElevator () DElevator::DElevator ()
{ {

View file

@ -132,18 +132,20 @@ CVAR (Int, cl_bloodtype, 0, CVAR_ARCHIVE);
// CODE -------------------------------------------------------------------- // CODE --------------------------------------------------------------------
IMPLEMENT_POINTY_CLASS_WITH_FIELDS (AActor) IMPLEMENT_POINTY_CLASS_WITH_FIELDS (AActor)
DECLARE_POINTER (target)
DECLARE_POINTER (lastenemy) IMPLEMENT_POINTERS_START(AActor)
DECLARE_POINTER (tracer) IMPLEMENT_POINTER(target)
DECLARE_POINTER (goal) IMPLEMENT_POINTER(lastenemy)
DECLARE_POINTER (LastLookActor) IMPLEMENT_POINTER(tracer)
DECLARE_POINTER (Inventory) IMPLEMENT_POINTER(goal)
DECLARE_POINTER (LastHeard) IMPLEMENT_POINTER(LastLookActor)
DECLARE_POINTER (master) IMPLEMENT_POINTER(Inventory)
DECLARE_POINTER (Poisoner) IMPLEMENT_POINTER(LastHeard)
DECLARE_POINTER (DamageFunc) IMPLEMENT_POINTER(master)
DECLARE_POINTER (alternative) IMPLEMENT_POINTER(Poisoner)
END_POINTERS IMPLEMENT_POINTER(DamageFunc)
IMPLEMENT_POINTER(alternative)
IMPLEMENT_POINTERS_END
AActor::~AActor () AActor::~AActor ()
{ {
@ -6953,9 +6955,12 @@ DEFINE_ACTION_FUNCTION(AActor, Vec3Offset)
// DropItem handling // DropItem handling
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
IMPLEMENT_POINTY_CLASS_WITH_FIELDS(DDropItem) IMPLEMENT_POINTY_CLASS_WITH_FIELDS(DDropItem)
DECLARE_POINTER(Next)
END_POINTERS IMPLEMENT_POINTERS_START(DDropItem)
IMPLEMENT_POINTER(Next)
IMPLEMENT_POINTERS_END
void DDropItem::InitNativeFields() void DDropItem::InitNativeFields()
{ {
@ -6967,7 +6972,6 @@ void DDropItem::InitNativeFields()
meta->AddNativeField("Amount", TypeSInt32, myoffsetof(DDropItem, Amount)); meta->AddNativeField("Amount", TypeSInt32, myoffsetof(DDropItem, Amount));
} }
void PrintMiscActorInfo(AActor *query) void PrintMiscActorInfo(AActor *query)
{ {
if (query) if (query)

View file

@ -40,10 +40,12 @@
#include "serializer.h" #include "serializer.h"
#include "r_data/r_interpolate.h" #include "r_data/r_interpolate.h"
IMPLEMENT_POINTY_CLASS (DPillar) IMPLEMENT_POINTY_CLASS(DPillar)
DECLARE_POINTER(m_Interp_Floor)
DECLARE_POINTER(m_Interp_Ceiling) IMPLEMENT_POINTERS_START(DPillar)
END_POINTERS IMPLEMENT_POINTER(m_Interp_Floor)
IMPLEMENT_POINTER(m_Interp_Ceiling)
IMPLEMENT_POINTERS_END
DPillar::DPillar () DPillar::DPillar ()
{ {

View file

@ -100,9 +100,11 @@ static const FGenericButtons ButtonChecks[] =
//------------------------------------------------------------------------ //------------------------------------------------------------------------
IMPLEMENT_POINTY_CLASS(DPSprite) IMPLEMENT_POINTY_CLASS(DPSprite)
DECLARE_POINTER(Caller)
DECLARE_POINTER(Next) IMPLEMENT_POINTERS_START(DPSprite)
END_POINTERS IMPLEMENT_POINTER(Caller)
IMPLEMENT_POINTER(Next)
IMPLEMENT_POINTERS_END
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// //

View file

@ -74,10 +74,11 @@ protected:
friend bool PIT_PushThing (AActor *thing); friend bool PIT_PushThing (AActor *thing);
}; };
IMPLEMENT_POINTY_CLASS(DPusher)
IMPLEMENT_POINTY_CLASS (DPusher) IMPLEMENT_POINTERS_START(DPusher)
DECLARE_POINTER (m_Source) IMPLEMENT_POINTER(m_Source)
END_POINTERS IMPLEMENT_POINTERS_END
DPusher::DPusher () DPusher::DPusher ()
{ {

View file

@ -73,12 +73,13 @@ private:
} }
}; };
IMPLEMENT_POINTY_CLASS(DScroller)
IMPLEMENT_POINTY_CLASS (DScroller) IMPLEMENT_POINTERS_START(DScroller)
DECLARE_POINTER (m_Interpolations[0]) IMPLEMENT_POINTER(m_Interpolations[0])
DECLARE_POINTER (m_Interpolations[1]) IMPLEMENT_POINTER(m_Interpolations[1])
DECLARE_POINTER (m_Interpolations[2]) IMPLEMENT_POINTER(m_Interpolations[2])
END_POINTERS IMPLEMENT_POINTERS_END
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -622,10 +622,12 @@ void player_t::SendPitchLimits() const
// //
//=========================================================================== //===========================================================================
IMPLEMENT_POINTY_CLASS (APlayerPawn) IMPLEMENT_POINTY_CLASS(APlayerPawn)
DECLARE_POINTER(InvFirst)
DECLARE_POINTER(InvSel) IMPLEMENT_POINTERS_START(APlayerPawn)
END_POINTERS IMPLEMENT_POINTER(InvFirst)
IMPLEMENT_POINTER(InvSel)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS (APlayerChunk) IMPLEMENT_CLASS (APlayerChunk)

View file

@ -172,9 +172,11 @@ static FPolyNode *FreePolyNodes;
// //
//========================================================================== //==========================================================================
IMPLEMENT_POINTY_CLASS (DPolyAction) IMPLEMENT_POINTY_CLASS(DPolyAction)
DECLARE_POINTER(m_Interpolation)
END_POINTERS IMPLEMENT_POINTERS_START(DPolyAction)
IMPLEMENT_POINTER(m_Interpolation)
IMPLEMENT_POINTERS_END
DPolyAction::DPolyAction () DPolyAction::DPolyAction ()
{ {

View file

@ -162,9 +162,12 @@ public:
//========================================================================== //==========================================================================
IMPLEMENT_ABSTRACT_POINTY_CLASS(DInterpolation) IMPLEMENT_ABSTRACT_POINTY_CLASS(DInterpolation)
DECLARE_POINTER(Next)
DECLARE_POINTER(Prev) IMPLEMENT_POINTERS_START(DInterpolation)
END_POINTERS IMPLEMENT_POINTER(Next)
IMPLEMENT_POINTER(Prev)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(DSectorPlaneInterpolation) IMPLEMENT_CLASS(DSectorPlaneInterpolation)
IMPLEMENT_CLASS(DSectorScrollInterpolation) IMPLEMENT_CLASS(DSectorScrollInterpolation)
IMPLEMENT_CLASS(DWallScrollInterpolation) IMPLEMENT_CLASS(DWallScrollInterpolation)

View file

@ -285,12 +285,14 @@ void DSeqNode::SerializeSequences (FSerializer &arc)
arc("sndseqlisthead", SequenceListHead); arc("sndseqlisthead", SequenceListHead);
} }
IMPLEMENT_POINTY_CLASS (DSeqNode) IMPLEMENT_POINTY_CLASS(DSeqNode)
DECLARE_POINTER(m_ChildSeqNode)
DECLARE_POINTER(m_ParentSeqNode) IMPLEMENT_POINTERS_START(DSeqNode)
DECLARE_POINTER(m_Next) IMPLEMENT_POINTER(m_ChildSeqNode)
DECLARE_POINTER(m_Prev) IMPLEMENT_POINTER(m_ParentSeqNode)
END_POINTERS IMPLEMENT_POINTER(m_Next)
IMPLEMENT_POINTER(m_Prev)
IMPLEMENT_POINTERS_END
DSeqNode::DSeqNode () DSeqNode::DSeqNode ()
: m_SequenceChoices(0) : m_SequenceChoices(0)
@ -427,9 +429,11 @@ FName DSeqNode::GetSequenceName () const
return Sequences[m_Sequence]->SeqName; return Sequences[m_Sequence]->SeqName;
} }
IMPLEMENT_POINTY_CLASS (DSeqActorNode) IMPLEMENT_POINTY_CLASS(DSeqActorNode)
DECLARE_POINTER (m_Actor)
END_POINTERS IMPLEMENT_POINTERS_START(DSeqActorNode)
IMPLEMENT_POINTER(m_Actor)
IMPLEMENT_POINTERS_END
void DSeqActorNode::Serialize(FSerializer &arc) void DSeqActorNode::Serialize(FSerializer &arc)
{ {

View file

@ -36,8 +36,11 @@
IMPLEMENT_CLASS(VMException) IMPLEMENT_CLASS(VMException)
IMPLEMENT_ABSTRACT_POINTY_CLASS(VMFunction) IMPLEMENT_ABSTRACT_POINTY_CLASS(VMFunction)
DECLARE_POINTER(Proto)
END_POINTERS IMPLEMENT_POINTERS_START(VMFunction)
IMPLEMENT_POINTER(Proto)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(VMScriptFunction) IMPLEMENT_CLASS(VMScriptFunction)
IMPLEMENT_CLASS(VMNativeFunction) IMPLEMENT_CLASS(VMNativeFunction)