mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
- moved 'frags' into player_struct.
Again for reducing the work with the script interface.
This commit is contained in:
parent
346921211e
commit
553bb2af19
8 changed files with 9 additions and 9 deletions
|
@ -739,7 +739,7 @@ public:
|
|||
|
||||
for (int y = 0; y < playerswhenstarted; y++)
|
||||
{
|
||||
int frag = frags[i][y];
|
||||
int frag = ps[i].frags[y];
|
||||
if (i == y)
|
||||
{
|
||||
mysnprintf(tempbuf, 32, "%-4d", ps[y].fraggedself);
|
||||
|
@ -774,7 +774,7 @@ public:
|
|||
{
|
||||
if (i == y)
|
||||
yfragtotal += ps[i].fraggedself;
|
||||
int frag = frags[i][y];
|
||||
int frag = ps[i].frags[y];
|
||||
yfragtotal += frag;
|
||||
}
|
||||
mysnprintf(tempbuf, 32, "%-4d", yfragtotal);
|
||||
|
|
|
@ -300,7 +300,7 @@ public:
|
|||
|
||||
for (int y = 0; y < playerswhenstarted; y++)
|
||||
{
|
||||
int frag = frags[i][y];
|
||||
int frag = ps[i].frags[y];
|
||||
if (i == y)
|
||||
{
|
||||
mysnprintf(tempbuf, 32, "%-4d", ps[y].fraggedself);
|
||||
|
@ -335,7 +335,7 @@ public:
|
|||
{
|
||||
if (i == y)
|
||||
yfragtotal += ps[i].fraggedself;
|
||||
int frag = frags[i][y];
|
||||
int frag = ps[i].frags[y];
|
||||
yfragtotal += frag;
|
||||
}
|
||||
mysnprintf(tempbuf, 32, "%-4d", yfragtotal);
|
||||
|
|
|
@ -53,7 +53,6 @@ int rtsplaying;
|
|||
int tempwallptr;
|
||||
weaponhit hittype[MAXSPRITES+1]; // +1 to have a blank entry for serialization.
|
||||
bool sound445done; // this was local state inside a function, but this must be maintained globally and serialized
|
||||
uint16_t frags[MAXPLAYERS][MAXPLAYERS];
|
||||
player_struct ps[MAXPLAYERS];
|
||||
int spriteqamount = 64;
|
||||
uint8_t shadedsector[MAXSECTORS];
|
||||
|
|
|
@ -60,7 +60,6 @@ extern int rtsplaying;
|
|||
extern int tempwallptr;
|
||||
|
||||
extern bool sound445done;
|
||||
extern uint16_t frags[MAXPLAYERS][MAXPLAYERS];
|
||||
extern player_struct ps[MAXPLAYERS];
|
||||
extern int spriteqamount;
|
||||
extern uint8_t shadedsector[MAXSECTORS];
|
||||
|
|
|
@ -612,7 +612,7 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
|
|||
if (p->frag_ps != snum)
|
||||
{
|
||||
ps[p->frag_ps].frag++;
|
||||
frags[p->frag_ps][snum]++;
|
||||
ps[p->frag_ps].frags[snum]++;
|
||||
|
||||
auto pname = PlayerName(p->frag_ps);
|
||||
if (snum == screenpeek)
|
||||
|
|
|
@ -898,8 +898,8 @@ static void clearfrags(void)
|
|||
for (int i = 0; i < ud.multimode; i++)
|
||||
{
|
||||
ps[i].frag = ps[i].fraggedself = 0;
|
||||
memset(ps[i].frags, 0, sizeof(ps[i].frags));
|
||||
}
|
||||
memset(frags, 0, sizeof(frags));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -248,6 +248,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
|
|||
("moto_on_mud", w.moto_on_mud)
|
||||
// new stuff
|
||||
("actions", w.sync.actions)
|
||||
.Array("frags", w.frags, MAXPLAYERS)
|
||||
.EndObject();
|
||||
|
||||
w.invdisptime = 0;
|
||||
|
@ -315,7 +316,6 @@ void GameInterface::SerializeGameState(FSerializer& arc)
|
|||
if (arc.BeginObject("duke.gamestate"))
|
||||
{
|
||||
arc("multimode", ud.multimode);
|
||||
if (ud.multimode > 1) arc.Array("frags", &frags[0][0], MAXPLAYERS * MAXPLAYERS);
|
||||
|
||||
arc.SparseArray("actors", hittype, MAXSPRITES, activeSprites)
|
||||
("skill", ud.player_skill)
|
||||
|
|
|
@ -171,6 +171,8 @@ struct player_struct
|
|||
PlayerHorizon horizon;
|
||||
PlayerAngle angle;
|
||||
|
||||
uint16_t frags[MAXPLAYERS];
|
||||
|
||||
// using a bit field for this to save a bit of space.
|
||||
FixedBitArray<MAX_WEAPONS> gotweapon;
|
||||
|
||||
|
|
Loading…
Reference in a new issue