mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 22:51:39 +00:00
- made ColorRangeStart and ColorRangeEnd meta properties of APlayerPawn.
These are only used during initialization and they should have been readonly from the start.
This commit is contained in:
parent
51499e167d
commit
08e2a86f64
6 changed files with 21 additions and 20 deletions
|
@ -151,8 +151,6 @@ public:
|
|||
FName Portrait;
|
||||
FName Slot[10];
|
||||
double HexenArmor[5];
|
||||
uint8_t ColorRangeStart; // Skin color range
|
||||
uint8_t ColorRangeEnd;
|
||||
|
||||
// Everything below this point is only used by scripted code.
|
||||
PClassActor *FlechetteType;
|
||||
|
|
|
@ -1019,6 +1019,11 @@ xx(WeaponFlags)
|
|||
xx(DropTime)
|
||||
xx(PickupSound)
|
||||
|
||||
// PlayerPawn member fields
|
||||
xx(ColorRangeStart)
|
||||
xx(ColorRangeEnd)
|
||||
|
||||
|
||||
xx(BlueCard)
|
||||
xx(YellowCard)
|
||||
xx(RedCard)
|
||||
|
|
|
@ -2129,8 +2129,6 @@ DEFINE_FIELD(APlayerPawn, Face)
|
|||
DEFINE_FIELD(APlayerPawn, Portrait)
|
||||
DEFINE_FIELD(APlayerPawn, Slot)
|
||||
DEFINE_FIELD(APlayerPawn, HexenArmor)
|
||||
DEFINE_FIELD(APlayerPawn, ColorRangeStart)
|
||||
DEFINE_FIELD(APlayerPawn, ColorRangeEnd)
|
||||
|
||||
DEFINE_FIELD_X(PlayerInfo, player_t, mo)
|
||||
DEFINE_FIELD_X(PlayerInfo, player_t, playerstate)
|
||||
|
|
|
@ -782,22 +782,22 @@ void R_InitSkins (void)
|
|||
|
||||
if (!remove)
|
||||
{
|
||||
auto transdef = ((APlayerPawn*)GetDefaultByType(transtype));
|
||||
auto basedef = ((APlayerPawn*)GetDefaultByType(basetype));
|
||||
auto transdef = GetDefaultByType(transtype);
|
||||
auto basedef = GetDefaultByType(basetype);
|
||||
|
||||
Skins[i].range0start = transdef->ColorRangeStart;
|
||||
Skins[i].range0end = transdef->ColorRangeEnd;
|
||||
Skins[i].range0start = transdef->IntVar(NAME_ColorRangeStart);
|
||||
Skins[i].range0end = transdef->IntVar(NAME_ColorRangeEnd);
|
||||
|
||||
remove = true;
|
||||
for (j = 0; j < (int)PlayerClasses.Size (); j++)
|
||||
{
|
||||
auto type = PlayerClasses[j].Type;
|
||||
auto type_def = ((APlayerPawn*)GetDefaultByType(type));
|
||||
auto type_def = GetDefaultByType(type);
|
||||
|
||||
if (type->IsDescendantOf (basetype) &&
|
||||
GetDefaultByType(type)->SpawnState->sprite == GetDefaultByType(basetype)->SpawnState->sprite &&
|
||||
type_def->ColorRangeStart == basedef->ColorRangeStart &&
|
||||
type_def->ColorRangeEnd == basedef->ColorRangeEnd)
|
||||
type_def->IntVar(NAME_ColorRangeStart) == basedef->IntVar(NAME_ColorRangeStart) &&
|
||||
type_def->IntVar(NAME_ColorRangeEnd) == basedef->IntVar(NAME_ColorRangeEnd))
|
||||
{
|
||||
PlayerClasses[j].Skins.Push ((int)i);
|
||||
remove = false;
|
||||
|
@ -999,9 +999,9 @@ void R_InitSprites ()
|
|||
|
||||
for (i = 0; i < numskins; i++)
|
||||
{ // Assume Doom skin by default
|
||||
auto type = ((APlayerPawn*)GetDefaultByType(PlayerClasses[0].Type));
|
||||
Skins[i].range0start = type->ColorRangeStart;
|
||||
Skins[i].range0end = type->ColorRangeEnd;
|
||||
auto type = GetDefaultByType(PlayerClasses[0].Type);
|
||||
Skins[i].range0start = type->IntVar(NAME_ColorRangeStart);
|
||||
Skins[i].range0end = type->IntVar(NAME_ColorRangeEnd);
|
||||
Skins[i].Scale = type->Scale;
|
||||
}
|
||||
|
||||
|
@ -1025,8 +1025,8 @@ void R_InitSprites ()
|
|||
{
|
||||
Skins[i].Face = basetype->Face;
|
||||
}
|
||||
Skins[i].range0start = basetype->ColorRangeStart;
|
||||
Skins[i].range0end = basetype->ColorRangeEnd;
|
||||
Skins[i].range0start = basetype->IntVar(NAME_ColorRangeStart);
|
||||
Skins[i].range0end = basetype->IntVar(NAME_ColorRangeEnd);
|
||||
Skins[i].Scale = basetype->Scale;
|
||||
Skins[i].sprite = basetype->SpawnState->sprite;
|
||||
Skins[i].namespc = ns_global;
|
||||
|
|
|
@ -1416,8 +1416,8 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, colorrange, I_I, PlayerPawn)
|
|||
if (start > end)
|
||||
swapvalues (start, end);
|
||||
|
||||
defaults->ColorRangeStart = start;
|
||||
defaults->ColorRangeEnd = end;
|
||||
defaults->IntVar(NAME_ColorRangeStart) = start;
|
||||
defaults->IntVar(NAME_ColorRangeEnd) = end;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -29,8 +29,6 @@ class PlayerPawn : Actor native
|
|||
native Name Portrait;
|
||||
native Name Slot[10];
|
||||
native double HexenArmor[5];
|
||||
native uint8 ColorRangeStart; // Skin color range
|
||||
native uint8 ColorRangeEnd;
|
||||
|
||||
// [GRB] Player class properties
|
||||
native double JumpZ;
|
||||
|
@ -54,6 +52,8 @@ class PlayerPawn : Actor native
|
|||
meta Name HealingRadiusType;
|
||||
meta Name InvulMode;
|
||||
meta int TeleportFreezeTime;
|
||||
meta int ColorRangeStart; // Skin color range
|
||||
meta int ColorRangeEnd;
|
||||
|
||||
property prefix: Player;
|
||||
property HealRadiusType: HealingradiusType;
|
||||
|
|
Loading…
Reference in a new issue