mirror of
https://github.com/ZDoom/Raze.git
synced 2025-04-04 06:55:48 +00:00
- Exhumed: Avoid unnecessarily iterating through tsprites twice.
This commit is contained in:
parent
10ebc00853
commit
0ac7af6cd7
1 changed files with 4 additions and 12 deletions
|
@ -62,23 +62,15 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& view, double
|
|||
{
|
||||
mytspriteArray = &tsprites;
|
||||
|
||||
for (unsigned i = 0; i < tsprites.Size(); i++)
|
||||
{
|
||||
auto pTSprite = tsprites.get(i);
|
||||
|
||||
if (pTSprite->ownerActor)
|
||||
{
|
||||
// interpolate sprite position
|
||||
pTSprite->pos = pTSprite->ownerActor->interpolatedpos(interpfrac);
|
||||
pTSprite->Angles.Yaw = pTSprite->ownerActor->interpolatedyaw(interpfrac);
|
||||
}
|
||||
}
|
||||
|
||||
for (int nTSprite = int(tsprites.Size()-1); nTSprite >= 0; nTSprite--)
|
||||
{
|
||||
auto pTSprite = tsprites.get(nTSprite);
|
||||
auto pActor = static_cast<DExhumedActor*>(pTSprite->ownerActor);
|
||||
|
||||
// interpolate sprite position
|
||||
pTSprite->pos = pActor->interpolatedpos(interpfrac);
|
||||
pTSprite->Angles.Yaw = pActor->interpolatedyaw(interpfrac);
|
||||
|
||||
if (pTSprite->sectp != nullptr)
|
||||
{
|
||||
sectortype *pTSector = pTSprite->sectp;
|
||||
|
|
Loading…
Reference in a new issue