12 const u8 *secondPosition) {
14 (*(
const s32 *)firstPosition - *(
const s32 *)secondPosition) >> 16;
21 firstPosition +=
sizeof(
s32);
22 secondPosition +=
sizeof(
s32);
23 deltaY = (*(
const s32 *)firstPosition - *(
const s32 *)secondPosition) >> 16;
24 firstPosition +=
sizeof(
s32);
25 secondPosition +=
sizeof(
s32);
26 deltaZ = (*(
const s32 *)firstPosition - *(
const s32 *)secondPosition) >> 16;
27 deltaXSquared = deltaX * deltaX;
28 deltaYSquared = deltaY * deltaY;
29 deltaZSquared = deltaZ * deltaZ;
30 return Iwram_Sqrt(deltaXSquared + deltaYSquared + deltaZSquared);
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address,...
static s32 Iwram_Sqrt(s32 value)
static UNUSED s32 FixedPoint_Distance(const u8 *firstPosition, const u8 *secondPosition)
The distance in whole pixels between two 16.16 positions of x, y and z.
The integer types, TRUE, UNUSED and the fixed-address macros.