diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index 11737dd1d..5b9a9aab0 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -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; diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 7a107a1a5..0f0239ced 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -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 diff --git a/source/games/exhumed/src/engine.h b/source/games/exhumed/src/engine.h index a4d7c7c28..a61a7862e 100644 --- a/source/games/exhumed/src/engine.h +++ b/source/games/exhumed/src/engine.h @@ -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); diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index 0772ad56a..50240798e 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -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) { diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 64d4d979e..207aa9733 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -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; } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 7f6209da7..460aa1a6a 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -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; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index e777cf7ea..28b716744 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -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); diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index 168461dd6..36798ca64 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -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); diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index 0fe89208a..fd05acd2b 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -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; } diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index 2ba82c37d..d68ebd3f1 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -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; diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index b57778574..8f8edacda 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -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); diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index 987a3fd86..f5b59e9a8 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -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; diff --git a/source/games/exhumed/src/trigdat.cpp b/source/games/exhumed/src/trigdat.cpp index db065bd1d..896ba9098 100644 --- a/source/games/exhumed/src/trigdat.cpp +++ b/source/games/exhumed/src/trigdat.cpp @@ -26,99 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS -static const uint16_t AngTable[] = {0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,27,28,28,28,28,28,28,29,29,29,29,29,29,30,30,30,30,30,30,30,31,31,31,31,31,31,32,32,32,32,32,32,33,33,33,33,33,33,33,34,34,34,34,34,34,35,35,35,35,35,35,35,36,36,36,36,36,36,37,37,37,37,37,37,38,38,38,38,38,38,38,39,39,39,39,39,39,40,40,40,40,40,40,41,41,41,41,41,41,41,42,42,42,42,42,42,43,43,43,43,43,43,43,44,44,44,44,44,44,45,45,45,45,45,45,46,46,46,46,46,46,46,47,47,47,47,47,47,48,48,48,48,48,48,48,49,49,49,49,49,49,50,50,50,50,50,50,51,51,51,51,51,51,51,52,52,52,52,52,52,53,53,53,53,53,53,53,54,54,54,54,54,54,55,55,55,55,55,55,55,56,56,56,56,56,56,57,57,57,57,57,57,57,58,58,58,58,58,58,59,59,59,59,59,59,59,60,60,60,60,60,60,61,61,61,61,61,61,61,62,62,62,62,62,62,63,63,63,63,63,63,63,64,64,64,64,64,64,65,65,65,65,65,65,65,66,66,66,66,66,66,67,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,71,71,71,71,71,71,72,72,72,72,72,72,72,73,73,73,73,73,73,74,74,74,74,74,74,74,75,75,75,75,75,75,75,76,76,76,76,76,76,77,77,77,77,77,77,77,78,78,78,78,78,78,78,79,79,79,79,79,79,80,80,80,80,80,80,80,81,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,83,83,84,84,84,84,84,84,84,85,85,85,85,85,85,86,86,86,86,86,86,86,87,87,87,87,87,87,87,88,88,88,88,88,88,88,89,89,89,89,89,89,90,90,90,90,90,90,90,91,91,91,91,91,91,91,92,92,92,92,92,92,92,93,93,93,93,93,93,93,94,94,94,94,94,94,94,95,95,95,95,95,95,96,96,96,96,96,96,96,97,97,97,97,97,97,97,98,98,98,98,98,98,98,99,99,99,99,99,99,99,100,100,100,100,100,100,100,101,101,101,101,101,101,101,102,102,102,102,102,102,102,103,103,103,103,103,103,103,104,104,104,104,104,104,104,105,105,105,105,105,105,105,106,106,106,106,106,106,106,107,107,107,107,107,107,107,108,108,108,108,108,108,108,109,109,109,109,109,109,109,110,110,110,110,110,110,110,111,111,111,111,111,111,111,112,112,112,112,112,112,112,113,113,113,113,113,113,113,114,114,114,114,114,114,114,115,115,115,115,115,115,115,116,116,116,116,116,116,116,117,117,117,117,117,117,117,117,118,118,118,118,118,118,118,119,119,119,119,119,119,119,120,120,120,120,120,120,120,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,123,123,123,123,123,123,123,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,214,214,215,215,215,215,215,215,215,215,215,215,216,216,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,219,219,220,220,220,220,220,220,220,220,220,220,221,221,221,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,228,228,228,228,228,228,229,229,229,229,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,230,230,230,231,231,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,234,234,234,234,234,235,235,235,235,235,235,235,235,235,235,235,236,236,236,236,236,236,236,236,236,236,236,237,237,237,237,237,237,237,237,237,237,237,238,238,238,238,238,238,238,238,238,238,238,238,239,239,239,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242,242,242,242,242,242,242,243,243,243,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,247,247,247,247,248,248,248,248,248,248,248,248,248,248,248,248,249,249,249,249,249,249,249,249,249,249,249,249,249,250,250,250,250,250,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,256,256,256,256,256,256}; - - -int GetMyAngle(int x, int y) -{ - int ebx = -x; - int esi = y << 11; - int ecx = y; - int edx = y; - - if (ebx >= 0) - { - // left path - edx = ebx << 11; - - if (y >= 0) - { - if (ebx == y) { - return 768; - } - else // loc_2F318: - { - if (y > ebx) - { - return (AngTable[(edx / y) & kAngleMask] + 512) & kAngleMask; - } - else - { - // loc_2F33C: - return ((512 - AngTable[(esi / ebx) & kAngleMask]) + 512) & kAngleMask; - } - } - } - else - { - // loc_2F35D: - ecx = -y; - - if (ebx == ecx) { - return 1280; - } - else if (ebx <= ecx) - { - return ((1024 - AngTable[(edx / ecx) & kAngleMask]) + 512) & kAngleMask; - } - else - { - edx = ecx << 11; - return (AngTable[(edx / ebx) & kAngleMask] + 1024) & kAngleMask; - } - } - } - else - { - if (edx >= 0) - { - ebx = -ebx; - - if (ebx == edx) { - return 256; - } - else if (ebx > edx) - { - return (AngTable[(esi / ebx) & kAngleMask] + 2048) & kAngleMask; - } - else - { - edx = ebx << 11; - return ((2048 - AngTable[(edx / ecx) & kAngleMask]) + 512) & kAngleMask; - } - } - else - { - ebx = -ebx; - ecx = -ecx; - - if (ebx == ecx) { - return 1792; - } - else if (ebx >= ecx) - { - edx = ecx << 11; - return ((1536 - AngTable[(edx / ebx) & kAngleMask]) + 512) & kAngleMask; - } - else - { - edx = ebx << 11; - return (AngTable[(edx / ecx) & kAngleMask] + 1536) & kAngleMask; - } - } - } -} - // 100% done int AngleDiff(DAngle a, DAngle b) {