diff --git a/docs/classes.txt b/docs/classes.txt index 682d32296..543d7490d 100644 --- a/docs/classes.txt +++ b/docs/classes.txt @@ -173,7 +173,7 @@ IMPLEMENT_SERIAL. For a class that won't be saved to disk, do this: should be sure to change if you change the structs. The code for serializing sector_t and line_t can be found in P_SerializeWorld() in p_saveg.cpp. The code for serializing player_t is in p_user.cpp as - player_s::Serialize(). + player_t::Serialize(). To determine the type of an object, you can use the IsA() and IsKindOf() methods of DObject. IsA() tests if the object is an instance of a @@ -210,8 +210,8 @@ END_POINTERS If you add pointers to any class, you need to update this list accordingly. The player class uses a hack, because it is not derived from DObject, to -clear pointers. See player_s::FixPointers() in p_user.cpp if you add any -pointers to player_s. +clear pointers. See player_t::FixPointers() in p_user.cpp if you add any +pointers to player_t. When you want to destroy any object derived from DThinker (this includes all actors), call that object's Destroy() method. Do not use delete, because it diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 3c2183a25..d482056f4 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -5158,7 +5158,7 @@ May 15, 2006 There is one important caveat, however. It is not acceptable to blindly 0 an FString's contents. This necessitated the creation of a proper - constructor for player_s so that it can be reset without using memset. I + constructor for player_t so that it can be reset without using memset. I did a quick scan of all memsets in the source and didn't see anything else with a similar problem, but it's possible I missed something. - Fixed: Build tiles were never deallocated. @@ -7648,7 +7648,7 @@ October 6, 2004 October 5, 2004 - Removed MF_NOBLOCKMAP from ColonGibs, SmallBloodPool, BrainStem, and BloodPool. I can't see any good reason for them to have this flag set. -- Fixed: player_s::Serialize() set PendingWeapon to WP_NOCHANGE. I have no idea why. +- Fixed: player_t::Serialize() set PendingWeapon to WP_NOCHANGE. I have no idea why. - Added a playing of "minotaur/attack3" to A_MinotaurAtk3(). - Fixed: R_FakeFlat() did not set FakeSide to FAKED_BelowFloor when viewing a fake plane with SECF_CLIPFAKEPLANES and SECF_FAKEFLOORONLY set and the fake floor @@ -11757,7 +11757,7 @@ February 12, 2002 are allowed and vice versa. February 11, 2002 -- The player_s struct now serializes the camera. Before, it always set it to +- The player_t struct now serializes the camera. Before, it always set it to mo when loading. I'm not sure why I did that, because it meant you lost your camera view when loading a game saved from a different camera. - Fixed: SetWeapon only worked if passed the name of a Doom weapon. Anything @@ -15193,7 +15193,7 @@ August 5, 1999 including the ones that were created while reading the sectors. Storing the thinkers before anything else avoids this. - Moved the serialization of player data into G_SerializeLevel. The bots - use pointers to some actors in their player_s, so we need to keep the + use pointers to some actors in their player_t, so we need to keep the player data in the same context as the actors they reference. (i.e. They need to go in the level snapshot instead of outside of them as was done previously.) diff --git a/src/actor.h b/src/actor.h index 064a3c3ae..4e35e82c2 100644 --- a/src/actor.h +++ b/src/actor.h @@ -664,7 +664,7 @@ public: // player to freeze a bit after teleporting SDWORD threshold; // if > 0, the target will be chased // no matter what (even if shot) - player_s *player; // only valid if type of APlayerPawn + player_t *player; // only valid if type of APlayerPawn TObjPtr LastLookActor; // Actor last looked for (if TIDtoHate != 0) fixed_t SpawnPoint[3]; // For nightmare respawn WORD SpawnAngle; diff --git a/src/b_bot.h b/src/b_bot.h index 5dfbe73f1..7c74d987c 100644 --- a/src/b_bot.h +++ b/src/b_bot.h @@ -86,7 +86,7 @@ public: void Main (int buf); void Init (); void End(); - void CleanBotstuff (player_s *p); + void CleanBotstuff (player_t *p); bool SpawnBot (const char *name, int color = NOCOLOR); bool LoadBots (); void ForgetBots (); diff --git a/src/d_netinf.h b/src/d_netinf.h index beb9e789e..e3989e247 100644 --- a/src/d_netinf.h +++ b/src/d_netinf.h @@ -82,7 +82,7 @@ void D_ReadUserInfoStrings (int player, BYTE **stream, bool update); void D_GetPlayerColor (int player, float *h, float *s, float *v); void D_PickRandomTeam (int player); int D_PickRandomTeam (); -class player_s; -int D_GetFragCount (player_s *player); +class player_t; +int D_GetFragCount (player_t *player); #endif //__D_CLIENTINFO_H__ diff --git a/src/d_player.h b/src/d_player.h index c57434214..d89b5d23e 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -62,7 +62,7 @@ enum APMETA_Hexenarmor4, }; -class player_s; +class player_t; class APlayerPawn : public AActor { @@ -186,10 +186,10 @@ typedef enum // // Extended player object info: player_t // -class player_s +class player_t { public: - player_s(); + player_t(); void Serialize (FArchive &arc); size_t FixPointers (const DObject *obj, DObject *replacement); @@ -346,13 +346,11 @@ public: int GetSpawnClass(); }; -typedef player_s player_t; - // Bookkeeping on players - state. -extern player_s players[MAXPLAYERS]; +extern player_t players[MAXPLAYERS]; extern DWORD playerswiping; -inline FArchive &operator<< (FArchive &arc, player_s *&p) +inline FArchive &operator<< (FArchive &arc, player_t *&p) { return arc.SerializePointer (players, (BYTE **)&p, sizeof(*players)); } diff --git a/src/dthinker.h b/src/dthinker.h index 4d0dc2479..b1e1d6f06 100644 --- a/src/dthinker.h +++ b/src/dthinker.h @@ -38,7 +38,7 @@ #include "dobject.h" class AActor; -class player_s; +class player_t; struct pspdef_s; typedef void (*actionf_p)( AActor* ); diff --git a/src/g_hexen/hexen_sbar.cpp b/src/g_hexen/hexen_sbar.cpp index 1a12a82aa..475683cf3 100644 --- a/src/g_hexen/hexen_sbar.cpp +++ b/src/g_hexen/hexen_sbar.cpp @@ -309,7 +309,7 @@ public: } } - void AttachToPlayer (player_s *player) + void AttachToPlayer (player_t *player) { DBaseStatusBar::AttachToPlayer (player); if (player->mo != NULL) diff --git a/src/g_shared/a_artifacts.h b/src/g_shared/a_artifacts.h index e4ade50f5..82786c4c9 100644 --- a/src/g_shared/a_artifacts.h +++ b/src/g_shared/a_artifacts.h @@ -20,7 +20,7 @@ return arc; \ } -class player_s; +class player_t; // A powerup is a pseudo-inventory item that applies an effect to its // owner while it is present. @@ -267,7 +267,7 @@ protected: void InitEffect (); void EndEffect (); // Variables - player_s *Player; + player_t *Player; }; #endif //__A_ARTIFACTS_H__ diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index 80e31d6f3..fd20fa8db 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -166,7 +166,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, const PClass *spawntype, i // //---------------------------------------------------------------------------- -bool P_UndoPlayerMorph (player_s *activator, player_t *player, bool force) +bool P_UndoPlayerMorph (player_t *activator, player_t *player, bool force) { AWeapon *beastweap; APlayerPawn *mo; @@ -469,7 +469,7 @@ bool P_UpdateMorphedMonster (AMorphedMonster *beast) // // Unmorphs the actor if possible. // Returns the unmorphed actor, the style with which they were morphed and the -// health (of the AActor, not the player_s) they last had before unmorphing. +// health (of the AActor, not the player_t) they last had before unmorphing. // //---------------------------------------------------------------------------- diff --git a/src/g_shared/a_morph.h b/src/g_shared/a_morph.h index c8afbed5d..7ae83aed4 100644 --- a/src/g_shared/a_morph.h +++ b/src/g_shared/a_morph.h @@ -27,12 +27,12 @@ enum struct PClass; class AActor; -class player_s; +class player_t; class AMorphedMonster; -bool P_MorphPlayer (player_s *activator, player_s *player, const PClass *morphclass, int duration = 0, int style = 0, +bool P_MorphPlayer (player_t *activator, player_t *player, const PClass *morphclass, int duration = 0, int style = 0, const PClass *enter_flash = NULL, const PClass *exit_flash = NULL); -bool P_UndoPlayerMorph (player_s *activator, player_s *player, bool force = false); +bool P_UndoPlayerMorph (player_t *activator, player_t *player, bool force = false); bool P_MorphMonster (AActor *actor, const PClass *morphclass, int duration = 0, int style = 0, const PClass *enter_flash = NULL, const PClass *exit_flash = NULL); bool P_UndoMonsterMorph (AMorphedMonster *beast, bool force = false); diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index 03bb0a7a2..2582ffb41 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -10,7 +10,7 @@ #define MAX_WEAPONS_PER_SLOT 8 #define NUM_WEAPON_SLOTS 10 -class player_s; +class player_t; class FConfigFile; class AWeapon; @@ -21,7 +21,7 @@ public: void Clear (); bool AddWeapon (const char *type); bool AddWeapon (const PClass *type); - AWeapon *PickWeapon (player_s *player); + AWeapon *PickWeapon (player_t *player); int CountWeapons (); inline const PClass *GetWeapon (int index) const @@ -29,8 +29,8 @@ public: return Weapons[index]; } - friend AWeapon *PickNextWeapon (player_s *player); - friend AWeapon *PickPrevWeapon (player_s *player); + friend AWeapon *PickNextWeapon (player_t *player); + friend AWeapon *PickPrevWeapon (player_t *player); friend struct FWeaponSlots; @@ -38,8 +38,8 @@ private: const PClass *Weapons[MAX_WEAPONS_PER_SLOT]; }; -AWeapon *PickNextWeapon (player_s *player); -AWeapon *PickPrevWeapon (player_s *player); +AWeapon *PickNextWeapon (player_t *player); +AWeapon *PickPrevWeapon (player_t *player); // FWeaponSlots::AddDefaultWeapon return codes enum ESlotDef diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index 560dacd4d..c903c04a8 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -691,7 +691,7 @@ bool FWeaponSlots::LocateWeapon (const PClass *type, int *const slot, int *const return false; } -static bool FindMostRecentWeapon (player_s *player, int *slot, int *index) +static bool FindMostRecentWeapon (player_t *player, int *slot, int *index) { if (player->PendingWeapon != WP_NOCHANGE) { @@ -728,7 +728,7 @@ static bool FindMostRecentWeapon (player_s *player, int *slot, int *index) } } -AWeapon *PickNextWeapon (player_s *player) +AWeapon *PickNextWeapon (player_t *player) { int startslot, startindex; @@ -760,7 +760,7 @@ AWeapon *PickNextWeapon (player_s *player) return player->ReadyWeapon; } -AWeapon *PickPrevWeapon (player_s *player) +AWeapon *PickPrevWeapon (player_t *player) { int startslot, startindex; diff --git a/src/g_shared/sbar.h b/src/g_shared/sbar.h index 66ce4f08c..61cc62b77 100644 --- a/src/g_shared/sbar.h +++ b/src/g_shared/sbar.h @@ -38,7 +38,7 @@ #include "v_text.h" struct patch_t; -class player_s; +class player_t; struct FRemapTable; extern int SB_state; @@ -196,14 +196,14 @@ private: FMugShotState(); }; -class player_s; +class player_t; struct FMugShot { FMugShot(); - void Tick(player_s *player); + void Tick(player_t *player); bool SetState(const char *state_name, bool wait_till_done=false); - int UpdateState(player_s *player, bool xdeath, bool animated_god_mode); - FTexture *GetFace(player_s *player, const char *default_face, int accuracy, bool xdeath, bool animated_god_mode); + int UpdateState(player_t *player, bool xdeath, bool animated_god_mode); + FTexture *GetFace(player_t *player, const char *default_face, int accuracy, bool xdeath, bool animated_god_mode); FMugShotState *CurrentState; int RampageTimer; @@ -281,7 +281,7 @@ public: virtual void Draw (EHudState state); void DrawTopStuff (EHudState state); virtual void FlashItem (const PClass *itemtype); - virtual void AttachToPlayer (player_s *player); + virtual void AttachToPlayer (player_t *player); virtual void FlashCrosshair (); virtual void BlendView (float blend[4]); virtual void SetFace (void *skn); // Takes a FPlayerSkin as input @@ -344,7 +344,7 @@ public: }; FImageCollection Images; - player_s *CPlayer; + player_t *CPlayer; private: DBaseStatusBar() {} diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index c6f479ff2..df72de5db 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -230,7 +230,7 @@ void DBaseStatusBar::SetScaled (bool scale) // //--------------------------------------------------------------------------- -void DBaseStatusBar::AttachToPlayer (player_s *player) +void DBaseStatusBar::AttachToPlayer (player_t *player) { CPlayer = player; SB_state = screen->GetPageCount (); diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 9380ea80c..b2b8559a6 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -45,7 +45,7 @@ extern int chatmodeon; // [RH] Draw deathmatch scores -class player_s; -void HU_DrawScores (player_s *me); +class player_t; +void HU_DrawScores (player_t *me); #endif diff --git a/src/m_cheat.h b/src/m_cheat.h index fe304630c..d273965ae 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -28,12 +28,12 @@ // // [RH] Functions that actually perform the cheating -class player_s; +class player_t; struct PClass; -void cht_DoCheat (player_s *player, int cheat); -void cht_Give (player_s *player, const char *item, int amount=1); -void cht_Take (player_s *player, const char *item, int amount=1); -void cht_Suicide (player_s *player); -const char *cht_Morph (player_s *player, const PClass *morphclass, bool quickundo); +void cht_DoCheat (player_t *player, int cheat); +void cht_Give (player_t *player, const char *item, int amount=1); +void cht_Take (player_t *player, const char *item, int amount=1); +void cht_Suicide (player_t *player); +const char *cht_Morph (player_t *player, const PClass *morphclass, bool quickundo); #endif diff --git a/src/p_local.h b/src/p_local.h index cd30a60ed..07afe057a 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -23,7 +23,7 @@ #ifndef __P_LOCAL__ #define __P_LOCAL__ -#ifndef __R_LOCAL__ +#ifndef __R_LOCAL_H__ #include "r_local.h" #endif diff --git a/src/p_pspr.h b/src/p_pspr.h index 2e2e87c89..8970556a3 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -81,15 +81,15 @@ typedef struct pspdef_s FArchive &operator<< (FArchive &, pspdef_t &); -class player_s; +class player_t; -void P_SetPsprite (player_s *player, int position, FState *state); -void P_SetPspriteNF (player_s *player, int position, FState *state); -void P_CalcSwing (player_s *player); -void P_BringUpWeapon (player_s *player); -void P_FireWeapon (player_s *player); -void P_DropWeapon (player_s *player); -void P_BobWeapon (player_s *player, pspdef_t *psp, fixed_t *x, fixed_t *y); +void P_SetPsprite (player_t *player, int position, FState *state); +void P_SetPspriteNF (player_t *player, int position, FState *state); +void P_CalcSwing (player_t *player); +void P_BringUpWeapon (player_t *player); +void P_FireWeapon (player_t *player); +void P_DropWeapon (player_t *player); +void P_BobWeapon (player_t *player, pspdef_t *psp, fixed_t *x, fixed_t *y); angle_t P_BulletSlope (AActor *mo, AActor **pLineTarget = NULL); void P_GunShot (AActor *mo, bool accurate, const PClass *pufftype, angle_t pitch); diff --git a/src/p_user.cpp b/src/p_user.cpp index 3c1d48b87..fc1dc9133 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -199,9 +199,9 @@ CCMD (playerclasses) bool onground; -// The player_s constructor. Since LogText is not a POD, we cannot just +// The player_t constructor. Since LogText is not a POD, we cannot just // memset it all to 0. -player_s::player_s() +player_t::player_t() : mo(0), playerstate(0), cls(0), @@ -298,15 +298,15 @@ player_s::player_s() } // This function supplements the pointer cleanup in dobject.cpp, because -// player_s is not derived from DObject. (I tried it, and DestroyScan was +// player_t is not derived from DObject. (I tried it, and DestroyScan was // unable to properly determine the player object's type--possibly // because it gets staticly allocated in an array.) // -// This function checks all the DObject pointers in a player_s and NULLs any +// This function checks all the DObject pointers in a player_t and NULLs any // that match the pointer passed in. If you add any pointers that point to // DObject (or a subclass), add them here too. -size_t player_s::FixPointers (const DObject *old, DObject *rep) +size_t player_t::FixPointers (const DObject *old, DObject *rep) { APlayerPawn *replacement = static_cast(rep); size_t changed = 0; @@ -327,7 +327,7 @@ size_t player_s::FixPointers (const DObject *old, DObject *rep) return changed; } -size_t player_s::PropagateMark() +size_t player_t::PropagateMark() { GC::Mark(mo); GC::Mark(poisoner); @@ -349,7 +349,7 @@ size_t player_s::PropagateMark() return sizeof(*this); } -void player_s::SetLogNumber (int num) +void player_t::SetLogNumber (int num) { char lumpname[16]; int lumpnum; @@ -377,7 +377,7 @@ void player_s::SetLogNumber (int num) } } -void player_s::SetLogText (const char *text) +void player_t::SetLogText (const char *text) { LogText = text; } @@ -2387,7 +2387,7 @@ void P_UnPredictPlayer () } } -void player_s::Serialize (FArchive &arc) +void player_t::Serialize (FArchive &arc) { int i; diff --git a/src/r_defs.h b/src/r_defs.h index 34ac7ffca..eb4fec1b6 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -84,7 +84,7 @@ struct vertex_t // Forward of LineDefs, for Sectors. struct line_t; -class player_s; +class player_t; class FScanner; class FBitmap; struct FCopyInfo;