mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- eliminated redundant and less precise GetMyAngle function
The engine's getangle function just works fine here.
This commit is contained in:
parent
c66c750547
commit
4403a6a411
13 changed files with 21 additions and 116 deletions
|
@ -216,7 +216,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
{
|
||||
ap->spr.xvel = 0;
|
||||
ap->spr.yvel = 0;
|
||||
ap->set_int_ang(GetMyAngle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y));
|
||||
ap->set_int_ang(getangle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y));
|
||||
|
||||
ap->nAction = 3;
|
||||
ap->nFrame = 0;
|
||||
|
|
|
@ -747,7 +747,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
|
|||
x -= pBulletActor->int_pos().X;
|
||||
y -= pBulletActor->int_pos().Y;
|
||||
|
||||
nAngle = GetMyAngle(x, y);
|
||||
nAngle = getangle(x, y);
|
||||
pActor->set_int_ang(nAngle);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -123,8 +123,6 @@ int RandomSize(int nSize);
|
|||
// trigdat
|
||||
|
||||
|
||||
int GetMyAngle(int x, int y);
|
||||
|
||||
int AngleDiff(DAngle a, DAngle b);
|
||||
int AngleDelta(int a, int b, int c);
|
||||
|
||||
|
|
|
@ -339,7 +339,7 @@ void AIFish::Tick(RunListEvent* ev)
|
|||
pActor->nAction = 2;
|
||||
pActor->nFrame = 0;
|
||||
|
||||
int nAngle = GetMyAngle(pTargetActor->int_pos().X - pActor->int_pos().X, pTargetActor->int_pos().Z - pActor->int_pos().Z);
|
||||
int nAngle = getangle(pTargetActor->int_pos().X - pActor->int_pos().X, pTargetActor->int_pos().Z - pActor->int_pos().Z);
|
||||
pActor->spr.zvel = bsin(nAngle, -5);
|
||||
|
||||
pActor->nCount = RandomSize(6) + 90;
|
||||
|
@ -454,7 +454,7 @@ void AIFish::Tick(RunListEvent* ev)
|
|||
if (pHitAct->spr.statnum == 100)
|
||||
{
|
||||
pActor->pTarget = coll.actor();
|
||||
pActor->set_int_ang(GetMyAngle(pHitAct->int_pos().X - pActor->int_pos().X, pHitAct->int_pos().Y - pActor->int_pos().Y));
|
||||
pActor->set_int_ang(getangle(pHitAct->int_pos().X - pActor->int_pos().X, pHitAct->int_pos().Y - pActor->int_pos().Y));
|
||||
|
||||
if (nAction != 3)
|
||||
{
|
||||
|
|
|
@ -658,7 +658,7 @@ int GetAngleToSprite(DExhumedActor* a1, DExhumedActor* a2)
|
|||
if (!a1 || !a2)
|
||||
return -1;
|
||||
|
||||
return GetMyAngle(a2->int_pos().X - a1->int_pos().X, a2->int_pos().Y - a1->int_pos().Y);
|
||||
return getangle(a2->int_pos().X - a1->int_pos().X, a2->int_pos().Y - a1->int_pos().Y);
|
||||
}
|
||||
|
||||
int PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2)
|
||||
|
@ -669,7 +669,7 @@ int PlotCourseToSprite(DExhumedActor* pActor1, DExhumedActor* pActor2)
|
|||
int x = pActor2->int_pos().X - pActor1->int_pos().X;
|
||||
int y = pActor2->int_pos().Y - pActor1->int_pos().Y;
|
||||
|
||||
pActor1->set_int_ang(GetMyAngle(x, y));
|
||||
pActor1->set_int_ang(getangle(x, y));
|
||||
|
||||
uint32_t x2 = abs(x);
|
||||
uint32_t y2 = abs(y);
|
||||
|
@ -775,7 +775,7 @@ int GetUpAngle(DExhumedActor* pActor1, int nVal, DExhumedActor* pActor2, int ecx
|
|||
|
||||
int nSqrt = lsqrt(x * x + y * y);
|
||||
|
||||
return GetMyAngle(nSqrt, ebx);
|
||||
return getangle(nSqrt, ebx);
|
||||
}
|
||||
|
||||
void InitPushBlocks()
|
||||
|
@ -858,7 +858,7 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
|
|||
{
|
||||
nXVect = *nXVel;
|
||||
nYVect = *nYVel;
|
||||
nAngle = GetMyAngle(nXVect, nYVect);
|
||||
nAngle = getangle(nXVect, nYVect);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1152,7 +1152,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int
|
|||
{
|
||||
int nHeight = tileHeight(pActor2->spr.picnum) * pActor2->spr.yrepeat * 2;
|
||||
|
||||
int nMyAngle = GetMyAngle(pActor2->int_pos().X - pActor->int_pos().X, pActor2->int_pos().Y - pActor->int_pos().Y);
|
||||
int nMyAngle = getangle(pActor2->int_pos().X - pActor->int_pos().X, pActor2->int_pos().Y - pActor->int_pos().Y);
|
||||
|
||||
uint32_t xDiff = abs(pActor2->int_pos().X - pActor->int_pos().X);
|
||||
uint32_t yDiff = abs(pActor2->int_pos().Y - pActor->int_pos().Y);
|
||||
|
@ -1167,7 +1167,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int
|
|||
|
||||
int nSqrt = ksqrt(sqrtNum);
|
||||
|
||||
int var_18 = GetMyAngle(nSqrt, ((pActor2->int_pos().Z - nHeight) - pActor->int_pos().Z) >> 8);
|
||||
int var_18 = getangle(nSqrt, ((pActor2->int_pos().Z - nHeight) - pActor->int_pos().Z) >> 8);
|
||||
|
||||
int nAngDelta = AngleDelta(pActor->int_ang(), nMyAngle, 1024);
|
||||
int nAngDelta2 = abs(nAngDelta);
|
||||
|
@ -1226,7 +1226,7 @@ int GetWallNormal(walltype* pWall)
|
|||
{
|
||||
auto delta = pWall->delta();
|
||||
|
||||
int nAngle = GetMyAngle(delta.X, delta.Y);
|
||||
int nAngle = getangle(delta.X, delta.Y);
|
||||
return (nAngle + 512) & kAngleMask;
|
||||
}
|
||||
|
||||
|
|
|
@ -2346,7 +2346,7 @@ void DoMovingSects()
|
|||
// TrailPoint *pTrail = &sTrailPoint[nTrail];
|
||||
|
||||
// loc_23872:
|
||||
int nAngle = GetMyAngle(sTrailPoint[nTrail].x - pBlockInfo->x, sTrailPoint[nTrail].y - pBlockInfo->y);
|
||||
int nAngle = getangle(sTrailPoint[nTrail].x - pBlockInfo->x, sTrailPoint[nTrail].y - pBlockInfo->y);
|
||||
|
||||
int nXVel = bcos(nAngle, 4) * sMoveSect[i].field_10;
|
||||
int nYVel = bsin(nAngle, 4) * sMoveSect[i].field_10;
|
||||
|
|
|
@ -1024,7 +1024,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
|
||||
int xvel = sPlayerInput[nPlayer].xVel;
|
||||
int yvel = sPlayerInput[nPlayer].yVel;
|
||||
int nMyAngle = GetMyAngle(xvel, yvel);
|
||||
int nMyAngle = getangle(xvel, yvel);
|
||||
|
||||
setsectinterpolate(sect);
|
||||
MoveSector(sect, nMyAngle, &xvel, &yvel);
|
||||
|
|
|
@ -297,7 +297,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int val
|
|||
{
|
||||
int nTileY = (tileHeight(pActor2->spr.picnum) * pActor2->spr.yrepeat) * 2;
|
||||
|
||||
int nMyAngle = GetMyAngle(pActor2->int_pos().X - pActor->int_pos().X, pActor2->int_pos().Y - pActor->int_pos().Y);
|
||||
int nMyAngle = getangle(pActor2->int_pos().X - pActor->int_pos().X, pActor2->int_pos().Y - pActor->int_pos().Y);
|
||||
|
||||
int edx = ((pActor2->int_pos().Z - nTileY) - pActor->int_pos().Z) >> 8;
|
||||
|
||||
|
@ -314,7 +314,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int val
|
|||
|
||||
int nSqrt = ksqrt(sqrtVal);
|
||||
|
||||
int var_14 = GetMyAngle(nSqrt, edx);
|
||||
int var_14 = getangle(nSqrt, edx);
|
||||
|
||||
int nAngDelta = AngleDelta(pActor->int_ang(), nMyAngle, 1024);
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ void AIRoach::Tick(RunListEvent* ev)
|
|||
|
||||
pActor->spr.xvel = 0;
|
||||
pActor->spr.yvel = 0;
|
||||
pActor->set_int_ang(GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y));
|
||||
pActor->set_int_ang(getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y));
|
||||
|
||||
pActor->nFrame = 0;
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ void AIRoach::Tick(RunListEvent* ev)
|
|||
|
||||
pActor->spr.xvel = 0;
|
||||
pActor->spr.yvel = 0;
|
||||
pActor->set_int_ang(GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y));
|
||||
pActor->set_int_ang(getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y));
|
||||
|
||||
pActor->nFrame = 0;
|
||||
}
|
||||
|
|
|
@ -1657,7 +1657,7 @@ int runlist_CheckRadialDamage(DExhumedActor* pActor)
|
|||
}
|
||||
else if (edi > 20)
|
||||
{
|
||||
int nAngle = GetMyAngle(x, y);
|
||||
int nAngle = getangle(x, y);
|
||||
|
||||
pActor->spr.xvel += (edi * bcos(nAngle)) >> 3;
|
||||
pActor->spr.yvel += (edi * bsin(nAngle)) >> 3;
|
||||
|
|
|
@ -428,7 +428,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode)
|
|||
{
|
||||
pActor->spr.xvel = 0;
|
||||
pActor->spr.yvel = 0;
|
||||
pActor->set_int_ang(GetMyAngle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y));
|
||||
pActor->set_int_ang(getangle(pTarget->int_pos().X - pActor->int_pos().X, pTarget->int_pos().Y - pActor->int_pos().Y));
|
||||
|
||||
pActor->nIndex = RandomSize(2) + RandomSize(3);
|
||||
|
||||
|
|
|
@ -479,7 +479,7 @@ int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx)
|
|||
int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal)
|
||||
{
|
||||
tspritetype* pTSprite = mytspriteArray->get(nSprite);
|
||||
int nAngle = GetMyAngle(nCamerax - pTSprite->int_pos().X, nCameray - pTSprite->int_pos().Y);
|
||||
int nAngle = getangle(nCamerax - pTSprite->int_pos().X, nCameray - pTSprite->int_pos().Y);
|
||||
|
||||
int nSeqOffset = ((((pTSprite->int_ang() + 512) - nAngle) + 128) & kAngleMask) >> 8;
|
||||
|
||||
|
@ -527,7 +527,7 @@ int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal)
|
|||
int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
|
||||
{
|
||||
tspritetype* pTSprite = mytspriteArray->get(nSprite);
|
||||
int nAngle = GetMyAngle(nCamerax - pTSprite->int_pos().X, nCameray - pTSprite->int_pos().Y);
|
||||
int nAngle = getangle(nCamerax - pTSprite->int_pos().X, nCameray - pTSprite->int_pos().Y);
|
||||
|
||||
|
||||
int val;
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue