Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
Dist3D.inc.c
Go to the documentation of this file.
1#include "common.h"
2
3API_CALLABLE(N(Dist3D)) {
4 Bytecode* args = script->ptrReadPos;
5 s32 var1 = evt_get_variable(script, *args++);
6 s32 var2 = evt_get_variable(script, *args++);
7 s32 var3 = evt_get_variable(script, *args++);
8 s32 var4 = evt_get_variable(script, *args++);
9 s32 var5 = evt_get_variable(script, *args++);
10 s32 var6 = evt_get_variable(script, *args++);
11 f32 diff1 = var1 - var4;
12 f32 diff2 = var2 - var5;
13 f32 diff3 = var3 - var6;
14
15 evt_set_variable(script, *args++, sqrtf(SQ(diff1) + SQ(diff2) + SQ(diff3)));
16 return ApiStatus_DONE2;
17}
#define sqrtf
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
#define SQ(x)
Definition macros.h:166