remove unecessary allocations

This commit is contained in:
Ricardo Luís Vaz Silva 2024-11-12 16:05:24 -03:00
commit 9466c2d138
3 changed files with 2 additions and 10 deletions

View file

@ -1006,7 +1006,6 @@ void DVisualThinker::Construct()
PT.subsector = nullptr;
cursector = nullptr;
PT.color = 0xffffff;
spr = new HWSprite();
AnimatedTexture.SetNull();
}
@ -1018,11 +1017,6 @@ DVisualThinker::DVisualThinker()
void DVisualThinker::OnDestroy()
{
PT.alpha = 0.0; // stops all rendering.
if(spr)
{
delete spr;
spr = nullptr;
}
Super::OnDestroy();
}

View file

@ -39,7 +39,6 @@ public:
// internal only variables
particle_t PT;
HWSprite *spr; //in an effort to cache the result.
DVisualThinker();
void Construct();

View file

@ -669,10 +669,9 @@ void HWDrawInfo::RenderParticles(subsector_t *sub, sector_t *front)
int clipres = mClipPortal->ClipPoint(sp->PT.Pos.XY());
if (clipres == PClip_InFront) continue;
}
assert(sp->spr);
sp->spr->ProcessParticle(this, &sp->PT, front, sp);
HWSprite sprite;
sprite.ProcessParticle(this, &sp->PT, front, sp);
}
for (int i = Level->ParticlesInSubsec[sub->Index()]; i != NO_PARTICLE; i = Level->Particles[i].snext)
{