Skip to content

Commit

Permalink
Added function VectorLength.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-fadely committed Oct 18, 2015
1 parent 6c5aea3 commit bcd0be5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions SA2ModLoader/include/SA2ModLoader/SA2Functions.h
Expand Up @@ -540,4 +540,18 @@ static inline double CheckDistance(NJS_VECTOR* a1, NJS_VECTOR* a2)
fstp result
}
return result;
}

//double __usercall VectorLength@<st0>(NJS_VECTOR *a1@<eax>)
static const void* const VectorLengthPtr = (void*)0x0077FC30;
static inline double VectorLength(NJS_VECTOR* a1)
{
double result;
__asm
{
mov eax, [a1]
call VectorLengthPtr
fstp result
}
return result;
}

0 comments on commit bcd0be5

Please sign in to comment.