- moved player color sets and pain flashes into global variables.
There's simply never enough of them and they are used far too infrequently to justify the hassle of tagging along two TMaps per class. For what they provide, single global lists that handle all player classes at once are fully sufficient.
This commit is contained in:
parent
dd102caf13
commit
68e9918ed5
10 changed files with 82 additions and 39 deletions
|
|
@ -69,6 +69,7 @@
|
|||
#include "backend/vmbuilder.h"
|
||||
#include "a_keys.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "d_player.h"
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
@ -2386,8 +2387,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, colorset, ISIIIiiiiiiiiiiiiiiiiiiiiiiii, Pl
|
|||
}
|
||||
else
|
||||
{
|
||||
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
||||
static_cast<PClassPlayerPawn *>(info)->ColorSets.Insert(setnum, color);
|
||||
ColorSets.Push(std::make_tuple(info, setnum, color));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2413,8 +2413,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, colorsetfile, ISSI, PlayerPawn)
|
|||
}
|
||||
else if (color.Lump >= 0)
|
||||
{
|
||||
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
||||
static_cast<PClassPlayerPawn *>(info)->ColorSets.Insert(setnum, color);
|
||||
ColorSets.Push(std::make_tuple(info, setnum, color));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2431,8 +2430,9 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, clearcolorset, I, PlayerPawn)
|
|||
}
|
||||
else
|
||||
{
|
||||
assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn)));
|
||||
static_cast<PClassPlayerPawn *>(info)->ColorSets.Remove(setnum);
|
||||
FPlayerColorSet color;
|
||||
memset(&color, 0, sizeof(color));
|
||||
ColorSets.Push(std::make_tuple(info, setnum, color));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2666,7 +2666,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, damagescreencolor, Cfs, PlayerPawn)
|
|||
PROP_STRING_PARM(type, 3);
|
||||
|
||||
color.a = BYTE(255 * clamp<double>(a, 0.f, 1.f));
|
||||
static_cast<PClassPlayerPawn *>(info)->PainFlashes.Insert(type, color);
|
||||
PainFlashes.Push(std::make_tuple(info, type, color));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue