ActorModelData cleanup in preparation for decoupled model animations

This commit is contained in:
Ricardo Luís Vaz Silva 2023-11-17 20:34:43 -03:00 committed by Rachael Alexanderson
commit 1a8dfd2dfa
9 changed files with 73 additions and 52 deletions

View file

@ -783,20 +783,14 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
if (fabs(viewpos.X - vp.Pos.X) < 32 && fabs(viewpos.Y - vp.Pos.Y) < 32) return;
}
modelframe = isPicnumOverride ? nullptr : FindModelFrame(thing, spritenum, thing->frame, !!(thing->flags & MF_DROPPED));
// Too close to the camera. This doesn't look good if it is a sprite.
if (fabs(thingpos.X - vp.Pos.X) < 2 && fabs(thingpos.Y - vp.Pos.Y) < 2)
if (fabs(thingpos.X - vp.Pos.X) < 2 && fabs(thingpos.Y - vp.Pos.Y) < 2
&& vp.Pos.Z >= thingpos.Z - 2 && vp.Pos.Z <= thingpos.Z + thing->Height + 2
&& !thing->Vel.isZero() && !modelframe) // exclude vertically moving objects from this check.
{
if (vp.Pos.Z >= thingpos.Z - 2 && vp.Pos.Z <= thingpos.Z + thing->Height + 2)
{
// exclude vertically moving objects from this check.
if (!thing->Vel.isZero())
{
if (!FindModelFrame(thing->GetClass(), spritenum, thing->frame, false))
{
return;
}
}
}
return;
}
// don't draw first frame of a player missile
@ -856,8 +850,6 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
z += fz;
}
modelframe = isPicnumOverride ? nullptr : FindModelFrame(thing->modelData != nullptr ? thing->modelData->modelDef != NAME_None ? PClass::FindActor(thing->modelData->modelDef) : thing->GetClass() : thing->GetClass(), spritenum, thing->frame, !!(thing->flags & MF_DROPPED));
// don't bother drawing sprite shadows if this is a model (it will never look right)
if (modelframe && isSpriteShadow)
{