mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-01 14:11:01 +00:00
- minor savegame optimizations.
Do not write out empty elements of arrays where these are by far the most common ones.
This commit is contained in:
parent
1a588c3cbf
commit
751c295b62
3 changed files with 16 additions and 10 deletions
|
@ -6956,11 +6956,13 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, POSTPONE& w, POSTP
|
||||||
|
|
||||||
FSerializer& Serialize(FSerializer& arc, const char* keyname, SPRITEHIT& w, SPRITEHIT* def)
|
FSerializer& Serialize(FSerializer& arc, const char* keyname, SPRITEHIT& w, SPRITEHIT* def)
|
||||||
{
|
{
|
||||||
|
int empty = 0;
|
||||||
|
if (arc.isReading()) w = {};
|
||||||
if (arc.BeginObject(keyname))
|
if (arc.BeginObject(keyname))
|
||||||
{
|
{
|
||||||
arc("hit", w.hit)
|
arc("hit", w.hit, &empty)
|
||||||
("ceilhit", w.ceilhit)
|
("ceilhit", w.ceilhit, &empty)
|
||||||
("florhit", w.florhit)
|
("florhit", w.florhit, &empty)
|
||||||
.EndObject();
|
.EndObject();
|
||||||
}
|
}
|
||||||
return arc;
|
return arc;
|
||||||
|
|
|
@ -1750,14 +1750,18 @@ void aiInitSprite(spritetype *pSprite)
|
||||||
|
|
||||||
FSerializer& Serialize(FSerializer& arc, const char* keyname, DUDEEXTRA& w, DUDEEXTRA* def)
|
FSerializer& Serialize(FSerializer& arc, const char* keyname, DUDEEXTRA& w, DUDEEXTRA* def)
|
||||||
{
|
{
|
||||||
|
int empty = 0;
|
||||||
|
char empty2 = 0;
|
||||||
|
if (arc.isReading()) w = {};
|
||||||
|
|
||||||
if (arc.BeginObject(keyname))
|
if (arc.BeginObject(keyname))
|
||||||
{
|
{
|
||||||
arc("time", w.time)
|
arc("time", w.time, &empty)
|
||||||
("recoil", w.recoil)
|
("recoil", w.recoil, &empty)
|
||||||
("prio", w.prio)
|
("prio", w.prio, &empty)
|
||||||
("x1", w.at6.u1.xval1)
|
("x1", w.at6.u1.xval1, &empty)
|
||||||
("x2", w.at6.u1.xval2)
|
("x2", w.at6.u1.xval2, &empty)
|
||||||
("x3", w.at6.u1.xval3)
|
("x3", w.at6.u1.xval3, &empty2)
|
||||||
.EndObject();
|
.EndObject();
|
||||||
}
|
}
|
||||||
return arc;
|
return arc;
|
||||||
|
|
|
@ -1998,7 +1998,7 @@ bool genDudePrepare(spritetype* pSprite, int propId) {
|
||||||
|
|
||||||
case kGenDudePropertyMass: {
|
case kGenDudePropertyMass: {
|
||||||
// to ensure mass gets updated, let's clear all cache
|
// to ensure mass gets updated, let's clear all cache
|
||||||
SPRITEMASS* pMass = &gSpriteMass[pSprite->index];
|
SPRITEMASS* pMass = &gSpriteMass[pSprite->extra];
|
||||||
pMass->seqId = pMass->picnum = pMass->xrepeat = pMass->yrepeat = pMass->clipdist = 0;
|
pMass->seqId = pMass->picnum = pMass->xrepeat = pMass->yrepeat = pMass->clipdist = 0;
|
||||||
pMass->mass = pMass->airVel = pMass->fraction = 0;
|
pMass->mass = pMass->airVel = pMass->fraction = 0;
|
||||||
getSpriteMassBySize(pSprite);
|
getSpriteMassBySize(pSprite);
|
||||||
|
|
Loading…
Reference in a new issue