- changed TObjPtr to take a pointer as its template argument and not the class it points to.

This addresses the main issue with TObjPtr, namely that using it required pulling in the entire class hierarchy in basic headers like r_defs which polluted nearly every single source file in the project.
This commit is contained in:
Christoph Oelckers 2017-03-08 13:34:26 +01:00
parent 1cb89c6b37
commit b8f7e305db
37 changed files with 124 additions and 140 deletions

View file

@ -1058,17 +1058,17 @@ public:
SBYTE visdir; SBYTE visdir;
SWORD movecount; // when 0, select a new dir SWORD movecount; // when 0, select a new dir
SWORD strafecount; // for MF3_AVOIDMELEE SWORD strafecount; // for MF3_AVOIDMELEE
TObjPtr<AActor> target; // thing being chased/attacked (or NULL) TObjPtr<AActor*> target; // thing being chased/attacked (or NULL)
// also the originator for missiles // also the originator for missiles
TObjPtr<AActor> lastenemy; // Last known enemy -- killough 2/15/98 TObjPtr<AActor*> lastenemy; // Last known enemy -- killough 2/15/98
TObjPtr<AActor> LastHeard; // [RH] Last actor this one heard TObjPtr<AActor*> LastHeard; // [RH] Last actor this one heard
int32_t reactiontime; // if non 0, don't attack yet; used by int32_t reactiontime; // if non 0, don't attack yet; used by
// player to freeze a bit after teleporting // player to freeze a bit after teleporting
int32_t threshold; // if > 0, the target will be chased int32_t threshold; // if > 0, the target will be chased
int32_t DefThreshold; // [MC] Default threshold which the actor will reset its threshold to after switching targets int32_t DefThreshold; // [MC] Default threshold which the actor will reset its threshold to after switching targets
// no matter what (even if shot) // no matter what (even if shot)
player_t *player; // only valid if type of APlayerPawn player_t *player; // only valid if type of APlayerPawn
TObjPtr<AActor> LastLookActor; // Actor last looked for (if TIDtoHate != 0) TObjPtr<AActor*> LastLookActor; // Actor last looked for (if TIDtoHate != 0)
DVector3 SpawnPoint; // For nightmare respawn DVector3 SpawnPoint; // For nightmare respawn
WORD SpawnAngle; WORD SpawnAngle;
int StartHealth; int StartHealth;
@ -1077,9 +1077,9 @@ public:
int skillrespawncount; int skillrespawncount;
int TIDtoHate; // TID of things to hate (0 if none) int TIDtoHate; // TID of things to hate (0 if none)
FNameNoInit Species; // For monster families FNameNoInit Species; // For monster families
TObjPtr<AActor> alternative; // (Un)Morphed actors stored here. Those with the MF_UNMORPHED flag are the originals. TObjPtr<AActor*> alternative; // (Un)Morphed actors stored here. Those with the MF_UNMORPHED flag are the originals.
TObjPtr<AActor> tracer; // Thing being chased/attacked for tracers TObjPtr<AActor*> tracer; // Thing being chased/attacked for tracers
TObjPtr<AActor> master; // Thing which spawned this one (prevents mutual attacks) TObjPtr<AActor*> master; // Thing which spawned this one (prevents mutual attacks)
int tid; // thing identifier int tid; // thing identifier
int special; // special int special; // special
@ -1088,7 +1088,7 @@ public:
int accuracy, stamina; // [RH] Strife stats -- [XA] moved here for DECORATE/ACS access. int accuracy, stamina; // [RH] Strife stats -- [XA] moved here for DECORATE/ACS access.
AActor *inext, **iprev;// Links to other mobjs in same bucket AActor *inext, **iprev;// Links to other mobjs in same bucket
TObjPtr<AActor> goal; // Monster's goal if not chasing anything TObjPtr<AActor*> goal; // Monster's goal if not chasing anything
int waterlevel; // 0=none, 1=feet, 2=waist, 3=eyes int waterlevel; // 0=none, 1=feet, 2=waist, 3=eyes
BYTE boomwaterlevel; // splash information for non-swimmable water sectors BYTE boomwaterlevel; // splash information for non-swimmable water sectors
BYTE MinMissileChance;// [RH] If a random # is > than this, then missile attack. BYTE MinMissileChance;// [RH] If a random # is > than this, then missile attack.
@ -1126,7 +1126,7 @@ public:
FNameNoInit PoisonDamageTypeReceived; // Damage type received by poison. FNameNoInit PoisonDamageTypeReceived; // Damage type received by poison.
int PoisonDurationReceived; // Duration left for receiving poison damage. int PoisonDurationReceived; // Duration left for receiving poison damage.
int PoisonPeriodReceived; // How often poison damage is applied. (Every X tics.) int PoisonPeriodReceived; // How often poison damage is applied. (Every X tics.)
TObjPtr<AActor> Poisoner; // Last source of received poison damage. TObjPtr<AActor*> Poisoner; // Last source of received poison damage.
// a linked list of sectors where this object appears // a linked list of sectors where this object appears
struct msecnode_t *touching_sectorlist; // phares 3/14/98 struct msecnode_t *touching_sectorlist; // phares 3/14/98
@ -1136,7 +1136,7 @@ public:
int validcount; int validcount;
TObjPtr<AInventory> Inventory; // [RH] This actor's inventory TObjPtr<AInventory*> Inventory; // [RH] This actor's inventory
DWORD InventoryID; // A unique ID to keep track of inventory items DWORD InventoryID; // A unique ID to keep track of inventory items
BYTE smokecounter; BYTE smokecounter;
@ -1434,7 +1434,7 @@ public:
// begin of GZDoom specific additions // begin of GZDoom specific additions
TArray<TObjPtr<AActor> > dynamiclights; TArray<TObjPtr<AActor*> > dynamiclights;
void * lightassociations; void * lightassociations;
bool hasmodel; bool hasmodel;
// end of GZDoom specific additions // end of GZDoom specific additions

View file

@ -116,9 +116,9 @@ public:
botinfo_t *botinfo; botinfo_t *botinfo;
int spawn_tries; int spawn_tries;
int wanted_botnum; int wanted_botnum;
TObjPtr<AActor> firstthing; TObjPtr<AActor*> firstthing;
TObjPtr<AActor> body1; TObjPtr<AActor*> body1;
TObjPtr<AActor> body2; TObjPtr<AActor*> body2;
bool m_Thinking; bool m_Thinking;
@ -152,12 +152,12 @@ public:
player_t *player; player_t *player;
DAngle Angle; // The wanted angle that the bot try to get every tic. DAngle Angle; // The wanted angle that the bot try to get every tic.
// (used to get a smooth view movement) // (used to get a smooth view movement)
TObjPtr<AActor> dest; // Move Destination. TObjPtr<AActor*> dest; // Move Destination.
TObjPtr<AActor> prev; // Previous move destination. TObjPtr<AActor*> prev; // Previous move destination.
TObjPtr<AActor> enemy; // The dead meat. TObjPtr<AActor*> enemy; // The dead meat.
TObjPtr<AActor> missile; // A threatening missile that needs to be avoided. TObjPtr<AActor*> missile; // A threatening missile that needs to be avoided.
TObjPtr<AActor> mate; // Friend (used for grouping in teamplay or coop). TObjPtr<AActor*> mate; // Friend (used for grouping in teamplay or coop).
TObjPtr<AActor> last_mate; // If bots mate disappeared (not if died) that mate is TObjPtr<AActor*> last_mate; // If bots mate disappeared (not if died) that mate is
// pointed to by this. Allows bot to roam to it if // pointed to by this. Allows bot to roam to it if
// necessary. // necessary.

View file

@ -131,8 +131,8 @@ public:
int RunHealth; int RunHealth;
int PlayerFlags; int PlayerFlags;
double FullHeight; double FullHeight;
TObjPtr<AInventory> InvFirst; // first inventory item displayed on inventory bar TObjPtr<AInventory*> InvFirst; // first inventory item displayed on inventory bar
TObjPtr<AInventory> InvSel; // selected inventory item TObjPtr<AInventory*> InvSel; // selected inventory item
// [GRB] Player class properties // [GRB] Player class properties
double JumpZ; double JumpZ;
@ -427,7 +427,7 @@ public:
AWeapon *ReadyWeapon; AWeapon *ReadyWeapon;
AWeapon *PendingWeapon; // WP_NOCHANGE if not changing AWeapon *PendingWeapon; // WP_NOCHANGE if not changing
TObjPtr<DPSprite> psprites; // view sprites (gun, etc) TObjPtr<DPSprite*> psprites; // view sprites (gun, etc)
int cheats; // bit flags int cheats; // bit flags
int timefreezer; // Player has an active time freezer int timefreezer; // Player has an active time freezer
@ -442,8 +442,8 @@ public:
int poisoncount; // screen flash for poison damage int poisoncount; // screen flash for poison damage
FName poisontype; // type of poison damage to apply FName poisontype; // type of poison damage to apply
FName poisonpaintype; // type of Pain state to enter for poison damage FName poisonpaintype; // type of Pain state to enter for poison damage
TObjPtr<AActor> poisoner; // NULL for non-player actors TObjPtr<AActor*> poisoner; // NULL for non-player actors
TObjPtr<AActor> attacker; // who did damage (NULL for floors) TObjPtr<AActor*> attacker; // who did damage (NULL for floors)
int extralight; // so gun flashes light up areas int extralight; // so gun flashes light up areas
short fixedcolormap; // can be set to REDCOLORMAP, etc. short fixedcolormap; // can be set to REDCOLORMAP, etc.
short fixedlightlevel; short fixedlightlevel;
@ -451,19 +451,19 @@ public:
PClassActor *MorphedPlayerClass; // [MH] (for SBARINFO) class # for this player instance when morphed PClassActor *MorphedPlayerClass; // [MH] (for SBARINFO) class # for this player instance when morphed
int MorphStyle; // which effects to apply for this player instance when morphed int MorphStyle; // which effects to apply for this player instance when morphed
PClassActor *MorphExitFlash; // flash to apply when demorphing (cache of value given to P_MorphPlayer) PClassActor *MorphExitFlash; // flash to apply when demorphing (cache of value given to P_MorphPlayer)
TObjPtr<AWeapon> PremorphWeapon; // ready weapon before morphing TObjPtr<AWeapon*> PremorphWeapon; // ready weapon before morphing
int chickenPeck; // chicken peck countdown int chickenPeck; // chicken peck countdown
int jumpTics; // delay the next jump for a moment int jumpTics; // delay the next jump for a moment
bool onground; // Identifies if this player is on the ground or other object bool onground; // Identifies if this player is on the ground or other object
int respawn_time; // [RH] delay respawning until this tic int respawn_time; // [RH] delay respawning until this tic
TObjPtr<AActor> camera; // [RH] Whose eyes this player sees through TObjPtr<AActor*> camera; // [RH] Whose eyes this player sees through
int air_finished; // [RH] Time when you start drowning int air_finished; // [RH] Time when you start drowning
FName LastDamageType; // [RH] For damage-specific pain and death sounds FName LastDamageType; // [RH] For damage-specific pain and death sounds
TObjPtr<AActor> MUSINFOactor; // For MUSINFO purposes TObjPtr<AActor*> MUSINFOactor; // For MUSINFO purposes
SBYTE MUSINFOtics; SBYTE MUSINFOtics;
bool settings_controller; // Player can control game settings. bool settings_controller; // Player can control game settings.
@ -471,7 +471,7 @@ public:
SBYTE crouchdir; SBYTE crouchdir;
//Added by MC: //Added by MC:
TObjPtr<DBot> Bot; TObjPtr<DBot*> Bot;
float BlendR; // [RH] Final blending values float BlendR; // [RH] Final blending values
float BlendG; float BlendG;
@ -490,7 +490,7 @@ public:
FWeaponSlots weapons; FWeaponSlots weapons;
// [CW] I moved these here for multiplayer conversation support. // [CW] I moved these here for multiplayer conversation support.
TObjPtr<AActor> ConversationNPC, ConversationPC; TObjPtr<AActor*> ConversationNPC, ConversationPC;
DAngle ConversationNPCAngle; DAngle ConversationNPCAngle;
bool ConversationFaceTalker; bool ConversationFaceTalker;

View file

@ -115,7 +115,7 @@ struct DDecalThinker : public DThinker
public: public:
DDecalThinker (DBaseDecal *decal) : DThinker (STAT_DECALTHINKER), TheDecal (decal) {} DDecalThinker (DBaseDecal *decal) : DThinker (STAT_DECALTHINKER), TheDecal (decal) {}
void Serialize(FSerializer &arc); void Serialize(FSerializer &arc);
TObjPtr<DBaseDecal> TheDecal; TObjPtr<DBaseDecal*> TheDecal;
protected: protected:
DDecalThinker () : DThinker (STAT_DECALTHINKER) {} DDecalThinker () : DThinker (STAT_DECALTHINKER) {}
}; };

View file

@ -542,7 +542,7 @@ size_t DObject::StaticPointerSubstitution (DObject *old, DObject *notOld, bool s
for (auto &sec : level.sectors) for (auto &sec : level.sectors)
{ {
#define SECTOR_CHECK(f,t) \ #define SECTOR_CHECK(f,t) \
if (sec.f.p == static_cast<t *>(old)) { sec.f = static_cast<t *>(notOld); changed++; } if (sec.f.pp == static_cast<t *>(old)) { sec.f = static_cast<t *>(notOld); changed++; }
SECTOR_CHECK( SoundTarget, AActor ); SECTOR_CHECK( SoundTarget, AActor );
SECTOR_CHECK( SecActTarget, AActor ); SECTOR_CHECK( SecActTarget, AActor );
SECTOR_CHECK( floordata, DSectorEffect ); SECTOR_CHECK( floordata, DSectorEffect );
@ -552,9 +552,9 @@ if (sec.f.p == static_cast<t *>(old)) { sec.f = static_cast<t *>(notOld); change
} }
// Go through bot stuff. // Go through bot stuff.
if (bglobal.firstthing.p == (AActor *)old) bglobal.firstthing = (AActor *)notOld, ++changed; if (bglobal.firstthing.pp == (AActor *)old) bglobal.firstthing = (AActor *)notOld, ++changed;
if (bglobal.body1.p == (AActor *)old) bglobal.body1 = (AActor *)notOld, ++changed; if (bglobal.body1.pp == (AActor *)old) bglobal.body1 = (AActor *)notOld, ++changed;
if (bglobal.body2.p == (AActor *)old) bglobal.body2 = (AActor *)notOld, ++changed; if (bglobal.body2.pp == (AActor *)old) bglobal.body2 = (AActor *)notOld, ++changed;
return changed; return changed;
} }

View file

@ -348,70 +348,54 @@ class TObjPtr
{ {
union union
{ {
T *p; T pp;
DObject *o; DObject *o;
}; };
public: public:
TObjPtr() throw() TObjPtr() throw()
{ {
} }
TObjPtr(T *q) throw() TObjPtr(T q) throw()
: p(q) : pp(q)
{ {
} }
TObjPtr(const TObjPtr<T> &q) throw() TObjPtr(const TObjPtr<T> &q) throw()
: p(q.p) : pp(q.pp)
{ {
} }
T *operator=(T *q) throw() T operator=(T q) throw()
{ {
return p = q; return pp = q;
// The caller must now perform a write barrier. // The caller must now perform a write barrier.
} }
operator T*() throw() operator T() throw()
{ {
return GC::ReadBarrier(p); return GC::ReadBarrier(pp);
} }
T &operator*() T &operator*()
{ {
T *q = GC::ReadBarrier(p); T q = GC::ReadBarrier(pp);
assert(q != NULL); assert(q != NULL);
return *q; return *q;
} }
T **operator&() throw() T *operator&() throw()
{ {
// Does not perform a read barrier. The only real use for this is with // Does not perform a read barrier. The only real use for this is with
// the DECLARE_POINTER macro, where a read barrier would be a very bad // the DECLARE_POINTER macro, where a read barrier would be a very bad
// thing. // thing.
return &p; return &pp;
} }
T *operator->() throw() T operator->() throw()
{ {
return GC::ReadBarrier(p); return GC::ReadBarrier(pp);
} }
bool operator<(T *u) throw() bool operator!=(T u) throw()
{ {
return GC::ReadBarrier(p) < u; return GC::ReadBarrier(o) != u;
} }
bool operator<=(T *u) throw() bool operator==(T u) throw()
{ {
return GC::ReadBarrier(p) <= u; return GC::ReadBarrier(o) == u;
}
bool operator>(T *u) throw()
{
return GC::ReadBarrier(p) > u;
}
bool operator>=(T *u) throw()
{
return GC::ReadBarrier(p) >= u;
}
bool operator!=(T *u) throw()
{
return GC::ReadBarrier(p) != u;
}
bool operator==(T *u) throw()
{
return GC::ReadBarrier(p) == u;
} }
template<class U> friend inline void GC::Mark(TObjPtr<U> &obj); template<class U> friend inline void GC::Mark(TObjPtr<U> &obj);
@ -424,7 +408,7 @@ public:
// the contents of a TObjPtr to a related type. // the contents of a TObjPtr to a related type.
template<class T,class U> inline T barrier_cast(TObjPtr<U> &o) template<class T,class U> inline T barrier_cast(TObjPtr<U> &o)
{ {
return static_cast<T>(static_cast<U *>(o)); return static_cast<T>(static_cast<U>(o));
} }
template<class T> inline void GC::Mark(TObjPtr<T> &obj) template<class T> inline void GC::Mark(TObjPtr<T> &obj)

View file

@ -29,7 +29,7 @@ public:
DMover (sector_t *sector); DMover (sector_t *sector);
void StopInterpolation(bool force = false); void StopInterpolation(bool force = false);
protected: protected:
TObjPtr<DInterpolation> interpolation; TObjPtr<DInterpolation*> interpolation;
private: private:
protected: protected:
DMover (); DMover ();

View file

@ -3257,7 +3257,7 @@ void FParser::SF_SpawnMissile()
void FParser::SF_MapThingNumExist() void FParser::SF_MapThingNumExist()
{ {
TArray<TObjPtr<AActor> > &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings; auto &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings;
int intval; int intval;
@ -3295,7 +3295,7 @@ void FParser::SF_MapThingNumExist()
void FParser::SF_MapThings() void FParser::SF_MapThings()
{ {
TArray<TObjPtr<AActor> > &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings; auto &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings;
t_return.type = svt_int; t_return.type = svt_int;
t_return.value.i = SpawnedThings.Size(); t_return.value.i = SpawnedThings.Size();

View file

@ -375,7 +375,7 @@ void T_AddSpawnedThing(AActor * ac)
{ {
if (DFraggleThinker::ActiveThinker) if (DFraggleThinker::ActiveThinker)
{ {
TArray<TObjPtr<AActor> > &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings; auto &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings;
SpawnedThings.Push(GC::ReadBarrier(ac)); SpawnedThings.Push(GC::ReadBarrier(ac));
} }
} }

View file

@ -388,7 +388,7 @@ IMPLEMENT_POINTERS_START(DFraggleThinker)
IMPLEMENT_POINTER(LevelScript) IMPLEMENT_POINTER(LevelScript)
IMPLEMENT_POINTERS_END IMPLEMENT_POINTERS_END
TObjPtr<DFraggleThinker> DFraggleThinker::ActiveThinker; TObjPtr<DFraggleThinker*> DFraggleThinker::ActiveThinker;
//========================================================================== //==========================================================================
// //

View file

@ -174,11 +174,11 @@ struct DFsVariable : public DObject
public: public:
FString Name; FString Name;
TObjPtr<DFsVariable> next; // for hashing TObjPtr<DFsVariable*> next; // for hashing
int type; // svt_string or svt_int: same as in svalue_t int type; // svt_string or svt_int: same as in svalue_t
FString string; FString string;
TObjPtr<AActor> actor; TObjPtr<AActor*> actor;
union value_t union value_t
{ {
@ -241,7 +241,7 @@ public:
int start_index; int start_index;
int end_index; int end_index;
int loop_index; int loop_index;
TObjPtr<DFsSection> next; // for hashing TObjPtr<DFsSection*> next; // for hashing
DFsSection() DFsSection()
{ {
@ -320,27 +320,27 @@ public:
// {} sections // {} sections
TObjPtr<DFsSection> sections[SECTIONSLOTS]; TObjPtr<DFsSection*> sections[SECTIONSLOTS];
// variables: // variables:
TObjPtr<DFsVariable> variables[VARIABLESLOTS]; TObjPtr<DFsVariable*> variables[VARIABLESLOTS];
// ptr to the parent script // ptr to the parent script
// the parent script is the script above this level // the parent script is the script above this level
// eg. individual linetrigger scripts are children // eg. individual linetrigger scripts are children
// of the levelscript, which is a child of the // of the levelscript, which is a child of the
// global_script // global_script
TObjPtr<DFsScript> parent; TObjPtr<DFsScript*> parent;
// haleyjd: 8-17 // haleyjd: 8-17
// child scripts. // child scripts.
// levelscript holds ptrs to all of the level's scripts // levelscript holds ptrs to all of the level's scripts
// here. // here.
TObjPtr<DFsScript> children[MAXSCRIPTS]; TObjPtr<DFsScript*> children[MAXSCRIPTS];
TObjPtr<AActor> trigger; // object which triggered this script TObjPtr<AActor*> trigger; // object which triggered this script
bool lastiftrue; // haleyjd: whether last "if" statement was bool lastiftrue; // haleyjd: whether last "if" statement was
// true or false // true or false
@ -665,7 +665,7 @@ public:
void OnDestroy() override; void OnDestroy() override;
void Serialize(FSerializer &arc); void Serialize(FSerializer &arc);
TObjPtr<DFsScript> script; TObjPtr<DFsScript*> script;
// where we are // where we are
int save_point; int save_point;
@ -674,10 +674,10 @@ public:
int wait_data; // data for wait: tagnum, counter, script number etc int wait_data; // data for wait: tagnum, counter, script number etc
// saved variables // saved variables
TObjPtr<DFsVariable> variables[VARIABLESLOTS]; TObjPtr<DFsVariable*> variables[VARIABLESLOTS];
TObjPtr<DRunningScript> prev, next; // for chain TObjPtr<DRunningScript*> prev, next; // for chain
TObjPtr<AActor> trigger; TObjPtr<AActor*> trigger;
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -691,9 +691,9 @@ class DFraggleThinker : public DThinker
HAS_OBJECT_POINTERS HAS_OBJECT_POINTERS
public: public:
TObjPtr<DFsScript> LevelScript; TObjPtr<DFsScript*> LevelScript;
TObjPtr<DRunningScript> RunningScripts; TObjPtr<DRunningScript*> RunningScripts;
TArray<TObjPtr<AActor> > SpawnedThings; TArray<TObjPtr<AActor*> > SpawnedThings;
bool nocheckposition; bool nocheckposition;
bool setcolormaterial; bool setcolormaterial;
@ -708,7 +708,7 @@ public:
bool wait_finished(DRunningScript *script); bool wait_finished(DRunningScript *script);
void AddRunningScript(DRunningScript *runscr); void AddRunningScript(DRunningScript *runscr);
static TObjPtr<DFraggleThinker> ActiveThinker; static TObjPtr<DFraggleThinker*> ActiveThinker;
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -153,7 +153,7 @@ AActor* actorvalue(const svalue_t &svalue)
} }
else else
{ {
TArray<TObjPtr<AActor> > &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings; auto &SpawnedThings = DFraggleThinker::ActiveThinker->SpawnedThings;
// this requires some creativity. We use the intvalue // this requires some creativity. We use the intvalue
// as the thing number of a thing in the level. // as the thing number of a thing in the level.
intval = intvalue(svalue); intval = intvalue(svalue);

View file

@ -85,7 +85,7 @@ public:
AInventory *PrevInv(); // Returns the previous item with IF_INVBAR set. AInventory *PrevInv(); // Returns the previous item with IF_INVBAR set.
AInventory *NextInv(); // Returns the next item with IF_INVBAR set. AInventory *NextInv(); // Returns the next item with IF_INVBAR set.
TObjPtr<AActor> Owner; // Who owns this item? NULL if it's still a pickup. TObjPtr<AActor*> Owner; // Who owns this item? NULL if it's still a pickup.
int Amount; // Amount of item this instance has int Amount; // Amount of item this instance has
int MaxAmount; // Max amount of item this instance can have int MaxAmount; // Max amount of item this instance can have
int InterHubAmount; // Amount of item that can be kept between hubs or levels int InterHubAmount; // Amount of item that can be kept between hubs or levels

View file

@ -113,8 +113,8 @@ public:
int SlotPriority; int SlotPriority;
// In-inventory instance variables // In-inventory instance variables
TObjPtr<AInventory> Ammo1, Ammo2; TObjPtr<AInventory*> Ammo1, Ammo2;
TObjPtr<AWeapon> SisterWeapon; TObjPtr<AWeapon*> SisterWeapon;
float FOVScale; float FOVScale;
int Crosshair; // 0 to use player's crosshair int Crosshair; // 0 to use player's crosshair
bool GivenAsMorphWeapon; bool GivenAsMorphWeapon;

View file

@ -86,7 +86,7 @@ public:
DCorpsePointer (AActor *ptr); DCorpsePointer (AActor *ptr);
void OnDestroy() override; void OnDestroy() override;
void Serialize(FSerializer &arc); void Serialize(FSerializer &arc);
TObjPtr<AActor> Corpse; TObjPtr<AActor*> Corpse;
DWORD Count; // Only the first corpse pointer's count is valid. DWORD Count; // Only the first corpse pointer's count is valid.
private: private:
DCorpsePointer () {} DCorpsePointer () {}

View file

@ -95,7 +95,7 @@ protected:
float Blends[2][4]; float Blends[2][4];
int TotalTics; int TotalTics;
int StartTic; int StartTic;
TObjPtr<AActor> ForWho; TObjPtr<AActor*> ForWho;
void SetBlend (float time); void SetBlend (float time);
DFlashFader (); DFlashFader ();
@ -131,7 +131,7 @@ public:
void Serialize(FSerializer &arc); void Serialize(FSerializer &arc);
void Tick (); void Tick ();
TObjPtr<AActor> m_Spot; TObjPtr<AActor*> m_Spot;
double m_TremorRadius, m_DamageRadius; double m_TremorRadius, m_DamageRadius;
int m_Countdown; int m_Countdown;
int m_CountdownStart; int m_CountdownStart;
@ -164,7 +164,7 @@ public:
void Die (AActor *source, AActor *inflictor, int dmgflags); void Die (AActor *source, AActor *inflictor, int dmgflags);
void OnDestroy() override; void OnDestroy() override;
TObjPtr<AActor> UnmorphedMe; TObjPtr<AActor*> UnmorphedMe;
int UnmorphTime, MorphStyle; int UnmorphTime, MorphStyle;
PClassActor *MorphExitFlash; PClassActor *MorphExitFlash;
ActorFlags FlagsSave; ActorFlags FlagsSave;

View file

@ -46,7 +46,7 @@ static FRandom pr_spawnmace ("SpawnMace");
IMPLEMENT_CLASS(DSpotState, false, false) IMPLEMENT_CLASS(DSpotState, false, false)
IMPLEMENT_CLASS(ASpecialSpot, false, false) IMPLEMENT_CLASS(ASpecialSpot, false, false)
TObjPtr<DSpotState> DSpotState::SpotState; TObjPtr<DSpotState*> DSpotState::SpotState;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// //

View file

@ -21,7 +21,7 @@ struct FSpotList;
class DSpotState : public DThinker class DSpotState : public DThinker
{ {
DECLARE_CLASS(DSpotState, DThinker) DECLARE_CLASS(DSpotState, DThinker)
static TObjPtr<DSpotState> SpotState; static TObjPtr<DSpotState*> SpotState;
TArray<FSpotList> SpotLists; TArray<FSpotList> SpotLists;
public: public:

View file

@ -133,7 +133,7 @@ protected:
DHUDMessage () : SourceText(NULL) {} DHUDMessage () : SourceText(NULL) {}
private: private:
TObjPtr<DHUDMessage> Next; TObjPtr<DHUDMessage*> Next;
DWORD SBarID; DWORD SBarID;
char *SourceText; char *SourceText;
@ -415,7 +415,7 @@ private:
void DrawConsistancy () const; void DrawConsistancy () const;
void DrawWaiting () const; void DrawWaiting () const;
TObjPtr<DHUDMessage> Messages[NUM_HUDMSGLAYERS]; TObjPtr<DHUDMessage*> Messages[NUM_HUDMSGLAYERS];
bool ShowLog; bool ShowLog;
}; };

View file

@ -285,7 +285,7 @@ class DIntermissionController : public DObject
HAS_OBJECT_POINTERS HAS_OBJECT_POINTERS
FIntermissionDescriptor *mDesc; FIntermissionDescriptor *mDesc;
TObjPtr<DIntermissionScreen> mScreen; TObjPtr<DIntermissionScreen*> mScreen;
bool mDeleteDesc; bool mDeleteDesc;
bool mFirst; bool mFirst;
bool mAdvance, mSentAdvance; bool mAdvance, mSentAdvance;

View file

@ -628,7 +628,7 @@ class DSuicider : public DThinker
DECLARE_CLASS(DSuicider, DThinker) DECLARE_CLASS(DSuicider, DThinker)
HAS_OBJECT_POINTERS; HAS_OBJECT_POINTERS;
public: public:
TObjPtr<APlayerPawn> Pawn; TObjPtr<APlayerPawn*> Pawn;
void Tick() void Tick()
{ {

View file

@ -262,7 +262,7 @@ public:
MOUSE_Release MOUSE_Release
}; };
TObjPtr<DMenu> mParentMenu; TObjPtr<DMenu*> mParentMenu;
bool mMouseCapture; bool mMouseCapture;
bool mBackbuttonSelected; bool mBackbuttonSelected;
bool DontDim; bool DontDim;

View file

@ -1383,7 +1383,7 @@ private:
double WatchD, LastD; double WatchD, LastD;
int Special; int Special;
int Args[5]; int Args[5];
TObjPtr<AActor> Activator; TObjPtr<AActor*> Activator;
line_t *Line; line_t *Line;
bool LineSide; bool LineSide;
bool bCeiling; bool bCeiling;
@ -2879,7 +2879,7 @@ IMPLEMENT_POINTERS_START(DACSThinker)
IMPLEMENT_POINTER(Scripts) IMPLEMENT_POINTER(Scripts)
IMPLEMENT_POINTERS_END IMPLEMENT_POINTERS_END
TObjPtr<DACSThinker> DACSThinker::ActiveThinker; TObjPtr<DACSThinker*> DACSThinker::ActiveThinker;
DACSThinker::DACSThinker () DACSThinker::DACSThinker ()
: DThinker(STAT_SCRIPTS) : DThinker(STAT_SCRIPTS)

View file

@ -895,7 +895,7 @@ protected:
int *pc; int *pc;
EScriptState state; EScriptState state;
int statedata; int statedata;
TObjPtr<AActor> activator; TObjPtr<AActor*> activator;
line_t *activationline; line_t *activationline;
bool backSide; bool backSide;
FFont *activefont; FFont *activefont;
@ -955,7 +955,7 @@ public:
typedef TMap<int, DLevelScript *> ScriptMap; typedef TMap<int, DLevelScript *> ScriptMap;
ScriptMap RunningScripts; // Array of all synchronous scripts ScriptMap RunningScripts; // Array of all synchronous scripts
static TObjPtr<DACSThinker> ActiveThinker; static TObjPtr<DACSThinker*> ActiveThinker;
void DumpScriptStatus(); void DumpScriptStatus();
void StopScriptsFor (AActor *actor); void StopScriptsFor (AActor *actor);

View file

@ -90,8 +90,8 @@ private:
void Tick(); void Tick();
public: // must be public to be able to generate the field export tables. Grrr... public: // must be public to be able to generate the field export tables. Grrr...
TObjPtr<AActor> Caller; TObjPtr<AActor*> Caller;
TObjPtr<DPSprite> Next; TObjPtr<DPSprite*> Next;
player_t *Owner; player_t *Owner;
FState *State; FState *State;
int Sprite; int Sprite;

View file

@ -66,7 +66,7 @@ public:
protected: protected:
EPusher m_Type; EPusher m_Type;
TObjPtr<AActor> m_Source;// Point source if point pusher TObjPtr<AActor*> m_Source;// Point source if point pusher
DVector2 m_PushVec; DVector2 m_PushVec;
double m_Magnitude; // Vector strength for point pusher double m_Magnitude; // Vector strength for point pusher
double m_Radius; // Effective radius for point pusher double m_Radius; // Effective radius for point pusher

View file

@ -66,7 +66,7 @@ protected:
double m_vdx, m_vdy; // Accumulated velocity if accelerative double m_vdx, m_vdy; // Accumulated velocity if accelerative
int m_Accel; // Whether it's accelerative int m_Accel; // Whether it's accelerative
EScrollPos m_Parts; // Which parts of a sidedef are being scrolled? EScrollPos m_Parts; // Which parts of a sidedef are being scrolled?
TObjPtr<DInterpolation> m_Interpolations[3]; TObjPtr<DInterpolation*> m_Interpolations[3];
private: private:
DScroller () DScroller ()

View file

@ -254,8 +254,8 @@ protected:
double m_CeilingTarget; double m_CeilingTarget;
int m_Crush; int m_Crush;
bool m_Hexencrush; bool m_Hexencrush;
TObjPtr<DInterpolation> m_Interp_Ceiling; TObjPtr<DInterpolation*> m_Interp_Ceiling;
TObjPtr<DInterpolation> m_Interp_Floor; TObjPtr<DInterpolation*> m_Interp_Floor;
private: private:
DPillar (); DPillar ();
@ -595,8 +595,8 @@ protected:
double m_FloorDestDist; double m_FloorDestDist;
double m_CeilingDestDist; double m_CeilingDestDist;
double m_Speed; double m_Speed;
TObjPtr<DInterpolation> m_Interp_Ceiling; TObjPtr<DInterpolation*> m_Interp_Ceiling;
TObjPtr<DInterpolation> m_Interp_Floor; TObjPtr<DInterpolation*> m_Interp_Floor;
void StartFloorSound (); void StartFloorSound ();

View file

@ -3157,7 +3157,7 @@ void P_UnPredictPlayer ()
APlayerPawn *act = player->mo; APlayerPawn *act = player->mo;
AActor *savedcamera = player->camera; AActor *savedcamera = player->camera;
TObjPtr<AInventory> InvSel = act->InvSel; TObjPtr<AInventory*> InvSel = act->InvSel;
int inventorytics = player->inventorytics; int inventorytics = player->inventorytics;
*player = PredictionPlayerBackup; *player = PredictionPlayerBackup;

View file

@ -22,7 +22,7 @@ protected:
int m_PolyObj; int m_PolyObj;
double m_Speed; double m_Speed;
double m_Dist; double m_Dist;
TObjPtr<DInterpolation> m_Interpolation; TObjPtr<DInterpolation*> m_Interpolation;
void SetInterpolation(); void SetInterpolation();
}; };
@ -87,8 +87,8 @@ struct FPolyObj
int seqType; int seqType;
double Size; // polyobj size (area of POLY_AREAUNIT == size of FRACUNIT) double Size; // polyobj size (area of POLY_AREAUNIT == size of FRACUNIT)
FPolyNode *subsectorlinks; FPolyNode *subsectorlinks;
TObjPtr<DPolyAction> specialdata; // pointer to a thinker, if the poly is moving TObjPtr<DPolyAction*> specialdata; // pointer to a thinker, if the poly is moving
TObjPtr<DInterpolation> interpolation; TObjPtr<DInterpolation*> interpolation;
FPolyObj(); FPolyObj();
DInterpolation *SetInterpolation(); DInterpolation *SetInterpolation();

View file

@ -227,7 +227,7 @@ struct FSectorPortal
sector_t *mDestination; sector_t *mDestination;
DVector2 mDisplacement; DVector2 mDisplacement;
double mPlaneZ; double mPlaneZ;
TObjPtr<AActor> mSkybox; TObjPtr<AActor*> mSkybox;
bool MergeAllowed() const bool MergeAllowed() const
{ {

View file

@ -15,8 +15,8 @@ class DInterpolation : public DObject
DECLARE_ABSTRACT_CLASS(DInterpolation, DObject) DECLARE_ABSTRACT_CLASS(DInterpolation, DObject)
HAS_OBJECT_POINTERS HAS_OBJECT_POINTERS
TObjPtr<DInterpolation> Next; TObjPtr<DInterpolation*> Next;
TObjPtr<DInterpolation> Prev; TObjPtr<DInterpolation*> Prev;
protected: protected:
int refcount; int refcount;
@ -43,7 +43,7 @@ public:
struct FInterpolator struct FInterpolator
{ {
TObjPtr<DInterpolation> Head; TObjPtr<DInterpolation*> Head;
bool didInterp; bool didInterp;
int count; int count;

View file

@ -491,10 +491,10 @@ void FRemapTable::AddColourisation(int start, int end, int r, int g, int b)
{ {
for (int i = start; i < end; ++i) for (int i = start; i < end; ++i)
{ {
float br = GPalette.BaseColors[i].r; double br = GPalette.BaseColors[i].r;
float bg = GPalette.BaseColors[i].g; double bg = GPalette.BaseColors[i].g;
float bb = GPalette.BaseColors[i].b; double bb = GPalette.BaseColors[i].b;
float grey = (br * 0.299 + bg * 0.587 + bb * 0.114) / 255.0f; double grey = (br * 0.299 + bg * 0.587 + bb * 0.114) / 255.0f;
if (grey > 1.0) grey = 1.0; if (grey > 1.0) grey = 1.0;
br = r * grey; br = r * grey;
bg = g * grey; bg = g * grey;

View file

@ -975,7 +975,7 @@ public:
PalEntry SpecialColors[5]; PalEntry SpecialColors[5];
TObjPtr<AActor> SoundTarget; TObjPtr<AActor*> SoundTarget;
short special; short special;
short lightlevel; short lightlevel;
@ -996,9 +996,9 @@ public:
int terrainnum[2]; int terrainnum[2];
// thinker_t for reversable actions // thinker_t for reversable actions
TObjPtr<DSectorEffect> floordata; // jff 2/22/98 make thinkers on TObjPtr<DSectorEffect*> floordata; // jff 2/22/98 make thinkers on
TObjPtr<DSectorEffect> ceilingdata; // floors, ceilings, lighting, TObjPtr<DSectorEffect*> ceilingdata; // floors, ceilings, lighting,
TObjPtr<DSectorEffect> lightingdata; // independent of one another TObjPtr<DSectorEffect*> lightingdata; // independent of one another
enum enum
{ {
@ -1007,7 +1007,7 @@ public:
CeilingScroll, CeilingScroll,
FloorScroll FloorScroll
}; };
TObjPtr<DInterpolation> interpolations[4]; TObjPtr<DInterpolation*> interpolations[4];
int prevsec; // -1 or number of sector for previous step int prevsec; // -1 or number of sector for previous step
int nextsec; // -1 or number of next step sector int nextsec; // -1 or number of next step sector
@ -1044,7 +1044,7 @@ public:
// flexible in a Bloody way. SecActTarget forms a list of actors // flexible in a Bloody way. SecActTarget forms a list of actors
// joined by their tracer fields. When a potential sector action // joined by their tracer fields. When a potential sector action
// occurs, SecActTarget's TriggerAction method is called. // occurs, SecActTarget's TriggerAction method is called.
TObjPtr<AActor> SecActTarget; TObjPtr<AActor*> SecActTarget;
// [RH] The portal or skybox to render for this sector. // [RH] The portal or skybox to render for this sector.
unsigned Portals[2]; unsigned Portals[2];
@ -1126,7 +1126,7 @@ struct side_t
double xScale; double xScale;
double yScale; double yScale;
FTextureID texture; FTextureID texture;
TObjPtr<DInterpolation> interpolation; TObjPtr<DInterpolation*> interpolation;
//int Light; //int Light;
}; };

View file

@ -108,7 +108,7 @@ extern void R_ClearPastViewer (AActor *actor);
struct FCanvasTextureInfo struct FCanvasTextureInfo
{ {
FCanvasTextureInfo *Next; FCanvasTextureInfo *Next;
TObjPtr<AActor> Viewpoint; TObjPtr<AActor*> Viewpoint;
FCanvasTexture *Texture; FCanvasTexture *Texture;
FTextureID PicNum; FTextureID PicNum;
int FOV; int FOV;

View file

@ -126,7 +126,7 @@ public:
} }
private: private:
DSeqActorNode() {} DSeqActorNode() {}
TObjPtr<AActor> m_Actor; TObjPtr<AActor*> m_Actor;
}; };
class DSeqPolyNode : public DSeqNode class DSeqPolyNode : public DSeqNode

View file

@ -55,8 +55,8 @@ protected:
int m_ModeNum; int m_ModeNum;
TArray<int> m_SequenceChoices; TArray<int> m_SequenceChoices;
TObjPtr<DSeqNode> m_ChildSeqNode; TObjPtr<DSeqNode*> m_ChildSeqNode;
TObjPtr<DSeqNode> m_ParentSeqNode; TObjPtr<DSeqNode*> m_ParentSeqNode;
private: private:
static DSeqNode *SequenceListHead; static DSeqNode *SequenceListHead;