diff --git a/src/playsim/p_effect.cpp b/src/playsim/p_effect.cpp index bc9e88163..86b9ac1bf 100644 --- a/src/playsim/p_effect.cpp +++ b/src/playsim/p_effect.cpp @@ -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(); } diff --git a/src/playsim/p_visualthinker.h b/src/playsim/p_visualthinker.h index c52cc1cd4..953f2f0ff 100644 --- a/src/playsim/p_visualthinker.h +++ b/src/playsim/p_visualthinker.h @@ -39,7 +39,6 @@ public: // internal only variables particle_t PT; - HWSprite *spr; //in an effort to cache the result. DVisualThinker(); void Construct(); diff --git a/src/rendering/hwrenderer/scene/hw_bsp.cpp b/src/rendering/hwrenderer/scene/hw_bsp.cpp index ef4c89cb1..2c1abdf7c 100644 --- a/src/rendering/hwrenderer/scene/hw_bsp.cpp +++ b/src/rendering/hwrenderer/scene/hw_bsp.cpp @@ -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) {