mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-27 05:40:46 +00:00
make sure that all places that read from SpriteMass ensure that the cache is up to date.
This allows removing the serializer for it.
This commit is contained in:
parent
b8aee5a730
commit
5dd0a43bca
3 changed files with 5 additions and 24 deletions
|
@ -4660,7 +4660,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3
|
||||||
{
|
{
|
||||||
if (actor->xspr.physAttr & kPhysDebrisVector)
|
if (actor->xspr.physAttr & kPhysDebrisVector)
|
||||||
{
|
{
|
||||||
int mass = max(actor->spriteMass.mass, 10);
|
int mass = max(getSpriteMassBySize(actor), 10);
|
||||||
double thrust = double(pVectorData->impulse) / (mass * 4096);
|
double thrust = double(pVectorData->impulse) / (mass * 4096);
|
||||||
actor->vel += dv * thrust;
|
actor->vel += dv * thrust;
|
||||||
|
|
||||||
|
|
|
@ -544,8 +544,7 @@ void DBloodActor::Serialize(FSerializer& arc)
|
||||||
#ifdef NOONE_EXTENSIONS
|
#ifdef NOONE_EXTENSIONS
|
||||||
if (gModernMap)
|
if (gModernMap)
|
||||||
{
|
{
|
||||||
arc//("spritemass", spriteMass) // should always be cached and not written out.
|
arc("prevmarker", prevmarker)
|
||||||
("prevmarker", prevmarker)
|
|
||||||
("customdude", customDude)
|
("customdude", customDude)
|
||||||
.Array("conditions", condition, 4);
|
.Array("conditions", condition, 4);
|
||||||
|
|
||||||
|
|
|
@ -1785,9 +1785,10 @@ void debrisConcuss(DBloodActor* owneractor, DBloodActor* actor, const DVector3&
|
||||||
double size = (tex->GetDisplayWidth() * actor->spr.scale.X * tex->GetDisplayHeight() * actor->spr.scale.Y) * 2048;
|
double size = (tex->GetDisplayWidth() * actor->spr.scale.X * tex->GetDisplayHeight() * actor->spr.scale.Y) * 2048;
|
||||||
if (actor->xspr.physAttr & kPhysDebrisExplode)
|
if (actor->xspr.physAttr & kPhysDebrisExplode)
|
||||||
{
|
{
|
||||||
if (actor->spriteMass.mass > 0)
|
int mass = getSpriteMassBySize(actor);
|
||||||
|
if (mass > 0)
|
||||||
{
|
{
|
||||||
double t = double(dmg) * size / actor->spriteMass.mass;
|
double t = double(dmg) * size / mass;
|
||||||
|
|
||||||
actor->vel += dv * t / (1 << 24);
|
actor->vel += dv * t / (1 << 24);
|
||||||
}
|
}
|
||||||
|
@ -8901,25 +8902,6 @@ int nnExtDudeStartHealth(DBloodActor* pSpr, int nHealth)
|
||||||
return getDudeInfo(pSpr->GetType())->startHealth << 4;
|
return getDudeInfo(pSpr->GetType())->startHealth << 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // no need to save if we ensure it never gets accessed directly without validating the content
|
|
||||||
FSerializer& Serialize(FSerializer& arc, const char* keyname, SPRITEMASS& w, SPRITEMASS* def)
|
|
||||||
{
|
|
||||||
static SPRITEMASS nul;
|
|
||||||
if (arc.isReading()) w = {};
|
|
||||||
if (arc.BeginObject(keyname))
|
|
||||||
{
|
|
||||||
arc("seq", w.seqId, &nul.seqId)
|
|
||||||
("texid", w.texid, &nul.texid)
|
|
||||||
("scale", w.scale, &nul.scale)
|
|
||||||
("clipdist", w.clipDist)
|
|
||||||
("mass", w.mass)
|
|
||||||
("airvel", w.airVel)
|
|
||||||
("fraction", w.fraction)
|
|
||||||
.EndObject();
|
|
||||||
}
|
|
||||||
return arc;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void SerializeConditions(FSerializer& arc);
|
void SerializeConditions(FSerializer& arc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue