- cleaned up some function calls where passing a vector is doable

This commit is contained in:
Christoph Oelckers 2022-09-16 18:07:38 +02:00
parent 0fdc91904d
commit e1bcb4962e
4 changed files with 9 additions and 9 deletions

View file

@ -5231,7 +5231,7 @@ int MoveMissile(DBloodActor* actor)
if (target->spr.statnum == kStatDude && target->hasX() && target->xspr.health > 0) if (target->spr.statnum == kStatDude && target->hasX() && target->xspr.health > 0)
{ {
int nTargetAngle = getangle(-(target->int_pos().Y - actor->int_pos().Y), target->int_pos().X - actor->int_pos().X); // X and Y are swapped here! int nTargetAngle = getangle(actor->spr.pos - target->spr.pos); // X and Y are swapped here!
int vx = missileInfo[actor->spr.type - kMissileBase].velocity; int vx = missileInfo[actor->spr.type - kMissileBase].velocity;
int vy = 0; int vy = 0;
auto rpt = rotatepoint(DVector2(0,0), DVector2(vx, 0), DAngle::fromBuild(nTargetAngle + 1536)); auto rpt = rotatepoint(DVector2(0,0), DVector2(vx, 0), DAngle::fromBuild(nTargetAngle + 1536));

View file

@ -626,7 +626,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
{ {
int top, bottom; int top, bottom;
GetSpriteExtents(pTSprite, &top, &bottom); GetSpriteExtents(pTSprite, &top, &bottom);
if (getflorzofslopeptr(pTSprite->sectp, pTSprite->int_pos().X, pTSprite->int_pos().Y) > bottom) if (getflorzofslopeptr(pTSprite->sectp, pTSprite->pos) > bottom)
nAnim = 1; nAnim = 1;
} }
break; break;
@ -909,7 +909,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
} }
if (pTSprite->ownerActor != pPlayer->actor || gViewPos != VIEWPOS_0) { if (pTSprite->ownerActor != pPlayer->actor || gViewPos != VIEWPOS_0) {
if (getflorzofslopeptr(pTSprite->sectp, pTSprite->int_pos().X, pTSprite->int_pos().Y) >= cZ) if (getflorzofslopeptr(pTSprite->sectp, pTSprite->pos) >= cZ)
{ {
viewAddEffect(tsprites, nTSprite, kViewEffectShadow); viewAddEffect(tsprites, nTSprite, kViewEffectShadow);
} }
@ -941,7 +941,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t
if (pTSprite->type < kThingBase || pTSprite->type >= kThingMax || owneractor->hit.florhit.type == kHitNone) if (pTSprite->type < kThingBase || pTSprite->type >= kThingMax || owneractor->hit.florhit.type == kHitNone)
{ {
if ((pTSprite->flags & kPhysMove) && getflorzofslopeptr(pTSprite->sectp, pTSprite->int_pos().X, pTSprite->int_pos().Y) >= cZ) if ((pTSprite->flags & kPhysMove) && getflorzofslopeptr(pTSprite->sectp, pTSprite->pos) >= cZ)
viewAddEffect(tsprites, nTSprite, kViewEffectShadow); viewAddEffect(tsprites, nTSprite, kViewEffectShadow);
} }
} }

View file

@ -224,7 +224,7 @@ void CFX::fxProcess(void)
remove(actor); remove(actor);
continue; continue;
} }
if (getflorzofslopeptr(actor->sector(), actor->spr.pos) <= actor->int_pos().Z) if (getflorzofslopeptrf(actor->sector(), actor->spr.pos) <= actor->spr.pos.Z)
{ {
if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax) if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax)
{ {

View file

@ -6742,7 +6742,7 @@ void useSlopeChanger(DBloodActor* sourceactor, int objType, sectortype* pSect, D
while (auto iactor = it.Next()) while (auto iactor = it.Next())
{ {
if (!(iactor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) continue; if (!(iactor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) continue;
else if (getflorzofslopeptr(pSect, iactor->int_pos().X, iactor->int_pos().Y) - kSlopeDist <= iactor->int_pos().Z) else if (getflorzofslopeptr(pSect, iactor->spr.pos) - kSlopeDist <= iactor->int_pos().Z)
{ {
sprite2sectorSlope(iactor, pSect, 0, true); sprite2sectorSlope(iactor, pSect, 0, true);
@ -6778,7 +6778,7 @@ void useSlopeChanger(DBloodActor* sourceactor, int objType, sectortype* pSect, D
while (auto iactor = it.Next()) while (auto iactor = it.Next())
{ {
if (!(iactor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) continue; if (!(iactor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) continue;
else if (getceilzofslopeptr(pSect, iactor->int_pos().X, iactor->int_pos().Y) + kSlopeDist >= iactor->int_pos().Z) else if (getceilzofslopeptr(pSect, iactor->spr.pos) + kSlopeDist >= iactor->int_pos().Z)
{ {
sprite2sectorSlope(iactor, pSect, 1, true); sprite2sectorSlope(iactor, pSect, 1, true);
@ -6833,8 +6833,8 @@ void useSlopeChanger(DBloodActor* sourceactor, int objType, sectortype* pSect, D
case 1: sprite2sectorSlope(objActor, objActor->sector(), 0, flag2); break; case 1: sprite2sectorSlope(objActor, objActor->sector(), 0, flag2); break;
case 2: sprite2sectorSlope(objActor, objActor->sector(), 1, flag2); break; case 2: sprite2sectorSlope(objActor, objActor->sector(), 1, flag2); break;
case 3: case 3:
if (getflorzofslopeptr(objActor->sector(), objActor->int_pos().X, objActor->int_pos().Y) - kSlopeDist <= objActor->int_pos().Z) sprite2sectorSlope(objActor, objActor->sector(), 0, flag2); if (getflorzofslopeptr(objActor->sector(), objActor->spr.pos) - kSlopeDist <= objActor->int_pos().Z) sprite2sectorSlope(objActor, objActor->sector(), 0, flag2);
if (getceilzofslopeptr(objActor->sector(), objActor->int_pos().X, objActor->int_pos().Y) + kSlopeDist >= objActor->int_pos().Z) sprite2sectorSlope(objActor, objActor->sector(), 1, flag2); if (getceilzofslopeptr(objActor->sector(), objActor->spr.pos) + kSlopeDist >= objActor->int_pos().Z) sprite2sectorSlope(objActor, objActor->sector(), 1, flag2);
break; break;
} }
break; break;