mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +00:00
- got rid of FNameNoInit and made the default constructor of FName non-initializing.
This setup has been a constant source of problems so now I reviewed all uses of FName to make sure that everything that needs to be initialized is done manually. This also merges the player_t constructor into the class definition as default values.
This commit is contained in:
parent
34f2d8f310
commit
fad406c4c9
47 changed files with 177 additions and 301 deletions
14
src/actor.h
14
src/actor.h
|
@ -1141,7 +1141,7 @@ public:
|
||||||
uint8_t WeaveIndexZ;
|
uint8_t WeaveIndexZ;
|
||||||
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
|
FName 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)
|
||||||
|
@ -1184,12 +1184,12 @@ public:
|
||||||
line_t *BlockingLine; // Line that blocked the last move
|
line_t *BlockingLine; // Line that blocked the last move
|
||||||
|
|
||||||
int PoisonDamage; // Damage received per tic from poison.
|
int PoisonDamage; // Damage received per tic from poison.
|
||||||
FNameNoInit PoisonDamageType; // Damage type dealt by poison.
|
FName PoisonDamageType; // Damage type dealt by poison.
|
||||||
int PoisonDuration; // Duration left for receiving poison damage.
|
int PoisonDuration; // Duration left for receiving poison damage.
|
||||||
int PoisonPeriod; // How often poison damage is applied. (Every X tics.)
|
int PoisonPeriod; // How often poison damage is applied. (Every X tics.)
|
||||||
|
|
||||||
int PoisonDamageReceived; // Damage received per tic from poison.
|
int PoisonDamageReceived; // Damage received per tic from poison.
|
||||||
FNameNoInit PoisonDamageTypeReceived; // Damage type received by poison.
|
FName 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.
|
||||||
|
@ -1229,13 +1229,13 @@ public:
|
||||||
int32_t Mass;
|
int32_t Mass;
|
||||||
int16_t PainChance;
|
int16_t PainChance;
|
||||||
int PainThreshold;
|
int PainThreshold;
|
||||||
FNameNoInit DamageType;
|
FName DamageType;
|
||||||
FNameNoInit DamageTypeReceived;
|
FName DamageTypeReceived;
|
||||||
double DamageFactor;
|
double DamageFactor;
|
||||||
double DamageMultiply;
|
double DamageMultiply;
|
||||||
|
|
||||||
FNameNoInit PainType;
|
FName PainType;
|
||||||
FNameNoInit DeathType;
|
FName DeathType;
|
||||||
PClassActor *TeleFogSourceType;
|
PClassActor *TeleFogSourceType;
|
||||||
PClassActor *TeleFogDestType;
|
PClassActor *TeleFogDestType;
|
||||||
int RipperLevel;
|
int RipperLevel;
|
||||||
|
|
|
@ -1807,7 +1807,7 @@ struct TabData
|
||||||
FName TabName;
|
FName TabName;
|
||||||
|
|
||||||
TabData()
|
TabData()
|
||||||
: UseCount(0)
|
: UseCount(0), TabName(NAME_None)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -756,7 +756,7 @@ void D_ReadUserInfoStrings (int pnum, uint8_t **stream, bool update)
|
||||||
const char *breakpt;
|
const char *breakpt;
|
||||||
FString value;
|
FString value;
|
||||||
bool compact;
|
bool compact;
|
||||||
FName keyname;
|
FName keyname = NAME_None;
|
||||||
unsigned int infotype = 0;
|
unsigned int infotype = 0;
|
||||||
|
|
||||||
if (*ptr++ != '\\')
|
if (*ptr++ != '\\')
|
||||||
|
@ -925,8 +925,6 @@ void WriteUserInfo(FSerializer &arc, userinfo_t &info)
|
||||||
|
|
||||||
void ReadUserInfo(FSerializer &arc, userinfo_t &info, FString &skin)
|
void ReadUserInfo(FSerializer &arc, userinfo_t &info, FString &skin)
|
||||||
{
|
{
|
||||||
FName name;
|
|
||||||
FBaseCVar **cvar;
|
|
||||||
UCVarValue val;
|
UCVarValue val;
|
||||||
const char *key;
|
const char *key;
|
||||||
const char *str;
|
const char *str;
|
||||||
|
@ -938,8 +936,8 @@ void ReadUserInfo(FSerializer &arc, userinfo_t &info, FString &skin)
|
||||||
while ((key = arc.GetKey()))
|
while ((key = arc.GetKey()))
|
||||||
{
|
{
|
||||||
arc.StringPtr(nullptr, str);
|
arc.StringPtr(nullptr, str);
|
||||||
name = key;
|
FName name = key;
|
||||||
cvar = info.CheckKey(name);
|
FBaseCVar **cvar = info.CheckKey(name);
|
||||||
if (cvar != NULL && *cvar != NULL)
|
if (cvar != NULL && *cvar != NULL)
|
||||||
{
|
{
|
||||||
switch (name)
|
switch (name)
|
||||||
|
|
164
src/d_player.h
164
src/d_player.h
|
@ -141,7 +141,7 @@ public:
|
||||||
double SideMove1, SideMove2;
|
double SideMove1, SideMove2;
|
||||||
FTextureID ScoreIcon;
|
FTextureID ScoreIcon;
|
||||||
int SpawnMask;
|
int SpawnMask;
|
||||||
FNameNoInit MorphWeapon;
|
FName MorphWeapon;
|
||||||
double AttackZOffset; // attack height, relative to player center
|
double AttackZOffset; // attack height, relative to player center
|
||||||
double UseRange; // [NS] Distance at which player can +use
|
double UseRange; // [NS] Distance at which player can +use
|
||||||
double AirCapacity; // Multiplier for air supply underwater.
|
double AirCapacity; // Multiplier for air supply underwater.
|
||||||
|
@ -155,10 +155,10 @@ public:
|
||||||
double ViewBob;
|
double ViewBob;
|
||||||
|
|
||||||
// Former class properties that were moved into the object to get rid of the meta class.
|
// Former class properties that were moved into the object to get rid of the meta class.
|
||||||
FNameNoInit SoundClass; // Sound class
|
FName SoundClass; // Sound class
|
||||||
FNameNoInit Face; // Doom status bar face (when used)
|
FName Face; // Doom status bar face (when used)
|
||||||
FNameNoInit Portrait;
|
FName Portrait;
|
||||||
FNameNoInit Slot[10];
|
FName Slot[10];
|
||||||
double HexenArmor[5];
|
double HexenArmor[5];
|
||||||
uint8_t ColorRangeStart; // Skin color range
|
uint8_t ColorRangeStart; // Skin color range
|
||||||
uint8_t ColorRangeEnd;
|
uint8_t ColorRangeEnd;
|
||||||
|
@ -372,7 +372,7 @@ void WriteUserInfo(FSerializer &arc, userinfo_t &info);
|
||||||
class player_t
|
class player_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
player_t();
|
player_t() = default;
|
||||||
~player_t();
|
~player_t();
|
||||||
player_t &operator= (const player_t &p);
|
player_t &operator= (const player_t &p);
|
||||||
|
|
||||||
|
@ -384,117 +384,117 @@ public:
|
||||||
void SetLogText (const char *text);
|
void SetLogText (const char *text);
|
||||||
void SendPitchLimits() const;
|
void SendPitchLimits() const;
|
||||||
|
|
||||||
APlayerPawn *mo;
|
APlayerPawn *mo = nullptr;
|
||||||
uint8_t playerstate;
|
uint8_t playerstate = 0;
|
||||||
ticcmd_t cmd;
|
ticcmd_t cmd = {};
|
||||||
usercmd_t original_cmd;
|
usercmd_t original_cmd;
|
||||||
uint32_t original_oldbuttons;
|
uint32_t original_oldbuttons;
|
||||||
|
|
||||||
userinfo_t userinfo; // [RH] who is this?
|
userinfo_t userinfo; // [RH] who is this?
|
||||||
|
|
||||||
PClassActor *cls; // class of associated PlayerPawn
|
PClassActor *cls = nullptr; // class of associated PlayerPawn
|
||||||
|
|
||||||
float DesiredFOV; // desired field of vision
|
float DesiredFOV = 0; // desired field of vision
|
||||||
float FOV; // current field of vision
|
float FOV = 0; // current field of vision
|
||||||
double viewz; // focal origin above r.z
|
double viewz = 0; // focal origin above r.z
|
||||||
double viewheight; // base height above floor for viewz
|
double viewheight = 0; // base height above floor for viewz
|
||||||
double deltaviewheight; // squat speed.
|
double deltaviewheight = 0; // squat speed.
|
||||||
double bob; // bounded/scaled total velocity
|
double bob = 0; // bounded/scaled total velocity
|
||||||
|
|
||||||
// killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
|
// killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
|
||||||
// mo->velx and mo->vely represent true velocity experienced by player.
|
// mo->velx and mo->vely represent true velocity experienced by player.
|
||||||
// This only represents the thrust that the player applies himself.
|
// This only represents the thrust that the player applies himself.
|
||||||
// This avoids anomalies with such things as Boom ice and conveyors.
|
// This avoids anomalies with such things as Boom ice and conveyors.
|
||||||
DVector2 Vel;
|
DVector2 Vel = { 0,0 };
|
||||||
|
|
||||||
bool centering;
|
bool centering = false;
|
||||||
uint8_t turnticks;
|
uint8_t turnticks = 0;
|
||||||
|
|
||||||
|
|
||||||
bool attackdown;
|
bool attackdown = false;
|
||||||
bool usedown;
|
bool usedown = false;
|
||||||
uint32_t oldbuttons;
|
uint32_t oldbuttons = false;
|
||||||
int health; // only used between levels, mo->health
|
int health = 0; // only used between levels, mo->health
|
||||||
// is used during levels
|
// is used during levels
|
||||||
|
|
||||||
int inventorytics;
|
int inventorytics = 0;
|
||||||
uint8_t CurrentPlayerClass; // class # for this player instance
|
uint8_t CurrentPlayerClass = 0; // class # for this player instance
|
||||||
|
|
||||||
int frags[MAXPLAYERS]; // kills of other players
|
int frags[MAXPLAYERS] = {}; // kills of other players
|
||||||
int fragcount; // [RH] Cumulative frags for this player
|
int fragcount = 0; // [RH] Cumulative frags for this player
|
||||||
int lastkilltime; // [RH] For multikills
|
int lastkilltime = 0; // [RH] For multikills
|
||||||
uint8_t multicount;
|
uint8_t multicount = 0;
|
||||||
uint8_t spreecount; // [RH] Keep track of killing sprees
|
uint8_t spreecount = 0; // [RH] Keep track of killing sprees
|
||||||
uint16_t WeaponState;
|
uint16_t WeaponState = 0;
|
||||||
|
|
||||||
AWeapon *ReadyWeapon;
|
AWeapon *ReadyWeapon = nullptr;
|
||||||
AWeapon *PendingWeapon; // WP_NOCHANGE if not changing
|
AWeapon *PendingWeapon = nullptr; // WP_NOCHANGE if not changing
|
||||||
TObjPtr<DPSprite*> psprites; // view sprites (gun, etc)
|
TObjPtr<DPSprite*> psprites = nullptr; // view sprites (gun, etc)
|
||||||
|
|
||||||
int cheats; // bit flags
|
int cheats = 0; // bit flags
|
||||||
int timefreezer; // Player has an active time freezer
|
int timefreezer = 0; // Player has an active time freezer
|
||||||
short refire; // refired shots are less accurate
|
short refire = 0; // refired shots are less accurate
|
||||||
short inconsistant;
|
short inconsistant = 0;
|
||||||
bool waiting;
|
bool waiting = 0;
|
||||||
int killcount, itemcount, secretcount; // for intermission
|
int killcount = 0, itemcount = 0, secretcount = 0; // for intermission
|
||||||
int damagecount, bonuscount;// for screen flashing
|
int damagecount = 0, bonuscount = 0;// for screen flashing
|
||||||
int hazardcount; // for delayed Strife damage
|
int hazardcount = 0; // for delayed Strife damage
|
||||||
int hazardinterval; // Frequency of damage infliction
|
int hazardinterval = 0; // Frequency of damage infliction
|
||||||
FName hazardtype; // Damage type of last hazardous damage encounter.
|
FName hazardtype = NAME_None; // Damage type of last hazardous damage encounter.
|
||||||
int poisoncount; // screen flash for poison damage
|
int poisoncount = 0; // screen flash for poison damage
|
||||||
FName poisontype; // type of poison damage to apply
|
FName poisontype = NAME_None; // type of poison damage to apply
|
||||||
FName poisonpaintype; // type of Pain state to enter for poison damage
|
FName poisonpaintype = NAME_None; // type of Pain state to enter for poison damage
|
||||||
TObjPtr<AActor*> poisoner; // NULL for non-player actors
|
TObjPtr<AActor*> poisoner = nullptr; // NULL for non-player actors
|
||||||
TObjPtr<AActor*> attacker; // who did damage (NULL for floors)
|
TObjPtr<AActor*> attacker = nullptr; // who did damage (NULL for floors)
|
||||||
int extralight; // so gun flashes light up areas
|
int extralight = 0; // so gun flashes light up areas
|
||||||
short fixedcolormap; // can be set to REDCOLORMAP, etc.
|
short fixedcolormap = 0; // can be set to REDCOLORMAP, etc.
|
||||||
short fixedlightlevel;
|
short fixedlightlevel = 0;
|
||||||
int morphTics; // player is a chicken/pig if > 0
|
int morphTics = 0; // player is a chicken/pig if > 0
|
||||||
PClassActor *MorphedPlayerClass; // [MH] (for SBARINFO) class # for this player instance when morphed
|
PClassActor *MorphedPlayerClass = nullptr; // [MH] (for SBARINFO) class # for this player instance when morphed
|
||||||
int MorphStyle; // which effects to apply for this player instance when morphed
|
int MorphStyle = 0; // 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 = nullptr; // flash to apply when demorphing (cache of value given to P_MorphPlayer)
|
||||||
TObjPtr<AWeapon*> PremorphWeapon; // ready weapon before morphing
|
TObjPtr<AWeapon*> PremorphWeapon = nullptr; // ready weapon before morphing
|
||||||
int chickenPeck; // chicken peck countdown
|
int chickenPeck = 0; // chicken peck countdown
|
||||||
int jumpTics; // delay the next jump for a moment
|
int jumpTics = 0; // delay the next jump for a moment
|
||||||
bool onground; // Identifies if this player is on the ground or other object
|
bool onground = 0; // Identifies if this player is on the ground or other object
|
||||||
|
|
||||||
int respawn_time; // [RH] delay respawning until this tic
|
int respawn_time = 0; // [RH] delay respawning until this tic
|
||||||
TObjPtr<AActor*> camera; // [RH] Whose eyes this player sees through
|
TObjPtr<AActor*> camera = nullptr; // [RH] Whose eyes this player sees through
|
||||||
|
|
||||||
int air_finished; // [RH] Time when you start drowning
|
int air_finished = 0; // [RH] Time when you start drowning
|
||||||
|
|
||||||
FName LastDamageType; // [RH] For damage-specific pain and death sounds
|
FName LastDamageType = NAME_None; // [RH] For damage-specific pain and death sounds
|
||||||
|
|
||||||
TObjPtr<AActor*> MUSINFOactor; // For MUSINFO purposes
|
TObjPtr<AActor*> MUSINFOactor = nullptr; // For MUSINFO purposes
|
||||||
int8_t MUSINFOtics;
|
int8_t MUSINFOtics = 0;
|
||||||
|
|
||||||
bool settings_controller; // Player can control game settings.
|
bool settings_controller = false; // Player can control game settings.
|
||||||
int8_t crouching;
|
int8_t crouching = 0;
|
||||||
int8_t crouchdir;
|
int8_t crouchdir = 0;
|
||||||
|
|
||||||
//Added by MC:
|
//Added by MC:
|
||||||
TObjPtr<DBot*> Bot;
|
TObjPtr<DBot*> Bot = nullptr;
|
||||||
|
|
||||||
float BlendR; // [RH] Final blending values
|
float BlendR = 0; // [RH] Final blending values
|
||||||
float BlendG;
|
float BlendG = 0;
|
||||||
float BlendB;
|
float BlendB = 0;
|
||||||
float BlendA;
|
float BlendA = 0;
|
||||||
|
|
||||||
FString LogText; // [RH] Log for Strife
|
FString LogText; // [RH] Log for Strife
|
||||||
|
|
||||||
DAngle MinPitch; // Viewpitch limits (negative is up, positive is down)
|
DAngle MinPitch = 0.; // Viewpitch limits (negative is up, positive is down)
|
||||||
DAngle MaxPitch;
|
DAngle MaxPitch = 0.;
|
||||||
|
|
||||||
double crouchfactor;
|
double crouchfactor = 0;
|
||||||
double crouchoffset;
|
double crouchoffset = 0;
|
||||||
double crouchviewdelta;
|
double crouchviewdelta = 0;
|
||||||
|
|
||||||
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 = nullptr, ConversationPC = nullptr;
|
||||||
DAngle ConversationNPCAngle;
|
DAngle ConversationNPCAngle = 0.;
|
||||||
bool ConversationFaceTalker;
|
bool ConversationFaceTalker = false;
|
||||||
|
|
||||||
double GetDeltaViewHeight() const
|
double GetDeltaViewHeight() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -1037,8 +1037,8 @@ FDecalLib::FTranslation *FDecalLib::GenerateTranslation (uint32_t start, uint32_
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalBase::FDecalBase ()
|
FDecalBase::FDecalBase ()
|
||||||
|
: Name(NAME_None)
|
||||||
{
|
{
|
||||||
Name = NAME_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalBase::~FDecalBase ()
|
FDecalBase::~FDecalBase ()
|
||||||
|
@ -1152,8 +1152,8 @@ const FDecalTemplate *FDecalGroup::GetDecal () const
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalAnimator::FDecalAnimator (const char *name)
|
FDecalAnimator::FDecalAnimator (const char *name)
|
||||||
|
: Name(name)
|
||||||
{
|
{
|
||||||
Name = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalAnimator::~FDecalAnimator ()
|
FDecalAnimator::~FDecalAnimator ()
|
||||||
|
|
|
@ -58,8 +58,8 @@ public:
|
||||||
uint8_t *Meta = nullptr; // Per-class static script data
|
uint8_t *Meta = nullptr; // Per-class static script data
|
||||||
unsigned Size = sizeof(DObject);
|
unsigned Size = sizeof(DObject);
|
||||||
unsigned MetaSize = 0;
|
unsigned MetaSize = 0;
|
||||||
FName TypeName;
|
FName TypeName = NAME_None;
|
||||||
FName SourceLumpName;
|
FName SourceLumpName = NAME_None;
|
||||||
bool bRuntimeClass = false; // class was defined at run-time, not compile-time
|
bool bRuntimeClass = false; // class was defined at run-time, not compile-time
|
||||||
bool bDecorateClass = false; // may be subject to some idiosyncracies due to DECORATE backwards compatibility
|
bool bDecorateClass = false; // may be subject to some idiosyncracies due to DECORATE backwards compatibility
|
||||||
bool bAbstract = false;
|
bool bAbstract = false;
|
||||||
|
|
|
@ -373,7 +373,7 @@ struct FMapThing
|
||||||
uint32_t RenderStyle;
|
uint32_t RenderStyle;
|
||||||
int FloatbobPhase;
|
int FloatbobPhase;
|
||||||
int friendlyseeblocks;
|
int friendlyseeblocks;
|
||||||
FNameNoInit arg0str;
|
FName arg0str;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ struct EDSector
|
||||||
|
|
||||||
int damageamount;
|
int damageamount;
|
||||||
int damageinterval;
|
int damageinterval;
|
||||||
FNameNoInit damagetype;
|
FName damagetype;
|
||||||
uint8_t leaky;
|
uint8_t leaky;
|
||||||
uint8_t leakyadd;
|
uint8_t leakyadd;
|
||||||
uint8_t leakyremove;
|
uint8_t leakyremove;
|
||||||
|
|
|
@ -204,7 +204,7 @@ struct FWorldEvent
|
||||||
AActor* Inflictor = nullptr; // can be null - for damagemobj
|
AActor* Inflictor = nullptr; // can be null - for damagemobj
|
||||||
AActor* DamageSource = nullptr; // can be null
|
AActor* DamageSource = nullptr; // can be null
|
||||||
int Damage = 0;
|
int Damage = 0;
|
||||||
FName DamageType;
|
FName DamageType = NAME_None;
|
||||||
int DamageFlags = 0;
|
int DamageFlags = 0;
|
||||||
DAngle DamageAngle;
|
DAngle DamageAngle;
|
||||||
// for line(pre)activated
|
// for line(pre)activated
|
||||||
|
|
|
@ -264,9 +264,8 @@ struct level_info_t;
|
||||||
|
|
||||||
struct FOptionalMapinfoData
|
struct FOptionalMapinfoData
|
||||||
{
|
{
|
||||||
FOptionalMapinfoData *Next;
|
FOptionalMapinfoData *Next = nullptr;
|
||||||
FName identifier;
|
FName identifier = NAME_None;
|
||||||
FOptionalMapinfoData() { Next = NULL; identifier = NAME_None; }
|
|
||||||
virtual ~FOptionalMapinfoData() {}
|
virtual ~FOptionalMapinfoData() {}
|
||||||
virtual FOptionalMapinfoData *Clone() const = 0;
|
virtual FOptionalMapinfoData *Clone() const = 0;
|
||||||
};
|
};
|
||||||
|
@ -572,7 +571,7 @@ typedef TMap<FName, FName> SkillActorReplacement;
|
||||||
|
|
||||||
struct FSkillInfo
|
struct FSkillInfo
|
||||||
{
|
{
|
||||||
FName Name;
|
FName Name = NAME_None;
|
||||||
double AmmoFactor, DoubleAmmoFactor, DropAmmoFactor;
|
double AmmoFactor, DoubleAmmoFactor, DropAmmoFactor;
|
||||||
double DamageFactor;
|
double DamageFactor;
|
||||||
double ArmorFactor;
|
double ArmorFactor;
|
||||||
|
|
|
@ -259,10 +259,13 @@ void level_info_t::Reset()
|
||||||
compatflags = compatflags2 = 0;
|
compatflags = compatflags2 = 0;
|
||||||
compatmask = compatmask2 = 0;
|
compatmask = compatmask2 = 0;
|
||||||
Translator = "";
|
Translator = "";
|
||||||
RedirectType = 0;
|
RedirectType = NAME_None;
|
||||||
RedirectMapName = "";
|
RedirectMapName = "";
|
||||||
EnterPic = "";
|
EnterPic = "";
|
||||||
ExitPic = "";
|
ExitPic = "";
|
||||||
|
Intermission = NAME_None;
|
||||||
|
deathsequence = NAME_None;
|
||||||
|
slideshow = NAME_None;
|
||||||
InterMusic = "";
|
InterMusic = "";
|
||||||
intermusicorder = 0;
|
intermusicorder = 0;
|
||||||
SoundInfo = "";
|
SoundInfo = "";
|
||||||
|
|
|
@ -252,7 +252,7 @@ struct FMugShotState
|
||||||
unsigned int Position;
|
unsigned int Position;
|
||||||
int Time;
|
int Time;
|
||||||
int Random;
|
int Random;
|
||||||
FName State;
|
FName State = NAME_None;
|
||||||
TArray<FMugShotFrame> Frames;
|
TArray<FMugShotFrame> Frames;
|
||||||
|
|
||||||
FMugShotState(FName name);
|
FMugShotState(FName name);
|
||||||
|
|
|
@ -667,7 +667,7 @@ class CommandDrawSwitchableImage : public CommandDrawImage
|
||||||
Operator conditionalOperator[2];
|
Operator conditionalOperator[2];
|
||||||
FString inventoryItem[2];
|
FString inventoryItem[2];
|
||||||
int armorType[2];
|
int armorType[2];
|
||||||
FName keySpecies[2];
|
FName keySpecies[2] = { NAME_None, NAME_None };
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -319,7 +319,7 @@ void ST_CreateStatusBar(bool bTitleLevel)
|
||||||
}
|
}
|
||||||
if (StatusBar == nullptr)
|
if (StatusBar == nullptr)
|
||||||
{
|
{
|
||||||
FName defname;
|
FName defname = NAME_None;
|
||||||
|
|
||||||
if (gameinfo.gametype & GAME_DoomChex) defname = "DoomStatusBar";
|
if (gameinfo.gametype & GAME_DoomChex) defname = "DoomStatusBar";
|
||||||
else if (gameinfo.gametype == GAME_Heretic) defname = "HereticStatusBar";
|
else if (gameinfo.gametype == GAME_Heretic) defname = "HereticStatusBar";
|
||||||
|
|
|
@ -408,7 +408,7 @@ void PClassActor::RegisterIDs()
|
||||||
|
|
||||||
PClassActor *PClassActor::GetReplacement(bool lookskill)
|
PClassActor *PClassActor::GetReplacement(bool lookskill)
|
||||||
{
|
{
|
||||||
FName skillrepname;
|
FName skillrepname = NAME_None;
|
||||||
|
|
||||||
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
|
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
|
||||||
{
|
{
|
||||||
|
@ -470,7 +470,7 @@ DEFINE_ACTION_FUNCTION(AActor, GetReplacement)
|
||||||
|
|
||||||
PClassActor *PClassActor::GetReplacee(bool lookskill)
|
PClassActor *PClassActor::GetReplacee(bool lookskill)
|
||||||
{
|
{
|
||||||
FName skillrepname;
|
FName skillrepname = NAME_None;
|
||||||
|
|
||||||
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
|
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
|
||||||
{
|
{
|
||||||
|
|
|
@ -122,7 +122,7 @@ struct FIntermissionActionCast : public FIntermissionAction
|
||||||
typedef FIntermissionAction Super;
|
typedef FIntermissionAction Super;
|
||||||
|
|
||||||
FString mName;
|
FString mName;
|
||||||
FName mCastClass;
|
FName mCastClass = NAME_None;
|
||||||
TArray<FCastSound> mCastSounds;
|
TArray<FCastSound> mCastSounds;
|
||||||
|
|
||||||
FIntermissionActionCast();
|
FIntermissionActionCast();
|
||||||
|
@ -144,7 +144,7 @@ struct FIntermissionActionScroller : public FIntermissionAction
|
||||||
|
|
||||||
struct FIntermissionDescriptor
|
struct FIntermissionDescriptor
|
||||||
{
|
{
|
||||||
FName mLink;
|
FName mLink = NAME_None;
|
||||||
TDeletingArray<FIntermissionAction *> mActions;
|
TDeletingArray<FIntermissionAction *> mActions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ class DMenuDescriptor : public DObject
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DMenuDescriptor, DObject)
|
DECLARE_CLASS(DMenuDescriptor, DObject)
|
||||||
public:
|
public:
|
||||||
FName mMenuName;
|
FName mMenuName = NAME_None;
|
||||||
FString mNetgameMessage;
|
FString mNetgameMessage;
|
||||||
PClass *mClass = nullptr;
|
PClass *mClass = nullptr;
|
||||||
bool mProtected = false;
|
bool mProtected = false;
|
||||||
|
@ -287,7 +287,7 @@ class DMenuItemBase : public DObject
|
||||||
DECLARE_CLASS(DMenuItemBase, DObject)
|
DECLARE_CLASS(DMenuItemBase, DObject)
|
||||||
public:
|
public:
|
||||||
double mXpos, mYpos;
|
double mXpos, mYpos;
|
||||||
FNameNoInit mAction;
|
FName mAction;
|
||||||
bool mEnabled;
|
bool mEnabled;
|
||||||
|
|
||||||
bool Activate();
|
bool Activate();
|
||||||
|
|
|
@ -657,11 +657,9 @@ static void ParseListMenu(FScanner &sc)
|
||||||
|
|
||||||
static void ParseOptionValue(FScanner &sc)
|
static void ParseOptionValue(FScanner &sc)
|
||||||
{
|
{
|
||||||
FName optname;
|
|
||||||
|
|
||||||
FOptionValues *val = new FOptionValues;
|
FOptionValues *val = new FOptionValues;
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
optname = sc.String;
|
FName optname = sc.String;
|
||||||
sc.MustGetStringName("{");
|
sc.MustGetStringName("{");
|
||||||
while (!sc.CheckString("}"))
|
while (!sc.CheckString("}"))
|
||||||
{
|
{
|
||||||
|
@ -689,11 +687,9 @@ static void ParseOptionValue(FScanner &sc)
|
||||||
|
|
||||||
static void ParseOptionString(FScanner &sc)
|
static void ParseOptionString(FScanner &sc)
|
||||||
{
|
{
|
||||||
FName optname;
|
|
||||||
|
|
||||||
FOptionValues *val = new FOptionValues;
|
FOptionValues *val = new FOptionValues;
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
optname = sc.String;
|
FName optname = sc.String;
|
||||||
sc.MustGetStringName("{");
|
sc.MustGetStringName("{");
|
||||||
while (!sc.CheckString("}"))
|
while (!sc.CheckString("}"))
|
||||||
{
|
{
|
||||||
|
|
16
src/name.h
16
src/name.h
|
@ -46,7 +46,7 @@ class FString;
|
||||||
class FName
|
class FName
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FName () : Index(0) {}
|
FName() = default;// : Index(0) {}
|
||||||
FName (const char *text) { Index = NameData.FindName (text, false); }
|
FName (const char *text) { Index = NameData.FindName (text, false); }
|
||||||
FName (const char *text, bool noCreate) { Index = NameData.FindName (text, noCreate); }
|
FName (const char *text, bool noCreate) { Index = NameData.FindName (text, noCreate); }
|
||||||
FName (const char *text, size_t textlen, bool noCreate) { Index = NameData.FindName (text, textlen, noCreate); }
|
FName (const char *text, size_t textlen, bool noCreate) { Index = NameData.FindName (text, textlen, noCreate); }
|
||||||
|
@ -120,20 +120,6 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
static NameManager NameData;
|
static NameManager NameData;
|
||||||
|
|
||||||
enum EDummy { NoInit };
|
|
||||||
FName (EDummy) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class FNameNoInit : public FName
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
FNameNoInit() : FName(NoInit) {}
|
|
||||||
|
|
||||||
FName &operator = (const char *text) { Index = NameData.FindName (text, false); return *this; }
|
|
||||||
FName &operator = (const FString &text);
|
|
||||||
FName &operator = (const FName &other) { Index = int(other); return *this; }
|
|
||||||
FName &operator = (ENamedName index) { Index = index; return *this; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct FStrifeDialogueNode
|
||||||
FString Goodbye; // must init to null for binary scripts to work as intended
|
FString Goodbye; // must init to null for binary scripts to work as intended
|
||||||
|
|
||||||
FStrifeDialogueReply *Children = nullptr;
|
FStrifeDialogueReply *Children = nullptr;
|
||||||
FName MenuClassName;
|
FName MenuClassName = NAME_None;
|
||||||
FString UserData;
|
FString UserData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -182,25 +182,22 @@ void SexMessage (const char *from, char *to, int gender, const char *victim, con
|
||||||
//
|
//
|
||||||
void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker, int dmgflags, FName MeansOfDeath)
|
void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker, int dmgflags, FName MeansOfDeath)
|
||||||
{
|
{
|
||||||
FName mod;
|
|
||||||
FString ret;
|
FString ret;
|
||||||
const char *message;
|
|
||||||
const char *messagename;
|
|
||||||
char gendermessage[1024];
|
char gendermessage[1024];
|
||||||
|
|
||||||
// No obituaries for non-players, voodoo dolls or when not wanted
|
// No obituaries for non-players, voodoo dolls or when not wanted
|
||||||
if (self->player == NULL || self->player->mo != self || !show_obituaries)
|
if (self->player == nullptr || self->player->mo != self || !show_obituaries)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Treat voodoo dolls as unknown deaths
|
// Treat voodoo dolls as unknown deaths
|
||||||
if (inflictor && inflictor->player && inflictor->player->mo != inflictor)
|
if (inflictor && inflictor->player && inflictor->player->mo != inflictor)
|
||||||
MeansOfDeath = NAME_None;
|
MeansOfDeath = NAME_None;
|
||||||
|
|
||||||
mod = MeansOfDeath;
|
FName mod = MeansOfDeath;
|
||||||
message = NULL;
|
const char *message = nullptr;
|
||||||
messagename = NULL;
|
const char *messagename = nullptr;
|
||||||
|
|
||||||
if (attacker == NULL || attacker->player != NULL)
|
if (attacker == nullptr || attacker->player != nullptr)
|
||||||
{
|
{
|
||||||
if (mod == NAME_Telefrag)
|
if (mod == NAME_Telefrag)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4484,7 +4484,7 @@ DEFINE_ACTION_FUNCTION(AActor, AimLineAttack)
|
||||||
struct Origin
|
struct Origin
|
||||||
{
|
{
|
||||||
AActor *Caller;
|
AActor *Caller;
|
||||||
FNameNoInit PuffSpecies;
|
FName PuffSpecies;
|
||||||
bool hitGhosts;
|
bool hitGhosts;
|
||||||
bool MThruSpecies;
|
bool MThruSpecies;
|
||||||
bool ThruSpecies;
|
bool ThruSpecies;
|
||||||
|
@ -5092,6 +5092,7 @@ AActor *P_LinePickActor(AActor *t1, DAngle angle, double distance, DAngle pitch,
|
||||||
TData.MThruSpecies = false;
|
TData.MThruSpecies = false;
|
||||||
TData.ThruActors = false;
|
TData.ThruActors = false;
|
||||||
TData.ThruSpecies = false;
|
TData.ThruSpecies = false;
|
||||||
|
TData.PuffSpecies = NAME_None;
|
||||||
|
|
||||||
if (Trace(t1->PosAtZ(shootz), t1->Sector, direction, distance,
|
if (Trace(t1->PosAtZ(shootz), t1->Sector, direction, distance,
|
||||||
actorMask, wallMask, t1, trace, TRACE_NoSky | TRACE_PortalRestrict, CheckForActor, &TData))
|
actorMask, wallMask, t1, trace, TRACE_NoSky | TRACE_PortalRestrict, CheckForActor, &TData))
|
||||||
|
@ -5309,7 +5310,7 @@ struct RailData
|
||||||
AActor *Caller;
|
AActor *Caller;
|
||||||
TArray<SRailHit> RailHits;
|
TArray<SRailHit> RailHits;
|
||||||
TArray<SPortalHit> PortalHits;
|
TArray<SPortalHit> PortalHits;
|
||||||
FNameNoInit PuffSpecies;
|
FName PuffSpecies;
|
||||||
bool StopAtOne;
|
bool StopAtOne;
|
||||||
bool StopAtInvul;
|
bool StopAtInvul;
|
||||||
bool ThruGhosts;
|
bool ThruGhosts;
|
||||||
|
|
|
@ -2171,13 +2171,9 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
||||||
// Set bounce state
|
// Set bounce state
|
||||||
if (BounceFlags & BOUNCE_UseBounceState)
|
if (BounceFlags & BOUNCE_UseBounceState)
|
||||||
{
|
{
|
||||||
FName names[2];
|
FName names[2] = { NAME_Bounce, plane.fC() < 0 ? NAME_Ceiling : NAME_Floor };
|
||||||
FState *bouncestate;
|
FState *bouncestate = FindState(2, names);
|
||||||
|
if (bouncestate != nullptr)
|
||||||
names[0] = NAME_Bounce;
|
|
||||||
names[1] = plane.fC() < 0 ? NAME_Ceiling : NAME_Floor;
|
|
||||||
bouncestate = FindState(2, names);
|
|
||||||
if (bouncestate != NULL)
|
|
||||||
{
|
{
|
||||||
SetState(bouncestate);
|
SetState(bouncestate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,7 @@ bool AActor::HasSpecialDeathStates () const
|
||||||
TArray<FName> &MakeStateNameList(const char * fname)
|
TArray<FName> &MakeStateNameList(const char * fname)
|
||||||
{
|
{
|
||||||
static TArray<FName> namelist(3);
|
static TArray<FName> namelist(3);
|
||||||
FName firstpart, secondpart;
|
FName firstpart = NAME_None, secondpart = NAME_None;
|
||||||
char *c;
|
char *c;
|
||||||
|
|
||||||
// Handle the old names for the existing death states
|
// Handle the old names for the existing death states
|
||||||
|
@ -256,21 +256,19 @@ TArray<FName> &MakeStateNameList(const char * fname)
|
||||||
FState *PClassActor::FindState(int numnames, FName *names, bool exact) const
|
FState *PClassActor::FindState(int numnames, FName *names, bool exact) const
|
||||||
{
|
{
|
||||||
FStateLabels *labels = GetStateLabels();
|
FStateLabels *labels = GetStateLabels();
|
||||||
FState *best = NULL;
|
FState *best = nullptr;
|
||||||
|
|
||||||
if (labels != NULL)
|
if (labels != nullptr)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
FStateLabel *slabel = NULL;
|
|
||||||
FName label;
|
|
||||||
|
|
||||||
// Find the best-matching label for this class.
|
// Find the best-matching label for this class.
|
||||||
while (labels != NULL && count < numnames)
|
while (labels != nullptr && count < numnames)
|
||||||
{
|
{
|
||||||
label = *names++;
|
FName label = *names++;
|
||||||
slabel = labels->FindLabel(label);
|
FStateLabel *slabel = labels->FindLabel(label);
|
||||||
|
|
||||||
if (slabel != NULL)
|
if (slabel != nullptr)
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
labels = slabel->Children;
|
labels = slabel->Children;
|
||||||
|
@ -283,7 +281,7 @@ FState *PClassActor::FindState(int numnames, FName *names, bool exact) const
|
||||||
}
|
}
|
||||||
if (count < numnames && exact)
|
if (count < numnames && exact)
|
||||||
{
|
{
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return best;
|
return best;
|
||||||
|
@ -411,7 +409,7 @@ FStateDefine *FStateDefinitions::FindStateLabelInList(TArray<FStateDefine> & lis
|
||||||
{
|
{
|
||||||
FStateDefine def;
|
FStateDefine def;
|
||||||
def.Label = name;
|
def.Label = name;
|
||||||
def.State = NULL;
|
def.State = nullptr;
|
||||||
def.DefineFlags = SDF_NEXT;
|
def.DefineFlags = SDF_NEXT;
|
||||||
return &list[list.Push(def)];
|
return &list[list.Push(def)];
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,10 +375,9 @@ void ParseSplash (FScanner &sc)
|
||||||
int splashnum;
|
int splashnum;
|
||||||
FSplashDef *splashdef;
|
FSplashDef *splashdef;
|
||||||
bool isnew = false;
|
bool isnew = false;
|
||||||
FName name;
|
|
||||||
|
|
||||||
sc.MustGetString ();
|
sc.MustGetString ();
|
||||||
name = sc.String;
|
FName name = sc.String;
|
||||||
splashnum = (int)FindSplash (name);
|
splashnum = (int)FindSplash (name);
|
||||||
if (splashnum < 0)
|
if (splashnum < 0)
|
||||||
{
|
{
|
||||||
|
@ -422,10 +421,9 @@ void ParseSplash (FScanner &sc)
|
||||||
void ParseTerrain (FScanner &sc)
|
void ParseTerrain (FScanner &sc)
|
||||||
{
|
{
|
||||||
int terrainnum;
|
int terrainnum;
|
||||||
FName name;
|
|
||||||
|
|
||||||
sc.MustGetString ();
|
sc.MustGetString ();
|
||||||
name = sc.String;
|
FName name = sc.String;
|
||||||
terrainnum = (int)P_FindTerrain (name);
|
terrainnum = (int)P_FindTerrain (name);
|
||||||
if (terrainnum < 0)
|
if (terrainnum < 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -462,7 +462,7 @@ class UDMFParser : public UDMFParserBase
|
||||||
TArray<vertex_t> ParsedVertices;
|
TArray<vertex_t> ParsedVertices;
|
||||||
TArray<UDMFScroll> UDMFScrollers;
|
TArray<UDMFScroll> UDMFScrollers;
|
||||||
|
|
||||||
FDynamicColormap *fogMap, *normMap;
|
FDynamicColormap *fogMap = nullptr, *normMap = nullptr;
|
||||||
FMissingTextureTracker &missingTex;
|
FMissingTextureTracker &missingTex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -470,7 +470,6 @@ public:
|
||||||
: missingTex(missing)
|
: missingTex(missing)
|
||||||
{
|
{
|
||||||
linemap.Clear();
|
linemap.Clear();
|
||||||
fogMap = normMap = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadUserKey(FUDMFKey &ukey) {
|
void ReadUserKey(FUDMFKey &ukey) {
|
||||||
|
@ -1357,11 +1356,11 @@ public:
|
||||||
// Brand new UDMF scroller properties
|
// Brand new UDMF scroller properties
|
||||||
double scroll_ceil_x = 0;
|
double scroll_ceil_x = 0;
|
||||||
double scroll_ceil_y = 0;
|
double scroll_ceil_y = 0;
|
||||||
FName scroll_ceil_type;
|
FName scroll_ceil_type = NAME_None;
|
||||||
|
|
||||||
double scroll_floor_x = 0;
|
double scroll_floor_x = 0;
|
||||||
double scroll_floor_y = 0;
|
double scroll_floor_y = 0;
|
||||||
FName scroll_floor_type;
|
FName scroll_floor_type = NAME_None;
|
||||||
|
|
||||||
|
|
||||||
memset(sec, 0, sizeof(*sec));
|
memset(sec, 0, sizeof(*sec));
|
||||||
|
|
|
@ -8,7 +8,7 @@ class UDMFParserBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
FScanner sc;
|
FScanner sc;
|
||||||
FName namespc;
|
FName namespc = NAME_None;
|
||||||
int namespace_bits;
|
int namespace_bits;
|
||||||
FString parsedString;
|
FString parsedString;
|
||||||
bool BadCoordinates = false;
|
bool BadCoordinates = false;
|
||||||
|
|
|
@ -400,9 +400,9 @@ class USDFParser : public UDMFParserBase
|
||||||
|
|
||||||
bool ParseConversation()
|
bool ParseConversation()
|
||||||
{
|
{
|
||||||
PClassActor *type = NULL;
|
PClassActor *type = nullptr;
|
||||||
int dlgid = -1;
|
int dlgid = -1;
|
||||||
FName clsid;
|
FName clsid = NAME_None;
|
||||||
unsigned int startpos = StrifeDialogues.Size();
|
unsigned int startpos = StrifeDialogues.Size();
|
||||||
|
|
||||||
while (!sc.CheckToken('}'))
|
while (!sc.CheckToken('}'))
|
||||||
|
|
|
@ -301,82 +301,6 @@ CCMD (playerclasses)
|
||||||
// 16 pixels of bob
|
// 16 pixels of bob
|
||||||
#define MAXBOB 16.
|
#define MAXBOB 16.
|
||||||
|
|
||||||
// The player_t constructor. Since LogText is not a POD, we cannot just
|
|
||||||
// memset it all to 0.
|
|
||||||
player_t::player_t()
|
|
||||||
: mo(0),
|
|
||||||
playerstate(0),
|
|
||||||
cls(0),
|
|
||||||
DesiredFOV(0),
|
|
||||||
FOV(0),
|
|
||||||
viewz(0),
|
|
||||||
viewheight(0),
|
|
||||||
deltaviewheight(0),
|
|
||||||
bob(0),
|
|
||||||
Vel(0, 0),
|
|
||||||
centering(0),
|
|
||||||
turnticks(0),
|
|
||||||
attackdown(0),
|
|
||||||
usedown(0),
|
|
||||||
oldbuttons(0),
|
|
||||||
health(0),
|
|
||||||
inventorytics(0),
|
|
||||||
CurrentPlayerClass(0),
|
|
||||||
fragcount(0),
|
|
||||||
lastkilltime(0),
|
|
||||||
multicount(0),
|
|
||||||
spreecount(0),
|
|
||||||
WeaponState(0),
|
|
||||||
ReadyWeapon(0),
|
|
||||||
PendingWeapon(0),
|
|
||||||
psprites(0),
|
|
||||||
cheats(0),
|
|
||||||
timefreezer(0),
|
|
||||||
refire(0),
|
|
||||||
inconsistant(0),
|
|
||||||
killcount(0),
|
|
||||||
itemcount(0),
|
|
||||||
secretcount(0),
|
|
||||||
damagecount(0),
|
|
||||||
bonuscount(0),
|
|
||||||
hazardcount(0),
|
|
||||||
poisoncount(0),
|
|
||||||
poisoner(0),
|
|
||||||
attacker(0),
|
|
||||||
extralight(0),
|
|
||||||
morphTics(0),
|
|
||||||
MorphedPlayerClass(0),
|
|
||||||
MorphStyle(0),
|
|
||||||
MorphExitFlash(0),
|
|
||||||
PremorphWeapon(0),
|
|
||||||
chickenPeck(0),
|
|
||||||
jumpTics(0),
|
|
||||||
onground(0),
|
|
||||||
respawn_time(0),
|
|
||||||
camera(0),
|
|
||||||
air_finished(0),
|
|
||||||
MUSINFOactor(0),
|
|
||||||
MUSINFOtics(-1),
|
|
||||||
crouching(0),
|
|
||||||
crouchdir(0),
|
|
||||||
Bot(0),
|
|
||||||
BlendR(0),
|
|
||||||
BlendG(0),
|
|
||||||
BlendB(0),
|
|
||||||
BlendA(0),
|
|
||||||
LogText(),
|
|
||||||
crouchfactor(0),
|
|
||||||
crouchoffset(0),
|
|
||||||
crouchviewdelta(0),
|
|
||||||
ConversationNPC(0),
|
|
||||||
ConversationPC(0),
|
|
||||||
ConversationNPCAngle(0.),
|
|
||||||
ConversationFaceTalker(0)
|
|
||||||
{
|
|
||||||
memset (&cmd, 0, sizeof(cmd));
|
|
||||||
memset (frags, 0, sizeof(frags));
|
|
||||||
}
|
|
||||||
|
|
||||||
player_t::~player_t()
|
player_t::~player_t()
|
||||||
{
|
{
|
||||||
DestroyPSprites();
|
DestroyPSprites();
|
||||||
|
|
|
@ -582,7 +582,7 @@ struct FTransform
|
||||||
|
|
||||||
struct secspecial_t
|
struct secspecial_t
|
||||||
{
|
{
|
||||||
FNameNoInit damagetype; // [RH] Means-of-death for applied damage
|
FName damagetype; // [RH] Means-of-death for applied damage
|
||||||
int damageamount; // [RH] Damage to do while standing on floor
|
int damageamount; // [RH] Damage to do while standing on floor
|
||||||
short special;
|
short special;
|
||||||
short damageinterval; // Interval for damage application
|
short damageinterval; // Interval for damage application
|
||||||
|
@ -997,7 +997,7 @@ public:
|
||||||
short seqType; // this sector's sound sequence
|
short seqType; // this sector's sound sequence
|
||||||
|
|
||||||
int sky;
|
int sky;
|
||||||
FNameNoInit SeqName; // Sound sequence name. Setting seqType non-negative will override this.
|
FName SeqName; // Sound sequence name. Setting seqType non-negative will override this.
|
||||||
|
|
||||||
DVector2 centerspot; // origin for any sounds played by the sector
|
DVector2 centerspot; // origin for any sounds played by the sector
|
||||||
int validcount; // if == validcount, already checked
|
int validcount; // if == validcount, already checked
|
||||||
|
@ -1047,7 +1047,7 @@ public:
|
||||||
struct msecnode_t *touching_renderthings; // this is used to allow wide things to be rendered not only from their main sector.
|
struct msecnode_t *touching_renderthings; // this is used to allow wide things to be rendered not only from their main sector.
|
||||||
|
|
||||||
double gravity; // [RH] Sector gravity (1.0 is normal)
|
double gravity; // [RH] Sector gravity (1.0 is normal)
|
||||||
FNameNoInit damagetype; // [RH] Means-of-death for applied damage
|
FName damagetype; // [RH] Means-of-death for applied damage
|
||||||
int damageamount; // [RH] Damage to do while standing on floor
|
int damageamount; // [RH] Damage to do while standing on floor
|
||||||
short damageinterval; // Interval for damage application
|
short damageinterval; // Interval for damage application
|
||||||
short leakydamage; // chance of leaking through radiation suit
|
short leakydamage; // chance of leaking through radiation suit
|
||||||
|
|
|
@ -314,7 +314,7 @@ void DSeqNode::Serialize(FSerializer &arc)
|
||||||
{
|
{
|
||||||
int seqOffset;
|
int seqOffset;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
FName seqName;
|
FName seqName = NAME_None;
|
||||||
int delayTics = 0;
|
int delayTics = 0;
|
||||||
FSoundID id;
|
FSoundID id;
|
||||||
float volume;
|
float volume;
|
||||||
|
@ -571,8 +571,8 @@ void S_ParseSndSeq (int levellump)
|
||||||
TArray<uint32_t> ScriptTemp;
|
TArray<uint32_t> ScriptTemp;
|
||||||
int lastlump, lump;
|
int lastlump, lump;
|
||||||
char seqtype = ':';
|
char seqtype = ':';
|
||||||
FName seqname;
|
FName seqname = NAME_None;
|
||||||
FName slot;
|
FName slot = NAME_None;
|
||||||
int stopsound;
|
int stopsound;
|
||||||
int delaybase;
|
int delaybase;
|
||||||
float volumebase;
|
float volumebase;
|
||||||
|
|
|
@ -211,7 +211,6 @@ FScanner &FScanner::operator=(const FScanner &other)
|
||||||
TokenType = other.TokenType;
|
TokenType = other.TokenType;
|
||||||
Number = other.Number;
|
Number = other.Number;
|
||||||
Float = other.Float;
|
Float = other.Float;
|
||||||
Name = other.Name;
|
|
||||||
Line = other.Line;
|
Line = other.Line;
|
||||||
End = other.End;
|
End = other.End;
|
||||||
Crossed = other.Crossed;
|
Crossed = other.Crossed;
|
||||||
|
@ -619,11 +618,7 @@ bool FScanner::GetToken ()
|
||||||
{
|
{
|
||||||
if (ScanString (true))
|
if (ScanString (true))
|
||||||
{
|
{
|
||||||
if (TokenType == TK_NameConst)
|
if (TokenType == TK_IntConst)
|
||||||
{
|
|
||||||
Name = FName(String);
|
|
||||||
}
|
|
||||||
else if (TokenType == TK_IntConst)
|
|
||||||
{
|
{
|
||||||
char *stopper;
|
char *stopper;
|
||||||
// Check for unsigned
|
// Check for unsigned
|
||||||
|
|
|
@ -82,7 +82,6 @@ public:
|
||||||
int TokenType;
|
int TokenType;
|
||||||
int Number;
|
int Number;
|
||||||
double Float;
|
double Float;
|
||||||
FName Name;
|
|
||||||
int Line;
|
int Line;
|
||||||
bool End;
|
bool End;
|
||||||
bool Crossed;
|
bool Crossed;
|
||||||
|
|
|
@ -9336,10 +9336,8 @@ ExpEmit FxFlopFunctionCall::Emit(VMFunctionBuilder *build)
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
FxVectorBuiltin::FxVectorBuiltin(FxExpression *self, FName name)
|
FxVectorBuiltin::FxVectorBuiltin(FxExpression *self, FName name)
|
||||||
:FxExpression(EFX_VectorBuiltin, self->ScriptPosition)
|
:FxExpression(EFX_VectorBuiltin, self->ScriptPosition), Function(name), Self(self)
|
||||||
{
|
{
|
||||||
Self = self;
|
|
||||||
Function = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FxVectorBuiltin::~FxVectorBuiltin()
|
FxVectorBuiltin::~FxVectorBuiltin()
|
||||||
|
@ -11136,7 +11134,7 @@ ExpEmit FxRuntimeStateIndex::Emit(VMFunctionBuilder *build)
|
||||||
FxMultiNameState::FxMultiNameState(const char *_statestring, const FScriptPosition &pos, PClassActor *checkclass)
|
FxMultiNameState::FxMultiNameState(const char *_statestring, const FScriptPosition &pos, PClassActor *checkclass)
|
||||||
:FxExpression(EFX_MultiNameState, pos)
|
:FxExpression(EFX_MultiNameState, pos)
|
||||||
{
|
{
|
||||||
FName scopename;
|
FName scopename = NAME_None;
|
||||||
FString statestring = _statestring;
|
FString statestring = _statestring;
|
||||||
int scopeindex = statestring.IndexOf("::");
|
int scopeindex = statestring.IndexOf("::");
|
||||||
|
|
||||||
|
@ -11145,10 +11143,6 @@ FxMultiNameState::FxMultiNameState(const char *_statestring, const FScriptPositi
|
||||||
scopename = FName(statestring, scopeindex, false);
|
scopename = FName(statestring, scopeindex, false);
|
||||||
statestring = statestring.Right(statestring.Len() - scopeindex - 2);
|
statestring = statestring.Right(statestring.Len() - scopeindex - 2);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
scopename = NAME_None;
|
|
||||||
}
|
|
||||||
names = MakeStateNameList(statestring);
|
names = MakeStateNameList(statestring);
|
||||||
names.Insert(0, scopename);
|
names.Insert(0, scopename);
|
||||||
scope = checkclass;
|
scope = checkclass;
|
||||||
|
|
|
@ -369,7 +369,7 @@ public:
|
||||||
class FxIdentifier : public FxExpression
|
class FxIdentifier : public FxExpression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FName Identifier;
|
FName Identifier = NAME_None;
|
||||||
bool noglobal = false;
|
bool noglobal = false;
|
||||||
|
|
||||||
FxIdentifier(FName i, const FScriptPosition &p);
|
FxIdentifier(FName i, const FScriptPosition &p);
|
||||||
|
|
|
@ -101,12 +101,11 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def, PNamespace *ns)
|
||||||
FExtraInfo extra;
|
FExtraInfo extra;
|
||||||
PClassActor *type;
|
PClassActor *type;
|
||||||
PClassActor *parent;
|
PClassActor *parent;
|
||||||
FName typeName;
|
|
||||||
|
|
||||||
parent = (def == DEF_Pickup) ? PClass::FindActor("FakeInventory") : RUNTIME_CLASS(AActor);
|
parent = (def == DEF_Pickup) ? PClass::FindActor("FakeInventory") : RUNTIME_CLASS(AActor);
|
||||||
|
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
typeName = FName(sc.String);
|
FName typeName = FName(sc.String);
|
||||||
type = DecoDerivedClass(FScriptPosition(sc), parent, typeName);
|
type = DecoDerivedClass(FScriptPosition(sc), parent, typeName);
|
||||||
ResetBaggage(&bag, parent);
|
ResetBaggage(&bag, parent);
|
||||||
bag.Namespace = ns;
|
bag.Namespace = ns;
|
||||||
|
|
|
@ -421,7 +421,7 @@ static FxExpression *ParseExpression0 (FScanner &sc, PClassActor *cls)
|
||||||
}
|
}
|
||||||
else if (sc.CheckToken(TK_NameConst))
|
else if (sc.CheckToken(TK_NameConst))
|
||||||
{
|
{
|
||||||
return new FxConstant(sc.Name, scpos);
|
return new FxConstant(FName(sc.String), scpos);
|
||||||
}
|
}
|
||||||
else if (sc.CheckToken(TK_StringConst))
|
else if (sc.CheckToken(TK_StringConst))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1029,9 +1029,7 @@ PClassActor *CreateNewActor(const FScriptPosition &sc, FName typeName, FName par
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
static PClassActor *ParseActorHeader(FScanner &sc, Baggage *bag)
|
static PClassActor *ParseActorHeader(FScanner &sc, Baggage *bag)
|
||||||
{
|
{
|
||||||
FName typeName;
|
FName replaceName = NAME_None;
|
||||||
FName parentName;
|
|
||||||
FName replaceName;
|
|
||||||
bool native = false;
|
bool native = false;
|
||||||
int DoomEdNum = -1;
|
int DoomEdNum = -1;
|
||||||
|
|
||||||
|
@ -1044,7 +1042,7 @@ static PClassActor *ParseActorHeader(FScanner &sc, Baggage *bag)
|
||||||
*colon++ = 0;
|
*colon++ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
typeName = sc.String;
|
FName typeName = sc.String;
|
||||||
|
|
||||||
// Do some tweaking so that a definition like 'Actor:Parent' which is read as a single token is recognized as well
|
// Do some tweaking so that a definition like 'Actor:Parent' which is read as a single token is recognized as well
|
||||||
// without having resort to C-mode (which disallows periods in actor names.)
|
// without having resort to C-mode (which disallows periods in actor names.)
|
||||||
|
@ -1071,7 +1069,7 @@ static PClassActor *ParseActorHeader(FScanner &sc, Baggage *bag)
|
||||||
sc.UnGet();
|
sc.UnGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
parentName = colon;
|
FName parentName = colon;
|
||||||
|
|
||||||
// Check for "replaces"
|
// Check for "replaces"
|
||||||
if (sc.CheckString ("replaces"))
|
if (sc.CheckString ("replaces"))
|
||||||
|
|
|
@ -569,9 +569,8 @@ DEFINE_PROPERTY(painchance, ZI, Actor)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FName painType;
|
FName painType = NAME_None;
|
||||||
if (!stricmp(str, "Normal")) painType = NAME_None;
|
if (stricmp(str, "Normal")) painType = str;
|
||||||
else painType=str;
|
|
||||||
|
|
||||||
info->SetPainChance(painType, id);
|
info->SetPainChance(painType, id);
|
||||||
}
|
}
|
||||||
|
@ -897,15 +896,14 @@ DEFINE_PROPERTY(damagefactor, ZF, Actor)
|
||||||
PROP_STRING_PARM(str, 0);
|
PROP_STRING_PARM(str, 0);
|
||||||
PROP_DOUBLE_PARM(id, 1);
|
PROP_DOUBLE_PARM(id, 1);
|
||||||
|
|
||||||
if (str == NULL)
|
if (str == nullptr)
|
||||||
{
|
{
|
||||||
defaults->DamageFactor = id;
|
defaults->DamageFactor = id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FName dmgType;
|
FName dmgType = NAME_None;
|
||||||
if (!stricmp(str, "Normal")) dmgType = NAME_None;
|
if (stricmp(str, "Normal")) dmgType = str;
|
||||||
else dmgType=str;
|
|
||||||
|
|
||||||
info->SetDamageFactor(dmgType, id);
|
info->SetDamageFactor(dmgType, id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1593,10 +1593,8 @@ PClassPointer *NewClassPointer(PClass *restrict)
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
PEnum::PEnum(FName name, PTypeBase *outer)
|
PEnum::PEnum(FName name, PTypeBase *outer)
|
||||||
: PInt(4, false)
|
: PInt(4, false), Outer(outer), EnumName(name)
|
||||||
{
|
{
|
||||||
EnumName = name;
|
|
||||||
Outer = outer;
|
|
||||||
Flags |= TYPE_IntNotInt;
|
Flags |= TYPE_IntNotInt;
|
||||||
mDescriptiveName.Format("Enum<%s>", name.GetChars());
|
mDescriptiveName.Format("Enum<%s>", name.GetChars());
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,10 +238,10 @@ protected:
|
||||||
class PContainerType : public PCompoundType
|
class PContainerType : public PCompoundType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PTypeBase *Outer; // object this type is contained within
|
PTypeBase *Outer = nullptr; // object this type is contained within
|
||||||
FName TypeName; // this type's name
|
FName TypeName = NAME_None; // this type's name
|
||||||
|
|
||||||
PContainerType() : Outer(NULL)
|
PContainerType()
|
||||||
{
|
{
|
||||||
mDescriptiveName = "ContainerType";
|
mDescriptiveName = "ContainerType";
|
||||||
Flags |= TYPE_Container;
|
Flags |= TYPE_Container;
|
||||||
|
|
|
@ -274,7 +274,7 @@ static void ParseSingleFile(FScanner *pSC, const char *filename, int lump, void
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TK_NameConst:
|
case TK_NameConst:
|
||||||
value.Int = sc.Name;
|
value.Int = FName(sc.String).GetIndex();
|
||||||
tokentype = ZCC_NAMECONST;
|
tokentype = ZCC_NAMECONST;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -2147,7 +2147,7 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, FFont *&fon
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FName n;
|
FName n = NAME_None;
|
||||||
arc(key, n);
|
arc(key, n);
|
||||||
font = V_GetFont(n);
|
font = V_GetFont(n);
|
||||||
if (font == nullptr)
|
if (font == nullptr)
|
||||||
|
|
|
@ -789,6 +789,7 @@ void FTextureManager::ParseAnimatedDoor(FScanner &sc)
|
||||||
|
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
anim.BaseTexture = CheckForTexture (sc.String, ETextureType::Wall, texflags);
|
anim.BaseTexture = CheckForTexture (sc.String, ETextureType::Wall, texflags);
|
||||||
|
anim.OpenSound = anim.CloseSound = NAME_None;
|
||||||
|
|
||||||
if (!anim.BaseTexture.Exists())
|
if (!anim.BaseTexture.Exists())
|
||||||
{
|
{
|
||||||
|
|
|
@ -403,7 +403,7 @@ void CommitUMapinfo(level_info_t *defaultinfo)
|
||||||
if (map.nextmap[0]) levelinfo->NextMap = map.nextmap;
|
if (map.nextmap[0]) levelinfo->NextMap = map.nextmap;
|
||||||
else if (map.endpic[0])
|
else if (map.endpic[0])
|
||||||
{
|
{
|
||||||
FName name;
|
FName name = NAME_None;
|
||||||
|
|
||||||
if (!stricmp(map.endpic, "$CAST"))
|
if (!stricmp(map.endpic, "$CAST"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -130,7 +130,7 @@ protected:
|
||||||
uint8_t *PatchRemap;
|
uint8_t *PatchRemap;
|
||||||
|
|
||||||
int Lump;
|
int Lump;
|
||||||
FName FontName;
|
FName FontName = NAME_None;
|
||||||
FFont *Next;
|
FFont *Next;
|
||||||
|
|
||||||
static FFont *FirstFont;
|
static FFont *FirstFont;
|
||||||
|
|
|
@ -454,7 +454,6 @@ namespace StringFormat
|
||||||
inline FName::FName(const FString &text) { Index = NameData.FindName (text.GetChars(), text.Len(), false); }
|
inline FName::FName(const FString &text) { Index = NameData.FindName (text.GetChars(), text.Len(), false); }
|
||||||
inline FName::FName(const FString &text, bool noCreate) { Index = NameData.FindName (text.GetChars(), text.Len(), noCreate); }
|
inline FName::FName(const FString &text, bool noCreate) { Index = NameData.FindName (text.GetChars(), text.Len(), noCreate); }
|
||||||
inline FName &FName::operator = (const FString &text) { Index = NameData.FindName (text.GetChars(), text.Len(), false); return *this; }
|
inline FName &FName::operator = (const FString &text) { Index = NameData.FindName (text.GetChars(), text.Len(), false); return *this; }
|
||||||
inline FName &FNameNoInit::operator = (const FString &text) { Index = NameData.FindName (text.GetChars(), text.Len(), false); return *this; }
|
|
||||||
|
|
||||||
// Hash FStrings on their contents. (used by TMap)
|
// Hash FStrings on their contents. (used by TMap)
|
||||||
extern unsigned int SuperFastHash (const char *data, size_t len);
|
extern unsigned int SuperFastHash (const char *data, size_t len);
|
||||||
|
|
Loading…
Reference in a new issue