mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
- moved DisplayName, the last remaining PlayerPawn meta property, to PClassActor so that PClassPlayerPawn could be removed.
Now all actors have the same metaclass and therefore it will always be the same size which will finally allow some needed changes to the type system which couldn't be done because it was occasionally necessary to replace tentatively created classes due to size mismatches.
This commit is contained in:
parent
68e9918ed5
commit
17a2666bd4
20 changed files with 49 additions and 86 deletions
|
@ -2539,7 +2539,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
||||||
case DEM_MORPHEX:
|
case DEM_MORPHEX:
|
||||||
{
|
{
|
||||||
s = ReadString (stream);
|
s = ReadString (stream);
|
||||||
const char *msg = cht_Morph (players + player, dyn_cast<PClassPlayerPawn>(PClass::FindClass (s)), false);
|
const char *msg = cht_Morph (players + player, PClass::FindActor (s), false);
|
||||||
if (player == consoleplayer)
|
if (player == consoleplayer)
|
||||||
{
|
{
|
||||||
Printf ("%s\n", *msg != '\0' ? msg : "Morph failed.");
|
Printf ("%s\n", *msg != '\0' ? msg : "Morph failed.");
|
||||||
|
|
|
@ -72,21 +72,11 @@ typedef TArray<std::tuple<PClass*, int, FPlayerColorSet>> ColorSetList;
|
||||||
extern PainFlashList PainFlashes;
|
extern PainFlashList PainFlashes;
|
||||||
extern ColorSetList ColorSets;
|
extern ColorSetList ColorSets;
|
||||||
|
|
||||||
class PClassPlayerPawn : public PClassActor
|
FString GetPrintableDisplayName(PClassActor *cls);
|
||||||
{
|
|
||||||
DECLARE_CLASS(PClassPlayerPawn, PClassActor);
|
|
||||||
protected:
|
|
||||||
public:
|
|
||||||
PClassPlayerPawn();
|
|
||||||
virtual void DeriveData(PClass *newclass);
|
|
||||||
|
|
||||||
FString DisplayName; // Display name (used in menus, etc.)
|
|
||||||
};
|
|
||||||
FString GetPrintableDisplayName(PClassPlayerPawn *cls);
|
|
||||||
|
|
||||||
class APlayerPawn : public AActor
|
class APlayerPawn : public AActor
|
||||||
{
|
{
|
||||||
DECLARE_CLASS_WITH_META(APlayerPawn, AActor, PClassPlayerPawn)
|
DECLARE_CLASS(APlayerPawn, AActor)
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -271,7 +261,7 @@ public:
|
||||||
|
|
||||||
bool CheckSkin (int skin);
|
bool CheckSkin (int skin);
|
||||||
|
|
||||||
PClassPlayerPawn *Type;
|
PClassActor *Type;
|
||||||
DWORD Flags;
|
DWORD Flags;
|
||||||
TArray<int> Skins;
|
TArray<int> Skins;
|
||||||
};
|
};
|
||||||
|
@ -343,7 +333,7 @@ struct userinfo_t : TMap<FName,FBaseCVar *>
|
||||||
{
|
{
|
||||||
return *static_cast<FIntCVar *>(*CheckKey(NAME_PlayerClass));
|
return *static_cast<FIntCVar *>(*CheckKey(NAME_PlayerClass));
|
||||||
}
|
}
|
||||||
PClassPlayerPawn *GetPlayerClassType() const
|
PClassActor *GetPlayerClassType() const
|
||||||
{
|
{
|
||||||
return PlayerClasses[GetPlayerClassNum()].Type;
|
return PlayerClasses[GetPlayerClassNum()].Type;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +391,7 @@ public:
|
||||||
|
|
||||||
userinfo_t userinfo; // [RH] who is this?
|
userinfo_t userinfo; // [RH] who is this?
|
||||||
|
|
||||||
PClassPlayerPawn *cls; // class of associated PlayerPawn
|
PClassActor *cls; // class of associated PlayerPawn
|
||||||
|
|
||||||
float DesiredFOV; // desired field of vision
|
float DesiredFOV; // desired field of vision
|
||||||
float FOV; // current field of vision
|
float FOV; // current field of vision
|
||||||
|
@ -459,7 +449,7 @@ public:
|
||||||
short fixedcolormap; // can be set to REDCOLORMAP, etc.
|
short fixedcolormap; // can be set to REDCOLORMAP, etc.
|
||||||
short fixedlightlevel;
|
short fixedlightlevel;
|
||||||
int morphTics; // player is a chicken/pig if > 0
|
int morphTics; // player is a chicken/pig if > 0
|
||||||
PClassPlayerPawn *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
|
||||||
|
|
|
@ -93,7 +93,6 @@ enum
|
||||||
{
|
{
|
||||||
CLASSREG_PClass,
|
CLASSREG_PClass,
|
||||||
CLASSREG_PClassActor,
|
CLASSREG_PClassActor,
|
||||||
CLASSREG_PClassPlayerPawn,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ClassReg
|
struct ClassReg
|
||||||
|
|
|
@ -2955,7 +2955,6 @@ PClass *ClassReg::RegisterClass()
|
||||||
{
|
{
|
||||||
&PClass::RegistrationInfo,
|
&PClass::RegistrationInfo,
|
||||||
&PClassActor::RegistrationInfo,
|
&PClassActor::RegistrationInfo,
|
||||||
&PClassPlayerPawn::RegistrationInfo,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Skip classes that have already been registered
|
// Skip classes that have already been registered
|
||||||
|
|
|
@ -1361,7 +1361,7 @@ void G_PlayerReborn (int player)
|
||||||
BYTE currclass;
|
BYTE currclass;
|
||||||
userinfo_t userinfo; // [RH] Save userinfo
|
userinfo_t userinfo; // [RH] Save userinfo
|
||||||
APlayerPawn *actor;
|
APlayerPawn *actor;
|
||||||
PClassPlayerPawn *cls;
|
PClassActor *cls;
|
||||||
FString log;
|
FString log;
|
||||||
DBot *Bot; //Added by MC:
|
DBot *Bot; //Added by MC:
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
class player_t;
|
class player_t;
|
||||||
class FConfigFile;
|
class FConfigFile;
|
||||||
class PClassPlayerPawn;
|
|
||||||
struct visstyle_t;
|
struct visstyle_t;
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
|
@ -1058,7 +1058,7 @@ void FWeaponSlots::SetFromGameInfo()
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void FWeaponSlots::StandardSetup(PClassPlayerPawn *type)
|
void FWeaponSlots::StandardSetup(PClassActor *type)
|
||||||
{
|
{
|
||||||
SetFromPlayer(type);
|
SetFromPlayer(type);
|
||||||
AddExtraWeapons();
|
AddExtraWeapons();
|
||||||
|
@ -1151,7 +1151,7 @@ void FWeaponSlots::SendDifferences(int playernum, const FWeaponSlots &other)
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void FWeaponSlots::SetFromPlayer(PClassPlayerPawn *type)
|
void FWeaponSlots::SetFromPlayer(PClassActor *type)
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
auto Slot = ((APlayerPawn*)GetDefaultByType(type))->Slot;
|
auto Slot = ((APlayerPawn*)GetDefaultByType(type))->Slot;
|
||||||
|
|
|
@ -65,8 +65,8 @@ struct FWeaponSlots
|
||||||
ESlotDef AddDefaultWeapon (int slot, PClassActor *type);
|
ESlotDef AddDefaultWeapon (int slot, PClassActor *type);
|
||||||
void AddExtraWeapons();
|
void AddExtraWeapons();
|
||||||
void SetFromGameInfo();
|
void SetFromGameInfo();
|
||||||
void SetFromPlayer(PClassPlayerPawn *type);
|
void SetFromPlayer(PClassActor *type);
|
||||||
void StandardSetup(PClassPlayerPawn *type);
|
void StandardSetup(PClassActor *type);
|
||||||
void LocalSetup(PClassActor *type);
|
void LocalSetup(PClassActor *type);
|
||||||
void SendDifferences(int playernum, const FWeaponSlots &other);
|
void SendDifferences(int playernum, const FWeaponSlots &other);
|
||||||
int RestoreSlots (FConfigFile *config, const char *section);
|
int RestoreSlots (FConfigFile *config, const char *section);
|
||||||
|
|
|
@ -33,7 +33,7 @@ void InitAllPowerupEffects(AInventory *item);
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntype, int duration, int style, PClassActor *enter_flash, PClassActor *exit_flash)
|
bool P_MorphPlayer (player_t *activator, player_t *p, PClassActor *spawntype, int duration, int style, PClassActor *enter_flash, PClassActor *exit_flash)
|
||||||
{
|
{
|
||||||
AInventory *item;
|
AInventory *item;
|
||||||
APlayerPawn *morphed;
|
APlayerPawn *morphed;
|
||||||
|
|
|
@ -35,7 +35,7 @@ class AActor;
|
||||||
class player_t;
|
class player_t;
|
||||||
class AMorphedMonster;
|
class AMorphedMonster;
|
||||||
|
|
||||||
bool P_MorphPlayer (player_t *activator, player_t *player, PClassPlayerPawn *morphclass, int duration = 0, int style = 0,
|
bool P_MorphPlayer (player_t *activator, player_t *player, PClassActor *morphclass, int duration = 0, int style = 0,
|
||||||
PClassActor *enter_flash = NULL, PClassActor *exit_flash = NULL);
|
PClassActor *enter_flash = NULL, PClassActor *exit_flash = NULL);
|
||||||
bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag = 0, bool force = false);
|
bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag = 0, bool force = false);
|
||||||
bool P_MorphMonster (AActor *actor, PClassActor *morphclass, int duration = 0, int style = 0,
|
bool P_MorphMonster (AActor *actor, PClassActor *morphclass, int duration = 0, int style = 0,
|
||||||
|
|
|
@ -354,6 +354,7 @@ void PClassActor::DeriveData(PClass *newclass)
|
||||||
newa->ForbiddenToPlayerClass = ForbiddenToPlayerClass;
|
newa->ForbiddenToPlayerClass = ForbiddenToPlayerClass;
|
||||||
newa->RestrictedToPlayerClass = RestrictedToPlayerClass;
|
newa->RestrictedToPlayerClass = RestrictedToPlayerClass;
|
||||||
|
|
||||||
|
newa->DisplayName = DisplayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -638,7 +639,7 @@ size_t PClassActor::PointerSubstitution(DObject *oldclass, DObject *newclass)
|
||||||
{
|
{
|
||||||
if (VisibleToPlayerClass[i] == oldclass)
|
if (VisibleToPlayerClass[i] == oldclass)
|
||||||
{
|
{
|
||||||
VisibleToPlayerClass[i] = static_cast<PClassPlayerPawn*>(newclass);
|
VisibleToPlayerClass[i] = static_cast<PClassActor*>(newclass);
|
||||||
changed++;
|
changed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -647,7 +648,7 @@ size_t PClassActor::PointerSubstitution(DObject *oldclass, DObject *newclass)
|
||||||
{
|
{
|
||||||
if (ForbiddenToPlayerClass[i] == oldclass)
|
if (ForbiddenToPlayerClass[i] == oldclass)
|
||||||
{
|
{
|
||||||
ForbiddenToPlayerClass[i] = static_cast<PClassPlayerPawn*>(newclass);
|
ForbiddenToPlayerClass[i] = static_cast<PClassActor*>(newclass);
|
||||||
changed++;
|
changed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -655,7 +656,7 @@ size_t PClassActor::PointerSubstitution(DObject *oldclass, DObject *newclass)
|
||||||
{
|
{
|
||||||
if (RestrictedToPlayerClass[i] == oldclass)
|
if (RestrictedToPlayerClass[i] == oldclass)
|
||||||
{
|
{
|
||||||
RestrictedToPlayerClass[i] = static_cast<PClassPlayerPawn*>(newclass);
|
RestrictedToPlayerClass[i] = static_cast<PClassActor*>(newclass);
|
||||||
changed++;
|
changed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
src/info.h
10
src/info.h
|
@ -235,7 +235,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
class DDropItem;
|
class DDropItem;
|
||||||
class PClassPlayerPawn;
|
|
||||||
|
|
||||||
class PClassActor : public PClass
|
class PClassActor : public PClass
|
||||||
{
|
{
|
||||||
|
@ -287,7 +286,7 @@ public:
|
||||||
DmgFactors *DamageFactors;
|
DmgFactors *DamageFactors;
|
||||||
PainChanceList *PainChances;
|
PainChanceList *PainChances;
|
||||||
|
|
||||||
TArray<PClassPlayerPawn *> VisibleToPlayerClass;
|
TArray<PClassActor *> VisibleToPlayerClass;
|
||||||
|
|
||||||
FString Obituary; // Player was killed by this actor
|
FString Obituary; // Player was killed by this actor
|
||||||
FString HitObituary; // Player was killed by this actor in melee
|
FString HitObituary; // Player was killed by this actor in melee
|
||||||
|
@ -319,8 +318,11 @@ public:
|
||||||
|
|
||||||
// These are only valid for inventory items.
|
// These are only valid for inventory items.
|
||||||
FString PickupMsg;
|
FString PickupMsg;
|
||||||
TArray<PClassPlayerPawn *> RestrictedToPlayerClass;
|
TArray<PClassActor *> RestrictedToPlayerClass;
|
||||||
TArray<PClassPlayerPawn *> ForbiddenToPlayerClass;
|
TArray<PClassActor *> ForbiddenToPlayerClass;
|
||||||
|
|
||||||
|
// This is from PClassPlayerPawn
|
||||||
|
FString DisplayName;
|
||||||
|
|
||||||
// For those times when being able to scan every kind of actor is convenient
|
// For those times when being able to scan every kind of actor is convenient
|
||||||
static TArray<PClassActor *> AllActorClasses;
|
static TArray<PClassActor *> AllActorClasses;
|
||||||
|
|
|
@ -170,7 +170,7 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_MORPH:
|
case CHT_MORPH:
|
||||||
msg = cht_Morph (player, static_cast<PClassPlayerPawn *>(PClass::FindClass (gameinfo.gametype == GAME_Heretic ? NAME_ChickenPlayer : NAME_PigPlayer)), true);
|
msg = cht_Morph (player, PClass::FindActor (gameinfo.gametype == GAME_Heretic ? NAME_ChickenPlayer : NAME_PigPlayer), true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_NOTARGET:
|
case CHT_NOTARGET:
|
||||||
|
@ -548,13 +548,13 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
Printf ("%s cheats: %s\n", player->userinfo.GetName(), msg);
|
Printf ("%s cheats: %s\n", player->userinfo.GetName(), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *cht_Morph (player_t *player, PClassPlayerPawn *morphclass, bool quickundo)
|
const char *cht_Morph (player_t *player, PClassActor *morphclass, bool quickundo)
|
||||||
{
|
{
|
||||||
if (player->mo == NULL)
|
if (player->mo == NULL)
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
PClassPlayerPawn *oldclass = player->mo->GetClass();
|
auto oldclass = player->mo->GetClass();
|
||||||
|
|
||||||
// Set the standard morph style for the current game
|
// Set the standard morph style for the current game
|
||||||
int style = MORPH_UNDOBYTOMEOFPOWER;
|
int style = MORPH_UNDOBYTOMEOFPOWER;
|
||||||
|
|
|
@ -29,12 +29,12 @@
|
||||||
|
|
||||||
// [RH] Functions that actually perform the cheating
|
// [RH] Functions that actually perform the cheating
|
||||||
class player_t;
|
class player_t;
|
||||||
class PClassPlayerPawn;
|
class PClassActor;
|
||||||
|
|
||||||
void cht_DoCheat (player_t *player, int cheat);
|
void cht_DoCheat (player_t *player, int cheat);
|
||||||
void cht_Give (player_t *player, const char *item, int amount=1);
|
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_Take (player_t *player, const char *item, int amount=1);
|
||||||
void cht_Suicide (player_t *player);
|
void cht_Suicide (player_t *player);
|
||||||
const char *cht_Morph (player_t *player, PClassPlayerPawn *morphclass, bool quickundo);
|
const char *cht_Morph (player_t *player, PClassActor *morphclass, bool quickundo);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -899,7 +899,7 @@ void DPlayerMenu::ClassChanged (DMenuItemBase *li)
|
||||||
players[consoleplayer].userinfo.PlayerClassNumChanged(gameinfo.norandomplayerclass ? sel : sel-1);
|
players[consoleplayer].userinfo.PlayerClassNumChanged(gameinfo.norandomplayerclass ? sel : sel-1);
|
||||||
PickPlayerClass();
|
PickPlayerClass();
|
||||||
|
|
||||||
cvar_set ("playerclass", sel == 0 && !gameinfo.norandomplayerclass ? "Random" : PlayerClass->Type->DisplayName.GetChars());
|
cvar_set ("playerclass", sel == 0 && !gameinfo.norandomplayerclass ? "Random" : GetPrintableDisplayName(PlayerClass->Type).GetChars());
|
||||||
|
|
||||||
UpdateSkins();
|
UpdateSkins();
|
||||||
UpdateColorsets();
|
UpdateColorsets();
|
||||||
|
|
|
@ -9491,7 +9491,7 @@ scriptwait:
|
||||||
{
|
{
|
||||||
int tag = STACK(7);
|
int tag = STACK(7);
|
||||||
FName playerclass_name = FBehavior::StaticLookupString(STACK(6));
|
FName playerclass_name = FBehavior::StaticLookupString(STACK(6));
|
||||||
PClassPlayerPawn *playerclass = dyn_cast<PClassPlayerPawn>(PClass::FindClass (playerclass_name));
|
auto playerclass = PClass::FindActor (playerclass_name);
|
||||||
FName monsterclass_name = FBehavior::StaticLookupString(STACK(5));
|
FName monsterclass_name = FBehavior::StaticLookupString(STACK(5));
|
||||||
PClassActor *monsterclass = PClass::FindActor(monsterclass_name);
|
PClassActor *monsterclass = PClass::FindActor(monsterclass_name);
|
||||||
int duration = STACK(4);
|
int duration = STACK(4);
|
||||||
|
|
|
@ -148,7 +148,7 @@ bool FPlayerClass::CheckSkin (int skin)
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
FString GetPrintableDisplayName(PClassPlayerPawn *cls)
|
FString GetPrintableDisplayName(PClassActor *cls)
|
||||||
{
|
{
|
||||||
// Fixme; This needs a decent way to access the string table without creating a mess.
|
// Fixme; This needs a decent way to access the string table without creating a mess.
|
||||||
// [RH] ????
|
// [RH] ????
|
||||||
|
@ -167,7 +167,7 @@ bool ValidatePlayerClass(PClassActor *ti, const char *name)
|
||||||
Printf("Invalid player class '%s'\n", name);
|
Printf("Invalid player class '%s'\n", name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (static_cast<PClassPlayerPawn *>(ti)->DisplayName.IsEmpty())
|
else if (ti->DisplayName.IsEmpty())
|
||||||
{
|
{
|
||||||
Printf ("Missing displayname for player class '%s'\n", name);
|
Printf ("Missing displayname for player class '%s'\n", name);
|
||||||
return false;
|
return false;
|
||||||
|
@ -186,7 +186,7 @@ void SetupPlayerClasses ()
|
||||||
if (ValidatePlayerClass(cls, gameinfo.PlayerClasses[i]))
|
if (ValidatePlayerClass(cls, gameinfo.PlayerClasses[i]))
|
||||||
{
|
{
|
||||||
newclass.Flags = 0;
|
newclass.Flags = 0;
|
||||||
newclass.Type = static_cast<PClassPlayerPawn *>(cls);
|
newclass.Type = cls;
|
||||||
if ((GetDefaultByType(cls)->flags6 & MF6_NOMENU))
|
if ((GetDefaultByType(cls)->flags6 & MF6_NOMENU))
|
||||||
{
|
{
|
||||||
newclass.Flags |= PCF_NOMENU;
|
newclass.Flags |= PCF_NOMENU;
|
||||||
|
@ -214,7 +214,7 @@ CCMD (addplayerclass)
|
||||||
{
|
{
|
||||||
FPlayerClass newclass;
|
FPlayerClass newclass;
|
||||||
|
|
||||||
newclass.Type = static_cast<PClassPlayerPawn *>(ti);
|
newclass.Type = ti;
|
||||||
newclass.Flags = 0;
|
newclass.Flags = 0;
|
||||||
|
|
||||||
int arg = 2;
|
int arg = 2;
|
||||||
|
@ -535,27 +535,6 @@ int player_t::GetSpawnClass()
|
||||||
return static_cast<APlayerPawn*>(GetDefaultByType(type))->SpawnMask;
|
return static_cast<APlayerPawn*>(GetDefaultByType(type))->SpawnMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
//
|
|
||||||
// PClassPlayerPawn
|
|
||||||
//
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
IMPLEMENT_CLASS(PClassPlayerPawn, false, false)
|
|
||||||
|
|
||||||
PClassPlayerPawn::PClassPlayerPawn()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void PClassPlayerPawn::DeriveData(PClass *newclass)
|
|
||||||
{
|
|
||||||
assert(newclass->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
|
||||||
Super::DeriveData(newclass);
|
|
||||||
PClassPlayerPawn *newp = static_cast<PClassPlayerPawn *>(newclass);
|
|
||||||
|
|
||||||
newp->DisplayName = DisplayName;
|
|
||||||
}
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// EnumColorsets
|
// EnumColorsets
|
||||||
|
@ -1247,7 +1226,7 @@ const char *APlayerPawn::GetSoundClass() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// [GRB]
|
// [GRB]
|
||||||
PClassPlayerPawn *pclass = GetClass();
|
auto pclass = GetClass();
|
||||||
return SoundClass != NAME_None? SoundClass.GetChars() : "player";
|
return SoundClass != NAME_None? SoundClass.GetChars() : "player";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1729,7 +1708,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullPop)
|
||||||
// [GRB] Parameterized version
|
// [GRB] Parameterized version
|
||||||
if (spawntype == NULL || !spawntype->IsDescendantOf("PlayerChunk"))
|
if (spawntype == NULL || !spawntype->IsDescendantOf("PlayerChunk"))
|
||||||
{
|
{
|
||||||
spawntype = dyn_cast<PClassPlayerPawn>(PClass::FindClass("BloodySkull"));
|
spawntype = PClass::FindActor("BloodySkull");
|
||||||
if (spawntype == NULL)
|
if (spawntype == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3276,7 +3255,7 @@ DEFINE_FIELD(APlayerPawn, HexenArmor)
|
||||||
DEFINE_FIELD(APlayerPawn, ColorRangeStart)
|
DEFINE_FIELD(APlayerPawn, ColorRangeStart)
|
||||||
DEFINE_FIELD(APlayerPawn, ColorRangeEnd)
|
DEFINE_FIELD(APlayerPawn, ColorRangeEnd)
|
||||||
|
|
||||||
DEFINE_FIELD(PClassPlayerPawn, DisplayName)
|
DEFINE_FIELD(PClassActor, DisplayName)
|
||||||
|
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, mo)
|
DEFINE_FIELD_X(PlayerInfo, player_t, mo)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, playerstate)
|
DEFINE_FIELD_X(PlayerInfo, player_t, playerstate)
|
||||||
|
|
|
@ -517,7 +517,7 @@ void R_InitSkins (void)
|
||||||
int lastlump;
|
int lastlump;
|
||||||
int aliasid;
|
int aliasid;
|
||||||
bool remove;
|
bool remove;
|
||||||
PClassPlayerPawn *basetype, *transtype;
|
PClassActor *basetype, *transtype;
|
||||||
|
|
||||||
key[sizeof(key)-1] = 0;
|
key[sizeof(key)-1] = 0;
|
||||||
i = PlayerClasses.Size () - 1;
|
i = PlayerClasses.Size () - 1;
|
||||||
|
@ -602,11 +602,11 @@ void R_InitSkins (void)
|
||||||
else if (0 == stricmp (key, "game"))
|
else if (0 == stricmp (key, "game"))
|
||||||
{
|
{
|
||||||
if (gameinfo.gametype == GAME_Heretic)
|
if (gameinfo.gametype == GAME_Heretic)
|
||||||
basetype = dyn_cast<PClassPlayerPawn>(PClass::FindActor(NAME_HereticPlayer));
|
basetype = PClass::FindActor(NAME_HereticPlayer);
|
||||||
else if (gameinfo.gametype == GAME_Strife)
|
else if (gameinfo.gametype == GAME_Strife)
|
||||||
basetype = dyn_cast<PClassPlayerPawn>(PClass::FindActor(NAME_StrifePlayer));
|
basetype = PClass::FindActor(NAME_StrifePlayer);
|
||||||
else
|
else
|
||||||
basetype = dyn_cast<PClassPlayerPawn>(PClass::FindActor(NAME_DoomPlayer));
|
basetype = PClass::FindActor(NAME_DoomPlayer);
|
||||||
|
|
||||||
transtype = basetype;
|
transtype = basetype;
|
||||||
|
|
||||||
|
@ -614,7 +614,7 @@ void R_InitSkins (void)
|
||||||
{
|
{
|
||||||
if (gameinfo.gametype & GAME_DoomChex)
|
if (gameinfo.gametype & GAME_DoomChex)
|
||||||
{
|
{
|
||||||
transtype = dyn_cast<PClassPlayerPawn>(PClass::FindActor(NAME_HereticPlayer));
|
transtype = PClass::FindActor(NAME_HereticPlayer);
|
||||||
skins[i].othergame = true;
|
skins[i].othergame = true;
|
||||||
}
|
}
|
||||||
else if (gameinfo.gametype != GAME_Heretic)
|
else if (gameinfo.gametype != GAME_Heretic)
|
||||||
|
@ -633,7 +633,7 @@ void R_InitSkins (void)
|
||||||
{
|
{
|
||||||
if (gameinfo.gametype == GAME_Heretic)
|
if (gameinfo.gametype == GAME_Heretic)
|
||||||
{
|
{
|
||||||
transtype = dyn_cast<PClassPlayerPawn>(PClass::FindActor(NAME_DoomPlayer));
|
transtype = PClass::FindActor(NAME_DoomPlayer);
|
||||||
skins[i].othergame = true;
|
skins[i].othergame = true;
|
||||||
}
|
}
|
||||||
else if (!(gameinfo.gametype & GAME_DoomChex))
|
else if (!(gameinfo.gametype & GAME_DoomChex))
|
||||||
|
@ -709,12 +709,12 @@ void R_InitSkins (void)
|
||||||
{
|
{
|
||||||
if (gameinfo.gametype & GAME_DoomChex)
|
if (gameinfo.gametype & GAME_DoomChex)
|
||||||
{
|
{
|
||||||
basetype = transtype = dyn_cast<PClassPlayerPawn>(PClass::FindActor(NAME_DoomPlayer));
|
basetype = transtype = PClass::FindActor(NAME_DoomPlayer);
|
||||||
}
|
}
|
||||||
else if (gameinfo.gametype == GAME_Heretic)
|
else if (gameinfo.gametype == GAME_Heretic)
|
||||||
{
|
{
|
||||||
basetype = dyn_cast<PClassPlayerPawn>(PClass::FindActor(NAME_HereticPlayer));
|
basetype = PClass::FindActor(NAME_HereticPlayer);
|
||||||
transtype = dyn_cast<PClassPlayerPawn>(PClass::FindActor(NAME_DoomPlayer));
|
transtype = PClass::FindActor(NAME_DoomPlayer);
|
||||||
skins[i].othergame = true;
|
skins[i].othergame = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -734,7 +734,7 @@ void R_InitSkins (void)
|
||||||
remove = true;
|
remove = true;
|
||||||
for (j = 0; j < (int)PlayerClasses.Size (); j++)
|
for (j = 0; j < (int)PlayerClasses.Size (); j++)
|
||||||
{
|
{
|
||||||
PClassPlayerPawn *type = PlayerClasses[j].Type;
|
auto type = PlayerClasses[j].Type;
|
||||||
auto type_def = ((APlayerPawn*)GetDefaultByType(type));
|
auto type_def = ((APlayerPawn*)GetDefaultByType(type));
|
||||||
|
|
||||||
if (type->IsDescendantOf (basetype) &&
|
if (type->IsDescendantOf (basetype) &&
|
||||||
|
|
|
@ -2277,8 +2277,7 @@ DEFINE_SCRIPTED_PROPERTY_PREFIX(powerup, type, S, PowerupGiver)
|
||||||
DEFINE_CLASS_PROPERTY_PREFIX(player, displayname, S, PlayerPawn)
|
DEFINE_CLASS_PROPERTY_PREFIX(player, displayname, S, PlayerPawn)
|
||||||
{
|
{
|
||||||
PROP_STRING_PARM(str, 0);
|
PROP_STRING_PARM(str, 0);
|
||||||
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
info->DisplayName = str;
|
||||||
static_cast<PClassPlayerPawn *>(info)->DisplayName = str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -246,11 +246,6 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, FDoorAnimat
|
||||||
template<> FSerializer &Serialize(FSerializer &arc, const char *key, char *&pstr, char **def);
|
template<> FSerializer &Serialize(FSerializer &arc, const char *key, char *&pstr, char **def);
|
||||||
template<> FSerializer &Serialize(FSerializer &arc, const char *key, FFont *&font, FFont **def);
|
template<> FSerializer &Serialize(FSerializer &arc, const char *key, FFont *&font, FFont **def);
|
||||||
|
|
||||||
template<> inline FSerializer &Serialize(FSerializer &arc, const char *key, PClassPlayerPawn *&clst, PClassPlayerPawn **def)
|
|
||||||
{
|
|
||||||
return Serialize(arc, key, (PClassActor *&)clst, (PClassActor **)def);
|
|
||||||
}
|
|
||||||
|
|
||||||
FSerializer &Serialize(FSerializer &arc, const char *key, FState *&state, FState **def, bool *retcode);
|
FSerializer &Serialize(FSerializer &arc, const char *key, FState *&state, FState **def, bool *retcode);
|
||||||
template<> inline FSerializer &Serialize(FSerializer &arc, const char *key, FState *&state, FState **def)
|
template<> inline FSerializer &Serialize(FSerializer &arc, const char *key, FState *&state, FState **def)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue