Matched most of REL/m402 + applying ext_math macros
This commit is contained in:
parent
bbebe8b7d8
commit
f9636fe567
13 changed files with 2277 additions and 305 deletions
|
|
@ -17,7 +17,7 @@
|
|||
#include "game/board/space.h"
|
||||
#include "game/board/window.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
|
|
@ -635,12 +635,12 @@ static void BallMain(omObjData *arg0) {
|
|||
temp_f30 = 240.0f;
|
||||
BoardCameraRotGet(&sp20);
|
||||
BoardCameraTargetGet(&sp2C);
|
||||
sp8.x = sp2C.x + sin(sp20.y * M_PI / 180.0) * cos(sp20.x * M_PI / 180.0) * temp_f30;
|
||||
sp8.y = sp2C.y + -sin(sp20.x * M_PI / 180.0) * temp_f30;
|
||||
sp8.z = sp2C.z + cos(sp20.y * M_PI / 180.0) * cos(sp20.x * M_PI / 180.0) * temp_f30;
|
||||
sp14.x = sin(sp20.y * M_PI / 180.0) * sin(sp20.x * M_PI / 180.0);
|
||||
sp14.y = cos(sp20.x * M_PI / 180.0);
|
||||
sp14.z = cos(sp20.y * M_PI / 180.0) * sin(sp20.x * M_PI / 180.0);
|
||||
sp8.x = sp2C.x + sind(sp20.y) * cosd(sp20.x) * temp_f30;
|
||||
sp8.y = sp2C.y + -sind(sp20.x) * temp_f30;
|
||||
sp8.z = sp2C.z + cosd(sp20.y) * cosd(sp20.x) * temp_f30;
|
||||
sp14.x = sind(sp20.y) * sind(sp20.x);
|
||||
sp14.y = cosd(sp20.x);
|
||||
sp14.z = cosd(sp20.y) * sind(sp20.x);
|
||||
if (temp_r30->unk01 != 0) {
|
||||
temp_r30->unk02 += temp_r30->unk01;
|
||||
if (temp_r30->unk02 > 255) {
|
||||
|
|
@ -711,8 +711,8 @@ static void BallRenderHook(void) {
|
|||
sp20.z = 0.0f;
|
||||
C_MTXLookAt(sp38, &sp2C, &sp20, &sp14);
|
||||
GXLoadPosMtxImm(sp38, GX_PNMTX0);
|
||||
sp2C.x = sin(5 * M_PI / 72) * 20000.0 * 1.2f;
|
||||
sp2C.y = sin(5 * M_PI / 72) * 20000.0 * 0.8333333f;
|
||||
sp2C.x = sind(12.5) * 20000.0 * 1.2f;
|
||||
sp2C.y = sind(12.5) * 20000.0 * 0.8333333f;
|
||||
sp2C.z = -9000.0f;
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3f32(-sp2C.x, -sp2C.y, sp2C.z);
|
||||
|
|
@ -754,12 +754,12 @@ static void UpdateBallCamera(omObjData *arg0) {
|
|||
sp20.x = arg0->trans.x;
|
||||
sp20.y = arg0->trans.y + arg0->rot.y;
|
||||
sp20.z = arg0->trans.z;
|
||||
sp14.x = sp20.x + sin(0.0) * cos(arg0->rot.x * M_PI / 180.0) * arg0->rot.z;
|
||||
sp14.y = sp20.y + -sin(arg0->rot.x * M_PI / 180.0) * arg0->rot.z;
|
||||
sp14.z = sp20.z + cos(0.0) * cos(arg0->rot.x * M_PI / 180.0) * arg0->rot.z;
|
||||
sp8.x = sin(0.0) * sin(arg0->rot.x * M_PI / 180.0);
|
||||
sp8.y = cos(arg0->rot.x * M_PI / 180.0);
|
||||
sp8.z = cos(0.0) * sin(arg0->rot.x * M_PI / 180.0);
|
||||
sp14.x = sp20.x + sin(0.0) * cosd(arg0->rot.x) * arg0->rot.z;
|
||||
sp14.y = sp20.y + -sind(arg0->rot.x) * arg0->rot.z;
|
||||
sp14.z = sp20.z + cos(0.0) * cosd(arg0->rot.x) * arg0->rot.z;
|
||||
sp8.x = sin(0.0) * sind(arg0->rot.x);
|
||||
sp8.y = cosd(arg0->rot.x);
|
||||
sp8.z = cos(0.0) * sind(arg0->rot.x);
|
||||
Hu3DCameraPosSetV(var_r30->unk02, &sp14, &sp8, &sp20);
|
||||
}
|
||||
|
||||
|
|
@ -909,9 +909,9 @@ static void BallPlayerZoomOut(omObjData *arg0, BallPlayerWork *arg1) {
|
|||
sp14.x = arg0->trans.x;
|
||||
sp14.y = arg0->trans.y;
|
||||
sp14.z = arg0->trans.z;
|
||||
sp8.x = sp14.x + 120.0 * sin(-M_PI / 2);
|
||||
sp8.x = sp14.x + 120.0 * sind(-90);
|
||||
sp8.y = sp14.y;
|
||||
sp8.z = sp14.z + 120.0 * cos(-M_PI / 2);
|
||||
sp8.z = sp14.z + 120.0 * cosd(-90);
|
||||
BoardPlayerPosLerpStart(stealTarget, &sp14, &sp8, 20);
|
||||
var_r29 = GWPlayer[stealTarget].character;
|
||||
HuAudFXPlay(booSfxTbl[0][var_r29]);
|
||||
|
|
@ -1082,9 +1082,9 @@ static void BallBooCreate(void) {
|
|||
BoardModelCameraSet(temp_r31->unk04, 1);
|
||||
temp_f31 = BoardPlayerRotYGet(stealTarget);
|
||||
BoardPlayerPosGet(stealTarget, &sp14);
|
||||
ballBooObj->trans.x = sp14.x + 240.0 * sin(-temp_f31 * M_PI / 180.0);
|
||||
ballBooObj->trans.x = sp14.x + 240.0 * sind(-temp_f31);
|
||||
ballBooObj->trans.y = sp14.y + 160.0f;
|
||||
ballBooObj->trans.z = sp14.z + 240.0 * cos(-temp_f31 * M_PI / 180.0);
|
||||
ballBooObj->trans.z = sp14.z + 240.0 * cosd(-temp_f31);
|
||||
BoardModelPosSet(temp_r31->unk04, ballBooObj->trans.x, ballBooObj->trans.y, ballBooObj->trans.z);
|
||||
if (stealType == 2) {
|
||||
var_f30 = 126.0f;
|
||||
|
|
@ -1093,9 +1093,9 @@ static void BallBooCreate(void) {
|
|||
var_f30 = 90.0f;
|
||||
var_f29 = 100.0f;
|
||||
}
|
||||
sp8.x = sp14.x + var_f30 * sin(-temp_f31 * M_PI / 180.0);
|
||||
sp8.x = sp14.x + var_f30 * sind(-temp_f31);
|
||||
sp8.y = sp14.y + var_f29;
|
||||
sp8.z = sp14.z + var_f30 * cos(-temp_f31 * M_PI / 180.0);
|
||||
sp8.z = sp14.z + var_f30 * cosd(-temp_f31);
|
||||
ballBooObj->rot.x = (sp8.x - ballBooObj->trans.x) / 60.0f;
|
||||
ballBooObj->rot.y = (sp8.y - ballBooObj->trans.y) / 60.0f;
|
||||
ballBooObj->rot.z = (sp8.z - ballBooObj->trans.z) / 60.0f;
|
||||
|
|
@ -1104,7 +1104,7 @@ static void BallBooCreate(void) {
|
|||
ballBooObj->scale.z = 1.0f;
|
||||
sp8.x = sp14.x - ballBooObj->trans.x;
|
||||
sp8.z = sp14.z - ballBooObj->trans.z;
|
||||
ballBooObj->scale.y = 180.0 * (atan2(sp8.x, sp8.z) / M_PI);
|
||||
ballBooObj->scale.y = atan2d(sp8.x, sp8.z);
|
||||
BoardModelRotYSet(temp_r31->unk04, ballBooObj->scale.y);
|
||||
BoardModelMotionStart(temp_r31->unk04, 1, 0x40000001);
|
||||
}
|
||||
|
|
@ -1246,7 +1246,7 @@ static void BallBooAttack(omObjData *arg0, BallBooWork *arg1) {
|
|||
}
|
||||
}
|
||||
OSu8tof32(&arg1->unk02, &var_f29);
|
||||
arg0->scale.z = 1.0 + sin(var_f29 * M_PI / 180.0);
|
||||
arg0->scale.z = 1.0 + sind(var_f29);
|
||||
}
|
||||
|
||||
static void BallBooFlash(omObjData *arg0, BallBooWork *arg1) {
|
||||
|
|
@ -1258,9 +1258,9 @@ static void BallBooFlash(omObjData *arg0, BallBooWork *arg1) {
|
|||
BoardModelMotionShiftSet(arg1->unk04, 3, 0.0f, 10.0f, 0x40000001);
|
||||
temp_f31 = BoardPlayerRotYGet(stealTarget);
|
||||
BoardPlayerPosGet(stealTarget, &sp8);
|
||||
sp8.x += 500.0 * sin(-temp_f31 * M_PI / 180.0);
|
||||
sp8.x += 500.0 * sind(-temp_f31);
|
||||
sp8.y = sp8.y + 160.0f;
|
||||
sp8.z += 500.0 * cos(-temp_f31 * M_PI / 180.0);
|
||||
sp8.z += 500.0 * cosd(-temp_f31);
|
||||
arg0->rot.x = (sp8.x - arg0->trans.x) / 72.0f;
|
||||
arg0->rot.y = (sp8.y - arg0->trans.y) / 72.0f;
|
||||
arg0->rot.z = (sp8.z - arg0->trans.z) / 72.0f;
|
||||
|
|
@ -1365,8 +1365,8 @@ void TakeBallStar(void) {
|
|||
ballTakeCoinObj->trans.y = sp8.y + 150.0f;
|
||||
ballTakeCoinObj->trans.z = sp8.z;
|
||||
temp_r31->unk04 = sp8.y;
|
||||
ballTakeCoinObj->rot.x = 3.0 * sin(4 * M_PI / 9);
|
||||
ballTakeCoinObj->rot.z = 3.0 * cos(4 * M_PI / 9);
|
||||
ballTakeCoinObj->rot.x = 3.0 * sind(80);
|
||||
ballTakeCoinObj->rot.z = 3.0 * cosd(80);
|
||||
ballTakeCoinObj->rot.y = 0.0f;
|
||||
BoardModelPosSet(temp_r31->unk02, ballTakeCoinObj->trans.x, ballTakeCoinObj->trans.y, ballTakeCoinObj->trans.z);
|
||||
BoardModelVisibilitySet(temp_r31->unk02, 1);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
#include "game/board/player.h"
|
||||
#include "game/board/window.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
// bss
|
||||
static s16 houseMdl[6];
|
||||
|
||||
|
|
@ -134,7 +136,7 @@ static void ExecBooHouse(void) {
|
|||
Vec sp20;
|
||||
Vec sp14;
|
||||
Vec sp8;
|
||||
f32 temp_f31;
|
||||
float temp_f31;
|
||||
s16 temp_r29;
|
||||
s32 var_r31;
|
||||
s16 var_r30;
|
||||
|
|
@ -187,7 +189,7 @@ static void ExecBooHouse(void) {
|
|||
BoardSpacePosGet(0, temp_r29, &sp2C);
|
||||
PSVECSubtract(&sp2C, &sp38, &sp20);
|
||||
PSVECNormalize(&sp20, &sp20);
|
||||
temp_f31 = (180.0 * (atan2(-sp20.x, -sp20.z) / M_PI));
|
||||
temp_f31 = atan2d(-sp20.x, -sp20.z);
|
||||
sp14.x = -15.0f;
|
||||
sp14.y = temp_f31;
|
||||
sp14.z = 0.0f;
|
||||
|
|
@ -577,7 +579,7 @@ void ApplySteal(void) {
|
|||
s32 temp_r30;
|
||||
s32 temp_r6;
|
||||
s32 var_r31;
|
||||
f32 var_f31;
|
||||
float var_f31;
|
||||
|
||||
BoardModelHookSet(houseMdl[0], "yoko8", booMdl);
|
||||
BoardModelVisibilitySet(booMdl, 1);
|
||||
|
|
@ -749,7 +751,7 @@ void BoardBooHouseTutorialExec(void) {
|
|||
Vec sp20;
|
||||
Vec sp14;
|
||||
Vec sp8;
|
||||
f32 temp_f31;
|
||||
float temp_f31;
|
||||
s16 temp_r28;
|
||||
s16 temp_r29;
|
||||
s32 temp_r27;
|
||||
|
|
@ -765,7 +767,7 @@ void BoardBooHouseTutorialExec(void) {
|
|||
BoardSpacePosGet(0, temp_r28, &sp2C);
|
||||
PSVECSubtract(&sp2C, &sp38, &sp20);
|
||||
PSVECNormalize(&sp20, &sp20);
|
||||
temp_f31 = (180.0 * (atan2(-sp20.x, -sp20.z) / M_PI));
|
||||
temp_f31 = atan2d(-sp20.x, -sp20.z);
|
||||
sp14.x = -15.0f;
|
||||
sp14.y = temp_f31;
|
||||
sp14.z = 0.0f;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "game/board/tutorial.h"
|
||||
#include "game/board/ui.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
|
|
@ -374,7 +374,7 @@ static void GrowCharWheel(CharWheelWork *arg0) {
|
|||
if (arg0->unk02 < 90) {
|
||||
arg0->unk02 += 3;
|
||||
} else {
|
||||
if (_CheckFlag(0x1000B)) {
|
||||
if (_CheckFlag(FLAG_ID_MAKE(1, 11))) {
|
||||
BoardTutorialHookExec(0x14, 0);
|
||||
}
|
||||
arg0->unk02 = 90;
|
||||
|
|
@ -382,7 +382,7 @@ static void GrowCharWheel(CharWheelWork *arg0) {
|
|||
wheelFXStat = HuAudFXPlay(0x30A);
|
||||
}
|
||||
OSs8tof32(&arg0->unk02, &temp_f30);
|
||||
HuSprGrpScaleSet(wheelSprGrp, sin(temp_f30 * M_PI / 180.0), sin(temp_f30 * M_PI / 180.0));
|
||||
HuSprGrpScaleSet(wheelSprGrp, sind(temp_f30), sind(temp_f30));
|
||||
}
|
||||
|
||||
static void ShrinkCharWheel(CharWheelWork *arg0) {
|
||||
|
|
@ -397,7 +397,7 @@ static void ShrinkCharWheel(CharWheelWork *arg0) {
|
|||
targetF = 0;
|
||||
}
|
||||
OSs8tof32(&arg0->unk02, &temp_f30);
|
||||
HuSprGrpScaleSet(wheelSprGrp, sin(temp_f30 * M_PI / 180.0), sin(temp_f30 * M_PI / 180.0));
|
||||
HuSprGrpScaleSet(wheelSprGrp, sind(temp_f30), sind(temp_f30));
|
||||
}
|
||||
|
||||
static void KillCharWheelSpr(void) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "game/board/window.h"
|
||||
#include "game/board/boo.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef BOOL (*UseCheckFunc)(s32 player, s32 item);
|
||||
|
||||
|
|
@ -625,7 +625,7 @@ s32 BoardComJunctionInputGet(s32 item, Vec *input, s32 num_dirs, float *dirs) {
|
|||
BoardSpacePosGet(0, space, &pos_junction);
|
||||
BoardSpacePosGet(0, space_next, &pos_next);
|
||||
PSVECSubtract(&pos_next, &pos_junction, &dir);
|
||||
angle = BoardDAngleCalc(90.0 - 180.0 * (atan2(dir.z, dir.x) / M_PI));
|
||||
angle = BoardDAngleCalc(90.0 - atan2d(dir.z, dir.x));
|
||||
if (angle < 0.0f) {
|
||||
angle += 360.0f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
#include "game/board/view.h"
|
||||
#include "game/frand.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 unk00;
|
||||
/* 0x02 */ s16 unk02;
|
||||
|
|
@ -285,7 +287,7 @@ static void ItemSizeShowAnim(void) {
|
|||
BoardModelRotSetV(suitMdl, &spC);
|
||||
BoardModelPosSetV(suitMdl, &sp24);
|
||||
for (i = 0; i < 120; i++) {
|
||||
sp24.y += 3.0 * sin(var_f31 * M_PI / 180.0);
|
||||
sp24.y += 3.0 * sind(var_f31);
|
||||
BoardModelPosSetV(suitMdl, &sp24);
|
||||
var_f31 += 9.0f;
|
||||
if (var_f31 >= 360.0f) {
|
||||
|
|
@ -318,7 +320,7 @@ static void ItemRotProc(void) {
|
|||
while (1) {
|
||||
if (temp_r31->unk00 == 0) {
|
||||
sp14 = sp20;
|
||||
sp14.y += temp_r31->unk04 * sin(temp_r31->unk0C * M_PI / 180.0);
|
||||
sp14.y += temp_r31->unk04 * sind(temp_r31->unk0C);
|
||||
BoardModelPosSetV(temp_r31->unk02, &sp14);
|
||||
temp_r31->unk0C += temp_r31->unk08;
|
||||
if (temp_r31->unk0C >= 360.0f) {
|
||||
|
|
@ -489,8 +491,8 @@ static Process *ItemShowProc(UnkItemShowProcStruct *arg0, Vec *arg1) {
|
|||
if (arg0 == NULL || arg0->unk1C != 0) {
|
||||
CharModelLayerSetAll(3);
|
||||
sp20.y += 35.0f;
|
||||
sp20.z += 50.0 * cos(sp14.y * M_PI / 180.0);
|
||||
sp20.x += 50.0 * sin(sp14.y * M_PI / 180.0);
|
||||
sp20.z += 50.0 * cosd(sp14.y);
|
||||
sp20.x += 50.0 * sind(sp14.y);
|
||||
CharModelEffectCreate(1, &sp20);
|
||||
HuPrcSleep(10);
|
||||
}
|
||||
|
|
@ -1124,12 +1126,12 @@ static void ExecItemSwap(void) {
|
|||
for (var_r31 = 0; var_r31 < 60; var_r31++) {
|
||||
for (var_r30 = 0; var_r30 < var_r28 / 2; var_r30++) {
|
||||
sp6C = sp1A4[var_r30];
|
||||
sp6C.x += 3.0 * sin((frandmods(360)) * M_PI / 180.0);
|
||||
sp6C.y += 3.0 * sin((frandmods(360)) * M_PI / 180.0);
|
||||
sp6C.x += 3.0 * sind(frandmods(360));
|
||||
sp6C.y += 3.0 * sind(frandmods(360));
|
||||
BoardModelPosSetV(sp54[var_r30], &sp6C);
|
||||
sp6C = sp180[var_r30];
|
||||
sp6C.x += 3.0 * sin((frandmods(360)) * M_PI / 180.0);
|
||||
sp6C.y += 3.0 * sin((frandmods(360)) * M_PI / 180.0);
|
||||
sp6C.x += 3.0 * sind(frandmods(360));
|
||||
sp6C.y += 3.0 * sind(frandmods(360));
|
||||
BoardModelPosSetV(sp54[var_r30 + 3], &sp6C);
|
||||
}
|
||||
HuPrcSleep(2);
|
||||
|
|
@ -1263,8 +1265,8 @@ static void ExecItemSpark(void) {
|
|||
BoardSpaceRotGet(0, GWPlayer[currItemRestore].space_curr, &sp20);
|
||||
BoardModelRotSetV(suitMdl, &sp20);
|
||||
BoardModelPosGet(suitMdl, &sp2C);
|
||||
sp2C.z += 106.0 * sin(sp20.x * M_PI / 180.0);
|
||||
sp2C.x -= 106.0 * sin(sp20.z * M_PI / 180.0);
|
||||
sp2C.z += 106.0 * sind(sp20.x);
|
||||
sp2C.x -= 106.0 * sind(sp20.z);
|
||||
BoardModelPosSetV(suitMdl, &sp2C);
|
||||
HuAudFXPlay(0x31B);
|
||||
BoardModelMotionStart(suitMdl, 1, 0);
|
||||
|
|
@ -1369,9 +1371,9 @@ static void ExecItemWhistle(void) {
|
|||
temp_r17 = BoardModelMotionCreate(sp20[var_r31], DATA_MAKE_NUM(DATADIR_BGUEST, 40));
|
||||
BoardModelMotionStart(sp20[var_r31], temp_r17, 0x40000001);
|
||||
sp28[var_r31] = 120.0f;
|
||||
spF0[var_r31].x = spB4.x + 120.0 * sin(var_f31 * M_PI / 180.0);
|
||||
spF0[var_r31].x = spB4.x + 120.0 * sind(var_f31);
|
||||
spF0[var_r31].y = 1000.0f + spB4.y + 100.0f * var_r31;
|
||||
spF0[var_r31].z = spB4.z + 120.0 * cos(var_f31 * M_PI / 180.0);
|
||||
spF0[var_r31].z = spB4.z + 120.0 * cosd(var_f31);
|
||||
spC0[var_r31].x = spC0[var_r31].z = 0.0f;
|
||||
spC0[var_r31].y = var_f31 + 90.0f;
|
||||
if (spC0[var_r31].y >= 360.0f) {
|
||||
|
|
@ -1490,8 +1492,8 @@ static void ExecItemWhistle(void) {
|
|||
if (spC0[var_r31].y >= 360.0f) {
|
||||
spC0[var_r31].y -= 360.0f;
|
||||
}
|
||||
spF0[var_r31].x = spB4.x + 120.0 * sin(sp38[var_r31] * M_PI / 180.0);
|
||||
spF0[var_r31].z = spB4.z + 120.0 * cos(sp38[var_r31] * M_PI / 180.0);
|
||||
spF0[var_r31].x = spB4.x + 120.0 * sind(sp38[var_r31]);
|
||||
spF0[var_r31].z = spB4.z + 120.0 * cosd(sp38[var_r31]);
|
||||
BoardModelPosSetV(sp20[var_r31], &spF0[var_r31]);
|
||||
BoardModelRotSetV(sp20[var_r31], &spC0[var_r31]);
|
||||
}
|
||||
|
|
@ -1523,8 +1525,8 @@ static void ExecItemWhistle(void) {
|
|||
spF0[var_r31].y = spB4.y;
|
||||
sp48[var_r31] = -1.0f;
|
||||
}
|
||||
spF0[var_r31].x = spB4.x + sp28[var_r31] * sin(sp38[var_r31] * M_PI / 180.0);
|
||||
spF0[var_r31].z = spB4.z + sp28[var_r31] * cos(sp38[var_r31] * M_PI / 180.0);
|
||||
spF0[var_r31].x = spB4.x + sp28[var_r31] * sind(sp38[var_r31]);
|
||||
spF0[var_r31].z = spB4.z + sp28[var_r31] * cosd(sp38[var_r31]);
|
||||
BoardModelPosSetV(sp20[var_r31], &spF0[var_r31]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1955,12 +1957,12 @@ static void LampParticleUpdate(ModelData *model, ParticleData *particle, Mtx mat
|
|||
}
|
||||
}
|
||||
if (j != particle->unk_30) {
|
||||
var_r31->unk34.x = 60.0 * sin((spC.y - 90.0f) * M_PI / 180.0);
|
||||
var_r31->unk34.x = 60.0 * sind(spC.y - 90.0f);
|
||||
var_r31->unk34.y = 30.0f;
|
||||
var_r31->unk34.z = 60.0 * cos((spC.y - 90.0f) * M_PI / 180.0);
|
||||
var_r31->unk34.z = 60.0 * cosd(spC.y - 90.0f);
|
||||
sp8 = 12.0f;
|
||||
var_r31->unk08.x = 12.0 * cos((i * 110.0f + 35.0f) * M_PI / 180.0);
|
||||
var_r31->unk08.y = 12.0 * sin((i * 110.0f + 35.0f) * M_PI / 180.0);
|
||||
var_r31->unk08.x = 12.0 * cosd(i * 110.0f + 35.0f);
|
||||
var_r31->unk08.y = 12.0 * sind(i * 110.0f + 35.0f);
|
||||
var_r31->unk08.z = 3.0f + frand8() * 5.0f * 0.003921569f;
|
||||
var_r31->unk14.y = 255.0f;
|
||||
var_r31->unk2C = 25.0f;
|
||||
|
|
@ -1983,9 +1985,9 @@ static void LampParticleUpdate(ModelData *model, ParticleData *particle, Mtx mat
|
|||
if (var_r31->unk14.y <= 120.0f) {
|
||||
var_r31->unk14.y = 200.0f;
|
||||
temp_f31 = frand8() * 180.0f * 0.003921569f;
|
||||
var_r31->unk08.x = 6.0 * cos(temp_f31 * M_PI / 180.0);
|
||||
var_r31->unk08.x = 6.0 * cosd(temp_f31);
|
||||
var_r31->unk08.y = -4.0f;
|
||||
var_r31->unk08.z = 6.0 * sin(temp_f31 * M_PI / 180.0);
|
||||
var_r31->unk08.z = 6.0 * sind(temp_f31);
|
||||
var_r31->unk00_s16 = 1;
|
||||
}
|
||||
var_r31->unk40.a = var_r31->unk14.y;
|
||||
|
|
@ -2017,11 +2019,11 @@ static void GenieParticleUpdate(ModelData *model, ParticleData *particle, Mtx ma
|
|||
var_r31->unk34.y = -50.0f + frand8() * 100.0f * 0.003921569f;
|
||||
var_r31->unk34.z = -10.0f + frand8() * 20.0f * 0.003921569f;
|
||||
temp_f31 = 0.5f + frand8() * 3.0f * 0.003921569f;
|
||||
var_r31->unk08.x = temp_f31 * cos((i * 110.0f + 35.0f) * M_PI / 180.0);
|
||||
var_r31->unk08.y = temp_f31 * sin((i * 110.0f + 35.0f) * M_PI / 180.0);
|
||||
var_r31->unk08.x = temp_f31 * cosd(i * 110.0f + 35.0f);
|
||||
var_r31->unk08.y = temp_f31 * sind(i * 110.0f + 35.0f);
|
||||
var_r31->unk08.z = 0.0f;
|
||||
var_r31->unk14.y = 255.0f;
|
||||
temp_f30 = 125.0f + frand8() * 0x64 * 0.003921569f;
|
||||
temp_f30 = 125.0f + frand8() * 100 * 0.003921569f;
|
||||
var_r31->unk40.r = var_r31->unk40.g = var_r31->unk40.b = temp_f30;
|
||||
var_r31->unk00 = 0;
|
||||
var_r31->unk2C = 80.0f + frand8() * 60.0f * 0.003921569f;
|
||||
|
|
@ -2288,9 +2290,9 @@ static void GenieSceneExec(void) {
|
|||
booCamUp.x = sp38.x + (sp50.x - sp38.x) * 0.7f;
|
||||
booCamUp.y = sp38.y + 400.0f;
|
||||
booCamUp.z = sp38.z + (sp50.z - sp38.z) * 0.7f;
|
||||
booCamPos.x = booCamUp.x + sin(-5 * M_PI / 9) * 1100.0;
|
||||
booCamPos.x = booCamUp.x + sind(-100) * 1100.0;
|
||||
booCamPos.y = booCamUp.y + 950.0f;
|
||||
booCamPos.z = booCamUp.z + cos(-5 * M_PI / 9) * 1100.0;
|
||||
booCamPos.z = booCamUp.z + cosd(-100) * 1100.0;
|
||||
HuAudFXPlay(0x356);
|
||||
BoardWinCreate(2, MAKE_MESSID(18, 27), -1);
|
||||
BoardWinWait();
|
||||
|
|
@ -2565,7 +2567,7 @@ static void ExecItemBagShow(void) {
|
|||
break;
|
||||
}
|
||||
sp8 = sp14;
|
||||
sp8.y += 15.0 * sin(var_f31 * M_PI / 180.0);
|
||||
sp8.y += 15.0 * sind(var_f31);
|
||||
BoardModelPosSetV(suitMdl, &sp8);
|
||||
var_f31 += 36.0f;
|
||||
HuPrcVSleep();
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#include "game/board/player.h"
|
||||
#include "game/board/tutorial.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
u8 unk00_field0 : 1;
|
||||
|
|
@ -481,7 +483,7 @@ static void DiceMain(omObjData *arg0) {
|
|||
var_f27 = 1.0f;
|
||||
var_f28 = 0.5f;
|
||||
}
|
||||
arg0->scale.x = var_f27 + var_f28 * sin((float) (temp_r29->unk04 % 180) * M_PI / 180.0);
|
||||
arg0->scale.x = var_f27 + var_f28 * sind((float) (temp_r29->unk04 % 180));
|
||||
arg0->scale.y = arg0->scale.x;
|
||||
arg0->scale.z = arg0->scale.x;
|
||||
if (temp_r29->unk04 <= 360) {
|
||||
|
|
@ -502,7 +504,7 @@ static void DiceMain(omObjData *arg0) {
|
|||
temp_r29->unk04 -= 360;
|
||||
}
|
||||
OSs16tof32(&temp_r29->unk04, &temp_f29);
|
||||
arg0->trans.y += 0.20000000298023224 * sin(temp_f29 * M_PI / 180.0);
|
||||
arg0->trans.y += 0.2f * sind(temp_f29);
|
||||
break;
|
||||
case 2:
|
||||
temp_r29->unk04++;
|
||||
|
|
@ -523,7 +525,7 @@ static void DiceMain(omObjData *arg0) {
|
|||
OSs16tof32(&temp_r29->unk04, &temp_f29);
|
||||
if (temp_r29->unk04 < 4) {
|
||||
arg0->trans.y += 10.0f + (0.5f * temp_f29);
|
||||
arg0->scale.x = (arg0->scale.x + (0.10000000149011612 * sin((M_PI * (4.0f * temp_f29)) / 180.0)));
|
||||
arg0->scale.x += 0.1f * sind(4.0f * temp_f29);
|
||||
arg0->scale.y = arg0->scale.x;
|
||||
arg0->scale.z = arg0->scale.x;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include "game/board/window.h"
|
||||
|
||||
#include "dolphin.h"
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
|
|
@ -262,7 +262,7 @@ static void ExecShop(void) {
|
|||
BoardSpacePosGet(0, temp_r25, &sp2C);
|
||||
PSVECSubtract(&sp2C, &sp38, &sp20);
|
||||
PSVECNormalize(&sp20, &sp20);
|
||||
temp_f31 = 180.0 * (atan2(-sp20.x, -sp20.z) / M_PI);
|
||||
temp_f31 = atan2d(-sp20.x, -sp20.z);
|
||||
sp14.x = -10.0f;
|
||||
sp14.y = temp_f31;
|
||||
sp14.z = 0.0f;
|
||||
|
|
@ -535,7 +535,7 @@ static void UpdateShopWin(omObjData *arg0) {
|
|||
temp_r28->unk04 = 90;
|
||||
}
|
||||
OSs8tof32(&temp_r28->unk04, &var_f28);
|
||||
arg0->scale.x = arg0->scale.y = arg0->scale.z = 0.25 * sin(var_f28 * M_PI / 180.0);
|
||||
arg0->scale.x = arg0->scale.y = arg0->scale.z = 0.25 * sind(var_f28);
|
||||
}
|
||||
if (temp_r28->unk00_field1 == 5) {
|
||||
var_f29 = -12.5f;
|
||||
|
|
@ -575,7 +575,7 @@ static void SetShopWinItem(ShopWinWork *arg0, omObjData *arg1) {
|
|||
BoardModelMotionSpeedSet(itemMdl, 0.033333335f);
|
||||
}
|
||||
BoardCameraDirGet(&spC);
|
||||
arg1->rot.y = BoardDAngleCalc(180.0 * (atan2(-spC.x, -spC.z) / M_PI));
|
||||
arg1->rot.y = BoardDAngleCalc(atan2d(-spC.x, -spC.z));
|
||||
OSf32tos16(&arg1->rot.y, &angleVal);
|
||||
}
|
||||
}
|
||||
|
|
@ -689,7 +689,7 @@ static void MoveItemGive(omObjData *arg0, ItemGiveWork *arg1) {
|
|||
temp_f27 = -0.08166667f * temp_f27 * temp_f27;
|
||||
arg0->trans.y += temp_f27;
|
||||
BoardCameraDirGet(&sp10);
|
||||
var_f26 = BoardDAngleCalc(180.0 * (atan2(-sp10.x, -sp10.z) / M_PI));
|
||||
var_f26 = BoardDAngleCalc(atan2d(-sp10.x, -sp10.z));
|
||||
OSf32tos16(&var_f26, &angleVal);
|
||||
} else {
|
||||
arg0->scale.x += arg0->scale.y;
|
||||
|
|
@ -723,7 +723,7 @@ static void ShrinkItemGive(omObjData *arg0, ItemGiveWork *arg1) {
|
|||
if (var_f30 > 90.0f) {
|
||||
var_f30 = 90.0f;
|
||||
}
|
||||
arg0->scale.x = cos(var_f30 * M_PI / 180.0);
|
||||
arg0->scale.x = cosd(var_f30);
|
||||
arg0->trans.y += arg0->rot.x;
|
||||
angleVal += 8;
|
||||
if (angleVal > 360) {
|
||||
|
|
@ -1137,7 +1137,7 @@ void BoardShopTutorialExec(s32 arg0) {
|
|||
BoardSpacePosGet(0, temp_r27, &sp3C);
|
||||
PSVECSubtract(&sp3C, &sp48, &sp30);
|
||||
PSVECNormalize(&sp30, &sp30);
|
||||
temp_f31 = 180.0 * (atan2(-sp30.x, -sp30.z) / M_PI);
|
||||
temp_f31 = atan2d(-sp30.x, -sp30.z);
|
||||
sp24.x = -10.0f;
|
||||
sp24.y = temp_f31;
|
||||
sp24.z = 0.0f;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#include "game/board/ui.h"
|
||||
#include "game/board/window.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
|
|
@ -207,7 +207,7 @@ static void ExecStar(void) {
|
|||
var_r22 = BoardSpaceLinkFlagSearch(0, temp_r24, 0x04000000);
|
||||
BoardSpacePosGet(0, var_r22, &sp18);
|
||||
PSVECSubtract(&sp18, &sp24, &spC);
|
||||
temp_f30 = 90.0 - 180.0 * (atan2(spC.z, spC.x) / M_PI);
|
||||
temp_f30 = 90.0 - atan2d(spC.z, spC.x);
|
||||
temp_f30 = 90.0f * ((temp_f30 + 3.0f) / 90.0f);
|
||||
temp_f29 = BoardPlayerRotYGet(temp_r31);
|
||||
BoardPlayerIdleSet(temp_r31);
|
||||
|
|
@ -511,7 +511,7 @@ static void ShrinkGiveStar(GiveStarWork *arg0, omObjData *arg1) {
|
|||
}
|
||||
}
|
||||
OSs16tof32(&arg0->unk08, &var_f30);
|
||||
arg1->scale.x = sin((var_f30 + 90.0f) * M_PI / 180.0);
|
||||
arg1->scale.x = sind(var_f30 + 90.0f);
|
||||
if (arg1->scale.x <= 0.0f) {
|
||||
arg1->scale.x = 0.001f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "game/armem.h"
|
||||
#include "game/audio.h"
|
||||
|
||||
#include "math.h"
|
||||
#include "ext_math.h"
|
||||
#include "stdarg.h"
|
||||
#include "string.h"
|
||||
|
||||
|
|
@ -1784,7 +1784,7 @@ static s32 winPortraitTbl[] = {
|
|||
WIN_BOWSER_TALK_ANM,
|
||||
WIN_KKID_TALK_ANM,
|
||||
WIN_KOOPA_TALK_ANM,
|
||||
WIN_CONDOR_TALK_ANM,
|
||||
WIN_CONDOR_TALK_ANM,
|
||||
WIN_BOO_BLUE_TALK_ANM,
|
||||
WIN_DOLPHIN_TALK_ANM,
|
||||
WIN_BOO_RED_TALK_ANM,
|
||||
|
|
@ -1842,7 +1842,7 @@ void HuWinExAnimIn(s16 window) {
|
|||
HuSprScaleSet(window_ptr->group, 0, 1.0f, 0.0f);
|
||||
HuWinDispOn(window);
|
||||
for (i=0; i<=10; i++) {
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, 1.0 - 1.1 * cos(M_PI * (9.0f * i) / 180.0));
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, 1.0 - 1.1 * cosd(9.0f * i));
|
||||
HuPrcVSleep();
|
||||
}
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, 1.0f);
|
||||
|
|
@ -1852,13 +1852,13 @@ void HuWinExAnimIn(s16 window) {
|
|||
HuWinDispOn(window);
|
||||
for (i=0; i<=20; i++) {
|
||||
if (i <= 10) {
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, 1.1 * (1.0 - cos(M_PI * (9.0f * i) / 180.0)));
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, 1.1 * (1.0 - cosd(9.0f * i)));
|
||||
} else {
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, 1.0f);
|
||||
}
|
||||
if (i > 10) {
|
||||
s16 time = i - 10;
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, 1.0 - 1.1 * cos(M_PI * (9.0f * time) / 180.0));
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, 1.0 - 1.1 * cosd(9.0f * time));
|
||||
}
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -1873,18 +1873,18 @@ void HuWinExAnimOut(s16 window) {
|
|||
_HuWinHomeClear(window_ptr);
|
||||
if (window_ptr->sprite_id[2] == -1) {
|
||||
for (i=0; i<=10; i++) {
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, cos(M_PI * (9.0f * i) / 180.0));
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, cosd(9.0f * i));
|
||||
HuPrcVSleep();
|
||||
}
|
||||
HuWinDispOff(window);
|
||||
} else {
|
||||
for (i=0; i<=15; i++) {
|
||||
if (i <= 10) {
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, cos(M_PI * (9.0f * i) / 180.0));
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, cosd(9.0f * i));
|
||||
}
|
||||
if (i > 5) {
|
||||
s16 time = i - 5;
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, cos(M_PI * (9.0f * time) / 180.0));
|
||||
HuSprScaleSet(window_ptr->group, 0, 1.0f, cosd(9.0f * time));
|
||||
}
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
@ -1901,13 +1901,13 @@ void HuWinExAnimPopIn(s16 window, s16 portrait) {
|
|||
s16 i;
|
||||
|
||||
for (i=0; i<=10; i++) {
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, cos(M_PI * (9.0f * i) / 180.0));
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, cosd(9.0f * i));
|
||||
HuPrcVSleep();
|
||||
}
|
||||
HuWinSprKill(window, 2);
|
||||
HuWinExCreatePortrait(window, portrait, 48.0f, 48.0f);
|
||||
for (i=0; i<=10; i++) {
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, sin(M_PI * (9.0f * i) / 180.0));
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, sind(9.0f * i));
|
||||
HuPrcVSleep();
|
||||
}
|
||||
HuSprScaleSet(window_ptr->group, 2, 1.0f, 1.0f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue