Draw the sprites

This commit is contained in:
Magnus Norddahl 2023-12-04 14:29:17 +01:00
commit 5443ed76ec

View file

@ -51,6 +51,7 @@
EXTERN_CVAR(Float, r_visibility)
EXTERN_CVAR(Int, lm_background_updates);
EXTERN_CVAR(Float, r_actorspriteshadowdist)
CVAR(Bool, lm_always_update, false, 0)
@ -452,6 +453,26 @@ void HWDrawInfo::CreateScene(bool drawpsprites, FRenderState& state)
}
}
// Draw sprites
auto it = level.GetThinkerIterator<AActor>();
AActor* thing;
while ((thing = it.Next()) != nullptr)
{
HWSprite sprite;
if (R_ShouldDrawSpriteShadow(thing))
{
double dist = (thing->Pos() - vp.Pos).LengthSquared();
double check = r_actorspriteshadowdist;
if (dist <= check * check)
{
sprite.Process(this, state, thing, thing->Sector, in_area, false, true);
}
}
sprite.Process(this, state, thing, thing->Sector, in_area, false);
}
// Process all the sprites on the current portal's back side which touch the portal.
if (mCurrentPortal != nullptr) mCurrentPortal->RenderAttached(this, state);