MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Map_Get_Distance_BetweenPoints_Within_640

Method Map_Get_Distance_BetweenPoints_Within_640

Source/Fodder.cpp:8515–8552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8513}
8514
8515void cFodder::Map_Get_Distance_BetweenPoints_Within_640(int16& pX, int16& pY, int16& pX2, int16& pY2) {
8516 int16 Data10 = 0;
8517
8518 pX2 -= pX;
8519 if (pX2 < 0)
8520 pX2 = -pX2;
8521
8522 if (pX2 >= getWindowWidth() * 2)
8523 goto loc_2B403;
8524
8525 pY2 -= pY;
8526 if (pY2 < 0)
8527 pY2 = -pY2;
8528
8529 if (pY2 >= getWindowWidth() * 2)
8530 goto loc_2B403;
8531
8532 for (;;) {
8533 if (pX2 <= 31)
8534 if (pY2 <= 31)
8535 break;
8536
8537 pX2 >>= 1;
8538 pY2 >>= 1;
8539 Data10 += 1;
8540 }
8541
8542 pY2 <<= 5;
8543 pY2 |= pX2;
8544 pX = 0;
8545 pX = mMap_Distance_Calculations[pY2];
8546
8547 pX <<= Data10;
8548 return;
8549
8550loc_2B403:;
8551 pX = getWindowWidth() * 2;
8552}
8553
8554bool cFodder::MapTile_Update_Position() {
8555

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected