Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
GetLeftRightPoints.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "npc.h"
3
4API_CALLABLE(N(GetLeftRightPoints)) {
5 Bytecode* args = script->ptrReadPos;
6 s32 posX = evt_get_variable(script, *args++);
7 s32 posZ = evt_get_variable(script, *args++);
8 f32 dist = evt_get_variable(script, *args++);
9
10 script->varTable[0] = posX + (sin_deg(gCameras[CAM_DEFAULT].curYaw + 270.0f + dist) * 100.0f);
11 script->varTable[1] = posZ - (cos_deg(gCameras[CAM_DEFAULT].curYaw + 270.0f + dist) * 100.0f);
12 script->varTable[2] = posX + (sin_deg(gCameras[CAM_DEFAULT].curYaw + 90.0f + dist) * 100.0f);
13 script->varTable[3] = posZ - (cos_deg(gCameras[CAM_DEFAULT].curYaw + 90.0f + dist) * 100.0f);
14 return ApiStatus_DONE2;
15}
#define sin_deg
#define cos_deg
@ CAM_DEFAULT
Definition enums.h:1800
#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
Camera gCameras[4]
Definition cam_main.c:17