diff --git a/include/context.h b/include/context.h index e161f955..f41dbb56 100644 --- a/include/context.h +++ b/include/context.h @@ -151,7 +151,7 @@ extern f32 D_ctx_80178470[3]; extern f32 gCameraShakeY; extern s32 gCameraShake; extern s32 D_ctx_80178484; -extern bool D_ctx_80178488; +extern bool gLoadLevelObjects; extern UNK_TYPE F_8017848C; extern UNK_TYPE F_80178490; extern s32 D_ctx_80178494; diff --git a/include/functions.h b/include/functions.h index 7b4224b0..1ea682f5 100644 --- a/include/functions.h +++ b/include/functions.h @@ -8,26 +8,26 @@ #include "sf64mesg.h" // fox_360 -void func_360_8002ED60(Player*); -void func_360_8002E3E0(Actor*); +void AllRange_FortunaIntro(Player*); +void AllRange_GetStarWolfHits(Actor*); void AllRange_UpdateCountdown(void); -void func_360_8002E5E0(Boss*); -void func_360_8002E604(Boss*); -void func_360_8002E628(Boss*); -void func_360_8002E64C(Boss*); -void func_360_8002E670(Actor*); -void func_360_8002E694(Actor*); -void func_360_8002E6B8(Actor*); -void func_360_8002E6DC(Actor*); -bool func_360_8002E4F8(u16*, RadioCharacterId); -void func_360_8002E700(Player*); -void func_360_8002EE34(void); -void func_360_8002EE64(Actor* actor); +void Boss309_Update(Boss*); +void Boss309_Draw(Boss*); +void Boss310_Update(Boss*); +void Boss310_Draw(Boss*); +void Actor271_Update(Actor*); +void Actor271_Draw(Actor*); +void Actor272_Update(Actor*); +void Actor272_Draw(Actor*); +bool AllRange_PlayMessage(u16*, RadioCharacterId); +void AllRange_GreatFoxRepair(Player*); +void AllRange_ClearRadio(void); +void func_360_8002EE64(Actor* this); void func_360_8002F180(void); -void func_360_8002F5F4(u16* msg, RadioCharacterId character); +void ActorAllRange_PlayMessage(u16* msg, RadioCharacterId character); void func_360_8002F69C(Actor*); void func_360_8002FC00(Actor*); -void func_360_8003088C(Actor*); +void ActorAllRange_ApplyDamage(Actor*); bool func_360_80031900(Actor*); void ActorAllRange_Update(Actor* this); void ActorAllRange_Draw(Actor* this); @@ -73,16 +73,16 @@ void func_tank_80047504(Player* player); void func_tank_80046358(Player*); // fox_demo -void func_demo_8004D440(Player*); +void Cutscene_KillPlayer(Player*); void func_demo_80048AC0(s32 teamId); -void func_demo_80049C0C(Player*); -void func_demo_8004A52C(Player*); +void Cutscene_EnterWarpZone(Player*); +void Cutscene_LevelStart(Player*); void func_demo_8004AA84(void); -void func_demo_8004AAF4(Player*); -void func_demo_8004C930(Player*); -void func_demo_8004CCC0(Player*); -void func_demo_8004D440(Player* player); -void func_demo_8004E3D8(Player*); +void Cutscene_AllRangeMode(Player*); +void Cutscene_LevelComplete(Player*); +void Cutscene_UTurn(Player*); +void Cutscene_KillPlayer(Player* player); +void Cutscene_PlayerDown(Player*); void func_demo_8004F8AC(Actor*); void func_demo_8004FEC0(Actor*); void func_demo_800515C4(void); @@ -159,10 +159,10 @@ void Object_Load(ObjectInit* , f32 , f32 , f32 , f32 ); void func_enmy_80062568(void); void func_enmy_80062B60(f32 xPos, f32 zPos, s32 state, f32 scale); void func_enmy_80062C38(f32, f32); -bool func_enmy_80062DBC(Vec3f* pos, f32* hitboxData, Object* obj, f32 xRot, f32 yRot, f32 zRot); -bool func_enmy_800631A8(Vec3f*, f32*, Vec3f*); -bool func_enmy_8006326C(Vec3f* , Vec3f* , ObjectId , Object* ); -s32 func_enmy_8006351C(s32 , Vec3f* , Vec3f* , s32 ); +bool Object_CheckHitboxCollision(Vec3f* pos, f32* hitboxData, Object* obj, f32 xRot, f32 yRot, f32 zRot); +bool Object_CheckSingleHitbox(Vec3f*, f32*, Vec3f*); +bool Object_CheckPolyCollision(Vec3f* , Vec3f* , ObjectId , Object* ); +s32 Object_CheckCollision(s32 , Vec3f* , Vec3f* , s32 ); void func_enmy_800652CC(Object_80*); void func_enmy_800654E4(Object*); void func_enmy_800656D4(Actor*); @@ -433,10 +433,11 @@ void func_hud_80096A74(Player* player); // fox_97F80 void func_col1_80098860(PlaneF* plane, Vec3f* point, Vec3f* normal); s32 func_col1_800988B4(Vec3f* vec, PlaneF* plane); -bool func_col1_800998FC(Vec3f*, Vec3f*, Vec3f*, s32, Vec3f*, f32*); +bool func_col1_800998FC(Vec3f* objPos, Vec3f* colliderPos, Vec3f* objVel, s32 colId, Vec3f* hitPosOut, + f32* hitAnglesOut); // fox_A4290 -bool func_col2_800A3690(Vec3f*, Vec3f*, s32, Vec3f*); +bool func_col2_800A3690(Vec3f* objPos, Vec3f* colliderPos, s32 colId, Vec3f* hitDataOut); // fox_A48A0 void func_800A3CA0(void); diff --git a/include/global.h b/include/global.h index 9811992c..a17e6200 100644 --- a/include/global.h +++ b/include/global.h @@ -3,6 +3,26 @@ #include "sys.h" +typedef enum OverlayCalls { + /* 90 */ OVLCALL_FO_CS_COMPLETE = 90, + /* 91 */ OVLCALL_BOSS309_UPDATE, + /* 92 */ OVLCALL_BOSS309_DRAW, + /* 93 */ OVLCALL_BOSS310_UPDATE, + /* 94 */ OVLCALL_BOSS310_DRAW, + /* 95 */ OVLCALL_ACTOR271_UPDATE, + /* 96 */ OVLCALL_ACTOR271_DRAW, + /* 97 */ OVLCALL_ACTOR272_UPDATE, + /* 98 */ OVLCALL_ACTOR272_DRAW, + /* 103 */ OVLCALL_TITLE_UPDATE = 103, + /* 104 */ OVLCALL_TITLE_DRAW, + /* 105 */ OVLCALL_MAP_UPDATE, + /* 106 */ OVLCALL_MAP_DRAW, + /* 107 */ OVLCALL_OPTION_UPDATE, + /* 108 */ OVLCALL_OPTION_DRAW, + /* 109 */ OVLCALL_GAME_OVER_UPDATE, + /* 110 */ OVLCALL_UNKMAP_DRAW, +} OverlayCalls; + #include "sf64audio_external.h" #include "functions.h" #include "variables.h" @@ -22,4 +42,6 @@ #include "i6.h" #include "assets/ast_common.h" + + #endif // GLOBAL_H diff --git a/include/sf64math.h b/include/sf64math.h index 939d0736..7fe5a7c2 100644 --- a/include/sf64math.h +++ b/include/sf64math.h @@ -3,6 +3,9 @@ #include "libultra/ultra64.h" +#define MTXF_NEW 0 +#define MTXF_APPLY 1 + typedef struct { /* 0x0 */ f32 x; /* 0x4 */ f32 y; @@ -71,24 +74,66 @@ s32 Math_PursueVec3f(Vec3f *pos, Vec3f *target, Vec3f *rot, f32 stepSize, f32 sc void Math_Vec3fFromAngles(Vec3f *step, f32 xRot, f32 yRot, f32 stepsize); f32 Math_RadToDeg(f32 rAngle); -void Matrix_Copy(Matrix*, Matrix*); +// Copies src Matrix into dst +void Matrix_Copy(Matrix* dst, Matrix* src); + +// Makes a copy of the stack's current matrix and puts it on the top of the stack void Matrix_Push(Matrix** mtxStack); + +// Removes the top matrix of the stack void Matrix_Pop(Matrix** mtxStack); -void Matrix_Mult(Matrix*, Matrix*, u8); -void Matrix_Translate(Matrix*, f32, f32, f32, u8); + +// Copies tf into mtx (MTXF_NEW) or applies it to mtx (MTXF_APPLY) +void Matrix_Mult(Matrix* mtx, Matrix* tf, u8 mode); + +// Creates a translation matrix in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) +void Matrix_Translate(Matrix* mtx, f32 x, f32 y, f32 z, u8 mode); + +// Creates a scale matrix in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) void Matrix_Scale(Matrix* mtx, f32 xScale, f32 yScale, f32 zScale, u8 mode); -void Matrix_RotateX(Matrix*, f32, u8); -void Matrix_RotateY(Matrix*, f32, u8); -void Matrix_RotateZ(Matrix*, f32, u8); -void Matrix_RotateAxis(Matrix*, f32, f32, f32, f32, u8); -void Matrix_ToMtx(Mtx *dest); -void Matrix_FromMtx(Mtx *src, Matrix *dest); + +// Creates rotation matrix about the X axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) +void Matrix_RotateX(Matrix* mtx, f32 angle, u8 mode); + +// Creates rotation matrix about the Y axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) +void Matrix_RotateY(Matrix* mtx, f32 angle, u8 mode); + +// Creates rotation matrix about the Z axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) +void Matrix_RotateZ(Matrix* mtx, f32 angle, u8 mode); + +// Creates rotation matrix about a given vector axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY). +// The vector specifying the axis does not need to be a unit vector. +void Matrix_RotateAxis(Matrix* mtx, f32 angle, f32 axisX, f32 axisY, f32 axisZ, u8 mode); + +// Converts the current Gfx matrix to a Mtx +void Matrix_ToMtx(Mtx* dest); + +// Converts the Mtx src to a Matrix, putting the result in dest +void Matrix_FromMtx(Mtx* src, Matrix* dest); + +// Applies the transform matrix mtx to the vector src, putting the result in dest void Matrix_MultVec3f(Matrix* mtx, Vec3f* src, Vec3f* dest); + +// Applies the linear part of the transformation matrix mtx to the vector src, ignoring any translation that mtx might +// have. Puts the result in dest. void Matrix_MultVec3fNoTranslate(Matrix* mtx, Vec3f* src, Vec3f* dest); -void Matrix_GetYRPAngles(Matrix*, Vec3f*); -void Matrix_GetXYZAngles(Matrix*, Vec3f*); -void Matrix_LookAt(Matrix*, f32, f32, f32, f32, f32, f32, f32, f32, f32, u8); -void Matrix_SetGfxMtx(Gfx**); + +// Expresses the rotational part of the transform mtx as Tait-Bryan angles, in the yaw-pitch-roll (intrinsic YXZ) +// convention used in worldspace calculations +void Matrix_GetYRPAngles(Matrix* mtx, Vec3f* rot); + +// Expresses the rotational part of the transform mtx as Tait-Bryan angles, in the extrinsic XYZ convention used in +// modelspace calculations +void Matrix_GetXYZAngles(Matrix* mtx, Vec3f* rot); + +// Creates a look-at matrix from Eye, At, and Up in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY). +// A look-at matrix is a rotation-translation matrix that maps y to Up, z to (At - Eye), and translates to Eye +void Matrix_LookAt(Matrix* mtx, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, + u8 mode); + +// Converts the current Gfx matrix to a Mtx and sets it to the display list +void Matrix_SetGfxMtx(Gfx** gfx); + f32 Math_FAtanF(f32); f32 Math_FAtan2F(f32, f32); diff --git a/include/sf64player.h b/include/sf64player.h index a18044ea..9504ab37 100644 --- a/include/sf64player.h +++ b/include/sf64player.h @@ -57,20 +57,20 @@ typedef enum LevelMode { } LevelMode; typedef enum PlayerState1C8 { - /* 0 */ PLAYERSTATE_1C8_0, - /* 1 */ PLAYERSTATE_1C8_1, - /* 2 */ PLAYERSTATE_1C8_2, - /* 3 */ PLAYERSTATE_1C8_3, - /* 4 */ PLAYERSTATE_1C8_4, - /* 5 */ PLAYERSTATE_1C8_5, - /* 6 */ PLAYERSTATE_1C8_6, - /* 7 */ PLAYERSTATE_1C8_7, - /* 8 */ PLAYERSTATE_1C8_8, - /* 9 */ PLAYERSTATE_1C8_9, - /* 10 */ PLAYERSTATE_1C8_10, - /* 11 */ PLAYERSTATE_1C8_11, + /* 0 */ PLAYERSTATE_1C8_STANDBY, + /* 1 */ PLAYERSTATE_1C8_INIT, + /* 2 */ PLAYERSTATE_1C8_LEVEL_INTRO, + /* 3 */ PLAYERSTATE_1C8_ACTIVE, + /* 4 */ PLAYERSTATE_1C8_DOWN, + /* 5 */ PLAYERSTATE_1C8_U_TURN, + /* 6 */ PLAYERSTATE_1C8_NEXT, + /* 7 */ PLAYERSTATE_1C8_LEVEL_COMPLETE, + /* 8 */ PLAYERSTATE_1C8_ENTER_WARP_ZONE, + /* 9 */ PLAYERSTATE_1C8_START_360, + /* 10 */ PLAYERSTATE_1C8_GFOX_REPAIR, + /* 11 */ PLAYERSTATE_1C8_ANDROSS_MOUTH, /* 12 */ PLAYERSTATE_1C8_12, - /* 13 */ PLAYERSTATE_1C8_13, + /* 13 */ PLAYERSTATE_1C8_VS_STANDBY, } PlayerState1C8; typedef enum { @@ -127,7 +127,7 @@ typedef struct { /* 0x20 */ f32 unk_20; /* 0x24 */ f32 unk_24; /* 0x28 */ f32 unk_28; - /* 0x2C */ u8 unk_2C; + /* 0x2C */ u8 modelId; /* 0x30 */ f32 unk_30; /* 0x34 */ f32 unk_34; /* 0x38 */ f32 unk_38; @@ -159,12 +159,11 @@ typedef struct Player { /* 0x028 */ f32 unk_028; /* 0x02C */ f32 unk_02C; /* 0x030 */ f32 unk_030; - /* 0x034 */ f32 unk_034; + /* 0x034 */ f32 camRoll; /* 0x038 */ char pad38[8]; - /* 0x040 */ Vec3f camEye; - /* 0x04C */ Vec3f camAt; - /* 0x058 */ f32 unk_058; - /* 0x05C */ f32 unk_05C; + /* 0x040 */ CameraPoint cam; + /* 0x058 */ f32 camYaw; + /* 0x05C */ f32 camPitch; /* 0x05C */ f32 unk_060; /* 0x064 */ f32 unk_064; /* 0x068 */ f32 unk_068; diff --git a/include/structs.h b/include/structs.h index 332d943c..7bd35c8c 100644 --- a/include/structs.h +++ b/include/structs.h @@ -5,8 +5,8 @@ #include "sf64math.h" typedef struct { - /* 0x00 */ u8 unk_00; - /* 0x02 */ u16 unk_02; + /* 0x00 */ u8 status; + /* 0x02 */ u16 type; /* 0x04 */ Vec3f pos; /* 0x10 */ f32 unk_10; /* 0x14 */ char pad14[0x14]; diff --git a/include/sys.h b/include/sys.h index e9a403ff..da2c0952 100644 --- a/include/sys.h +++ b/include/sys.h @@ -47,7 +47,7 @@ extern f32 D_game_80161A10; extern f32 D_game_80161A14; extern s32 gPlayerInactive[4]; extern s32 D_game_80161A28; -extern u8 D_game_80161A2C; +extern u8 gShowHud; extern u16 gNextLevelStage; extern u16 gNextLevel; extern u16 gNextGameState; diff --git a/linker_scripts/us/symbol_addrs_engine.txt b/linker_scripts/us/symbol_addrs_engine.txt index e5638aa8..65389bdc 100644 --- a/linker_scripts/us/symbol_addrs_engine.txt +++ b/linker_scripts/us/symbol_addrs_engine.txt @@ -276,14 +276,14 @@ func_enmy_80061E48 = 0x80061E48; func_enmy_80061F0C = 0x80061F0C; Object_Load = 0x80062180; func_enmy_80062568 = 0x80062568; -func_enmy_80062664 = 0x80062664; +Object_LoadFromInit = 0x80062664; func_enmy_80062B60 = 0x80062B60; func_enmy_80062C38 = 0x80062C38; func_enmy_80062D04 = 0x80062D04; -func_enmy_80062DBC = 0x80062DBC; -func_enmy_800631A8 = 0x800631A8; -func_enmy_8006326C = 0x8006326C; -func_enmy_8006351C = 0x8006351C; +Object_CheckHitboxCollision = 0x80062DBC; +Object_CheckSingleHitbox = 0x800631A8; +Object_CheckPolyCollision = 0x8006326C; +Object_CheckCollision = 0x8006351C; func_enmy_80063CAC = 0x80063CAC; func_enmy_80063D58 = 0x80063D58; func_enmy_80063E5C = 0x80063E5C; @@ -355,7 +355,7 @@ D_game_80161A10 = 0x80161A10; D_game_80161A14 = 0x80161A14; gPlayerInactive = 0x80161A18; //size:0x10 D_game_80161A28 = 0x80161A28; -D_game_80161A2C = 0x80161A2C; +gShowHud = 0x80161A2C; gNextLevelStage = 0x80161A2E; gNextLevel = 0x80161A30; gNextGameState = 0x80161A32; @@ -621,7 +621,7 @@ D_ctx_80178444 = 0x80178444; D_ctx_80178448 = 0x80178448; gCameraShakeY = 0x8017847C; gCameraShake = 0x80178480; -D_ctx_80178488 = 0x80178488; +gLoadLevelObjects = 0x80178488; D_ctx_801784A4 = 0x801784A4; D_ctx_801784AC = 0x801784AC; D_ctx_801784B8 = 0x801784B8; @@ -750,7 +750,7 @@ func_play_800B41EC = 0x800B41EC; func_play_800B42B0 = 0x800B42B0; func_play_800B44C4 = 0x800B44C4; func_play_800B46F8 = 0x800B46F8; -Player_Update1 = 0x800B48BC; +Player_Update = 0x800B48BC; func_play_800B56BC = 0x800B56BC; func_play_800B5D30 = 0x800B5D30; func_play_800B5FBC = 0x800B5FBC; @@ -759,7 +759,7 @@ func_play_800B6848 = 0x800B6848; func_play_800B6BFC = 0x800B6BFC; func_play_800B6F50 = 0x800B6F50; func_play_800B7184 = 0x800B7184; -Player_Update2 = 0x800B71E4; +Player_UpdateCamera = 0x800B71E4; func_play_800B73E0 = 0x800B73E0; Play_UpdateLevel = 0x800B79B0; Play_Update = 0x800B832C; diff --git a/src/audio/audio_load.c b/src/audio/audio_load.c index 9a87a93b..bc85f192 100644 --- a/src/audio/audio_load.c +++ b/src/audio/audio_load.c @@ -1276,6 +1276,9 @@ s32 AudioLoad_RelocateFontAndPreloadSamples(s32 fontId, u32 fontDataAddr, Sample break; } sample = gUsedSamples[i]; +#ifdef AVOID_UB + sampleRamAddr = NULL; +#endif //! Bug: Those are assignments, not equality checks. switch (isAsync) { case 0: diff --git a/src/engine/fox_360.c b/src/engine/fox_360.c index dfffbaed..48b437a9 100644 --- a/src/engine/fox_360.c +++ b/src/engine/fox_360.c @@ -9,6 +9,29 @@ #include "assets/ast_enmy_planet.h" #include "assets/ast_sector_z.h" +typedef enum ActorAllRangeState { + STATE360_0, + STATE360_1, + STATE360_2, + STATE360_3, + STATE360_4, + STATE360_5, + STATE360_6, + STATE360_7, + STATE360_8, + STATE360_9, + STATE360_10, + STATE360_11, + STATE360_12, + STATE360_13, + STATE360_14, + STATE360_15, + STATE360_16, + STATE360_17, + STATE360_18, + STATE360_19, +} ActorAllRangeState; + /* static */ Vec3f D_360_800C9A90 = { 0.0f, -10.0f, 0.0f }; /* static */ Vec3f D_360_800C9A9C[4] = { { 0.0f, 20000.0f, 0.0f }, @@ -52,7 +75,7 @@ s32 gShowAllRangeCountdown; s32 gAllRangeFrameCount; f32 gAllRangeCountdownScale; -void func_360_8002E3E0(Actor* actor) { +void AllRange_GetStarWolfHits(Actor* actor) { s32 hits = 0; (void) "time=%d\n"; @@ -88,8 +111,8 @@ void func_360_8002E3E0(Actor* actor) { D_ctx_80177850 = 15; } -bool func_360_8002E4F8(u16* msg, RadioCharacterId rcid) { - if ((gRadioState == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_0)) { +bool AllRange_PlayMessage(u16* msg, RadioCharacterId rcid) { + if ((gRadioState == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) { Radio_PlayMessage(msg, rcid); return true; } else { @@ -108,39 +131,39 @@ void AllRange_UpdateCountdown(void) { } } -void func_360_8002E5E0(Boss* boss) { - OvlI4_CallFunction(91, boss); +void Boss309_Update(Boss* boss) { + OvlI4_CallFunction(OVLCALL_BOSS309_UPDATE, boss); } -void func_360_8002E604(Boss* boss) { - OvlI4_CallFunction(92, boss); +void Boss309_Draw(Boss* boss) { + OvlI4_CallFunction(OVLCALL_BOSS309_DRAW, boss); } -void func_360_8002E628(Boss* boss) { - OvlI4_CallFunction(93, boss); +void Boss310_Update(Boss* boss) { + OvlI4_CallFunction(OVLCALL_BOSS310_UPDATE, boss); } -void func_360_8002E64C(Boss* boss) { - OvlI4_CallFunction(94, boss); +void Boss310_Draw(Boss* boss) { + OvlI4_CallFunction(OVLCALL_BOSS310_DRAW, boss); } -void func_360_8002E670(Actor* actor) { - OvlI4_CallFunction(95, actor); +void Actor271_Update(Actor* actor) { + OvlI4_CallFunction(OVLCALL_ACTOR271_UPDATE, actor); } -void func_360_8002E694(Actor* actor) { - OvlI4_CallFunction(96, actor); +void Actor271_Draw(Actor* actor) { + OvlI4_CallFunction(OVLCALL_ACTOR271_DRAW, actor); } -void func_360_8002E6B8(Actor* actor) { - OvlI4_CallFunction(97, actor); +void Actor272_Update(Actor* actor) { + OvlI4_CallFunction(OVLCALL_ACTOR272_UPDATE, actor); } -void func_360_8002E6DC(Actor* actor) { - OvlI4_CallFunction(98, actor); +void Actor272_Draw(Actor* actor) { + OvlI4_CallFunction(OVLCALL_ACTOR272_DRAW, actor); } -void func_360_8002E700(Player* player) { +void AllRange_GreatFoxRepair(Player* player) { Vec3f sp6C; Vec3f sp60; @@ -149,7 +172,7 @@ void func_360_8002E700(Player* player) { case 0: player->unk_1F4 = player->timer_498 = player->damage = player->unk_280 = player->unk_2BC = player->unk_2B4 = player->unk_4DC = gCsFrameCount = 0; - player->unk_130 = player->unk_034 = player->unk_110 = player->unk_08C = player->unk_0D8.x = + player->unk_130 = player->camRoll = player->unk_110 = player->unk_08C = player->unk_0D8.x = player->unk_0D8.y = player->unk_0D8.z = player->unk_134 = player->unk_4D8 = 0.0f; gCsCamEyeX = 1673.0f; gCsCamEyeY = 337.0f; @@ -169,7 +192,7 @@ void func_360_8002E700(Player* player) { player->pos.z = 0.0f; gCsCamAtZ = 0.0f; D_ctx_80177A48[0] = 1.0f; - player->wings.unk_2C = 1; + player->wings.modelId = 1; player->unk_1D0++; break; case 1: @@ -222,8 +245,8 @@ void func_360_8002E700(Player* player) { gCsCamEyeX -= 1.0f; player->unk_0E4 += 0.4f; if (gCsFrameCount >= 130) { - player->state_1C8 = PLAYERSTATE_1C8_3; - player->wings.unk_2C = 0; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; + player->wings.modelId = 0; player->unk_014 = 0; player->unk_018 = 0; player->unk_01C = 0; @@ -236,8 +259,8 @@ void func_360_8002E700(Player* player) { gCsCamAtZ = player->pos.z; Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 2.0f, 0); Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 3.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); sp6C.x = 0.0f; sp6C.y = 0.0f; sp6C.z = player->unk_0D0; @@ -250,15 +273,15 @@ void func_360_8002E700(Player* player) { player->pos.z += player->vel.z; player->unk_138 = player->pos.z; player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); } -void func_360_8002ED60(Player* player) { +void AllRange_FortunaIntro(Player* player) { Vec3f sp24; Math_Vec3fFromAngles(&sp24, 0.0f, player->unk_114 + 180.0f, 40.0f); @@ -269,19 +292,19 @@ void func_360_8002ED60(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; player->unk_138 = player->pos.z; - player->camEye.x = -200.0f; - player->camEye.y = 500.0f; - player->camEye.z = 7000.0f; - player->camAt.x = player->pos.x; - player->camAt.y = player->pos.y; - player->camAt.z = player->pos.z; + player->cam.eye.x = -200.0f; + player->cam.eye.y = 500.0f; + player->cam.eye.z = 7000.0f; + player->cam.at.x = player->pos.x; + player->cam.at.y = player->pos.y; + player->cam.at.z = player->pos.z; } -void func_360_8002EE34(void) { +void AllRange_ClearRadio(void) { sStarWolfKillTimer = gRadioState = gActors[1].iwork[1] = gActors[2].iwork[1] = gActors[3].iwork[1] = 0; } -void func_360_8002EE64(Actor* actor) { +void func_360_8002EE64(Actor* this) { s32 i; s32 colId; Object_58* obj58; @@ -299,29 +322,29 @@ void func_360_8002EE64(Actor* actor) { s32 pad1; s32 pad2; - actor->fwork[25] = actor->fwork[26] = actor->fwork[28] = actor->fwork[27] = 0.0f; - if ((actor->unk_0C9 != 0) && (gLevelMode == LEVELMODE_ALL_RANGE) && (gLevelType == LEVELTYPE_PLANET)) { + this->fwork[25] = this->fwork[26] = this->fwork[28] = this->fwork[27] = 0.0f; + if ((this->unk_0C9 != 0) && (gLevelMode == LEVELMODE_ALL_RANGE) && (gLevelType == LEVELTYPE_PLANET)) { for (i = 0, obj58 = gObjects58; i < 200; i++, obj58++) { if ((obj58->obj.status == OBJ_ACTIVE) && ((obj58->obj.id == OBJ_80_150) || (obj58->obj.id == OBJ_80_149) || (obj58->obj.id == OBJ_80_148) || (obj58->obj.id == OBJ_80_1) || (obj58->obj.id == OBJ_80_3)) && - (fabsf(obj58->obj.pos.x - actor->obj.pos.x) < 2500.0f) && - (fabsf(obj58->obj.pos.z - actor->obj.pos.z) < 2500.0f)) { + (fabsf(obj58->obj.pos.x - this->obj.pos.x) < 2500.0f) && + (fabsf(obj58->obj.pos.z - this->obj.pos.z) < 2500.0f)) { temp1.x = obj58->obj.pos.x; temp1.y = obj58->obj.pos.y; temp1.z = obj58->obj.pos.z; temp4 = obj58->obj.rot.y; - Matrix_RotateY(gCalcMatrix, -temp4 * M_DTOR, 0); - spE4.x = actor->obj.pos.x - temp1.x; + Matrix_RotateY(gCalcMatrix, -temp4 * M_DTOR, MTXF_NEW); + spE4.x = this->obj.pos.x - temp1.x; spE4.y = 0.0f; - spE4.z = actor->obj.pos.z - temp1.z; + spE4.z = this->obj.pos.z - temp1.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spE4, &spD8); spC0.x = temp1.x; spC0.y = temp1.y; spCC.x = spD8.x + temp1.x; - spC0.z = temp1.z; // fake? + spC0.z = temp1.z; // fake? weird ordering spCC.y = spD8.y + temp1.y; spCC.z = spD8.z + temp1.z; if ((obj58->obj.id == OBJ_80_149) || (obj58->obj.id == OBJ_80_150)) { @@ -331,10 +354,10 @@ void func_360_8002EE64(Actor* actor) { colId = COL1_6; } if (func_col1_800998FC(&spCC, &spC0, &sp94, colId, &spA8, spA0) > 0) { - actor->fwork[25] = spA8.y; - actor->fwork[26] = spA0[0]; - actor->fwork[28] = spA0[1]; - actor->fwork[27] = DEG_TO_RAD(temp4); + this->fwork[25] = spA8.y; + this->fwork[26] = spA0[0]; + this->fwork[28] = spA0[1]; + this->fwork[27] = DEG_TO_RAD(temp4); } } else { colId = COL2_0; @@ -342,10 +365,10 @@ void func_360_8002EE64(Actor* actor) { colId = COL2_3; } if (func_col2_800A3690(&spCC, &spC0, colId, &spB4)) { - actor->fwork[25] = spB4.y; - actor->fwork[26] = spB4.x; - actor->fwork[28] = spB4.z; - actor->fwork[27] = DEG_TO_RAD(temp4); + this->fwork[25] = spB4.y; + this->fwork[26] = spB4.x; + this->fwork[28] = spB4.z; + this->fwork[27] = DEG_TO_RAD(temp4); } } } @@ -436,17 +459,18 @@ void func_360_8002F3E0(void) { } } -void func_360_8002F5F4(u16* msg, RadioCharacterId character) { - if ((D_ctx_80178300 == 0) && (gActors[0].state == 2) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_0)) { +void ActorAllRange_PlayMessage(u16* msg, RadioCharacterId character) { + if ((D_ctx_80178300 == 0) && (gActors[0].state == STATE360_2) && + (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) { Radio_PlayMessage(msg, character); } } -void func_360_8002F64C(u16* msg, RadioCharacterId character) { +void ActorAllRange_StarWolfDefeatMesg(u16* msg, RadioCharacterId character) { if ((gStarWolfTeamAlive[0] + gStarWolfTeamAlive[1] + gStarWolfTeamAlive[2] + gStarWolfTeamAlive[3]) == 0) { gRadioState = 0; } - func_360_8002F5F4(msg, character); + ActorAllRange_PlayMessage(msg, character); } void func_360_8002F69C(Actor* actor) { @@ -468,22 +492,22 @@ void func_360_8002F69C(Actor* actor) { if (gAllRangeEventTimer == D_360_800C9B4C) { func_360_8002F3E0(); actor->state = 3; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; if ((gCurrentLevel == LEVEL_VENOM_2) || (gCurrentLevel == LEVEL_BOLSE)) { - gPlayer[0].unk_034 = 20.0f; + gPlayer[0].camRoll = 20.0f; } AUDIO_PLAY_BGM(SEQ_ID_STAR_WOLF | SEQ_FLAG); - func_360_8002EE34(); + AllRange_ClearRadio(); if ((gCurrentLevel == LEVEL_FORTUNA) || (gCurrentLevel == LEVEL_VENOM_2)) { - gPlayer[0].camEye.x = 4500.0f; + gPlayer[0].cam.eye.x = 4500.0f; } else if (gCurrentLevel == LEVEL_BOLSE) { - gPlayer[0].camEye.x = 5500.0f; + gPlayer[0].cam.eye.x = 5500.0f; } - gPlayer[0].camEye.y = 2500.0f; - gPlayer[0].camEye.z = 5000.0f; - gPlayer[0].camAt.x = gActors[4].obj.pos.x; - gPlayer[0].camAt.y = gActors[4].obj.pos.y; - gPlayer[0].camAt.z = gActors[4].obj.pos.z; + gPlayer[0].cam.eye.y = 2500.0f; + gPlayer[0].cam.eye.z = 5000.0f; + gPlayer[0].cam.at.x = gActors[4].obj.pos.x; + gPlayer[0].cam.at.y = gActors[4].obj.pos.y; + gPlayer[0].cam.at.z = gActors[4].obj.pos.z; } if (gAllRangeEventTimer > D_360_800C9B4C) { if (gStarWolfMsgTimer == 0) { @@ -491,7 +515,7 @@ void func_360_8002F69C(Actor* actor) { for (i = 1, otherActor = &gActors[1]; i < 8; i++, otherActor++) { if ((otherActor->obj.status == OBJ_ACTIVE) && (otherActor->state == 2) && (otherActor->health < 70) && (otherActor->timer_0C6 != 0) && (otherActor->unk_0D4 == 1)) { - if ((gActors[otherActor->aiIndex].state == 3) && + if ((gActors[otherActor->aiIndex].state == STATE360_3) && (gActors[otherActor->aiIndex].aiType < AI360_KATT)) { gActors[otherActor->aiIndex].iwork[2] = AI360_FOX; gActors[otherActor->aiIndex].state = 2; @@ -503,13 +527,13 @@ void func_360_8002F69C(Actor* actor) { if (gActors[otherActor->aiIndex].iwork[3] == 0) { switch (gActors[otherActor->aiIndex].aiType) { case AI360_FALCO: - func_360_8002F5F4(gMsg_ID_9160, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_9160, RCID_FALCO); break; case AI360_SLIPPY: - func_360_8002F5F4(gMsg_ID_9170, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_9170, RCID_SLIPPY); break; case AI360_PEPPY: - func_360_8002F5F4(gMsg_ID_9180, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_9180, RCID_PEPPY); break; } gActors[otherActor->aiIndex].iwork[3] = 200; @@ -517,11 +541,11 @@ void func_360_8002F69C(Actor* actor) { } if (otherActor->aiType == AI360_WOLF) { if (gCurrentLevel != LEVEL_VENOM_2) { - otherActor->state = 3; + otherActor->state = STATE360_3; otherActor->unk_04E = 300; } } else { - otherActor->state = 3; + otherActor->state = STATE360_3; otherActor->aiIndex = -1; } } @@ -591,13 +615,13 @@ void func_360_8002FC00(Actor* actor) { } switch (gActors[otherActor->aiIndex].aiType) { case AI360_FALCO: - func_360_8002F5F4(gMsg_ID_9160, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_9160, RCID_FALCO); break; case AI360_SLIPPY: - func_360_8002F5F4(gMsg_ID_9170, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_9170, RCID_SLIPPY); break; case AI360_PEPPY: - func_360_8002F5F4(gMsg_ID_9180, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_9180, RCID_PEPPY); break; } gActors[otherActor->aiIndex].iwork[3] = 200; @@ -620,8 +644,8 @@ bool func_360_8002FE74(void) { return false; } -void func_360_8002FEF0(Actor* actor) { - Actor* newActor; +void ActorAllRange_SpawnSupplies(Actor* this) { + Actor* supplies; s32 i; if ((gCallTimer != 0) && (gControllerPress[gMainController].button & R_CBUTTONS)) { @@ -634,30 +658,30 @@ void func_360_8002FEF0(Actor* actor) { if (gAllRangeSupplyTimer != 0) { gAllRangeSupplyTimer--; if (gAllRangeSupplyTimer == 0) { - for (i = 20, newActor = &gActors[20]; i < 60; i++, newActor++) { - if (newActor->obj.status == OBJ_FREE) { - Actor_Initialize(newActor); - newActor->obj.status = OBJ_INIT; - newActor->obj.id = OBJ_ACTOR_SUPPLIES; + for (i = 20, supplies = &gActors[20]; i < 60; i++, supplies++) { + if (supplies->obj.status == OBJ_FREE) { + Actor_Initialize(supplies); + supplies->obj.status = OBJ_INIT; + supplies->obj.id = OBJ_ACTOR_SUPPLIES; if (gCurrentLevel == LEVEL_SECTOR_Z) { - newActor->obj.pos.x = 200.0f; - newActor->obj.pos.y = -500.0f; - newActor->obj.pos.z = 0.0f; - AUDIO_PLAY_SFX(0x09000002, newActor->sfxSource, 0); - newActor->timer_0C2 = 50; + supplies->obj.pos.x = 200.0f; + supplies->obj.pos.y = -500.0f; + supplies->obj.pos.z = 0.0f; + AUDIO_PLAY_SFX(0x09000002, supplies->sfxSource, 0); + supplies->timer_0C2 = 50; } else { - newActor->obj.pos.x = 0.0f; - newActor->obj.pos.y = 3000.0f; - newActor->obj.pos.z = 5000.0f; - newActor->timer_0C2 = 50; + supplies->obj.pos.x = 0.0f; + supplies->obj.pos.y = 3000.0f; + supplies->obj.pos.z = 5000.0f; + supplies->timer_0C2 = 50; } - Object_SetInfo(&newActor->info, newActor->obj.id); + Object_SetInfo(&supplies->info, supplies->obj.id); break; } } } } - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && !gAllRangeWingRepairSent) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && !gAllRangeWingRepairSent) { if (gAllRangeWingRepairTimer != 0) { gAllRangeWingRepairTimer--; } @@ -668,30 +692,30 @@ void func_360_8002FEF0(Actor* actor) { } } -void func_360_8003010C(Actor* actor) { - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_4) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_6)) { - Object_Kill(&actor->obj, actor->sfxSource); +void ActorAllRange_UpdateEvents(Actor* this) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_DOWN) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT)) { + Object_Kill(&this->obj, this->sfxSource); return; } gAllRangeEventTimer++; switch (gCurrentLevel) { case LEVEL_FORTUNA: - Fortuna_80187960(actor); + Fortuna_80187960(this); break; case LEVEL_KATINA: - Katina_80198594(actor); + Katina_80198594(this); break; case LEVEL_BOLSE: - Bolse_8018C158(actor); + Bolse_8018C158(this); break; case LEVEL_SECTOR_Z: - SectorZ_8019AB8C(actor); + SectorZ_8019AB8C(this); break; case LEVEL_VENOM_2: - Venom2_80196314(actor); + Venom2_80196314(this); break; } - func_360_8002FEF0(actor); + ActorAllRange_SpawnSupplies(this); } s32 func_360_800301F4(Actor* actor) { @@ -748,7 +772,7 @@ s32 func_360_8003049C(Actor* actor) { Boss* boss = &gBosses[0]; s32 pad[4]; - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { return 0; } if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { @@ -790,67 +814,67 @@ s32 func_360_8003049C(Actor* actor) { return 0; } -void func_360_8003088C(Actor* actor) { +void ActorAllRange_ApplyDamage(Actor* this) { s32 var_a1; Vec3f sp48; Vec3f sp3C; - if (actor->unk_0D0 != 0) { - if (actor->aiType == AI360_GREAT_FOX) { - actor->unk_0D0 = 0; + if (this->unk_0D0 != 0) { + if (this->aiType == AI360_GREAT_FOX) { + this->unk_0D0 = 0; } - if ((actor->unk_0D0 >= 2) && (actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { - actor->damage = 10; - actor->timer_0C2 = 10; + if ((this->unk_0D0 >= 2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { + this->damage = 10; + this->timer_0C2 = 10; } - if (((actor->aiType <= AI360_PEPPY) || (actor->aiType == AI360_BILL) || (actor->aiType == AI360_KATT)) && - (actor->unk_0D0 == 2)) { - actor->unk_0D0 = 0; + if (((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_BILL) || (this->aiType == AI360_KATT)) && + (this->unk_0D0 == 2)) { + this->unk_0D0 = 0; } - if ((actor->unk_0D0 == 2) && (actor->fwork[22] > 0.0f)) { - actor->unk_0D0 = 0; + if ((this->unk_0D0 == 2) && (this->fwork[22] > 0.0f)) { + this->unk_0D0 = 0; } - if (actor->fwork[23] > 1.0f) { - actor->unk_0D0 = 0; + if (this->fwork[23] > 1.0f) { + this->unk_0D0 = 0; } - if (actor->unk_0D0 != 0) { + if (this->unk_0D0 != 0) { var_a1 = false; - if ((actor->unk_0B6 == 3) || + if ((this->unk_0B6 == 3) || ((gCurrentLevel == LEVEL_BOLSE) && (gBosses[1].obj.status != OBJ_FREE) && - (actor->aiType >= AI360_WOLF)) || - ((gCurrentLevel == LEVEL_VENOM_2) && (actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_10) && - (actor->unk_0D0 == 2))) { - actor->damage = 0; + (this->aiType >= AI360_WOLF)) || + ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF) && (this->aiType < AI360_10) && + (this->unk_0D0 == 2))) { + this->damage = 0; var_a1 = true; if (gCurrentLevel == LEVEL_BOLSE) { - actor->unk_0D4 = 0; + this->unk_0D4 = 0; } } - if (actor->aiType >= AI360_WOLF) { - if (((actor->unk_0D0 != 3) || (actor->aiType != AI360_WOLF)) && - ((actor->aiType != AI360_MISSILE) || (actor->unk_0D0 != 2))) { - actor->health -= actor->damage; + if (this->aiType >= AI360_WOLF) { + if (((this->unk_0D0 != 3) || (this->aiType != AI360_WOLF)) && + ((this->aiType != AI360_MISSILE) || (this->unk_0D0 != 2))) { + this->health -= this->damage; } - } else if ((actor->aiType <= AI360_PEPPY) && (actor->state != 6)) { - if (actor->aiType == AI360_FALCO) { - gTeamDamage[actor->aiType] = actor->damage; + } else if ((this->aiType <= AI360_PEPPY) && (this->state != 6)) { + if (this->aiType == AI360_FALCO) { + gTeamDamage[this->aiType] = this->damage; } else { - gTeamDamage[actor->aiType] = actor->damage * 2; + gTeamDamage[this->aiType] = this->damage * 2; } } - if (actor->health <= 0) { - actor->health = 0; - if (actor->aiType == AI360_MISSILE) { - SectorZ_80199900(actor, 1); - if (actor->unk_0D4 == 1) { + if (this->health <= 0) { + this->health = 0; + if (this->aiType == AI360_MISSILE) { + SectorZ_80199900(this, 1); + if (this->unk_0D4 == 1) { if (gActors[8].obj.status == OBJ_ACTIVE) { Radio_PlayMessage(gMsg_ID_16140, RCID_KATT); } - BonusText_Display(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10); + BonusText_Display(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10); gHitCount += 11; D_ctx_80177850 = 15; } else { - switch (actor->unk_0D4) { + switch (this->unk_0D4) { case 102: Radio_PlayMessage(gMsg_ID_16170, RCID_FALCO); break; @@ -867,100 +891,100 @@ void func_360_8003088C(Actor* actor) { } return; } - actor->timer_0C6 = 50; - actor->iwork[8] = 20; - actor->obj.status = OBJ_DYING; - actor->fwork[23] = 0.0f; - func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 4.0f); - AUDIO_PLAY_SFX(0x2903700B, actor->sfxSource, 4); - actor->timer_0C2 = 10; - actor->timer_0BE = 0; - actor->timer_04C = RAND_INT(2.9f); + this->timer_0C6 = 50; + this->iwork[8] = 20; + this->obj.status = OBJ_DYING; + this->fwork[23] = 0.0f; + func_effect_8007D2C8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 4.0f); + AUDIO_PLAY_SFX(0x2903700B, this->sfxSource, 4); + this->timer_0C2 = 10; + this->timer_0BE = 0; + this->timer_04C = RAND_INT(2.9f); switch (RAND_INT(4.0f)) { case 0: - actor->timer_0BC = 0; + this->timer_0BC = 0; break; case 1: - actor->timer_0BC = 50; + this->timer_0BC = 50; break; case 2: - actor->timer_0BC = 200; + this->timer_0BC = 200; break; case 3: - actor->timer_0BC = 300; + this->timer_0BC = 300; break; } if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { - actor->timer_0BC = 70; + this->timer_0BC = 70; } if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { if (Rand_ZeroOne() < 0.5f) { - actor->timer_0BC = 10; + this->timer_0BC = 10; } else { - actor->timer_0BC = RAND_INT(50.0f); + this->timer_0BC = RAND_INT(50.0f); } } - if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { - actor->timer_0BC = RAND_INT(40.0f) + 60.0f; + if ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { + this->timer_0BC = RAND_INT(40.0f) + 60.0f; } - if (actor->damage >= 20) { - actor->timer_0BC = 0; + if (this->damage >= 20) { + this->timer_0BC = 0; } - if ((gCurrentLevel == LEVEL_KATINA) && (actor->unk_0B6 == 1) && (actor->unk_0D4 == 1)) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (this->unk_0D4 == 1)) { if (gKaAllyKillCount < 2) { - func_360_8002F5F4(gMsg_ID_18018, RCID_BILL); + ActorAllRange_PlayMessage(gMsg_ID_18018, RCID_BILL); } gKaAllyKillCount++; } - switch (actor->aiType) { + switch (this->aiType) { case AI360_WOLF: gStarWolfTeamAlive[0] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { - func_360_8002F64C(gMsg_ID_19458, RCID_WOLF); + ActorAllRange_StarWolfDefeatMesg(gMsg_ID_19458, RCID_WOLF); } else { - func_360_8002F64C(gMsg_ID_9365, RCID_WOLF); + ActorAllRange_StarWolfDefeatMesg(gMsg_ID_9365, RCID_WOLF); } break; case AI360_LEON: gStarWolfTeamAlive[1] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { - func_360_8002F64C(gMsg_ID_19459, RCID_LEON); + ActorAllRange_StarWolfDefeatMesg(gMsg_ID_19459, RCID_LEON); } else { - func_360_8002F64C(gMsg_ID_9366, RCID_LEON); + ActorAllRange_StarWolfDefeatMesg(gMsg_ID_9366, RCID_LEON); } break; case AI360_PIGMA: gStarWolfTeamAlive[2] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { - func_360_8002F64C(gMsg_ID_19460, RCID_PIGMA); + ActorAllRange_StarWolfDefeatMesg(gMsg_ID_19460, RCID_PIGMA); } else { - func_360_8002F64C(gMsg_ID_9367, RCID_PIGMA); + ActorAllRange_StarWolfDefeatMesg(gMsg_ID_9367, RCID_PIGMA); } break; case AI360_ANDREW: gStarWolfTeamAlive[3] = 0; if (gCurrentLevel == LEVEL_VENOM_2) { - func_360_8002F64C(gMsg_ID_19461, RCID_ANDREW); + ActorAllRange_StarWolfDefeatMesg(gMsg_ID_19461, RCID_ANDREW); } else { - func_360_8002F64C(gMsg_ID_9368, RCID_ANDREW); + ActorAllRange_StarWolfDefeatMesg(gMsg_ID_9368, RCID_ANDREW); } break; } - if ((actor->aiType >= AI360_WOLF) && (actor->aiType <= AI360_ANDREW)) { + if ((this->aiType >= AI360_WOLF) && (this->aiType <= AI360_ANDREW)) { sStarWolfKillTimer = 150; } - switch (actor->unk_0D4) { + switch (this->unk_0D4) { case 1: - if (actor->aiType >= AI360_10) { - switch (actor->iwork[2]) { + if (this->aiType >= AI360_10) { + switch (this->iwork[2]) { case AI360_FALCO: - func_360_8002F5F4(gMsg_ID_20170, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_20170, RCID_FALCO); break; case AI360_SLIPPY: - func_360_8002F5F4(gMsg_ID_20150, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_20150, RCID_SLIPPY); break; case AI360_PEPPY: - func_360_8002F5F4(gMsg_ID_20160, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_20160, RCID_PEPPY); break; } } @@ -968,10 +992,10 @@ void func_360_8003088C(Actor* actor) { case 102: case 103: case 104: - if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { + if ((this->aiType >= AI360_WOLF) && (this->aiType < AI360_KATT)) { if ((gStarWolfTeamAlive[0] + gStarWolfTeamAlive[1] + gStarWolfTeamAlive[2] + gStarWolfTeamAlive[3]) == 0) { - switch (actor->unk_0D4) { + switch (this->unk_0D4) { case 102: Radio_PlayMessage(gMsg_ID_9438, RCID_FALCO); break; @@ -983,146 +1007,146 @@ void func_360_8003088C(Actor* actor) { break; } } else { - gActors[actor->unk_0D4 - 101].iwork[1] = 80; + gActors[this->unk_0D4 - 101].iwork[1] = 80; } } else { - gActors[actor->unk_0D4 - 101].iwork[1] = 80; + gActors[this->unk_0D4 - 101].iwork[1] = 80; } break; } } else { if (var_a1) { - AUDIO_PLAY_SFX(0x29001062, actor->sfxSource, 4); - actor->iwork[7] = 3; - actor->iwork[18] = 5; - actor->iwork[8] = 15; + AUDIO_PLAY_SFX(0x29001062, this->sfxSource, 4); + this->iwork[7] = 3; + this->iwork[18] = 5; + this->iwork[8] = 15; if (Rand_ZeroOne() < 0.5f) { - actor->fwork[8] = 0.0f; - actor->fwork[7] = 360.0f; + this->fwork[8] = 0.0f; + this->fwork[7] = 360.0f; } else { - actor->fwork[7] = 0.0f; - actor->fwork[8] = 359.999f; + this->fwork[7] = 0.0f; + this->fwork[8] = 359.999f; } } else { - actor->timer_0C6 = 20; - actor->iwork[8] = 20; + this->timer_0C6 = 20; + this->iwork[8] = 20; } - if (actor->aiType == AI360_MISSILE) { - AUDIO_PLAY_SFX(0x29034003, actor->sfxSource, 4); - } else if (actor->iwork[7] == 0) { - AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); + if (this->aiType == AI360_MISSILE) { + AUDIO_PLAY_SFX(0x29034003, this->sfxSource, 4); + } else if (this->iwork[7] == 0) { + AUDIO_PLAY_SFX(0x2903300E, this->sfxSource, 4); } - func_effect_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); - if (actor->aiType < AI360_GREAT_FOX) { - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); + func_effect_8007D10C(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.5f); + if (this->aiType < AI360_GREAT_FOX) { + Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, MTXF_NEW); sp48.x = 30.0f; if (Rand_ZeroOne() < 0.5f) { sp48.x = -30.0f; } sp48.y = RAND_FLOAT_CENTERED(30.0f); sp48.z = 0.0f; - if (actor->iwork[7] != 0) { + if (this->iwork[7] != 0) { sp48.x *= 1.5f; sp48.y = 30.0f; - if ((actor->obj.pos.y > 100.0f) && (Rand_ZeroOne() < 0.5f)) { + if ((this->obj.pos.y > 100.0f) && (Rand_ZeroOne() < 0.5f)) { sp48.y = -30.0f; } } Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp48, &sp3C); - actor->fwork[13] = sp3C.x; - actor->fwork[14] = sp3C.y; - actor->fwork[12] = sp3C.z; + this->fwork[13] = sp3C.x; + this->fwork[14] = sp3C.y; + this->fwork[12] = sp3C.z; } if ((gRadioState == 0) && (gActors[0].obj.status == OBJ_ACTIVE)) { - if (actor->unk_0D0 == 3) { - switch (actor->aiType) { + if (this->unk_0D0 == 3) { + switch (this->aiType) { case AI360_FALCO: - func_360_8002F5F4(gMsg_ID_20210, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_20210, RCID_FALCO); break; case AI360_PEPPY: - func_360_8002F5F4(gMsg_ID_20200, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_20200, RCID_PEPPY); break; case AI360_SLIPPY: - func_360_8002F5F4(gMsg_ID_20190, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_20190, RCID_SLIPPY); break; case AI360_KATT: - func_360_8002F5F4(gMsg_ID_20084, RCID_KATT); + ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_KATT); break; } - } else if (actor->unk_0D4 < 105) { - if (actor->aiType >= AI360_WOLF) { - if (actor->unk_0D4 == 1) { - if ((gCurrentLevel == LEVEL_KATINA) && (actor->unk_0B6 == 1) && (gKaKilledAlly == 0)) { + } else if (this->unk_0D4 < 105) { + if (this->aiType >= AI360_WOLF) { + if (this->unk_0D4 == 1) { + if ((gCurrentLevel == LEVEL_KATINA) && (this->unk_0B6 == 1) && (gKaKilledAlly == 0)) { gKaKilledAlly = 1; Radio_PlayMessage(gMsg_ID_18015, RCID_BILL); - } else if (actor->aiType == AI360_KATT) { - func_360_8002F5F4(gMsg_ID_20084, RCID_KATT); - } else if (actor->aiType == AI360_BILL) { - func_360_8002F5F4(gMsg_ID_20085, RCID_BILL); + } else if (this->aiType == AI360_KATT) { + ActorAllRange_PlayMessage(gMsg_ID_20084, RCID_KATT); + } else if (this->aiType == AI360_BILL) { + ActorAllRange_PlayMessage(gMsg_ID_20085, RCID_BILL); } else if (gCurrentLevel == LEVEL_VENOM_2) { - switch (actor->aiType) { + switch (this->aiType) { case AI360_WOLF: - func_360_8002F5F4(gMsg_ID_19454, RCID_WOLF); + ActorAllRange_PlayMessage(gMsg_ID_19454, RCID_WOLF); break; case AI360_LEON: - func_360_8002F5F4(gMsg_ID_19455, RCID_LEON); + ActorAllRange_PlayMessage(gMsg_ID_19455, RCID_LEON); break; case AI360_PIGMA: - func_360_8002F5F4(gMsg_ID_19456, RCID_PIGMA); + ActorAllRange_PlayMessage(gMsg_ID_19456, RCID_PIGMA); break; case AI360_ANDREW: - func_360_8002F5F4(gMsg_ID_19457, RCID_ANDREW); + ActorAllRange_PlayMessage(gMsg_ID_19457, RCID_ANDREW); break; } } } - } else if (actor->unk_0D4 == 1) { - switch (actor->aiType) { + } else if (this->unk_0D4 == 1) { + switch (this->aiType) { case AI360_FALCO: - func_360_8002F5F4(gMsg_ID_20060, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_20060, RCID_FALCO); break; case AI360_PEPPY: - func_360_8002F5F4(gMsg_ID_20070, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_20070, RCID_PEPPY); break; case AI360_SLIPPY: - func_360_8002F5F4(gMsg_ID_20080, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_20080, RCID_SLIPPY); break; } } - } else if ((actor->aiType <= AI360_PEPPY) && (actor->iwork[6] != 0) && - (actor->iwork[2] != AI360_FOX)) { - switch (actor->aiType) { + } else if ((this->aiType <= AI360_PEPPY) && (this->iwork[6] != 0) && + (this->iwork[2] != AI360_FOX)) { + switch (this->aiType) { case AI360_FALCO: if (gTeamShields[TEAM_ID_FALCO] >= 90) { - func_360_8002F5F4(gMsg_ID_9130, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_9130, RCID_FALCO); } else { Radio_PlayMessage(gMsg_ID_9151, RCID_FALCO); } - if ((D_display_800CA234 == NULL) || (gTeamShields[actor->aiType] <= 50)) { - D_display_800CA234 = actor; + if ((D_display_800CA234 == NULL) || (gTeamShields[this->aiType] <= 50)) { + D_display_800CA234 = this; D_display_Timer_800CA238 = 320; } break; case AI360_SLIPPY: if (gTeamShields[TEAM_ID_SLIPPY] >= 90) { - func_360_8002F5F4(gMsg_ID_9140, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_9140, RCID_SLIPPY); } else { Radio_PlayMessage(gMsg_ID_9152, RCID_SLIPPY); } - if ((D_display_800CA234 == NULL) || (gTeamShields[actor->aiType] <= 50)) { - D_display_800CA234 = actor; + if ((D_display_800CA234 == NULL) || (gTeamShields[this->aiType] <= 50)) { + D_display_800CA234 = this; D_display_Timer_800CA238 = 320; } break; case AI360_PEPPY: if (gTeamShields[TEAM_ID_PEPPY] >= 90) { - func_360_8002F5F4(gMsg_ID_9150, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_9150, RCID_PEPPY); } else { Radio_PlayMessage(gMsg_ID_9153, RCID_PEPPY); } - if ((D_display_800CA234 == NULL) || (gTeamShields[actor->aiType] <= 50)) { - D_display_800CA234 = actor; + if ((D_display_800CA234 == NULL) || (gTeamShields[this->aiType] <= 50)) { + D_display_800CA234 = this; D_display_Timer_800CA238 = 320; } break; @@ -1130,13 +1154,13 @@ void func_360_8003088C(Actor* actor) { } } } - actor->unk_0D0 = 0; + this->unk_0D0 = 0; } } } -void func_360_80031858(Actor* actor) { - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (actor->iwork[24] != 0) && +void ActorAllRange_CheckPlayerNearby(Actor* actor) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (actor->iwork[24] != 0) && (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 1000.0f) && (fabsf(actor->obj.pos.y - gPlayer[0].pos.y) < 1000.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 1000.0f)) { @@ -1150,7 +1174,7 @@ bool func_360_80031900(Actor* actor) { Vec3f sp24; Vec3f sp18; - Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_NEW); sp24.x = actor->fwork[4] - actor->obj.pos.x; sp24.y = 0.0f; sp24.z = actor->fwork[6] - actor->obj.pos.z; @@ -1197,7 +1221,7 @@ void ActorAllRange_Update(Actor* this) { if (this->aiType == AI360_EVENT_HANDLER) { this->timer_0C2 = 10; this->info.unk_1C = 0.0f; - func_360_8003010C(this); + ActorAllRange_UpdateEvents(this); return; } if ((this->iwork[17] != 0) && (this->iwork[16] == 0) && (this->aiType >= AI360_WOLF)) { @@ -1281,7 +1305,7 @@ void ActorAllRange_Update(Actor* this) { this->iwork[11] = 1; } if (this->aiType < AI360_10) { - func_360_80031858(this); + ActorAllRange_CheckPlayerNearby(this); if (this->iwork[10] == 200) { switch (this->aiType) { case AI360_WOLF: @@ -1353,7 +1377,7 @@ void ActorAllRange_Update(Actor* this) { this->timer_0C2 = 10000; } switch (this->state) { - case 6: + case STATE360_6: this->timer_0C2 = 10000; this->iwork[11] = 2; this->fwork[1] = 45.0f; @@ -1379,12 +1403,12 @@ void ActorAllRange_Update(Actor* this) { } sp104 = 2; break; - case 5: + case STATE360_5: SectorZ_Missile_Update(this); sp104 = 1; break; - case 0: - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_9) { + case STATE360_0: + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) { this->fwork[0] = this->fwork[1] = 40.0f; if (gActors[0].state == 5) { Math_SmoothStepToF(&this->unk_0F4.x, 30.0f, 0.1f, 0.5f, 0.0f); @@ -1409,7 +1433,7 @@ void ActorAllRange_Update(Actor* this) { Math_SmoothStepToAngle(&this->obj.rot.z, 0.0f, 0.03f, 0.5f, 0.0f); } break; - case 1: + case STATE360_1: this->fwork[1] = 40.0f; if ((this->timer_0BC < 35) && (gCurrentLevel == LEVEL_FORTUNA)) { Math_SmoothStepToF(&this->unk_0F4.x, 15.0f, 0.1f, 1.0f, 0.0f); @@ -1421,7 +1445,7 @@ void ActorAllRange_Update(Actor* this) { } } break; - case 2: + case STATE360_2: sp104 = 1; spF8 = 800.0f; spF4 = 1500.0f; @@ -1448,12 +1472,12 @@ void ActorAllRange_Update(Actor* this) { if (this->aiIndex == AI360_FOX) { if (gCurrentLevel != LEVEL_VENOM_2) { if (((gPlayer[0].unk_4DC != 0) && (this->iwork[4] > 10)) || - ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0))) { + ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY))) { this->state = 3; this->unk_04E = 300; this->timer_0BC = 160; if (this->aiType == AI360_WOLF) { - func_360_8002F5F4(gMsg_ID_9369, RCID_WOLF); + ActorAllRange_PlayMessage(gMsg_ID_9369, RCID_WOLF); } break; } else if ((this->iwork[4] > 200) && (gPlayer[0].timer_224 != 0)) { @@ -1526,8 +1550,8 @@ void ActorAllRange_Update(Actor* this) { this->fwork[1] = gActors[this->aiIndex].fwork[0] - 5.0f; } else { this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; - if ((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5) && - (gPlayer[0].unk_4D8 > 100.0f)) { + if ((gCurrentLevel == LEVEL_VENOM_2) && + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN) && (gPlayer[0].unk_4D8 > 100.0f)) { this->iwork[16] = 8; } } @@ -1540,27 +1564,28 @@ void ActorAllRange_Update(Actor* this) { this->iwork[4]++; this->iwork[5] = 1; if (!((this->index + gGameFrameCount) & sp10F) && (Rand_ZeroOne() < spF0) && - func_360_80031900(this) && ((gActors[0].state == 2) || (gCurrentLevel == LEVEL_TRAINING))) { + func_360_80031900(this) && + ((gActors[0].state == STATE360_2) || (gCurrentLevel == LEVEL_TRAINING))) { if ((this->aiIndex == AI360_FOX) && (gCurrentLevel != LEVEL_TRAINING)) { if ((this->iwork[4] > 250) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) { if ((Rand_ZeroOne() < 0.5f) || (gCurrentLevel == LEVEL_VENOM_2)) { this->iwork[4] = 0; switch (this->aiType) { case AI360_WOLF: - func_360_8002E4F8(gMsg_ID_19450, RCID_WOLF); + AllRange_PlayMessage(gMsg_ID_19450, RCID_WOLF); break; case AI360_LEON: - func_360_8002E4F8(gMsg_ID_19451, RCID_LEON); + AllRange_PlayMessage(gMsg_ID_19451, RCID_LEON); break; case AI360_PIGMA: - func_360_8002E4F8(gMsg_ID_19452, RCID_PIGMA); + AllRange_PlayMessage(gMsg_ID_19452, RCID_PIGMA); break; case AI360_ANDREW: - func_360_8002E4F8(gMsg_ID_19453, RCID_ANDREW); + AllRange_PlayMessage(gMsg_ID_19453, RCID_ANDREW); break; } } else { - func_360_8002E4F8(gMsg_ID_2233, RCID_FALCO); + AllRange_PlayMessage(gMsg_ID_2233, RCID_FALCO); } } this->iwork[0] = 1; @@ -1576,11 +1601,11 @@ void ActorAllRange_Update(Actor* this) { switch (this->aiIndex) { case AI360_FALCO: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_19462, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_19462, RCID_FALCO); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_20310, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_20310, RCID_FALCO); } else { - func_360_8002F5F4(gMsg_ID_9100, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_9100, RCID_FALCO); } gActors[this->aiIndex].iwork[2] = this->aiType; if ((D_display_800CA234 == NULL) || (gTeamShields[this->aiIndex] <= 50)) { @@ -1590,11 +1615,11 @@ void ActorAllRange_Update(Actor* this) { break; case AI360_SLIPPY: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_19463, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_19463, RCID_SLIPPY); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_20311, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_20311, RCID_SLIPPY); } else { - func_360_8002F5F4(gMsg_ID_9110, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_9110, RCID_SLIPPY); } gActors[this->aiIndex].iwork[2] = this->aiType; if ((D_display_800CA234 == NULL) || (gTeamShields[this->aiIndex] <= 50)) { @@ -1604,11 +1629,11 @@ void ActorAllRange_Update(Actor* this) { break; case AI360_PEPPY: if ((gCurrentLevel == LEVEL_VENOM_2) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_19464, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_19464, RCID_PEPPY); } else if ((gActors[this->aiIndex].iwork[6] >= 3) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_20312, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_20312, RCID_PEPPY); } else { - func_360_8002F5F4(gMsg_ID_9120, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_9120, RCID_PEPPY); } gActors[this->aiIndex].iwork[2] = this->aiType; if ((D_display_800CA234 == NULL) || (gTeamShields[this->aiIndex] <= 50)) { @@ -1618,22 +1643,22 @@ void ActorAllRange_Update(Actor* this) { break; case AI360_WOLF: if (gStarWolfTeamAlive[0] != 0) { - func_360_8002F5F4(gMsg_ID_9330, RCID_WOLF); + ActorAllRange_PlayMessage(gMsg_ID_9330, RCID_WOLF); } break; case AI360_LEON: if (gStarWolfTeamAlive[1] != 0) { - func_360_8002F5F4(gMsg_ID_9340, RCID_LEON); + ActorAllRange_PlayMessage(gMsg_ID_9340, RCID_LEON); } break; case AI360_PIGMA: if (gStarWolfTeamAlive[2] != 0) { - func_360_8002F5F4(gMsg_ID_9350, RCID_PIGMA); + ActorAllRange_PlayMessage(gMsg_ID_9350, RCID_PIGMA); } break; case AI360_ANDREW: if (gStarWolfTeamAlive[3] != 0) { - func_360_8002F5F4(gMsg_ID_9360, RCID_ANDREW); + ActorAllRange_PlayMessage(gMsg_ID_9360, RCID_ANDREW); } break; } @@ -1641,25 +1666,25 @@ void ActorAllRange_Update(Actor* this) { switch (this->aiType) { case AI360_FALCO: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_9211, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_9211, RCID_FALCO); } else { - func_360_8002F5F4(gMsg_ID_9190, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_9190, RCID_FALCO); } gActors[this->aiIndex].iwork[2] = AI360_FALCO; break; case AI360_SLIPPY: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_9212, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_9212, RCID_SLIPPY); } else { - func_360_8002F5F4(gMsg_ID_9200, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_9200, RCID_SLIPPY); } gActors[this->aiIndex].iwork[2] = AI360_SLIPPY; break; case AI360_PEPPY: if ((gCurrentLevel == LEVEL_FORTUNA) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002F5F4(gMsg_ID_9213, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_9213, RCID_PEPPY); } else { - func_360_8002F5F4(gMsg_ID_9210, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_9210, RCID_PEPPY); } gActors[this->aiIndex].iwork[2] = AI360_PEPPY; break; @@ -1667,56 +1692,56 @@ void ActorAllRange_Update(Actor* this) { if (gCurrentLevel != LEVEL_VENOM_2) { if (this->iwork[6] == 0) { this->iwork[6] = 1; - func_360_8002F5F4(gMsg_ID_9289, RCID_WOLF); + ActorAllRange_PlayMessage(gMsg_ID_9289, RCID_WOLF); } else if (this->iwork[4] > 150) { if (Rand_ZeroOne() < 0.5f) { this->iwork[4] = 0; - func_360_8002F5F4(gMsg_ID_9290, RCID_WOLF); + ActorAllRange_PlayMessage(gMsg_ID_9290, RCID_WOLF); } else { - func_360_8002F5F4(gMsg_ID_2233, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_2233, RCID_FALCO); } } else { - func_360_8002F5F4(gMsg_ID_9322, RCID_WOLF); + ActorAllRange_PlayMessage(gMsg_ID_9322, RCID_WOLF); } } break; case AI360_LEON: if (gCurrentLevel == LEVEL_VENOM_2) { if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_FALCO)) { - func_360_8002F5F4(gMsg_ID_9323, RCID_LEON); + ActorAllRange_PlayMessage(gMsg_ID_9323, RCID_LEON); } else { - func_360_8002F5F4(gMsg_ID_19451, RCID_LEON); + ActorAllRange_PlayMessage(gMsg_ID_19451, RCID_LEON); } } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_FALCO)) { - func_360_8002F5F4(gMsg_ID_9323, RCID_LEON); + ActorAllRange_PlayMessage(gMsg_ID_9323, RCID_LEON); } else { - func_360_8002F5F4(gMsg_ID_9300, RCID_LEON); + ActorAllRange_PlayMessage(gMsg_ID_9300, RCID_LEON); } break; case AI360_PIGMA: if (gCurrentLevel == LEVEL_VENOM_2) { if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_PEPPY)) { - func_360_8002F5F4(gMsg_ID_9324, RCID_PIGMA); + ActorAllRange_PlayMessage(gMsg_ID_9324, RCID_PIGMA); } else { - func_360_8002F5F4(gMsg_ID_19452, RCID_PIGMA); + ActorAllRange_PlayMessage(gMsg_ID_19452, RCID_PIGMA); } } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_PEPPY)) { - func_360_8002F5F4(gMsg_ID_9324, RCID_PIGMA); + ActorAllRange_PlayMessage(gMsg_ID_9324, RCID_PIGMA); } else { - func_360_8002F5F4(gMsg_ID_9310, RCID_PIGMA); + ActorAllRange_PlayMessage(gMsg_ID_9310, RCID_PIGMA); } break; case AI360_ANDREW: if (gCurrentLevel == LEVEL_VENOM_2) { if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_SLIPPY)) { - func_360_8002F5F4(gMsg_ID_9325, RCID_ANDREW); + ActorAllRange_PlayMessage(gMsg_ID_9325, RCID_ANDREW); } else { - func_360_8002F5F4(gMsg_ID_19453, RCID_ANDREW); + ActorAllRange_PlayMessage(gMsg_ID_19453, RCID_ANDREW); } } else if ((Rand_ZeroOne() < 0.5f) && (this->aiIndex == AI360_SLIPPY)) { - func_360_8002F5F4(gMsg_ID_9325, RCID_ANDREW); + ActorAllRange_PlayMessage(gMsg_ID_9325, RCID_ANDREW); } else { - func_360_8002F5F4(gMsg_ID_9320, RCID_ANDREW); + ActorAllRange_PlayMessage(gMsg_ID_9320, RCID_ANDREW); } break; } @@ -1736,7 +1761,7 @@ void ActorAllRange_Update(Actor* this) { } } break; - case 3: + case STATE360_3: sp104 = 1; if (this->timer_0BC == 0) { if ((this->aiType < AI360_10) || (gCurrentLevel == LEVEL_BOLSE)) { @@ -1778,7 +1803,7 @@ void ActorAllRange_Update(Actor* this) { spE0 = 0.0f; } spDC = RAND_FLOAT_CENTERED(10000.0f); - if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0)) { + if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY)) { spE4 = RAND_FLOAT_CENTERED(5000.0f); spDC = RAND_FLOAT_CENTERED(5000.0f); } @@ -1809,7 +1834,7 @@ void ActorAllRange_Update(Actor* this) { } } break; - case 7: + case STATE360_7: this->fwork[1] = 40.0f; Math_SmoothStepToF(&this->unk_0F4.x, 360.0f, 0.1f, 5.0f, 0.0001f); Math_SmoothStepToAngle(&this->obj.rot.z, 0.0f, 0.1f, 3.0f, 0.01f); @@ -1817,7 +1842,7 @@ void ActorAllRange_Update(Actor* this) { this->state = 3; } break; - case 8: + case STATE360_8: this->fwork[1] = 40.0f; if ((this->index % 2) != 0) { Math_SmoothStepToAngle(&this->obj.rot.z, 355.0f, 0.1f, 3.0f, 0.01f); @@ -1849,7 +1874,7 @@ void ActorAllRange_Update(Actor* this) { break; } break; - case 9: + case STATE360_9: this->fwork[1] = 40.0f; if (Math_SmoothStepToAngle(&this->unk_0F4.y, this->fwork[19], 0.5f, 5.0f, 0.0f) < 0.0f) { spD0 = 70.0f; @@ -1861,7 +1886,7 @@ void ActorAllRange_Update(Actor* this) { this->state = 3; } break; - case 10: + case STATE360_10: sp104 = 1; if (this->timer_0BC == 0) { this->state = 3; @@ -1945,9 +1970,9 @@ void ActorAllRange_Update(Actor* this) { Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[7], 0.2f, 100.0f, 0.01f); if ((this->aiType == AI360_KATT) && ((gGameFrameCount % 2) == 0)) { if ((this->fwork[7] > 10.0f) && (this->fwork[7] < 350.0f)) { - Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); spA8.x = 0.0f; spA8.y = 70.0f; @@ -1991,9 +2016,9 @@ void ActorAllRange_Update(Actor* this) { sp90.z = spB4 * sp90.z; if ((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType >= AI360_WOLF)) { - Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); spA8.y = 0.0f; spA8.z = 0.0f; if (Rand_ZeroOne() < 0.8f) { @@ -2018,16 +2043,16 @@ void ActorAllRange_Update(Actor* this) { this->obj.rot.y, this->obj.rot.z); } } - func_360_8003088C(this); + ActorAllRange_ApplyDamage(this); radarMark = &gRadarMarks[this->index]; - radarMark->unk_00 = 1; + radarMark->status = 1; if (this->aiType == AI360_MISSILE) { - radarMark->unk_02 = 100; + radarMark->type = 100; } else { - radarMark->unk_02 = this->aiType; + radarMark->type = this->aiType; } if (gCurrentLevel == LEVEL_TRAINING) { - radarMark->unk_02 = 4; + radarMark->type = 4; } radarMark->pos.x = this->obj.pos.x; radarMark->pos.y = this->obj.pos.y; @@ -2035,19 +2060,19 @@ void ActorAllRange_Update(Actor* this) { radarMark->unk_10 = this->unk_0F4.y + 180.0f; if (this->iwork[1] != 0) { this->iwork[1]--; - if ((this->iwork[1] == 0) && (gActors[0].state == 2) && (gRadioState == 0)) { + if ((this->iwork[1] == 0) && (gActors[0].state == STATE360_2) && (gRadioState == 0)) { switch (this->aiType) { case AI360_FALCO: - func_360_8002F5F4(gMsg_ID_9220, RCID_FALCO); + ActorAllRange_PlayMessage(gMsg_ID_9220, RCID_FALCO); break; case AI360_SLIPPY: - func_360_8002F5F4(gMsg_ID_9230, RCID_SLIPPY); + ActorAllRange_PlayMessage(gMsg_ID_9230, RCID_SLIPPY); break; case AI360_PEPPY: if ((Rand_ZeroOne() < 0.1f) && (gCurrentLevel == LEVEL_KATINA)) { - func_360_8002F5F4(gMsg_ID_18150, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_18150, RCID_PEPPY); } else { - func_360_8002F5F4(gMsg_ID_9240, RCID_PEPPY); + ActorAllRange_PlayMessage(gMsg_ID_9240, RCID_PEPPY); } break; } @@ -2064,7 +2089,7 @@ void ActorAllRange_Update(Actor* this) { sp90.x = this->vel.x; sp90.y = this->vel.y; sp90.z = this->vel.z; - temp_v0_27 = func_enmy_8006351C(this->index, &this->obj.pos, &sp90, var_a3); + temp_v0_27 = Object_CheckCollision(this->index, &this->obj.pos, &sp90, var_a3); if (temp_v0_27 != 0) { this->obj.pos.x -= this->vel.x; this->obj.pos.y -= this->vel.y; @@ -2079,7 +2104,7 @@ void ActorAllRange_Update(Actor* this) { this->unk_0D0 = 1; this->damage = 10; this->health = 0; - func_360_8003088C(this); + ActorAllRange_ApplyDamage(this); } } } @@ -2110,9 +2135,9 @@ void func_360_80034E64(Actor* actor) { if (gCurrentLevel == LEVEL_VENOM_2) { sp24 *= 1.5f; } - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - Matrix_Scale(gGfxMatrix, sp24, sp24 * 0.5f, sp24, 1); - Matrix_RotateY(gGfxMatrix, gGameFrameCount * 3.0f * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp24, sp24 * 0.5f, sp24, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gGameFrameCount * 3.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x29); if (gCurrentLevel == LEVEL_KATINA) { @@ -2133,16 +2158,16 @@ void func_360_80035098(Actor* actor) { if (actor->fwork[23] > 1.0f) { Matrix_Push(&gGfxMatrix); sp2C = actor->fwork[23]; - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - Matrix_RotateZ(gGfxMatrix, -actor->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * -actor->obj.rot.y - gPlayer[0].unk_058, 1); - Matrix_RotateX(gGfxMatrix, gPlayer[0].unk_05C, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * actor->iwork[15] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -actor->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * -actor->obj.rot.y - gPlayer[0].camYaw, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gPlayer[0].camPitch, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * actor->iwork[15] * M_DTOR, MTXF_APPLY); if (actor->iwork[15] < 0) { - Matrix_RotateX(gGfxMatrix, M_PI, 1); + Matrix_RotateX(gGfxMatrix, M_PI, MTXF_APPLY); } - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, sp2C); @@ -2152,7 +2177,7 @@ void func_360_80035098(Actor* actor) { } } -bool func_360_800352E0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { +bool ActorAllRange_MissileOverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { Actor* this = thisx; if ((this->timer_0C6 % 2) != 0) { @@ -2182,9 +2207,9 @@ void ActorAllRange_Draw(ActorAllRange* this) { if ((this->iwork[8] != 0) && (this->aiType < AI360_GREAT_FOX)) { pad2 = SIN_DEG(this->iwork[8] * 400.0f); sp38 = this->iwork[8] * pad2; - Matrix_RotateY(gGfxMatrix, M_DTOR * sp38, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * sp38, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * sp38, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * sp38, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * sp38, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sp38, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } if ((this->timer_0C6 % 2) == 0) { @@ -2208,18 +2233,18 @@ void ActorAllRange_Draw(ActorAllRange* this) { if (gCurrentLevel == LEVEL_VENOM_2) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F0103D0); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 30.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 30.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(this, 2); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -30.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, -30.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(this, 2); Matrix_Pop(&gGfxMatrix); func_360_80035098(this); func_360_80034E64(this); } else { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F00F200); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); if (gCurrentLevel == LEVEL_BOLSE) { func_edisplay_8005B1E8(this, 3); } else { @@ -2242,18 +2267,19 @@ void ActorAllRange_Draw(ActorAllRange* this) { break; case AI360_MISSILE: Animation_GetFrameData(&D_SZ_6006D64, 0, sp7C); - Animation_DrawSkeleton(3, D_SZ_6006E50, sp7C, func_360_800352E0, NULL, this, gCalcMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -400.0f, 1); - Matrix_Scale(gGfxMatrix, this->fwork[29], this->fwork[29], this->fwork[29], 1); + Animation_DrawSkeleton(3, D_SZ_6006E50, sp7C, ActorAllRange_MissileOverrideLimbDraw, NULL, this, + gCalcMatrix); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -400.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, this->fwork[29], this->fwork[29], this->fwork[29], MTXF_APPLY); func_edisplay_8005B1E8(this, 3); break; default: if (gCurrentLevel == LEVEL_FORTUNA) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 60.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_FO_6006BE0); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -100.0f, 1); - Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -100.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); func_edisplay_8005B1E8(this, 2); } else if (gCurrentLevel == LEVEL_KATINA) { switch (this->unk_0B6) { @@ -2262,38 +2288,39 @@ void ActorAllRange_Draw(ActorAllRange* this) { break; case 1: gSPDisplayList(gMasterDisp++, D_KA_600E050); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(this, 0); break; case 3: gSPDisplayList(gMasterDisp++, D_KA_6001530); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, MTXF_APPLY); func_360_80034E64(this); break; } } else if (gCurrentLevel == LEVEL_SECTOR_Z) { - gSPDisplayList(gMasterDisp++, D_SZ_6004FE0) Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + gSPDisplayList(gMasterDisp++, D_SZ_6004FE0); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(this, 2); } else if (gCurrentLevel == LEVEL_BOLSE) { gSPDisplayList(gMasterDisp++, D_BO_6008770) Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(this, 2); Matrix_Pop(&gGfxMatrix); func_360_80034E64(this); } else if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { Animation_GetFrameData(&D_VE2_600C200, this->unk_04A, this->vwork); - Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, 1); + Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, MTXF_APPLY); Animation_DrawSkeleton(0, D_VE2_600C2AC, this->vwork, NULL, NULL, this, &gIdentityMatrix); } else if (gCurrentLevel == LEVEL_VERSUS) { gSPDisplayList(gMasterDisp++, D_versus_3015740); } else if (gCurrentLevel == LEVEL_TRAINING) { if (this->aiIndex == AI360_FOX) { gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F00F200); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(this, 3); } else { gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40068F0); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(this, 2); } } diff --git a/src/engine/fox_A48A0.c b/src/engine/fox_A48A0.c index 0f9adc10..01036834 100644 --- a/src/engine/fox_A48A0.c +++ b/src/engine/fox_A48A0.c @@ -2,10 +2,11 @@ void func_800A3CA0(void) { Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, gCsCamEyeX, gCsCamEyeY, gCsCamEyeZ, gCsCamAtX, gCsCamAtY, gCsCamAtZ, 0.0f, 1.0f, 0.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -200.0f, 1); - Matrix_RotateY(gGfxMatrix, gControllerPress[gPlayerNum].stick_x * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, gControllerPress[gPlayerNum].stick_y * M_DTOR, 1); + Matrix_LookAt(gGfxMatrix, gCsCamEyeX, gCsCamEyeY, gCsCamEyeZ, gCsCamAtX, gCsCamAtY, gCsCamAtZ, 0.0f, 1.0f, 0.0f, + MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -200.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gControllerPress[gPlayerNum].stick_x * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gControllerPress[gPlayerNum].stick_y * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_23(); Matrix_Pop(&gGfxMatrix); diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index 62cc5f77..c1471e6a 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -281,12 +281,12 @@ s32 func_beam_80036874(PlayerShot* shot, f32* hitboxData, Object* obj) { shotPy = shot->obj.pos.y; shotPz = shot->obj.pos.z; } else { - Matrix_RotateZ(gCalcMatrix, -boxRotZ * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -boxRotX * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -boxRotY * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -obj->rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -obj->rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -boxRotZ * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -boxRotX * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -boxRotY * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -obj->rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, MTXF_APPLY); spAC.x = shot->obj.pos.x - obj->pos.x; spAC.y = shot->obj.pos.y - obj->pos.y; spAC.z = shot->obj.pos.z - obj->pos.z; @@ -379,24 +379,24 @@ s32 func_beam_80036F88(PlayerShot* shot, Actor* actor) { shotPz = shot->obj.pos.z; } else { if (hitboxData[0] == HITBOX_ROTATED) { - Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); hitboxData += 4; } else { - Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); } if (((actor->vwork[29].z != 0.0f) || (actor->vwork[29].x != 0.0f) || (actor->unk_0F4.z != 0.0f) || (actor->vwork[29].y != 0.0f)) && (actor->unk_0B4 != 31)) { - Matrix_RotateZ(gCalcMatrix, -(actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -actor->vwork[29].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->vwork[29].y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -(actor->vwork[29].z + actor->unk_0F4.z) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -actor->vwork[29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->vwork[29].y * M_DTOR, MTXF_APPLY); } sp7C.x = shot->obj.pos.x - actor->obj.pos.x; sp7C.y = shot->obj.pos.y - actor->obj.pos.y; @@ -427,8 +427,8 @@ bool func_beam_80037438(PlayerShot* shot, Actor* actor) { if (((s32) hitboxData[0] != 0) && (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) <= 500.0f)) { if (shot->playerNum < 4) { - temp_fv1 = actor->obj.pos.x - gPlayer[0].camEye.x; - temp_fa0 = actor->obj.pos.z + D_ctx_80177D20 - gPlayer[0].camEye.z; + temp_fv1 = actor->obj.pos.x - gPlayer[0].cam.eye.x; + temp_fa0 = actor->obj.pos.z + D_ctx_80177D20 - gPlayer[0].cam.eye.z; var_fa1 = (sqrtf(SQ(temp_fv1) + SQ(temp_fa0)) / 50.0f) + 20.0f + 10.0f; if (var_fa1 > 200.0f) { var_fa1 = 200.0f; @@ -486,7 +486,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) { // undefined behavior: if this check fails, the function returns no value if (((fabsf(sp7C.x) < 1100.0f) && (fabsf(sp7C.z) < 1100.0f) && (shot->obj.pos.y < 900.0f)) || (objId == OBJ_BOSS_313) || (objId == ACTOR_EVENT_ID) || (objId == OBJ_80_39)) { - Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, MTXF_NEW); sp7C.x = shot->obj.pos.x - obj->pos.x; sp7C.y = shot->obj.pos.y - obj->pos.y; sp7C.z = shot->obj.pos.z - obj->pos.z; @@ -614,7 +614,7 @@ bool func_beam_8003774C(PlayerShot* shot, ObjectId objId, Object* obj) { func_beam_80036318(shot); func_effect_8007A6F0(&shot->obj.pos, 0x29121007); if (gCurrentLevel == LEVEL_METEO) { - Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, MTXF_NEW); sp7C.x = sp4C.x - obj->pos.x; sp7C.y = sp4C.y - obj->pos.y; sp7C.z = sp4C.z - obj->pos.z; @@ -701,8 +701,8 @@ void func_beam_80037CF4(PlayerShot* shot, Actor* actor, s32 hitIndex) { shot->unk_64 = 25; shot->obj.rot.y += 90.0f; shot->obj.rot.x = RAND_FLOAT(360.0f); - Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); shot->vel.x = sp38.x; shot->vel.y = sp38.y; @@ -839,15 +839,15 @@ void func_beam_80038140(PlayerShot* shot) { } test.z = test.x; if ((i != shot->playerNum) && - ((player->state_1C8 == PLAYERSTATE_1C8_3) || (player->state_1C8 == PLAYERSTATE_1C8_4)) && + ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_DOWN)) && (fabsf(player->unk_138 - shot->obj.pos.z) < test.z) && (fabsf(player->pos.x - shot->obj.pos.x) < test.x) && (fabsf(player->pos.y - shot->obj.pos.y) < test.y)) { if (player->unk_280 >= 100) { shot->obj.rot.y = player->unk_0E8 + player->unk_114 + 180.0f + 90.0f; shot->obj.rot.x = RAND_FLOAT(360.0f); - Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); sp88.x = sp88.y = 0.0f; sp88.z = -133.33333f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp88, &sp7C); @@ -1031,7 +1031,7 @@ void func_beam_80038F34(PlayerShot* shot) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; s32 sp48 = 0; - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_beam_8015F950); if ((D_beam_8015F950.z < 0.0f) && (D_beam_8015F950.z > -10000.0f)) { if (fabsf(D_beam_8015F950.x) < (fabsf(D_beam_8015F950.z * 0.5f) + 500.0f)) { @@ -1046,11 +1046,11 @@ void func_beam_80038F34(PlayerShot* shot) { return; } } else { - shot->obj.rot.y = -gPlayer[gPlayerNum].unk_058; - Matrix_RotateY(gGfxMatrix, shot->obj.rot.y, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + shot->obj.rot.y = -gPlayer[gPlayerNum].camYaw; + Matrix_RotateY(gGfxMatrix, shot->obj.rot.y, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); if (shot->obj.id == PLAYERSHOT_7) { - Matrix_Scale(gGfxMatrix, 0.2f, 0.2f, 0.2f, 1); + Matrix_Scale(gGfxMatrix, 0.2f, 0.2f, 0.2f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_40(); @@ -1062,7 +1062,7 @@ void func_beam_80038F34(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_1025800); break; case 2: - Matrix_Scale(gGfxMatrix, 1.5f, 0.7f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.5f, 0.7f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1025800); break; @@ -1081,7 +1081,8 @@ void func_beam_80039210(PlayerShot* shot) { if (gCamCount < 4) { RCP_SetupDL_21(); sp70 = 9.0f; - if ((shot->unk_58 == 0) || ((gCurrentLevel == LEVEL_METEO) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2))) { + if ((shot->unk_58 == 0) || + ((gCurrentLevel == LEVEL_METEO) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO))) { var_fv0 = 4.0f; var_fv1 = 20.0f; } else { @@ -1099,12 +1100,12 @@ void func_beam_80039210(PlayerShot* shot) { if (gCurrentLevel == LEVEL_AQUAS) { sp70 = 4.0f; } - Matrix_Scale(gGfxMatrix, var_fv0, var_fv0, var_fv1, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); - Matrix_Translate(gGfxMatrix, sp70, 0.f, 0.0f, 1); + Matrix_Scale(gGfxMatrix, var_fv0, var_fv0, var_fv1, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, sp70, 0.f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, sp6C); - Matrix_Translate(gGfxMatrix, -(2.0f * sp70), 0.0f, 0.f, 1); + Matrix_Translate(gGfxMatrix, -(2.0f * sp70), 0.0f, 0.f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, sp6C); } else { @@ -1116,7 +1117,7 @@ void func_beam_80039210(PlayerShot* shot) { var_a1 = 2; } } else if (gCurrentLevel == LEVEL_KATINA) { - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) { if (shot->playerNum >= 104) { if (gActors[shot->playerNum - 100].unk_0B6 == 0) { var_a1 = 1; @@ -1131,40 +1132,40 @@ void func_beam_80039210(PlayerShot* shot) { } switch (var_a1) { case 0: - Matrix_Scale(gGfxMatrix, var_fv0, var_fv0, var_fv1, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Scale(gGfxMatrix, var_fv0, var_fv0, var_fv1, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101AED0); break; case 1: - Matrix_Translate(gGfxMatrix, 0.0f, 0.f, 150.0f, 1); - Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.5f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.f, 150.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.5f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101ABD0); break; case 2: - Matrix_Scale(gGfxMatrix, var_fv0, var_fv0, var_fv1, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); - Matrix_Translate(gGfxMatrix, 25.0f, 0.0f, 0.f, 1); + Matrix_Scale(gGfxMatrix, var_fv0, var_fv0, var_fv1, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 25.0f, 0.0f, 0.f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101AED0); sp6C = D_101AED0; - Matrix_Translate(gGfxMatrix, -50.0f, 0.0f, 0.f, 1); + Matrix_Translate(gGfxMatrix, -50.0f, 0.0f, 0.f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, sp6C); break; case 3: Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 50.0f, 0.0f, 150.0f, 1); - Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.5f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Translate(gGfxMatrix, 50.0f, 0.0f, 150.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.5f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101ABD0); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -50.0f, 0.0f, 150.0f, 1); - Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.5f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Translate(gGfxMatrix, -50.0f, 0.0f, 150.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.5f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101ABD0); break; @@ -1186,14 +1187,14 @@ void func_beam_80039210(PlayerShot* shot) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 32, 32, 255, 255); break; } - Matrix_Scale(gGfxMatrix, 6.0f, 4.0f, 10.0f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Scale(gGfxMatrix, 6.0f, 4.0f, 10.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gLaserStrength[shot->playerNum] != LASERS_SINGLE) { - Matrix_Translate(gGfxMatrix, 6.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 6.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_versus_302D120); - Matrix_Translate(gGfxMatrix, -12.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, -12.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_versus_302D120); } else { @@ -1212,7 +1213,7 @@ void func_beam_80039A50(PlayerShot* shot) { f32 var_fv1; s32 sp104 = 0; - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp11C, &D_beam_8015F950); if ((D_beam_8015F950.z < 0.0f) && (D_beam_8015F950.z > -10000.0f)) { var_fv1 = fabsf(D_beam_8015F950.x); // probably fake. The use of temps was likely different @@ -1228,20 +1229,20 @@ void func_beam_80039A50(PlayerShot* shot) { } } else { if ((shot->obj.id == PLAYERSHOT_5) || (shot->obj.id == PLAYERSHOT_6) || (shot->obj.id == PLAYERSHOT_7)) { - shot->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].unk_058); - shot->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].unk_05C); + shot->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); + shot->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].camPitch); } if (shot->obj.id != PLAYERSHOT_2) { - Matrix_RotateY(gGfxMatrix, shot->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, shot->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, shot->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, shot->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, shot->obj.rot.z * M_DTOR, MTXF_APPLY); if ((shot->obj.id == PLAYERSHOT_3) && (shot->unk_5C == 0)) { - Matrix_RotateZ(gGfxMatrix, shot->unk_34 * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, shot->unk_30 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, shot->unk_2C * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, shot->unk_34 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, shot->unk_30 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, shot->unk_2C * M_DTOR, MTXF_APPLY); } } - Matrix_Translate(gGfxMatrix, 0.f, 0.f, D_800C9BD8[shot->obj.id], 1); + Matrix_Translate(gGfxMatrix, 0.f, 0.f, D_800C9BD8[shot->obj.id], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); switch (shot->obj.id) { case PLAYERSHOT_0: @@ -1254,14 +1255,15 @@ void func_beam_80039A50(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_10231A0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, 1); - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); - Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].unk_05C, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 40.0f * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, + MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 40.0f * M_DTOR, MTXF_APPLY); if (((gGameFrameCount % 2) == 0)) { - Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.7f, 1); + Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.7f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, 1); + Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, MTXF_APPLY); } RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); @@ -1286,7 +1288,7 @@ void func_beam_80039A50(PlayerShot* shot) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } else { - Matrix_Scale(gGfxMatrix, shot->unk_44, shot->unk_44, shot->unk_44, 1); + Matrix_Scale(gGfxMatrix, shot->unk_44, shot->unk_44, shot->unk_44, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gVersusMode) { RCP_SetupDL_49(); @@ -1321,17 +1323,17 @@ void func_beam_80039A50(PlayerShot* shot) { D_800C9C08[shot->playerNum], 255); RCP_SetupDL(&gMasterDisp, 0x31); if (gLaserStrength[shot->playerNum] != LASERS_SINGLE) { - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 48.0f * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 48.0f * M_DTOR, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.f, 50.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 70.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Translate(gGfxMatrix, 0.f, 50.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 70.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_versus_301AD60); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -50.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 70.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -50.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 70.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_versus_301AD60); } else { @@ -1340,9 +1342,9 @@ void func_beam_80039A50(PlayerShot* shot) { } else { var_fv1 = 0.0f; } - Matrix_RotateY(gGfxMatrix, var_fv1, 1); - Matrix_RotateZ(gGfxMatrix, 30.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_RotateY(gGfxMatrix, var_fv1, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, 30.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_versus_301AD60); } @@ -1352,9 +1354,9 @@ void func_beam_80039A50(PlayerShot* shot) { } else { var_fv1 = 0.0f; } - Matrix_RotateY(gGfxMatrix, var_fv1, 1); - Matrix_RotateZ(gGfxMatrix, 30.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 0.65f, 1.0f, 1); + Matrix_RotateY(gGfxMatrix, var_fv1, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, 30.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 0.65f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_68(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); @@ -1365,20 +1367,20 @@ void func_beam_80039A50(PlayerShot* shot) { break; case PLAYERSHOT_6: case PLAYERSHOT_7: - Matrix_Scale(gGfxMatrix, shot->unk_44, shot->unk_44, shot->unk_44, 1); + Matrix_Scale(gGfxMatrix, shot->unk_44, shot->unk_44, shot->unk_44, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, D_800C9C00[shot->playerNum], D_800C9C04[shot->playerNum], D_800C9C08[shot->playerNum], 255); if (gLaserStrength[shot->playerNum] != LASERS_SINGLE) { - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 48.0f * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 48.0f * M_DTOR, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.f, 40.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.f, 40.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_versus_301AEF0); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.f, -40.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.f, -40.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_versus_301AEF0); } else { @@ -1386,15 +1388,16 @@ void func_beam_80039A50(PlayerShot* shot) { } break; case PLAYERSHOT_8: - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gCurrentLevel == LEVEL_AQUAS) { RCP_SetupDL(&gMasterDisp, 0x3C); gSPDisplayList(gMasterDisp++, D_AQ_600DB80); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, gGroundLevel, shot->obj.pos.z + D_ctx_80177D20, 1); - Matrix_Scale(gGfxMatrix, shot->unk_2C, shot->unk_30, shot->unk_34, 1); + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, gGroundLevel, shot->obj.pos.z + D_ctx_80177D20, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, shot->unk_2C, shot->unk_30, shot->unk_34, MTXF_APPLY); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 32, 32, 0, shot->unk_58); gDPSetEnvColor(gMasterDisp++, 32, 16, 16, shot->unk_58); @@ -1405,11 +1408,11 @@ void func_beam_80039A50(PlayerShot* shot) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, - 1); - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); - Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].unk_05C, 1); + MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 20.0f, 20.0f, 20.0f, 1); + Matrix_Scale(gGfxMatrix, 20.0f, 20.0f, 20.0f, MTXF_APPLY); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); if (gVersusMode) { @@ -1430,17 +1433,17 @@ void func_beam_80039A50(PlayerShot* shot) { } else { gDPSetEnvColor(gMasterDisp++, 0, 255, 0, 255); } - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 53.0f * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 53.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * -53.0f * 2.0f * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * -53.0f * 2.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); Matrix_Pop(&gGfxMatrix); if (((gGameFrameCount % 2) == 0)) { - Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.7f, 1); + Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.7f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 1.3f, 1.3f, 1.3f, 1); + Matrix_Scale(gGfxMatrix, 1.3f, 1.3f, 1.3f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -1450,13 +1453,14 @@ void func_beam_80039A50(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_10231A0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, 1); - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); - Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].unk_05C, 1); + Matrix_Translate(gGfxMatrix, shot->obj.pos.x, shot->obj.pos.y, shot->obj.pos.z + D_ctx_80177D20, + MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); if (((gGameFrameCount % 2) == 0)) { - Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, 1); + Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); + Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); } RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); @@ -1466,8 +1470,8 @@ void func_beam_80039A50(PlayerShot* shot) { } break; case PLAYERSHOT_9: - Matrix_RotateY(gGfxMatrix, M_PI, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 20.0f, 1); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 20.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_40(); gSPDisplayList(gMasterDisp++, D_GREAT_FOX_E00DFB0); @@ -1501,10 +1505,10 @@ void func_beam_8003B00C(PlayerShot* shot, Player* player) { Vec3f sp38; switch (shot->unk_5C) { case 0: - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; sp5C.z = player->unk_0D0 + 200.0f; @@ -1605,9 +1609,9 @@ void func_beam_8003B55C(PlayerShot* shot, s32 index) { if ((gCamCount != 4) && (gCurrentLevel != LEVEL_AQUAS)) { if ((shot->playerNum == 0) && (gLaserStrength[0] != LASERS_SINGLE) && (gPlayer[0].form != FORM_LANDMASTER)) { - Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, shot->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, shot->obj.rot.z * M_DTOR, MTXF_APPLY); sp44.y = sp44.z = 0.0f; sp44.x = 40.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); @@ -1708,8 +1712,8 @@ bool func_beam_8003BB4C(PlayerShot* shot) { } if (gVersusMode) { for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { - if ((player->state_1C8 == PLAYERSTATE_1C8_3) && (player->unk_4DC == 0) && (player->form != FORM_ON_FOOT) && - (i != shot->playerNum) && (D_ctx_80177B00[i][shot->playerNum] == 0) && + if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->unk_4DC == 0) && + (player->form != FORM_ON_FOOT) && (i != shot->playerNum) && (D_ctx_80177B00[i][shot->playerNum] == 0) && (fabsf(shot->obj.pos.x - player->pos.x) <= var_fa0) && (fabsf(shot->obj.pos.y - player->pos.y) <= var_fa0) && (fabsf(shot->obj.pos.z - player->unk_138) <= var_fa0)) { @@ -1773,17 +1777,17 @@ void func_beam_8003C008(PlayerShot* shot) { if (count != 0) { for (j = 0; j < count; j++, hitboxData += 6) { if (hitboxData[0] == HITBOX_ROTATED) { - Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, MTXF_APPLY); hitboxData += 4; } else { - Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, MTXF_APPLY); } if ((j == var_s6) && (hitboxData[1] > -100.0f) && (hitboxData[3] > -100.0f)) { sp8C.x = shot->obj.pos.x - boss->obj.pos.x; @@ -1961,7 +1965,7 @@ void func_beam_8003C4D0(PlayerShot* shot, s32 damage) { } if (gVersusMode) { for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { - if ((i != shot->playerNum) && (player->state_1C8 == PLAYERSTATE_1C8_3) && (player->unk_1F4 == 0)) { + if ((i != shot->playerNum) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->unk_1F4 == 0)) { sp68 = player->pos.x - shot->obj.pos.x; sp64 = player->pos.y - shot->obj.pos.y; sp60 = player->unk_138 - shot->obj.pos.z; @@ -2026,8 +2030,8 @@ void func_beam_8003CC08(PlayerShot* shot) { shot->obj.rot.y += 1.0f; Math_SmoothStepToF(&shot->unk_44, shot->unk_48, 0.05f, 1.5f, 0.001f); if ((shot->unk_64 > 0) && (shot->unk_64 < 30)) { - if (!gVersusMode && - ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5))) { + if (!gVersusMode && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { test.x = gPlayer[0].pos.x - shot->obj.pos.x; test.y = gPlayer[0].pos.y - shot->obj.pos.y; test.z = gPlayer[0].unk_138 - shot->obj.pos.z; @@ -2091,7 +2095,7 @@ void func_beam_8003CF90(PlayerShot* shot) { } } for (i = 0, player = gPlayer; i < gCamCount; i++, player++) { - if (((player->state_1C8 == PLAYERSTATE_1C8_3) || (player->state_1C8 == PLAYERSTATE_1C8_5)) && + if (((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_U_TURN)) && (D_ctx_80177B00[i][shot->playerNum] != 0)) { var_a3 = 1; D_ctx_80177B00[i][shot->playerNum] = 2; @@ -2141,8 +2145,8 @@ void func_beam_8003CF90(PlayerShot* shot) { shot->obj.rot.y = shot->unk_30; shot->obj.rot.x = shot->unk_2C; - Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); sp44.x = sp44.y = 0.0f; sp44.z = -(shot->unk_54 + 40.0f); Matrix_MultVec3f(gCalcMatrix, &sp44, &sp38); @@ -2253,7 +2257,7 @@ void func_beam_8003D854(PlayerShot* shot) { break; case PLAYERSHOT_0: case PLAYERSHOT_1: - if ((shot->unk_58 == 0) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2)) { + if ((shot->unk_58 == 0) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO)) { var_s5 = 4; } else { var_s5 = 3; diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index e40fcb1b..dc7dc243 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -262,7 +262,7 @@ void func_bg_8003E1E8(void) { sp11C = gCurrentLevel; Matrix_Push(&gGfxMatrix); if (D_ctx_80177C70 == 2) { - Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, MTXF_APPLY); } switch (var_s0) { case LEVELTYPE_PLANET: @@ -272,14 +272,14 @@ void func_bg_8003E1E8(void) { case LEVEL_KATINA: case LEVEL_VENOM_2: case LEVEL_VERSUS: - sp134 = (gPlayer[gPlayerNum].unk_05C * -6000.0f) - (gPlayer[gPlayerNum].camEye.y * 0.4f); - sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].unk_058) * (-7280.0f / 360.0f) * 5.0f, 7280.0f); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, sp13C, -2000.0f + sp134, -6000.0f, 1); + sp134 = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.4f); + sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f, 7280.0f); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, sp13C, -2000.0f + sp134, -6000.0f, MTXF_APPLY); if (gCurrentLevel == LEVEL_FORTUNA) { - Matrix_Translate(gGfxMatrix, 0.0f, -2000.0f, 0, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -2000.0f, 0, MTXF_APPLY); } else if (gCurrentLevel == LEVEL_KATINA) { - Matrix_Translate(gGfxMatrix, 0.0f, -2500.0f, 0, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -2500.0f, 0, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); switch (gCurrentLevel) { @@ -302,7 +302,7 @@ void func_bg_8003E1E8(void) { gSPDisplayList(gMasterDisp++, D_VE2_600F670); break; } - Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); switch (gCurrentLevel) { case LEVEL_VERSUS: @@ -327,10 +327,10 @@ void func_bg_8003E1E8(void) { break; case LEVEL_CORNERIA: case LEVEL_VENOM_1: - sp134 = (gPlayer[gPlayerNum].unk_05C * -6000.0f) - (gPlayer[gPlayerNum].camEye.y * 0.6f); - sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].unk_058) * (-7280.0f / 360.0f) * 5.0f, 7280.0f); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, sp13C, -2000.0f + sp134, -6000.0f, 1); + sp134 = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f); + sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f, 7280.0f); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, sp13C, -2000.0f + sp134, -6000.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); switch (gCurrentLevel) { case LEVEL_CORNERIA: @@ -340,7 +340,7 @@ void func_bg_8003E1E8(void) { gSPDisplayList(gMasterDisp++, D_VE1_60046F0); break; } - Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); switch (gCurrentLevel) { case LEVEL_CORNERIA: @@ -354,8 +354,8 @@ void func_bg_8003E1E8(void) { case LEVEL_VENOM_ANDROSS: if (D_ctx_80177AB0 != 6) { if ((D_ctx_80177AB0 == 2) || (D_ctx_80177AB0 == 7)) { - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, 0.0f, -4000.0f, -7000.0f, 1); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, -4000.0f, -7000.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE2_600F670); } else if ((D_ctx_80177AB0 == 3) || (D_ctx_80177AB0 == 4)) { @@ -372,15 +372,15 @@ void func_bg_8003E1E8(void) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, (s32) D_bg_80161394, (s32) D_bg_80161394, (s32) D_bg_800C9C30); - sp134 = (gPlayer[gPlayerNum].unk_05C * -6000.0f) - (gPlayer[gPlayerNum].camEye.y * 0.4f); - sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].unk_058) * (-7280.0f / 360.0f) * 5.0f, + sp134 = (gPlayer[gPlayerNum].camPitch * -6000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.4f); + sp13C = Math_ModF(Math_RadToDeg(gPlayer[gPlayerNum].camYaw) * (-7280.0f / 360.0f) * 5.0f, 7280.0f); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, sp13C, -2000.0f + sp134, -6000.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, -2500.0f, 0.0f, 1); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, sp13C, -2000.0f + sp134, -6000.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, -2500.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE2_60038E0); - Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 7280.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE2_60038E0); } else { @@ -391,18 +391,19 @@ void func_bg_8003E1E8(void) { } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 255, 128, (s32) D_bg_800C9C30); } - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -290.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -290.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 11.0f, 11.0f, 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, (gPlayer[0].unk_034 + (gGameFrameCount * 1.5f)) * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, 11.0f, 11.0f, 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (gPlayer[0].camRoll + (gGameFrameCount * 1.5f)) * M_DTOR, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C039208); Matrix_Pop(&gGfxMatrix); if (D_ctx_80177AB0 != 5) { Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, (gPlayer[0].unk_034 + (gGameFrameCount * -1.3f)) * M_DTOR, - 1); + Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (gPlayer[0].camRoll + (gGameFrameCount * -1.3f)) * M_DTOR, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C039208); Matrix_Pop(&gGfxMatrix); @@ -411,17 +412,17 @@ void func_bg_8003E1E8(void) { } break; case LEVEL_AQUAS: - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { - sp13C = ((Math_RadToDeg(gPlayer[gPlayerNum].unk_058) - gPlayer[gPlayerNum].unk_114)); - sp134 = (gPlayer[gPlayerNum].unk_05C * -7000.0f) - (gPlayer[gPlayerNum].camEye.y * 0.6f); + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { + sp13C = ((Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].unk_114)); + sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f); sp13C = Math_ModF(sp13C * -40.44444f * 2.0f, 7280.0f); // close to 7280.0f / 180.0f RCP_SetupDL_17(); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, sp13C, sp134, -7000.0f, 1); + Matrix_Translate(gGfxMatrix, sp13C, sp134, -7000.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { gSPDisplayList(gMasterDisp++, D_AQ_601AFF0); } else { gSPDisplayList(gMasterDisp++, D_AQ_601C080); @@ -432,9 +433,9 @@ void func_bg_8003E1E8(void) { } else { sp13C = -1.0f; } - Matrix_Translate(gGfxMatrix, 7280.0f * sp13C, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 7280.0f * sp13C, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { gSPDisplayList(gMasterDisp++, D_AQ_601AFF0); } else { @@ -447,29 +448,29 @@ void func_bg_8003E1E8(void) { case LEVEL_ZONESS: case LEVEL_MACBETH: case LEVEL_TITANIA: - sp12C = Math_RadToDeg(gPlayer[gPlayerNum].unk_058) - gPlayer[gPlayerNum].unk_114; - sp134 = (gPlayer[gPlayerNum].unk_05C * -7000.0f) - (gPlayer[gPlayerNum].camEye.y * 0.6f); + sp12C = Math_RadToDeg(gPlayer[gPlayerNum].camYaw) - gPlayer[gPlayerNum].unk_114; + sp134 = (gPlayer[gPlayerNum].camPitch * -7000.0f) - (gPlayer[gPlayerNum].cam.eye.y * 0.6f); sp13C = sp12C * -40.44444f * 2.0f; // close to 7280.0f / 180.0f - if ((gCurrentLevel == LEVEL_TITANIA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) && + if ((gCurrentLevel == LEVEL_TITANIA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].unk_1D0 < 3)) { - D_bg_8015F968 += __sinf(gPlayer[0].unk_058) * 20.0f; + D_bg_8015F968 += __sinf(gPlayer[0].camYaw) * 20.0f; sp13C += D_bg_8015F968; } - if ((gCurrentLevel == LEVEL_SOLAR) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) && - (gPlayer[0].unk_1D0 >= 2) && (gPlayer[0].camEye.z <= -1900.0f)) { - D_bg_8015F968 = __sinf(gPlayer[0].unk_05C) * 7000.0f; + if ((gCurrentLevel == LEVEL_SOLAR) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && + (gPlayer[0].unk_1D0 >= 2) && (gPlayer[0].cam.eye.z <= -1900.0f)) { + D_bg_8015F968 = __sinf(gPlayer[0].camPitch) * 7000.0f; sp134 -= fabsf(D_bg_8015F968); } sp13C = Math_ModF(sp13C, 7280.0f); RCP_SetupDL_17(); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY); if ((gCurrentLevel == LEVEL_TITANIA) || (gCurrentLevel == LEVEL_ZONESS)) { - Matrix_Translate(gGfxMatrix, sp13C, -3000.0f + sp134, -7000.0f, 1); + Matrix_Translate(gGfxMatrix, sp13C, -3000.0f + sp134, -7000.0f, MTXF_APPLY); } else if (gCurrentLevel == LEVEL_SOLAR) { - Matrix_Translate(gGfxMatrix, sp13C, -3500.0f + sp134, -7000.0f, 1); + Matrix_Translate(gGfxMatrix, sp13C, -3500.0f + sp134, -7000.0f, MTXF_APPLY); } else if (gCurrentLevel == LEVEL_MACBETH) { - Matrix_Translate(gGfxMatrix, sp13C, -4000.0f + sp134, -7000.0f, 1); + Matrix_Translate(gGfxMatrix, sp13C, -4000.0f + sp134, -7000.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); if (gCurrentLevel == LEVEL_TITANIA) { @@ -486,7 +487,7 @@ void func_bg_8003E1E8(void) { } else { sp13C = -1.0f; } - Matrix_Translate(gGfxMatrix, 7280.0f * sp13C, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 7280.0f * sp13C, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gCurrentLevel == LEVEL_TITANIA) { gSPDisplayList(gMasterDisp++, D_TI_6000A80); @@ -501,10 +502,10 @@ void func_bg_8003E1E8(void) { } break; case LEVELTYPE_SPACE: - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_8) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ENTER_WARP_ZONE) { Matrix_Push(&gGfxMatrix); - sp12C = Math_RadToDeg(gPlayer[0].unk_058); - sp130 = Math_RadToDeg(gPlayer[0].unk_05C); + sp12C = Math_RadToDeg(gPlayer[0].camYaw); + sp130 = Math_RadToDeg(gPlayer[0].camPitch); if (((sp12C < 45.0f) || (sp12C > 315.0f)) && ((sp130 < 40.0f) || (sp130 > 325.0f))) { RCP_SetupDL_36(); sp138 = D_ctx_80178420; @@ -525,7 +526,7 @@ void func_bg_8003E1E8(void) { sp138 = Math_ModF(sp138 - 34.5f, 480.0f); sp134 = Math_ModF(sp134 + 19.0f, 360.0f); } else if (sp11C == LEVEL_BOLSE) { - if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) || (gPlayer[0].unk_1D0 < 10)) { + if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].unk_1D0 < 10)) { sp134 = Math_ModF(sp134 + 360.0f - 100.0f, 360.0f); } } else { @@ -538,41 +539,43 @@ void func_bg_8003E1E8(void) { if ((sp130 > 180.0f) && (sp134 > 280.0f)) { sp134 = -(360.0f - sp134); } - Matrix_RotateZ(gGfxMatrix, D_ctx_80178428, 1); + Matrix_RotateZ(gGfxMatrix, D_ctx_80178428, MTXF_APPLY); switch (sp11C) { case LEVEL_WARP_ZONE: if ((s32) D_bg_8015F960 != 0) { RCP_SetupDL_62(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_bg_8015F960); - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, 1); - Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.07f, 0.93f, 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 10.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.07f, 0.93f, 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.07f, 0.93f, 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.07f, 0.93f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_WZ_7001540); Matrix_Pop(&gGfxMatrix); } break; case LEVEL_METEO: - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) && (gCsFrameCount > 260)) { - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 30.0f, -290.0f, 1); - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, 1); + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gCsFrameCount > 260)) { + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 30.0f, -290.0f, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600DDF0); } else if (D_ctx_80177D20 > 185668.0f) { - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 130.0f, -290.0f, 1); - Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f) - 130.0f, -290.0f, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600DDF0); } break; case LEVEL_SECTOR_X: if (gOverlayStage == 0) { - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_62(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 192); @@ -580,8 +583,8 @@ void func_bg_8003E1E8(void) { } break; case LEVEL_TRAINING: - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, 1); - Matrix_Scale(gGfxMatrix, 0.2f, 0.2f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.2f, 0.2f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_62(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); @@ -593,15 +596,15 @@ void func_bg_8003E1E8(void) { if (sp128 > 3.5f) { sp128 = 3.5f; } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { sp128 = D_bg_8015F984; if (sp128 > 3.5f) { sp128 = 3.5f; } } sp128 = sp128; - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, 1); - Matrix_Scale(gGfxMatrix, sp128 * 0.75, sp128 * 0.75f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp128 * 0.75, sp128 * 0.75f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_A6_601BB40); break; @@ -610,31 +613,31 @@ void func_bg_8003E1E8(void) { if ((gCsFrameCount > 400) && (gNextPlanetPath == 0)) { sp128 = 0.75f; } - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, 1); - Matrix_Scale(gGfxMatrix, sp128, sp128, sp128, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp128, sp128, sp128, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_FO_600B4B0); break; case LEVEL_BOLSE: sp128 = 1.0f; - if ((gCsFrameCount > 500) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7)) { + if ((gCsFrameCount > 500) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { sp128 = 1.3f; } - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, 1); - Matrix_Scale(gGfxMatrix, sp128, sp128, sp128, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp128, sp128, sp128, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BO_600D190); break; case LEVEL_SECTOR_Z: - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, 1); - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SZ_6002F80); break; case LEVEL_SECTOR_Y: - Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, 1); - Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_62(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 192); @@ -657,9 +660,10 @@ void func_bg_8003E1E8(void) { *sp50 = RAND_FLOAT_SEEDED(480.0f) - 80.0f; *sp4C = RAND_FLOAT_SEEDED(360.0f) - 60.0f; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, (*sp50 - 160.0f) * 10.0f, (*sp4C - 120.0f) * 10.0f, -5000.0f, 1); - Matrix_RotateZ(gGfxMatrix, sp48, 1); - Matrix_Scale(gGfxMatrix, 10.0f, 1.0f, -D_ctx_80178414, 1); + Matrix_Translate(gGfxMatrix, (*sp50 - 160.0f) * 10.0f, (*sp4C - 120.0f) * 10.0f, -5000.0f, + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, sp48, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 10.0f, 1.0f, -D_ctx_80178414, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80); Matrix_Pop(&gGfxMatrix); @@ -689,21 +693,21 @@ void func_bg_80040450(void) { if (gPlayerFillScreenAlphas[gPlayerNum] > 300) { gPlayerFillScreenAlphas[gPlayerNum] = 0; } - if (((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2)) || - (((gPlayer[gPlayerNum].state_1C8 == PLAYERSTATE_1C8_5) || (gLevelMode == LEVELMODE_ALL_RANGE) || - (gPlayer[gPlayerNum].state_1C8 == PLAYERSTATE_1C8_7)) && + if (((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO)) || + (((gPlayer[gPlayerNum].state_1C8 == PLAYERSTATE_1C8_U_TURN) || (gLevelMode == LEVELMODE_ALL_RANGE) || + (gPlayer[gPlayerNum].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) && (gLevelType == LEVELTYPE_PLANET) && (gCurrentLevel != LEVEL_TITANIA) && (gCurrentLevel != LEVEL_AQUAS))) { gPlayerFillScreenReds[gPlayerNum] = 128; gPlayerFillScreenGreens[gPlayerNum] = 128; gPlayerFillScreenBlues[gPlayerNum] = 128; - sp44 = Math_RadToDeg(gPlayer[gPlayerNum].unk_058); - var_fa0 = Math_RadToDeg(gPlayer[gPlayerNum].unk_05C); + sp44 = Math_RadToDeg(gPlayer[gPlayerNum].camYaw); + var_fa0 = Math_RadToDeg(gPlayer[gPlayerNum].camPitch); if (var_fa0 > 180.0f) { var_fa0 -= 360.0f; } sp44 -= 135.0f; D_ctx_801783D0 = -sp44 * 3.2f; - D_ctx_801783D4 = ((-var_fa0 * 3.2f) + 130.0f) - ((gPlayer[gPlayerNum].camEye.y - 350.0f) * 0.015f); + D_ctx_801783D4 = ((-var_fa0 * 3.2f) + 130.0f) - ((gPlayer[gPlayerNum].cam.eye.y - 350.0f) * 0.015f); if (gCurrentLevel == LEVEL_KATINA) { D_ctx_801783D4 -= 80.0f; } @@ -720,8 +724,8 @@ void func_bg_80040450(void) { } if (gPlayerFillScreenAlphas[gPlayerNum] != 0) { Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, 1); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, MTXF_APPLY); RCP_SetupDL_62(); var_s1 = D_bg_800C9D94; var_s2 = D_bg_800C9DE4; @@ -735,7 +739,7 @@ void func_bg_80040450(void) { } for (i = 0; i < 5; i++, var_s1++, var_s2++, var_s3++, var_s4++) { Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, *var_s4, *var_s4, *var_s4, 1); + Matrix_Scale(gGfxMatrix, *var_s4, *var_s4, *var_s4, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, var_s1->r, var_s1->g, var_s1->b, *var_s2); gSPDisplayList(gMasterDisp++, *var_s3); @@ -767,8 +771,8 @@ void func_bg_80040954(void) { } var_fs2 *= D_bg_800C9E5C[gLevelType]; Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].unk_034 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, 1); + Matrix_RotateZ(gGfxMatrix, gPlayer[gPlayerNum].camRoll * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, MTXF_APPLY); RCP_SetupDL_62(); temp_fs0 = D_ctx_801783D0 * -0.03f; temp_fs1 = D_ctx_801783D4 * 0.03f; @@ -786,10 +790,10 @@ void func_bg_80040954(void) { } for (i = 5; i < 13; i++, var_s1++, var_s4++, var_s5++, var_s6++, var_s7++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, *var_s7 * temp_fs0, *var_s7 * -temp_fs1, 0.0f, 1); - Matrix_Scale(gGfxMatrix, *var_s6, *var_s6, *var_s6, 1); + Matrix_Translate(gGfxMatrix, *var_s7 * temp_fs0, *var_s7 * -temp_fs1, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, *var_s6, *var_s6, *var_s6, MTXF_APPLY); if (((i == 5) || (i == 11)) && (gCurrentLevel != LEVEL_KATINA)) { - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); var_fv0 = *var_s4; @@ -814,7 +818,7 @@ void func_bg_80040CE4(void) { u16* sp1C4; Gfx* sp1C0; - if ((gCurrentLevel != LEVEL_VENOM_2) && ((gPlayer[0].camEye.y > 4000.0f) || (D_ctx_80177A98 == 0))) { + if ((gCurrentLevel != LEVEL_VENOM_2) && ((gPlayer[0].cam.eye.y > 4000.0f) || (D_ctx_80177A98 == 0))) { return; } if ((gCurrentLevel == LEVEL_BOLSE) && (D_bg_800C9C34 != 0)) { @@ -842,10 +846,10 @@ void func_bg_80040CE4(void) { sp1B4.x = 0; sp1B4.y = 0; sp1B4.z = -5500.0f; - Matrix_RotateY(gCalcMatrix, -gPlayer[gPlayerNum].unk_058, 0); + Matrix_RotateY(gCalcMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp1B4, &sp1A8); - temp_fv1 = gPlayer[gPlayerNum].camEye.x + sp1A8.x; - temp_fa0 = gPlayer[gPlayerNum].camEye.z + sp1A8.z; + temp_fv1 = gPlayer[gPlayerNum].cam.eye.x + sp1A8.x; + temp_fa0 = gPlayer[gPlayerNum].cam.eye.z + sp1A8.z; if (temp_fv1 > 6000.0f) { gPlayer[gPlayerNum].unk_0AC = 12000.0f; } @@ -872,9 +876,9 @@ void func_bg_80040CE4(void) { } } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].unk_0AC, -3.0f + gCameraShakeY, sp1D4, 1); + Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].unk_0AC, -3.0f + gCameraShakeY, sp1D4, MTXF_APPLY); if (D_ctx_80177C70 == 2) { - Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); switch (gCurrentLevel) { @@ -907,13 +911,13 @@ void func_bg_80040CE4(void) { break; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_601B640); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_601B640); } else { @@ -921,7 +925,7 @@ void func_bg_80040CE4(void) { gBgColor = 0x845; // 8, 8, 32 for (i = 0; i < 4; i++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_bg_800C9E64[i], 0.0f, D_bg_800C9E74[i], 1); + Matrix_Translate(gGfxMatrix, D_bg_800C9E64[i], 0.0f, D_bg_800C9E74[i], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_601EAA0); Matrix_Pop(&gGfxMatrix); @@ -953,14 +957,14 @@ void func_bg_80040CE4(void) { gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, sp1C0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, sp1C0); Matrix_Pop(&gGfxMatrix); @@ -972,23 +976,23 @@ void func_bg_80040CE4(void) { D_ctx_80177CE8 -= 290.0f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f + D_ctx_80177CE8, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f + D_ctx_80177CE8, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TR_6005880); Matrix_Pop(&gGfxMatrix); if (1) {} Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f + D_ctx_80177CE8, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f + D_ctx_80177CE8, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TR_6005880); Matrix_Pop(&gGfxMatrix); } else { for (i = 0; i < 4; i++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_bg_800C9E64[i], 0.0f, D_bg_800C9E74[i], 1); - Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, D_bg_800C9E64[i], 0.0f, D_bg_800C9E74[i], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TR_6005880); Matrix_Pop(&gGfxMatrix); @@ -1010,14 +1014,14 @@ void func_bg_80040CE4(void) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, sp1C0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 3000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, sp1C0); Matrix_Pop(&gGfxMatrix); @@ -1035,22 +1039,22 @@ void func_bg_80040CE4(void) { } else { RCP_SetupDL(&gMasterDisp, 0x25); } - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) && (gPlayer[0].unk_1D0 < 2)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gPlayer[0].unk_1D0 < 2)) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); - } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { + } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, D_bg_8015F974, D_bg_8015F978, D_bg_8015F97C, D_bg_8015F980); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_AQ_801C4188); } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, D_bg_8015F970, -3000.0f, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, D_bg_8015F970, -3000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_602AC40); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, D_bg_8015F970, 3000.0f, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, D_bg_8015F970, 3000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_602AC40); } @@ -1066,7 +1070,7 @@ void func_bg_80040CE4(void) { } for (i = 0; i < 4; i++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_bg_800C9E64[i], 0.0f, D_bg_800C9E74[i], 1); + Matrix_Translate(gGfxMatrix, D_bg_800C9E64[i], 0.0f, D_bg_800C9E74[i], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gCurrentLevel == LEVEL_FORTUNA) { gSPDisplayList(gMasterDisp++, D_FO_6001360); @@ -1088,7 +1092,7 @@ void func_bg_80040CE4(void) { } for (i = 0; i < 4; i++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_bg_800C9E64[i], 0.0f, D_bg_800C9E74[i], 1); + Matrix_Translate(gGfxMatrix, D_bg_800C9E64[i], 0.0f, D_bg_800C9E74[i], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gVersusStage == VS_STAGE_CORNERIA) { gSPDisplayList(gMasterDisp++, D_versus_3018800); @@ -1100,8 +1104,8 @@ void func_bg_80040CE4(void) { break; case LEVEL_SOLAR: RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -2000.0f, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 2.0f, 3.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -2000.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 2.0f, 3.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((gGameFrameCount % 2) != 0) { gSPDisplayList(gMasterDisp++, D_SO_60005B0); @@ -1111,8 +1115,8 @@ void func_bg_80040CE4(void) { break; case LEVEL_ZONESS: RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -1500.0f, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 2.0f, 3.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -1500.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 2.0f, 3.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((gGameFrameCount % 2) != 0) { gSPDisplayList(gMasterDisp++, D_ZO_6008830); @@ -1128,15 +1132,15 @@ void func_bg_80042D38(void) { f32 xEye; f32 zEye; - if (!gPlayer[gPlayerNum].camEye.x) {} - if (!gPlayer[gPlayerNum].camEye.y) {} // all sorts of fake + if (!gPlayer[gPlayerNum].cam.eye.x) {} + if (!gPlayer[gPlayerNum].cam.eye.y) {} // all sorts of fake Matrix_Push(&gGfxMatrix); - xEye = gPlayer[gPlayerNum].camEye.x; + xEye = gPlayer[gPlayerNum].cam.eye.x; if (0) {} - zEye = gPlayer[gPlayerNum].camEye.z; - Matrix_Translate(gGfxMatrix, xEye, 2.0f + gCameraShakeY, zEye, 1); - Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, 1); + zEye = gPlayer[gPlayerNum].cam.eye.z; + Matrix_Translate(gGfxMatrix, xEye, 2.0f + gCameraShakeY, zEye, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY); RCP_SetupDL_37(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 125); Matrix_SetGfxMtx(&gMasterDisp); diff --git a/src/engine/fox_boss.c b/src/engine/fox_boss.c index 9ba48bab..7244529d 100644 --- a/src/engine/fox_boss.c +++ b/src/engine/fox_boss.c @@ -108,7 +108,7 @@ void func_boss_8004319C(Player* player, f32 arg1, f32 arg2, f32 arg3) { D_ctx_80178440 = arg1; D_ctx_80178444 = arg2; - player->state_1C8 = PLAYERSTATE_1C8_7; + player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; player->unk_1D0 = 10; player->timer_1F8 = 50; player->timer_1FC = 50; diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c index 06f607d1..c42f9adf 100644 --- a/src/engine/fox_context.c +++ b/src/engine/fox_context.c @@ -164,7 +164,7 @@ f32 D_ctx_80178470[3]; f32 gCameraShakeY; s32 gCameraShake; s32 D_ctx_80178484; -bool D_ctx_80178488; +bool gLoadLevelObjects; UNK_TYPE F_8017848C; UNK_TYPE F_80178490; s32 D_ctx_80178494; diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index fcd01d5e..0d8e55ff 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -183,7 +183,7 @@ void func_demo_80048CC4(Actor* actor, s32 arg1) { } } -void func_demo_80048E40(Player* player) { +void Cutscene_WarpZoneComplete(Player* player) { Vec3f sp5C; Vec3f sp50; s32 pad[2]; @@ -198,7 +198,7 @@ void func_demo_80048E40(Player* player) { Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->unk_110, 0.0f, 0.1f, 3.0f, 0.0f); @@ -210,7 +210,7 @@ void func_demo_80048E40(Player* player) { D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 0.0f; - player->wings.unk_2C = 1; + player->wings.modelId = 1; gCsFrameCount = 0; /* fallthrough */ case 1: @@ -218,8 +218,8 @@ void func_demo_80048E40(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[2], 1.2f, 0.1f, 0.01f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 0.1f, 0.002f, 0.0f); Math_SmoothStepToF(&player->unk_0D0, 0.0f, 1.0f, 0.5f, 0.0f); - Matrix_RotateX(gCalcMatrix, -5.0f * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -5.0f * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; sp5C.z = 300.0f; @@ -288,7 +288,7 @@ void func_demo_80048E40(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; if (gCurrentLevel == LEVEL_METEO) { @@ -308,14 +308,14 @@ void func_demo_80048E40(Player* player) { break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; @@ -369,8 +369,8 @@ void func_demo_80049630(Actor* actor) { } break; } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); sp3C.x = 0.0f; sp3C.y = 0.0f; @@ -445,7 +445,7 @@ void func_demo_80049B44(void) { } } -void func_demo_80049C0C(Player* player) { +void Cutscene_EnterWarpZone(Player* player) { s32 var_v0; s32 pad[4]; @@ -468,10 +468,10 @@ void func_demo_80049C0C(Player* player) { Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->pos.x, 0.0f, 0.1f, 50.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 0.0f, 0.1f, 50.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.x, 0.0f, 0.1f, 50.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, 0.0f, 0.1f, 50.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, 0.0f, 0.1f, 50.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, 0.0f, 0.1f, 50.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, 0.0f, 0.1f, 50.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, 0.0f, 0.1f, 50.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, 0.0f, 0.1f, 50.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, 0.0f, 0.1f, 50.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); switch (player->unk_1D0) { @@ -480,7 +480,7 @@ void func_demo_80049C0C(Player* player) { D_ctx_80178414 = 100.0f; player->unk_1D0 = 1; D_ctx_80178410 = 1; - D_ctx_80178488 = 0; + gLoadLevelObjects = 0; player->vel.x = 0.0f; player->vel.y = 0.0f; player->vel.z = -500.0f; @@ -502,7 +502,7 @@ void func_demo_80049C0C(Player* player) { case 1: Math_SmoothStepToF(&D_ctx_801779A8[player->num], 100.0f, 1.0f, 4.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); D_ctx_80178414 *= 1.05f; if (player->timer_1F8 == 0) { player->unk_1D0 = 2; @@ -568,7 +568,7 @@ void func_demo_80049C0C(Player* player) { case 4: Math_SmoothStepToF(&D_ctx_801779A8[player->num], 100.0f, 1.0f, 3.0f, 0.0f); - player->unk_034 -= 0.5f; + player->camRoll -= 0.5f; if (player->timer_1F8 == 0) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; gFillScreenAlphaTarget = 255; @@ -579,7 +579,7 @@ void func_demo_80049C0C(Player* player) { player->timer_1F8 = 10; player->unk_08C = -10000.0f; player->unk_0AC = player->unk_0B8 = player->unk_0B0 = player->unk_0BC = player->pos.x = - player->pos.y = player->pos.z = player->unk_130 = player->unk_034 = player->unk_138 = + player->pos.y = player->pos.z = player->unk_130 = player->camRoll = player->unk_138 = player->vel.z = player->unk_144 = D_ctx_80177D20 = player->unk_144 = D_ctx_80177CB0 = D_ctx_80177D20 = 0.0f; @@ -623,14 +623,14 @@ void func_demo_80049C0C(Player* player) { if (player->timer_1F8 == 0) { D_bg_8015F960 = 0.0f; D_ctx_80178414 = 0.0f; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0f; player->unk_018 = 0.0f; D_ctx_801782B8 = 0; - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; } - Math_SmoothStepToF(&player->camEye.y, (player->pos.y * player->unk_148) + 50.0f, 0.2f, 15.0f, 0.01f); - Math_SmoothStepToF(&player->camAt.y, (player->pos.y * player->unk_14C) + 20.0f, 0.2f, 15.0f, 0.01f); + Math_SmoothStepToF(&player->cam.eye.y, (player->pos.y * player->unk_148) + 50.0f, 0.2f, 15.0f, 0.01f); + Math_SmoothStepToF(&player->cam.at.y, (player->pos.y * player->unk_14C) + 20.0f, 0.2f, 15.0f, 0.01f); break; default: @@ -638,7 +638,7 @@ void func_demo_80049C0C(Player* player) { } } -void func_demo_8004A52C(Player* player) { +void Cutscene_LevelStart(Player* player) { gCsFrameCount += 1; if (gLevelMode == LEVELMODE_ON_RAILS) { switch (gCurrentLevel) { @@ -694,7 +694,7 @@ void func_demo_8004A52C(Player* player) { } switch (gCurrentLevel) { case LEVEL_FORTUNA: - func_360_8002ED60(player); + AllRange_FortunaIntro(player); func_play_800AA800(player); break; @@ -748,8 +748,8 @@ void func_demo_8004A888(Effect* effect) { Vec3f sp2C; Vec3f sp20; - Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(gPlayer[0].unk_0E4 * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(gPlayer[0].unk_0E4 * M_DTOR), MTXF_APPLY); Effect_Initialize(effect); effect->obj.status = OBJ_INIT; @@ -795,7 +795,7 @@ void func_demo_8004AA84(void) { } } -void func_demo_8004AAF4(Player* player) { +void Cutscene_AllRangeMode(Player* player) { s32 pad; Vec3f sp70; Vec3f sp64; @@ -832,7 +832,7 @@ void func_demo_8004AAF4(Player* player) { Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 1.0f, 0.0f); Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->unk_110, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 3.0f, 0.0f); @@ -843,7 +843,7 @@ void func_demo_8004AAF4(Player* player) { D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 60.0f; D_ctx_80177A48[3] = 0.0f; - player->wings.unk_2C = 1; + player->wings.modelId = 1; player->unk_1D0++; gCsFrameCount = 0; /* fallthrough */ @@ -873,7 +873,7 @@ void func_demo_8004AAF4(Player* player) { } if (D_ctx_80177A48[1] > 350.0f) { - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0f; player->unk_018 = 0.1f; player->unk_194 = 10.0f; @@ -898,8 +898,8 @@ void func_demo_8004AAF4(Player* player) { } } - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, MTXF_APPLY); sp70.x = 0.0f; sp70.y = 0.0f; @@ -911,17 +911,17 @@ void func_demo_8004AAF4(Player* player) { sp64.x *= -1.0f; } Math_SmoothStepToF(&D_ctx_80177A48[0], 0.1f, 1.0f, 0.005f, 0.0f); - Math_SmoothStepToF(&player->camEye.x, player->pos.x + sp64.x, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, player->pos.y + sp64.y, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, player->unk_138 + D_ctx_80177D20 + sp64.z, D_ctx_80177A48[0], 500.0f, + Math_SmoothStepToF(&player->cam.eye.x, player->pos.x + sp64.x, D_ctx_80177A48[0], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + sp64.y, D_ctx_80177A48[0], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, player->unk_138 + D_ctx_80177D20 + sp64.z, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, player->pos.x, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, player->pos.y, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, player->unk_138 + D_ctx_80177D20, D_ctx_80177A48[0], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, player->pos.x, D_ctx_80177A48[0], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, player->pos.y, D_ctx_80177A48[0], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, player->unk_138 + D_ctx_80177D20, D_ctx_80177A48[0], 500.0f, 0.0f); break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); sp70.x = 0.0f; sp70.y = 0.0f; @@ -936,8 +936,8 @@ void func_demo_8004AAF4(Player* player) { player->pos.y += player->vel.y; player->pos.z += player->vel.z; player->unk_138 = player->pos.z + player->unk_08C; - player->camAt.z += player->vel.z; - player->camEye.z += player->vel.z; + player->cam.at.z += player->vel.z; + player->cam.eye.z += player->vel.z; player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; player->unk_088 += 10.0f; @@ -948,7 +948,7 @@ void func_demo_8004AAF4(Player* player) { func_play_800AA800(player); } -void func_demo_8004B368(Player* player) { +void Cutscene_CoComplete2(Player* player) { s32 pad[5]; Vec3f sp78; Vec3f sp6C; @@ -959,7 +959,7 @@ void func_demo_8004B368(Player* player) { player->flags_228 = 0; - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 5.0f, 0.01f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 5.0f, 0.01f); switch (player->unk_1D0) { case 10: @@ -972,19 +972,19 @@ void func_demo_8004B368(Player* player) { player->unk_130 = 0.0f; player->unk_12C = 0.0f; player->unk_110 = 0.0f; - player->wings.unk_2C = 1; + player->wings.modelId = 1; player->unk_0D0 = 40.0f; /* fallthrough */ case 11: D_ctx_80177A48[0] = 0.0f; Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 1.0f, 5.0f, 0.0f); - player->camAt.x += (D_ctx_80178440 - player->camAt.x) * 0.01f; - player->camAt.y += (D_ctx_80178444 - player->camAt.y) * 0.01f; - player->camAt.z += (D_ctx_80178448 - player->camAt.z) * 0.01f; - player->camEye.x += ((player->camAt.x + (500.0f * player->unk_004)) - player->camEye.x) * 0.01f; - player->camEye.y += ((player->camAt.y + 500.0f) - player->camEye.y) * 0.01f; - player->camEye.z += ((D_ctx_80178448 + (2000.0f * D_ctx_80177950)) - player->camEye.z) * 0.01f; + player->cam.at.x += (D_ctx_80178440 - player->cam.at.x) * 0.01f; + player->cam.at.y += (D_ctx_80178444 - player->cam.at.y) * 0.01f; + player->cam.at.z += (D_ctx_80178448 - player->cam.at.z) * 0.01f; + player->cam.eye.x += ((player->cam.at.x + (500.0f * player->unk_004)) - player->cam.eye.x) * 0.01f; + player->cam.eye.y += ((player->cam.at.y + 500.0f) - player->cam.eye.y) * 0.01f; + player->cam.eye.z += ((D_ctx_80178448 + (2000.0f * D_ctx_80177950)) - player->cam.eye.z) * 0.01f; if (player->timer_1FC > 25) { D_ctx_80177A48[2] += 1.5f * player->unk_004; @@ -1004,25 +1004,25 @@ void func_demo_8004B368(Player* player) { Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.1f); } else { Math_SmoothStepToF(&player->unk_0E8, 180.0f, 0.1f, 3.0f, 0.1f); - Math_SmoothStepToF(&player->pos.x, player->camEye.x, 1.0f, 30.0f, 0.0f); + Math_SmoothStepToF(&player->pos.x, player->cam.eye.x, 1.0f, 30.0f, 0.0f); D_ctx_80177A48[2] = 0.0f; } player->pos.x += D_ctx_80177A48[2]; Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 3.0f, 0.1f); - Math_SmoothStepToF(&player->pos.y, player->camEye.y + 5.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&player->pos.y, player->cam.eye.y + 5.0f, 0.1f, 1.0f, 0.0f); if (player->timer_1F8 == 0) { player->unk_1D0 = 0; player->timer_1F8 = 120; player->timer_1FC = 20; D_ctx_80177A48[0] = 0.001f; - gCsCamEyeX = player->camEye.x; - gCsCamEyeY = player->camEye.y; - gCsCamEyeZ = player->camEye.z; - gCsCamAtX = player->camAt.x; - gCsCamAtY = player->camAt.y; - gCsCamAtZ = player->camAt.z; + gCsCamEyeX = player->cam.eye.x; + gCsCamEyeY = player->cam.eye.y; + gCsCamEyeZ = player->cam.eye.z; + gCsCamAtX = player->cam.at.x; + gCsCamAtY = player->cam.at.y; + gCsCamAtZ = player->cam.at.z; } break; @@ -1037,9 +1037,9 @@ void func_demo_8004B368(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[0], 0.05f, 0.1f, 0.0005f, 0.0f); } - Math_SmoothStepToF(&player->pos.x, player->camEye.x, 0.1f, 10.0f, 0.0f); - gCsCamEyeY += ((player->camAt.y + 500.0f) - player->camEye.y) * 0.01f; - player->camEye.y = gCsCamEyeY; + Math_SmoothStepToF(&player->pos.x, player->cam.eye.x, 0.1f, 10.0f, 0.0f); + gCsCamEyeY += ((player->cam.at.y + 500.0f) - player->cam.eye.y) * 0.01f; + player->cam.eye.y = gCsCamEyeY; var_fa1 = player->unk_004 * 190.0f; if ((D_ctx_80177950 > 0.0f) && (player->unk_004 > 0.0f)) { @@ -1059,7 +1059,7 @@ void func_demo_8004B368(Player* player) { } player->vel.y = 0.0f; - Math_SmoothStepToF(&player->pos.y, player->camEye.y + 5.0f, 0.1f, 4.0f, 0.0f); + Math_SmoothStepToF(&player->pos.y, player->cam.eye.y + 5.0f, 0.1f, 4.0f, 0.0f); if (player->timer_1F8 < 40) { Math_SmoothStepToF(&player->unk_0EC, player->unk_004 * 180.0f, 0.1f, 1.5f, 0.0f); @@ -1088,9 +1088,9 @@ void func_demo_8004B368(Player* player) { Math_SmoothStepToF(&gCsCamAtX, player->pos.x, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, player->pos.y, D_ctx_80177A48[0], 50000.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtZ, player->unk_138 + D_ctx_80177D20 + 30.0f, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->pos.y, player->camEye.y + 5.0f, 0.1f, 4.0f, 0.0f); + Math_SmoothStepToF(&player->pos.y, player->cam.eye.y + 5.0f, 0.1f, 4.0f, 0.0f); Math_SmoothStepToF(&player->unk_0E4, 20.0f, 0.1f, 0.2f, 0.01f); - Math_SmoothStepToF(&player->pos.x, player->camEye.x, 0.1f, 2.0f, 0.0f); + Math_SmoothStepToF(&player->pos.x, player->cam.eye.x, 0.1f, 2.0f, 0.0f); if (player->timer_1F8 <= 110) { Math_SmoothStepToF(&player->unk_0EC, player->unk_004 * 360.0f, 0.1f, 2.5f, 0.0f); @@ -1114,9 +1114,9 @@ void func_demo_8004B368(Player* player) { case 2: player->pos.y += 5.0f; - Matrix_RotateY(gCalcMatrix, ((player->unk_0E8 + 180.0f) + D_ctx_80178418) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, ((player->unk_0E8 + 180.0f) + D_ctx_80178418) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); sp78.x = 0; sp78.y = 70.0f; @@ -1172,9 +1172,9 @@ void func_demo_8004B368(Player* player) { gGroundType = GROUNDTYPE_GRASS; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); if ((D_ctx_80178418 > 70.0f) && (D_ctx_80178418 < 280.0f)) { func_demo_8004AA84(); @@ -1286,7 +1286,7 @@ void func_demo_8004B368(Player* player) { gCsCamAtZ += D_ctx_80177A48[9]; player->unk_234 = 0; if (player->timer_1F8 == 0) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; Audio_FadeOutAll(10); @@ -1313,8 +1313,8 @@ void func_demo_8004B368(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, ((player->unk_114 + player->unk_0E8) + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, ((player->unk_114 + player->unk_0E8) + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); sp60.x = 0.0f; sp60.y = 0.0f; @@ -1333,12 +1333,12 @@ void func_demo_8004B368(Player* player) { player->unk_0F8 = player->unk_0EC; player->unk_138 = player->pos.z; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.f); player->unk_088 += 10.0f; player->unk_080 = (-SIN_DEG(player->unk_088)) * 0.3f; @@ -1346,11 +1346,11 @@ void func_demo_8004B368(Player* player) { player->unk_0F0 = SIN_DEG(player->unk_0F4); } -void func_demo_8004C90C(Player* player) { - OvlI4_CallFunction(90, player); +void Cutscene_FortunaComplete(Player* player) { + OvlI4_CallFunction(OVLCALL_FO_CS_COMPLETE, player); } -void func_demo_8004C930(Player* player) { +void Cutscene_LevelComplete(Player* player) { s32 sp24; s32 sp20; s32 btn; @@ -1365,12 +1365,12 @@ void func_demo_8004C930(Player* player) { if (gLevelStage == 0) { SectorX_80194728(player); } else { - func_demo_80048E40(player); + Cutscene_WarpZoneComplete(player); } } else if (gCurrentLevel == LEVEL_AREA_6) { Area6_8018ED78(player); } else if (gCurrentLevel == LEVEL_FORTUNA) { - func_demo_8004C90C(player); + Cutscene_FortunaComplete(player); func_play_800AA800(player); } else if (gCurrentLevel == LEVEL_BOLSE) { Bolse_8018F94C(player); @@ -1396,7 +1396,7 @@ void func_demo_8004C930(Player* player) { if (gLevelStage == 0) { Meteo_8018E084(player); } else { - func_demo_80048E40(player); + Cutscene_WarpZoneComplete(player); } } else if ((gCurrentLevel == LEVEL_CORNERIA) && (gLevelMode == LEVELMODE_ALL_RANGE)) { Corneria_80191160(player); @@ -1405,7 +1405,7 @@ void func_demo_8004C930(Player* player) { if (gCsFrameCount == 170) { AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); } - func_demo_8004B368(player); + Cutscene_CoComplete2(player); func_play_800AA800(player); } func_play_800B2130(player); @@ -1441,7 +1441,7 @@ void func_demo_8004C930(Player* player) { } } -void func_demo_8004CCC0(Player* player) { +void Cutscene_UTurn(Player* player) { Vec3f sp58; PosRot sp50; @@ -1449,7 +1449,7 @@ void func_demo_8004CCC0(Player* player) { Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, player->pos.y - 20.0f, 0.2f, 100.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, player->pos.y - 20.0f, 0.2f, 100.0f, 0.0f); sp50.rot.z = player->unk_0D0; sp58.x = Math_RadToDeg(Math_Atan2F(player->pos.x, player->unk_138)); @@ -1483,8 +1483,8 @@ void func_demo_8004CCC0(Player* player) { player->timer_1F8 = 80; } } - player->camEye.x += player->vel.x * 0.2f; - player->camEye.z += player->vel.z * 0.2f; + player->cam.eye.x += player->vel.x * 0.2f; + player->cam.eye.z += player->vel.z * 0.2f; Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); break; @@ -1535,12 +1535,12 @@ void func_demo_8004CCC0(Player* player) { Math_SmoothStepToF(&player->wings.unk_10, sp58.z, 0.3f, 100.0f, 0.0f); player->unk_190 = 2.0f; - player->camEye.x += player->vel.x * 0.1f; - player->camEye.z += player->vel.z * 0.1f; + player->cam.eye.x += player->vel.x * 0.1f; + player->cam.eye.z += player->vel.z * 0.1f; if (player->unk_19C != 0) { - player->camEye.x += player->vel.z * 0.2f; - player->camEye.z += player->vel.x * 0.2f; + player->cam.eye.x += player->vel.z * 0.2f; + player->cam.eye.z += player->vel.x * 0.2f; } if (player->unk_19C == 0) { @@ -1556,18 +1556,18 @@ void func_demo_8004CCC0(Player* player) { } if (player->timer_1F8 == 0) { - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0f; player->unk_018 = 0.0f; } break; } player->pos.y += player->unk_004; - player->camAt.y += player->unk_004; + player->cam.at.y += player->unk_004; player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp50.rot.x = 0.0f; sp50.rot.y = 0.0f; @@ -1597,7 +1597,7 @@ void func_demo_8004CCC0(Player* player) { void func_demo_8004D3C8(s32 arg0) { } -void func_demo_8004D3D4(Player* player, ObjectId itemId, Item* item) { +void Cutscene_DropVsItem(Player* player, ObjectId itemId, Item* item) { Item_Initialize(item); item->obj.status = OBJ_INIT; item->obj.pos.x = player->pos.x; @@ -1607,13 +1607,13 @@ void func_demo_8004D3D4(Player* player, ObjectId itemId, Item* item) { Object_SetInfo(&item->info, item->obj.id); } -void func_demo_8004D440(Player* player) { +void Cutscene_KillPlayer(Player* player) { s32 teamId; func_8001CA24(player->num); Audio_KillSfxBySourceAndId(player->sfxSource, 0x0900C010U); func_play_800A5FA0(player->sfxSource, 0x0903F004U, player->num); - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 70; player->timer_224 = 20; D_ctx_8017837C = 7; @@ -1665,11 +1665,11 @@ void func_demo_8004D440(Player* player) { } if (gBombCount[gPlayerNum] != 0) { gBombCount[gPlayerNum] = 0; - func_demo_8004D3D4(player, OBJ_ITEM_BOMB, &gItems[1]); + Cutscene_DropVsItem(player, OBJ_ITEM_BOMB, &gItems[1]); } if (gLaserStrength[gPlayerNum] != 0) { gLaserStrength[gPlayerNum] = 0; - func_demo_8004D3D4(player, OBJ_ITEM_LASERS, &gItems[0]); + Cutscene_DropVsItem(player, OBJ_ITEM_LASERS, &gItems[0]); } } } @@ -1683,7 +1683,7 @@ void func_demo_8004D738(Player* player) { } else { func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 10); } - func_demo_8004D440(player); + Cutscene_KillPlayer(player); } void func_demo_8004D828(Player* player) { @@ -1769,10 +1769,10 @@ void func_demo_8004D828(Player* player) { func_effect_8007D0E0(player->pos.x, player->pos.y, player->unk_138, 5.0f); func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, player->vel.x, 0.0f, player->vel.z, 5.0f, 20); - func_demo_8004D440(player); + Cutscene_KillPlayer(player); } - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.05f, 5.0f, 0.00001f); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, 0); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.05f, 5.0f, 0.00001f); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, MTXF_NEW); Math_SmoothStepToF(&player->unk_000, 700.0f, 0.05f, 10.0f, 0.00001f); src.x = player->unk_004 * (player->unk_000 * 0.7f); @@ -1781,19 +1781,19 @@ void func_demo_8004D828(Player* player) { Matrix_MultVec3f(gCalcMatrix, &src, &dest); - player->camEye.x = player->pos.x + dest.x; - player->camEye.z = player->pos.z + dest.z; + player->cam.eye.x = player->pos.x + dest.x; + player->cam.eye.z = player->pos.z + dest.z; - player->camAt.x = player->pos.x; - player->camAt.z = player->pos.z; + player->cam.at.x = player->pos.x; + player->cam.at.z = player->pos.z; if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { - player->camEye.y = (player->pos.y * player->unk_148) + dest.y; - player->camEye.y -= player->unk_02C - 50.0f; - player->camAt.y = ((player->pos.y * player->unk_14C) + 20.0f) + (player->unk_060 * 5.0f); + player->cam.eye.y = (player->pos.y * player->unk_148) + dest.y; + player->cam.eye.y -= player->unk_02C - 50.0f; + player->cam.at.y = ((player->pos.y * player->unk_14C) + 20.0f) + (player->unk_060 * 5.0f); } else { - player->camEye.y = player->pos.y + dest.y; - player->camAt.y = player->pos.y; + player->cam.eye.y = player->pos.y + dest.y; + player->cam.at.y = player->pos.y; } if (gVersusMode != 0) { @@ -1874,13 +1874,13 @@ void func_demo_8004DEF8(Player* player) { func_play_800A69F8(4, player->pos.x, player->pos.y, player->unk_138); } } - func_demo_8004D440(player); + Cutscene_KillPlayer(player); } - player->unk_034 -= 3.0f; + player->camRoll -= 3.0f; if (player->unk_1D0 != 0) { - player->unk_034 += 10.0f; + player->camRoll += 10.0f; } if ((gGroundType == GROUNDTYPE_WATER) && (player->pos.y <= player->unk_0A4)) { @@ -1889,7 +1889,7 @@ void func_demo_8004DEF8(Player* player) { } } -void func_demo_8004E3D8(Player* player) { +void Cutscene_PlayerDown(Player* player) { player->flags_228 = 0; player->unk_280 = 0; @@ -2007,7 +2007,7 @@ void func_demo_8004E4D4(Actor* actor) { case 30: actor->fwork[3] += D_demo_800CA098[actor->index]; - Matrix_RotateY(gCalcMatrix, actor->fwork[3] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->fwork[3] * M_DTOR, MTXF_NEW); sp54.x = 0.0f; sp54.y = D_demo_800CA0A4[actor->index]; @@ -2038,8 +2038,8 @@ void func_demo_8004E4D4(Actor* actor) { Math_SmoothStepToF(&actor->obj.rot.z, 0.0f, 0.1f, 0.5f, 0.0f); break; } - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; sp54.y = 0.0f; @@ -2131,9 +2131,9 @@ void func_demo_8004EBD0(Actor* actor) { } actor->fwork[6] += 1.0f; - Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(gPlayer[0].unk_0E4 * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((gPlayer[0].unk_0F8 + gPlayer[0].unk_0F0) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(gPlayer[0].unk_0E4 * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((gPlayer[0].unk_0F8 + gPlayer[0].unk_0F0) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = actor->fwork[6] * actor->fwork[6]; @@ -2167,7 +2167,7 @@ void func_demo_8004F05C(Actor* actor) { case LEVEL_BOLSE: switch (actor->unk_0B6) { case 0: - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { actor->unk_0F4.z += actor->unk_0F4.y; actor->vel.x = SIN_DEG(actor->unk_0F4.z) * 10.0f; actor->obj.rot.z = SIN_DEG(actor->unk_0F4.z) * 40.0f; @@ -2268,7 +2268,7 @@ void func_demo_8004F05C(Actor* actor) { case 0: actor->obj.rot.z = actor->unk_0F4.z; if (actor->unk_0B6 == 10) { - actor->obj.pos.z = gPlayer[0].camEye.z + 12000.0f; + actor->obj.pos.z = gPlayer[0].cam.eye.z + 12000.0f; } break; @@ -2348,7 +2348,7 @@ void func_demo_8004F8AC(Actor* actor) { } switch (gPlayer[0].state_1C8) { - case PLAYERSTATE_1C8_7: + case PLAYERSTATE_1C8_LEVEL_COMPLETE: switch (gCurrentLevel) { case LEVEL_SECTOR_Y: if (gPlayer[0].unk_1D0 >= 3) { @@ -2469,15 +2469,15 @@ void func_demo_8004F8AC(Actor* actor) { } break; - case PLAYERSTATE_1C8_2: + case PLAYERSTATE_1C8_LEVEL_INTRO: func_demo_8004F05C(actor); break; - case PLAYERSTATE_1C8_8: + case PLAYERSTATE_1C8_ENTER_WARP_ZONE: func_demo_8004F798(actor); break; - case PLAYERSTATE_1C8_0: + case PLAYERSTATE_1C8_STANDBY: if (gCurrentLevel == LEVEL_SECTOR_Y) { SectorY_8019FF00(actor); } @@ -2501,15 +2501,16 @@ void func_demo_8004FCB8(Actor* actor, s32 arg1) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 16, 16, 240, 255); - angle = Math_Atan2F(gPlayer[0].camEye.x - gPlayer[0].camAt.x, gPlayer[0].camEye.z - gPlayer[0].camAt.z); + angle = Math_Atan2F(gPlayer[0].cam.eye.x - gPlayer[0].cam.at.x, gPlayer[0].cam.eye.z - gPlayer[0].cam.at.z); for (i = arg1; i < (arg1 + 4); i++) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_demo_800CA110[i].x + actor->obj.pos.x, - D_demo_800CA110[i].y + actor->obj.pos.y, D_demo_800CA110[i].z + actor->obj.pos.z, 1); - Matrix_RotateY(gGfxMatrix, angle, 1); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + D_demo_800CA110[i].y + actor->obj.pos.y, D_demo_800CA110[i].z + actor->obj.pos.z, + MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, angle, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -2561,7 +2562,7 @@ void func_demo_8004FEC0(Actor* actor) { case 10: RCP_SetupDL_40(); - Matrix_Scale(gGfxMatrix, 60.0f, 60.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 60.0f, 60.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_6020810); break; @@ -2569,9 +2570,9 @@ void func_demo_8004FEC0(Actor* actor) { case 11: RCP_SetupDL_64_2(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - Matrix_Scale(gGfxMatrix, 60.0f, 60.0f, 1.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 10.0f, 1); - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 60.0f, 60.0f, 1.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 10.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_49(); @@ -2599,13 +2600,13 @@ void func_demo_8004FEC0(Actor* actor) { case 26: gSPDisplayList(gMasterDisp++, D_SZ_6004FE0); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(actor, 2); break; case 28: gSPDisplayList(gMasterDisp++, D_ENMY_SPACE_400AAE0); - Matrix_Translate(gGfxMatrix, 0.f, 0.f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.f, 0.f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(actor, 2); break; @@ -2621,30 +2622,31 @@ void func_demo_8004FEC0(Actor* actor) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, RAND_FLOAT_CENTERED_SEEDED(3000.0f) * actor->fwork[20], RAND_FLOAT_CENTERED_SEEDED(3000.0f) * actor->fwork[20], - RAND_FLOAT_CENTERED_SEEDED(3000.0f) * actor->fwork[20], 1); - Matrix_RotateY(gGfxMatrix, 2.0f * RAND_FLOAT_SEEDED(M_PI), 1); - Matrix_RotateZ(gGfxMatrix, (2.0f * gGameFrameCount) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, 2.0f * RAND_FLOAT_SEEDED(M_PI), 1); + RAND_FLOAT_CENTERED_SEEDED(3000.0f) * actor->fwork[20], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, 2.0f * RAND_FLOAT_SEEDED(M_PI), MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (2.0f * gGameFrameCount) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, 2.0f * RAND_FLOAT_SEEDED(M_PI), MTXF_APPLY); switch ((s32) (sp2D0 % 4U)) { case 0: - Matrix_Scale(gGfxMatrix, 1.0f, 0.3f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 0.3f, 1.0f, MTXF_APPLY); break; case 1: - Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, MTXF_APPLY); break; case 2: - Matrix_Scale(gGfxMatrix, 1.0f, 0.5f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 0.5f, 1.0f, MTXF_APPLY); break; case 3: - Matrix_Scale(gGfxMatrix, 0.5f, 1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 1.0f, 1.0f, MTXF_APPLY); break; } - Matrix_Scale(gGfxMatrix, RAND_FLOAT_SEEDED(8.0f) + 8.0f, RAND_FLOAT_SEEDED(8.0f) + 8.0f, 10.0f, 1); + Matrix_Scale(gGfxMatrix, RAND_FLOAT_SEEDED(8.0f) + 8.0f, RAND_FLOAT_SEEDED(8.0f) + 8.0f, 10.0f, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1021E20); Matrix_Pop(&gGfxMatrix); @@ -2653,19 +2655,19 @@ void func_demo_8004FEC0(Actor* actor) { break; } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { Matrix_Push(&gGfxMatrix); - Matrix_RotateX(gGfxMatrix, 20.0f * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, (gGameFrameCount * 0.5f) * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_RotateX(gGfxMatrix, 20.0f * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (gGameFrameCount * 0.5f) * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); } else { - Matrix_RotateX(gGfxMatrix, -10.0f * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, (gGameFrameCount * 0.3f) * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, 1); + Matrix_RotateX(gGfxMatrix, -10.0f * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (gGameFrameCount * 0.3f) * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); } - Matrix_Translate(gGfxMatrix, 0.f, -590.0f, 0.f, 1); + Matrix_Translate(gGfxMatrix, 0.f, -590.0f, 0.f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2707,10 +2709,10 @@ void func_demo_8004FEC0(Actor* actor) { gDPSetPrimColor(gMasterDisp++, 0, 0, (s32) D_800CA210, (s32) D_800CA214, (s32) D_800CA218, 128); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { - Matrix_Scale(gGfxMatrix, 1.02f, 1.02f, 1.02f, 1); + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { + Matrix_Scale(gGfxMatrix, 1.02f, 1.02f, 1.02f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 0.97f, 0.97f, 0.97f, 1); + Matrix_Scale(gGfxMatrix, 0.97f, 0.97f, 0.97f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); @@ -2722,15 +2724,15 @@ void func_demo_8004FEC0(Actor* actor) { Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { - Matrix_Scale(gGfxMatrix, 0.075f, 0.075f, 0.075f, 1); + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { + Matrix_Scale(gGfxMatrix, 0.075f, 0.075f, 0.075f, MTXF_APPLY); break; } break; case 31: RCP_SetupDL_21(); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 2.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101ABD0); break; @@ -2740,12 +2742,12 @@ void func_demo_8004FEC0(Actor* actor) { break; case 33: - if ((actor->index == 3) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7)) { + if ((actor->index == 3) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { gSPDisplayList(gMasterDisp++, D_D00B880); } else { gSPDisplayList(gMasterDisp++, D_KA_600E050); } - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(actor, 0); break; @@ -2754,7 +2756,7 @@ void func_demo_8004FEC0(Actor* actor) { break; case 35: - Matrix_Scale(gGfxMatrix, 0.125f, 0.125f, 0.125f, 1); + Matrix_Scale(gGfxMatrix, 0.125f, 0.125f, 0.125f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); /* fallthrough */ case 39: @@ -2763,7 +2765,7 @@ void func_demo_8004FEC0(Actor* actor) { break; case 36: - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SY_601D730); func_demo_8004FCB8(actor, 0); @@ -2773,7 +2775,7 @@ void func_demo_8004FEC0(Actor* actor) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, actor->iwork[0], actor->iwork[1], actor->iwork[2], actor->iwork[3]); gDPSetEnvColor(gMasterDisp++, actor->iwork[4], actor->iwork[5], actor->iwork[6], actor->iwork[7]); - Matrix_Scale(gGfxMatrix, actor->scale, actor->fwork[4], 1.0f, 1); + Matrix_Scale(gGfxMatrix, actor->scale, actor->fwork[4], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -2789,20 +2791,20 @@ void func_demo_8004FEC0(Actor* actor) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 32, 32, 255); - Matrix_Translate(gGfxMatrix, 10.0f, -5.0f, -40.0f, 1); - Matrix_RotateY(gGfxMatrix, (-actor->obj.rot.y) * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 10.0f, -5.0f, -40.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (-actor->obj.rot.y) * M_DTOR, MTXF_APPLY); Graphics_SetScaleMtx(1.0f); - Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[0], actor->fwork[0], 1); + Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[0], actor->fwork[0], MTXF_APPLY); - camX = gPlayer[0].camEye.x - actor->obj.pos.x; - camY = gPlayer[0].camEye.y - actor->obj.pos.y; - camZ = gPlayer[0].camEye.z - (actor->obj.pos.z + D_ctx_80177D20); + camX = gPlayer[0].cam.eye.x - actor->obj.pos.x; + camY = gPlayer[0].cam.eye.y - actor->obj.pos.y; + camZ = gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20); y = -Math_Atan2F(camX, camZ); x = Math_Atan2F(camY, sqrtf(SQ(camZ) + SQ(camX))); - Matrix_RotateY(gGfxMatrix, -y, 1); - Matrix_RotateX(gGfxMatrix, -x, 1); + Matrix_RotateY(gGfxMatrix, -y, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -x, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -2815,7 +2817,7 @@ void func_demo_8004FEC0(Actor* actor) { gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gCalcMatrix, (actor->obj.rot.y - 90.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (actor->obj.rot.y - 90.0f) * M_DTOR, MTXF_NEW); sp2B8.x = 210.0f; sp2B8.y = 0.0f; @@ -2823,18 +2825,18 @@ void func_demo_8004FEC0(Actor* actor) { Matrix_MultVec3fNoTranslate(gCalcMatrix, (Vec3f*) (&sp2B8), &sp2AC); Matrix_Translate(gGfxMatrix, actor->obj.pos.x + sp2AC.x, actor->obj.pos.y + sp2AC.y, - actor->obj.pos.z + sp2AC.z, 1); - Matrix_Scale(gGfxMatrix, actor->fwork[6], actor->fwork[6], actor->fwork[6], 1); + actor->obj.pos.z + sp2AC.z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, actor->fwork[6], actor->fwork[6], actor->fwork[6], MTXF_APPLY); - camX = gPlayer[0].camEye.x - actor->obj.pos.x; - camY = gPlayer[0].camEye.y - actor->obj.pos.y; - camZ = gPlayer[0].camEye.z - (actor->obj.pos.z + D_ctx_80177D20); + camX = gPlayer[0].cam.eye.x - actor->obj.pos.x; + camY = gPlayer[0].cam.eye.y - actor->obj.pos.y; + camZ = gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20); y = -Math_Atan2F(camX, camZ); x = Math_Atan2F(camY, sqrtf(SQ(camZ) + SQ(camX))); - Matrix_RotateY(gGfxMatrix, -y, 1); - Matrix_RotateX(gGfxMatrix, -x, 1); + Matrix_RotateY(gGfxMatrix, -y, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -x, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -2862,8 +2864,9 @@ void func_demo_8004FEC0(Actor* actor) { Matrix_RotateY( gGfxMatrix, - Math_Atan2F(gPlayer[0].camEye.x - gPlayer[0].camAt.x, gPlayer[0].camEye.z - gPlayer[0].camAt.z), 1); - Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[0], actor->fwork[0], 1); + Math_Atan2F(gPlayer[0].cam.eye.x - gPlayer[0].cam.at.x, gPlayer[0].cam.eye.z - gPlayer[0].cam.at.z), + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[0], actor->fwork[0], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -2882,7 +2885,7 @@ void func_demo_8004FEC0(Actor* actor) { break; case 45: - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_600EEF0); break; @@ -2927,7 +2930,7 @@ void func_demo_800515C4(void) { } if ((gCurrentLevel != LEVEL_AQUAS) && - ((gCurrentLevel != LEVEL_SECTOR_Z) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7))) { + ((gCurrentLevel != LEVEL_SECTOR_Z) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE))) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); for (i = 0, var_s6_2 = D_demo_800CA0BC; i < 4; i++, var_s6_2++) { @@ -2945,8 +2948,8 @@ void func_demo_800515C4(void) { gDPSetEnvColor(gMasterDisp++, 32, 32, 255, 128); } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, var_s6_2->x, var_s6_2->y, var_s6_2->z, 1); - Matrix_Scale(gGfxMatrix, sp9C[i], sp9C[i], 1.0f, 1); + Matrix_Translate(gGfxMatrix, var_s6_2->x, var_s6_2->y, var_s6_2->z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp9C[i], sp9C[i], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, var_fp); Matrix_Pop(&gGfxMatrix); @@ -2958,15 +2961,15 @@ void func_demo_800515C4(void) { for (i = 0, var_s6_2 = D_demo_800CA0EC; i < 3; i++, var_s6_2++) { sp9C[i] = D_demo_800CA190[gGameFrameCount % 2U]; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, var_s6_2->x, var_s6_2->y, var_s6_2->z, 1); - Matrix_Scale(gGfxMatrix, sp9C[i], sp9C[i], 1.0f, 1); + Matrix_Translate(gGfxMatrix, var_s6_2->x, var_s6_2->y, var_s6_2->z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp9C[i], sp9C[i], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, var_fp); for (j = 0; j < 4; j++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_demo_800CA1B4[2 * j], 1); - Matrix_Scale(gGfxMatrix, D_demo_800CA1D4[2 * j], D_demo_800CA1D4[2 * j], 1.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_demo_800CA1B4[2 * j], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_demo_800CA1D4[2 * j], D_demo_800CA1D4[2 * j], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, var_fp); Matrix_Pop(&gGfxMatrix); @@ -2977,9 +2980,9 @@ void func_demo_800515C4(void) { if ((gCurrentLevel == LEVEL_METEO) && (gPlayer[0].timer_1FC != 0)) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 128); gDPSetEnvColor(gMasterDisp++, 255, 255, 32, 128); - Matrix_Translate(gGfxMatrix, D_ctx_80177A48[3] * (-74.0f), -232.0f, 1190.0f, 1); + Matrix_Translate(gGfxMatrix, D_ctx_80177A48[3] * (-74.0f), -232.0f, 1190.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_demo_800CA198[gPlayer[0].timer_1FC], D_demo_800CA198[gPlayer[0].timer_1FC], 1.0f, - 1); + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, var_fp); } diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index 576b22fa..0e1e55d1 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -17,7 +17,7 @@ f32 D_display_801615B8[4]; s32 D_display_800CA220 = 0; u8 sPlayersVisible[] = { 0, 0, 0, 0 }; // -s32 D_display_800CA228 = 0; // +s32 sDrawCockpit = 0; // s32 D_display_800CA22C = 0; // f32 D_display_800CA230 = 0.0f; Actor* D_display_800CA234 = NULL; @@ -35,7 +35,7 @@ void func_display_80051B30(void) { if ((gPlayState == PLAY_PAUSE) || (D_display_800CA234 == NULL)) { return; } - if ((D_display_800CA234->obj.status != OBJ_ACTIVE) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_3)) { + if ((D_display_800CA234->obj.status != OBJ_ACTIVE) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE)) { D_display_800CA234 = NULL; D_display_Timer_800CA238 = 0; return; @@ -48,11 +48,11 @@ void func_display_80051B30(void) { } } if (!(D_display_Timer_800CA238 & 4)) { - Matrix_RotateY(gCalcMatrix, gPlayer[0].unk_058, 0); - Matrix_RotateX(gCalcMatrix, gPlayer[0].unk_05C, 1); - sp68.x = D_display_800CA234->obj.pos.x - gPlayer[0].camEye.x; - sp68.y = D_display_800CA234->obj.pos.y - gPlayer[0].camEye.y; - sp68.z = D_display_800CA234->obj.pos.z + D_ctx_80177D20 - gPlayer[0].camEye.z; + Matrix_RotateY(gCalcMatrix, gPlayer[0].camYaw, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY); + sp68.x = D_display_800CA234->obj.pos.x - gPlayer[0].cam.eye.x; + sp68.y = D_display_800CA234->obj.pos.y - gPlayer[0].cam.eye.y; + sp68.z = D_display_800CA234->obj.pos.z + D_ctx_80177D20 - gPlayer[0].cam.eye.z; Matrix_MultVec3f(gCalcMatrix, &sp68, &sp5C); sp7C = 0; if ((sp5C.z < 0.0f) && (sp5C.z > -12000.0f) && (fabsf(sp5C.x) < fabsf(sp5C.z * 0.4f))) { @@ -80,26 +80,26 @@ void func_display_80051B30(void) { sp74 = -M_PI / 2; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, sp78, 0.0f, -50.0f, 1); - Matrix_RotateZ(gGfxMatrix, sp74, 1); - Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, 1); + Matrix_Translate(gGfxMatrix, sp78, 0.0f, -50.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, sp74, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1023700); Matrix_Pop(&gGfxMatrix); break; case 1: Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 20.0f, 0.0f, -50.0f, 1); - Matrix_RotateZ(gGfxMatrix, -M_PI / 2, 1); - Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, 1); + Matrix_Translate(gGfxMatrix, 20.0f, 0.0f, -50.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -M_PI / 2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1023700); Matrix_Pop(&gGfxMatrix); sp78 = -20.0f; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -20.0f, 0.0f, -50.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_PI / 2, 1); - Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, 1); + Matrix_Translate(gGfxMatrix, -20.0f, 0.0f, -50.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.03f, 0.03f, 0.03f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1023700); Matrix_Pop(&gGfxMatrix); @@ -232,11 +232,11 @@ void func_display_8005250C(s32 limbIndex, Vec3f* rot, void* data) { void func_display_80052584(Player* player) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &gIdentityMatrix); - if ((player->state_1C8 == PLAYERSTATE_1C8_3) && (player->timer_1F8 != 0)) { + if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->timer_1F8 != 0)) { Matrix_Translate(gGfxMatrix, D_display_801613B0[player->num].x, D_display_801613B0[player->num].y, - D_display_801613B0[player->num].z, 1); + D_display_801613B0[player->num].z, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_display_800CA23C[player->timer_1F8 - 1], D_display_800CA23C[player->timer_1F8 - 1], - D_display_800CA23C[player->timer_1F8 - 1], 1); + D_display_800CA23C[player->timer_1F8 - 1], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_40(); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -247,8 +247,8 @@ void func_display_80052584(Player* player) { void func_display_800526B8(Player* player) { Matrix_Push(&gGfxMatrix); - Matrix_Scale(gCalcMatrix, 0.5f, 0.5f, 0.5f, 1); - Matrix_Translate(gCalcMatrix, 0.0f, 35.0f, 0.0f, 1); + Matrix_Scale(gCalcMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, 35.0f, 0.0f, MTXF_APPLY); switch (player->num) { case 0: Animation_DrawSkeleton(5, D_versus_301D258, player->jointTable, func_display_800520FC, @@ -284,9 +284,9 @@ void func_display_80052884(Player* player) { gSPDisplayList(gMasterDisp++, D_versus_300FB80); } Matrix_MultVec3f(gGfxMatrix, &sp40, &D_display_80161518[player->num]); - Matrix_Translate(gGfxMatrix, 0.0f, 51.0f, -10.0f, 1); - Matrix_RotateY(gGfxMatrix, -player->unk_180 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, player->unk_17C * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 51.0f, -10.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -player->unk_180 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); if (gPlayerNum == player->num) { sp64 = 0.0f; if (gChargeTimers[player->num] >= 20) { @@ -323,18 +323,18 @@ f32 sPlayerShadowing = 0.0f; void func_display_80052B80(Player* player) { Matrix_Push(&gGfxMatrix); - if ((player->state_1C8 == PLAYERSTATE_1C8_3) && (player->unk_1A0 != 0)) { + if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (player->unk_1A0 != 0)) { Matrix_Translate(gGfxMatrix, D_display_80161548[player->num].x, D_display_80161548[player->num].y, - D_display_80161548[player->num].z, 1); + D_display_80161548[player->num].z, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_display_800CA248[player->unk_1A0 - 1], D_display_800CA248[player->unk_1A0 - 1], - D_display_800CA248[player->unk_1A0 - 1], 1); + D_display_800CA248[player->unk_1A0 - 1], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gVersusMode) { RCP_SetupDL_40(); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_versus_301FD20); } else { - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); @@ -367,12 +367,12 @@ void func_display_80052D48(Player* player) { sp2C *= 1.1f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 20.0f, 30.0f, -10.0f, 1); + Matrix_Translate(gGfxMatrix, 20.0f, 30.0f, -10.0f, MTXF_APPLY); if (!gVersusMode) { - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); } - Matrix_Scale(gGfxMatrix, sp2C, sp2C, sp2C, 1); - Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); + Matrix_Scale(gGfxMatrix, sp2C, sp2C, sp2C, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (!gVersusMode) { gSPDisplayList(gMasterDisp++, D_landmaster_30066B0); @@ -390,12 +390,12 @@ void func_display_80052D48(Player* player) { sp2C *= 1.1f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -20.0f, 30.0f, -10.0f, 1); + Matrix_Translate(gGfxMatrix, -20.0f, 30.0f, -10.0f, MTXF_APPLY); if (!gVersusMode) { - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); } - Matrix_Scale(gGfxMatrix, sp2C, sp2C, sp2C, 1); - Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); + Matrix_Scale(gGfxMatrix, sp2C, sp2C, sp2C, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (!gVersusMode) { gSPDisplayList(gMasterDisp++, D_landmaster_30066B0); @@ -520,7 +520,7 @@ bool func_display_800531A4(s32 limbIndex, Gfx** gfxPtr, Vec3f* pos, Vec3f* rot, void func_display_80053658(WingInfo* wings) { Vec3f sp68[30]; - s32 sp64; + s32 modelId; Matrix_Push(&gGfxMatrix); wings->unk_18 = 0.0f; @@ -539,32 +539,32 @@ void func_display_80053658(WingInfo* wings) { Animation_DrawSkeleton(1, D_arwing_3016610, sp68, func_display_800531A4, NULL, wings, &gIdentityMatrix); } D_display_800CA22C = 0; - sp64 = wings->unk_2C; + modelId = wings->modelId; if (D_display_800CA220 != 0) { - sp64 = 1; + modelId = 1; } - if (sp64 != 0) { + if (modelId != 0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 6.4f, -16.5f, 1); - Matrix_RotateY(gGfxMatrix, wings->unk_34 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, wings->unk_30 * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.0f / 70.925f, 1.0f / 70.925f, 1.0f / 70.925f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 6.4f, -16.5f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, wings->unk_34 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, wings->unk_30 * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f / 70.925f, 1.0f / 70.925f, 1.0f / 70.925f, MTXF_APPLY); if (gGameState == GSTATE_ENDING) { - Matrix_Scale(gGfxMatrix, 0.95f, 0.95f, 0.95f, 1); + Matrix_Scale(gGfxMatrix, 0.95f, 0.95f, 0.95f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); if (gExpertMode) { - gSPDisplayList(gMasterDisp++, D_display_800CA27C[sp64 - 1]); + gSPDisplayList(gMasterDisp++, D_display_800CA27C[modelId - 1]); } else { - gSPDisplayList(gMasterDisp++, D_display_800CA26C[sp64 - 1]); + gSPDisplayList(gMasterDisp++, D_display_800CA26C[modelId - 1]); } Matrix_Pop(&gGfxMatrix); } - Matrix_Translate(gGfxMatrix, 0.0f, 17.2f, -25.8f, 1); - Matrix_RotateX(gGfxMatrix, wings->unk_38 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 17.2f, -25.8f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, wings->unk_38 * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_64_2(); - if ((gGameState == GSTATE_PLAY) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) && + if ((gGameState == GSTATE_PLAY) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_CORNERIA)) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 120); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -588,8 +588,8 @@ void func_display_80053B00(f32 arg0, f32 arg1, UNK_TYPE arg2, UNK_TYPE arg3) { void func_display_80053B18(void) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_display_80161418[0]); - Matrix_Translate(gGfxMatrix, 0.0f, D_display_800CA290, D_display_800CA294, 1); - Matrix_Scale(gGfxMatrix, D_display_800CA28C, D_display_800CA28C, D_display_800CA28C, 1); + Matrix_Translate(gGfxMatrix, 0.0f, D_display_800CA290, D_display_800CA294, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_display_800CA28C, D_display_800CA28C, D_display_800CA28C, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_64_2(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 120); @@ -616,12 +616,12 @@ void func_display_80053C38(Player* player, s32 arg1) { Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_display_801613E0[1]); } if ((player->cockpitView != 0) && (gLevelMode == LEVELMODE_ON_RAILS) && - (fabsf(player->unk_138 + D_ctx_80177D20 - player->camEye.z) < 10.0f)) { + (fabsf(player->unk_138 + D_ctx_80177D20 - player->cam.eye.z) < 10.0f)) { if (arg1 == 0) { - D_display_800CA228 = 1; + sDrawCockpit = 1; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -8.0f, 5.0f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -8.0f, 5.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_arwing_30131F0); Matrix_Pop(&gGfxMatrix); @@ -657,11 +657,12 @@ void func_display_80053F7C(Player* player) { if ((gPlayerNum == player->num) && ((player->form == FORM_ARWING) || (player->form == FORM_LANDMASTER)) && (player->unk_234 != 0) && - (((gGameState == GSTATE_PLAY) && (player->state_1C8 == PLAYERSTATE_1C8_3)) || (gGameState == GSTATE_MENU))) { + (((gGameState == GSTATE_PLAY) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) || + (gGameState == GSTATE_MENU))) { for (i = 0; i < 2; i++) { translate = &D_display_801613E0[i]; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, translate->x, translate->y, translate->z, 1); + Matrix_Translate(gGfxMatrix, translate->x, translate->y, translate->z, MTXF_APPLY); if (gChargeTimers[player->num] >= 20) { RCP_SetupDL(&gMasterDisp, 0x3F); if (i == 1) { @@ -676,10 +677,11 @@ void func_display_80053F7C(Player* player) { RCP_SetupDL_36(); } if (i == 1) { - Matrix_Scale(gGfxMatrix, sCrosshairScales[player->num], sCrosshairScales[player->num], 1.0f, 1); + Matrix_Scale(gGfxMatrix, sCrosshairScales[player->num], sCrosshairScales[player->num], 1.0f, + MTXF_APPLY); Math_SmoothStepToF(&sCrosshairScales[player->num], 1.0f, 1.0f, 0.2f, 0.0f); } - Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, 1); + Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024F60); Matrix_Pop(&gGfxMatrix); @@ -719,15 +721,15 @@ void func_display_80054300(Player* player) { switch (player->form) { case FORM_ARWING: fake_label: - Matrix_Scale(gGfxMatrix, 2.5049999f, 1.5f, 2.5049999f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, 1); + Matrix_Scale(gGfxMatrix, 2.5049999f, 1.5f, 2.5049999f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1032780); break; case FORM_LANDMASTER: Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 1.17f, 1.17f, 1.17f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 20.0f, 1); + Matrix_Scale(gGfxMatrix, 1.17f, 1.17f, 1.17f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 20.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gCurrentLevel == LEVEL_MACBETH) { RCP_SetupDL(&gMasterDisp, 0x41); @@ -743,8 +745,8 @@ void func_display_80054300(Player* player) { break; case FORM_ON_FOOT: Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_102A8A0); @@ -779,20 +781,20 @@ void func_display_8005478C(Player* player) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, player->unk_0F8 * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, player->unk_0F8 * M_DTOR, MTXF_APPLY); if (player->form == FORM_LANDMASTER) { if (player->unk_194 <= 0.0f) { Matrix_Pop(&gGfxMatrix); return; } - Matrix_Scale(gGfxMatrix, player->unk_194, player->unk_194, 1.0f, 1); + Matrix_Scale(gGfxMatrix, player->unk_194, player->unk_194, 1.0f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, player->unk_194, player->unk_194, 1.0f, 1); + Matrix_Scale(gGfxMatrix, player->unk_194, player->unk_194, 1.0f, MTXF_APPLY); } if ((gGameFrameCount % 2) != 0) { - Matrix_Scale(gGfxMatrix, 0.9f, 0.63f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.9f, 0.63f, 1.0f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 0.80999994f, 0.567f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.80999994f, 0.567f, 1.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); func_display_8005465C(gLevelType); @@ -805,11 +807,11 @@ void func_display_80054914(Player* player) { Vec3f sp34; if (player->unk_280 != 0) { - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, MTXF_NEW); Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), - 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); + MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); sp40.x = 0.0f; sp40.y = 0.0f; sp40.z = -30.0f; @@ -820,17 +822,17 @@ void func_display_80054914(Player* player) { } Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, player->pos.x + sp34.x, player->pos.y + sp34.y, - player->unk_138 + player->unk_144 + sp34.z, 1); - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); - Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].unk_05C, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * sp4C * M_DTOR, 1); + player->unk_138 + player->unk_144 + sp34.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * sp4C * M_DTOR, MTXF_APPLY); if (player->form == FORM_ARWING) { - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, 1); + Matrix_Scale(gGfxMatrix, 1.2f, 1.2f, 1.2f, MTXF_APPLY); } if (player->unk_1F0 < 0) { - Matrix_RotateX(gGfxMatrix, M_PI, 1); + Matrix_RotateX(gGfxMatrix, M_PI, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x43); @@ -845,8 +847,8 @@ void func_display_80054CA4(Player* player) { if (D_ctx_80177AB8[player->num] > 1.0f) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_display_80161418[player->num]); - Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 10.0f, 1); - Matrix_Scale(gGfxMatrix, 2.5f, 1.6f, 2.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 10.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.5f, 1.6f, 2.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x44); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 255, 255, (s32) D_ctx_80177AB8[player->num]); @@ -878,13 +880,13 @@ void func_display_80054E80(Player* player) { } Matrix_Push(&gGfxMatrix); sp80 = gChargeTimers[player->num] / 20.0f; - Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, 0); - Matrix_Scale(gGfxMatrix, sp80, sp80, 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); + Matrix_Scale(gGfxMatrix, sp80, sp80, 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); if ((player->cockpitView != 0) && (gLevelMode == LEVELMODE_ON_RAILS)) { - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, 1); + Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, MTXF_APPLY); } RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128); @@ -906,21 +908,21 @@ void func_display_80054E80(Player* player) { } else { gDPSetEnvColor(gMasterDisp++, 0, 255, 0, 128); } - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 53.0f * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 53.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * -53.0f * 2.0f * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * -53.0f * 2.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); Matrix_Pop(&gGfxMatrix); if ((player->cockpitView != 0) && (gLevelMode == LEVELMODE_ON_RAILS)) { - Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); + Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, MTXF_APPLY); } - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY); if (((gGameFrameCount % 2) == 0)) { - Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.0f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 1.3f, 1.3f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.3f, 1.3f, 1.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -944,8 +946,8 @@ void func_display_80054E80(Player* player) { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, 0); - Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); + Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -962,14 +964,14 @@ void func_display_80054E80(Player* player) { Matrix_MultVec3f(gCalcMatrix, &spAC, &sp94); Matrix_MultVec3f(gCalcMatrix, &spA0, &sp88); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, 0); - Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); + Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, sp88.x, sp88.y, sp88.z, 0); - Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, 1); + Matrix_Translate(gGfxMatrix, sp88.x, sp88.y, sp88.z, MTXF_NEW); + Matrix_Scale(gGfxMatrix, D_ctx_80177AA0[player->num], D_ctx_80177AA0[player->num], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -987,10 +989,10 @@ void func_display_80055788(Player* player) { Matrix_Push(&gGfxMatrix); sp54 = gChargeTimers[player->num] / 20.0f; Matrix_Translate(gGfxMatrix, D_display_80161548[player->num].x, D_display_80161548[player->num].y, - D_display_80161548[player->num].z, 0); - Matrix_Scale(gGfxMatrix, sp54, sp54, 1.0f, 1); + D_display_80161548[player->num].z, MTXF_NEW); + Matrix_Scale(gGfxMatrix, sp54, sp54, 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, 1); + Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, MTXF_APPLY); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128); if (gVersusMode) { @@ -1011,18 +1013,18 @@ void func_display_80055788(Player* player) { } else { gDPSetEnvColor(gMasterDisp++, 0, 255, 0, 128); } - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 53.0f * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 53.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * -53.0f * 2.0f * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * -53.0f * 2.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); Matrix_Pop(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 1.0f, MTXF_APPLY); if (((gGameFrameCount % 2) == 0)) { - Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.0f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 1.3f, 1.3f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.3f, 1.3f, 1.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -1036,14 +1038,17 @@ void func_display_80055B58(Player* player) { f32 var_fv0; s32 pad[3]; - if ((player->unk_234 != 0) && (player->state_1C8 != PLAYERSTATE_1C8_4)) { + if ((player->unk_234 != 0) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) { switch (player->form) { case FORM_ARWING: - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, + MTXF_NEW); Matrix_RotateX(gCalcMatrix, - -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); + -((player->unk_120 + player->unk_0E4 + player->unk_134 + player->unk_4D8) * M_DTOR), + MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), + MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); var_fv0 = player->unk_194 * 30.0f; if (var_fv0 > 30.0f) { var_fv0 = 30.0f; @@ -1056,9 +1061,9 @@ void func_display_80055B58(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, player->pos.x + sp40.x, player->pos.y + sp40.y, - player->unk_138 + player->unk_144 + sp40.z, 1); - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); - Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].unk_05C, 1); + player->unk_138 + player->unk_144 + sp40.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); func_display_8005478C(player); Matrix_Pop(&gGfxMatrix); @@ -1070,7 +1075,7 @@ void func_display_80055B58(Player* player) { func_display_80052D48(player); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_display_80161518[player->num].x, D_display_80161518[player->num].y, - D_display_80161518[player->num].z, 0); + D_display_80161518[player->num].z, MTXF_NEW); Matrix_SetGfxMtx(&gMasterDisp); func_display_8005478C(player); Matrix_Pop(&gGfxMatrix); @@ -1107,7 +1112,7 @@ void func_display_80055E98(Player* player) { } var_fs0 = var_fs0 * 0.25f; sp50 = player->unk_0E4 * 0.25f; - if (player->state_1C8 == PLAYERSTATE_1C8_7) { + if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { var_fs0 = 0.0f; sp50 = 0.0f; } @@ -1115,26 +1120,26 @@ void func_display_80055E98(Player* player) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); if (player->wings.leftState == WINGSTATE_INTACT) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, sp5C, sp58, -100.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, 1); - Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), 1); - Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, 1); + Matrix_Translate(gGfxMatrix, sp5C, sp58, -100.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), MTXF_APPLY); + Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102A8A0); Matrix_Pop(&gGfxMatrix); } if (player->wings.rightState == WINGSTATE_INTACT) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -sp5C, sp58, -100.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, 1); - Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), 1); - Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, 1); + Matrix_Translate(gGfxMatrix, -sp5C, sp58, -100.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * sp50, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -(M_DTOR * var_fs0), MTXF_APPLY); + Matrix_Scale(gGfxMatrix, player->unk_25C, 1.0f, 50.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102A8A0); Matrix_Pop(&gGfxMatrix); @@ -1146,11 +1151,11 @@ void func_display_80056230(Player* player) { if ((player->unk_234 != 0) && (player->form == FORM_ARWING) && (gCurrentLevel != LEVEL_VENOM_ANDROSS) && (gCurrentLevel != LEVEL_TRAINING) && (gLevelType == LEVELTYPE_PLANET)) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, 1); - Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); - Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); - Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, 1); + Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); func_display_80055E98(player); Matrix_Pop(&gGfxMatrix); @@ -1188,10 +1193,10 @@ void func_display_800564C0(Player* player, s32 arg1) { Matrix_Push(&gGfxMatrix); if (player->form == FORM_LANDMASTER) { if (player->unk_1D4 != 0) { - Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY); } Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y + player->unk_18C + 30.0f, - player->unk_138 + player->unk_144, 1); + player->unk_138 + player->unk_144, MTXF_APPLY); if (gVersusMode) { for (i = 0; i < gCamCount; i++) { if (D_ctx_80177B00[player->num][i] != 0) { @@ -1210,18 +1215,18 @@ void func_display_800564C0(Player* player, s32 arg1) { Matrix_Pop(&gGfxMatrix); return; } - Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); if (gVersusMode) { - Matrix_RotateX(gGfxMatrix, player->unk_000 * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, player->unk_000 * M_DTOR, MTXF_APPLY); } - Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080 - 30.0f, 0.0f, 1); + Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080 - 30.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } else if (player->form == FORM_ON_FOOT) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, 1); + Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY); if (!func_display_800563B4(player->num, arg1)) { Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix); @@ -1229,13 +1234,14 @@ void func_display_800564C0(Player* player, s32 arg1) { } Matrix_Pop(&gGfxMatrix); Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y + gCameraShakeY, - player->unk_138 + player->unk_144, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); + player->unk_138 + player->unk_144, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, + MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, 1); + Matrix_Translate(gGfxMatrix, player->pos.x, player->pos.y, player->unk_138 + player->unk_144, MTXF_APPLY); if (gVersusMode) { for (i = 0; i < gCamCount; i++) { if (D_ctx_80177B00[player->num][i] != 0) { @@ -1254,11 +1260,13 @@ void func_display_800564C0(Player* player, s32 arg1) { Matrix_Pop(&gGfxMatrix); return; } - Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, - -((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), 1); - Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); - Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, 1); + -((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gGfxMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } switch (player->unk_200) { @@ -1319,33 +1327,35 @@ void func_display_80056E2C(Player* player) { Matrix_Push(&gGfxMatrix); if (gLevelMode == LEVELMODE_ALL_RANGE) { if (player->form == FORM_ON_FOOT) { - Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, 1); + Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, 1); + Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C, MTXF_APPLY); } } else { - Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C + player->unk_144, 1); + Matrix_Translate(gGfxMatrix, player->unk_064, player->unk_068 + 2.0f, player->unk_06C + player->unk_144, + MTXF_APPLY); } - Matrix_RotateY(gGfxMatrix, player->unk_070, 1); - Matrix_RotateX(gGfxMatrix, player->unk_248, 1); - Matrix_RotateZ(gGfxMatrix, player->unk_24C, 1); - Matrix_Scale(gGfxMatrix, 0.8f + sp34, 0.0f, 0.8f + sp30, 1); + Matrix_RotateY(gGfxMatrix, player->unk_070, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, player->unk_248, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, player->unk_24C, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.8f + sp34, 0.0f, 0.8f + sp30, MTXF_APPLY); if ((player->form == FORM_ARWING) || (player->form == FORM_BLUE_MARINE) || (player->form == FORM_ON_FOOT)) { sp2C = player->unk_0F8 + player->unk_0F0 + player->unk_134; if (((sp2C > 70.0f) && (sp2C < 110.0f)) || ((sp2C < -70.0f) && (sp2C > -110.0f))) { sp2C = 70.0f; } - Matrix_RotateY(gGfxMatrix, -player->unk_070, 1); - Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134) * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, -player->unk_070, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134) * M_DTOR, MTXF_APPLY); Matrix_RotateX(gGfxMatrix, - -((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * sp2C, 1); + -((player->unk_120 + player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sp2C, MTXF_APPLY); } else { - Matrix_RotateY(gGfxMatrix, player->unk_114 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, (player->unk_0E4 + player->unk_4D8 + player->unk_134) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (player->unk_0EC + player->unk_0F0 + player->unk_134) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); } func_display_80054300(player); Matrix_Pop(&gGfxMatrix); @@ -1368,12 +1378,12 @@ void func_display_80057248(void) { } Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, gTeamArrowsViewPos[i].x, gTeamArrowsViewPos[i].y, gTeamArrowsViewPos[i].z, - 1); - Matrix_Scale(gGfxMatrix, var_fs0 * 0.25f, var_fs0 * 0.25f, 1.0f, 1); + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, var_fs0 * 0.25f, var_fs0 * 0.25f, 1.0f, MTXF_APPLY); if ((i == 0) && (gCurrentLevel == LEVEL_SECTOR_Z)) { - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 1.0f, MTXF_APPLY); } - Matrix_Translate(gGfxMatrix, 0.0f, 150.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 150.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); if ((i == 0) && (gCurrentLevel == LEVEL_SECTOR_Z)) { @@ -1408,14 +1418,14 @@ void func_display_80057504(void) { } Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_display_80161578[i].x, D_display_80161578[i].y, D_display_80161578[i].z, - 1); + MTXF_APPLY); if ((gPlayState != PLAY_PAUSE) && (i == gPlayerNum)) { Math_SmoothStepToF(&D_display_801615A8[i], 0.0f, 0.5f, 20.0f, 0); Math_SmoothStepToF(&D_display_801615B8[i], 1.0, 0.5f, 0.2f, 0); } var_fs0 *= D_display_801615B8[i]; - Matrix_Scale(gGfxMatrix, var_fs0 * 1.5f, var_fs0 * 1.5f, 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, D_display_801615A8[i] * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, var_fs0 * 1.5f, var_fs0 * 1.5f, 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_display_801615A8[i] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); @@ -1462,24 +1472,24 @@ void func_display_800578C4(Player* player) { case 0: Math_SmoothStepToAngle(&player->wings.unk_30, 0.0f, 0.2f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->wings.unk_34, 0.0f, 0.2f, 3.0f, 0.0f); - gPlayerCamEye.x = player->camEye.x; - gPlayerCamEye.y = player->camEye.y; - gPlayerCamEye.z = player->camEye.z; - gPlayerCamAt.x = player->camAt.x; - gPlayerCamAt.y = player->camAt.y; - gPlayerCamAt.z = player->camAt.z; + gPlayerCamEye.x = player->cam.eye.x; + gPlayerCamEye.y = player->cam.eye.y; + gPlayerCamEye.z = player->cam.eye.z; + gPlayerCamAt.x = player->cam.at.x; + gPlayerCamAt.y = player->cam.at.y; + gPlayerCamAt.z = player->cam.at.z; break; case 1: case 2: case 3: - sp38 = Math_RadToDeg(player->unk_05C) + player->unk_0E4; + sp38 = Math_RadToDeg(player->camPitch) + player->unk_0E4; if (sp38 > 360.0f) { sp38 -= 360.0f; } if (sp38 < 0.0f) { sp38 += 360.0f; } - sp3C = (Math_RadToDeg(player->unk_058) + 180.0f) - player->unk_0E8; + sp3C = (Math_RadToDeg(player->camYaw) + 180.0f) - player->unk_0E8; if (sp3C > 360.0f) { sp3C -= 360.0f; } @@ -1493,8 +1503,8 @@ void func_display_800578C4(Player* player) { Math_SmoothStepToF(&D_display_800CA384, gControllerPress->stick_x * 3.0f, 0.1f, 5.0f, 0.0f); Math_SmoothStepToF(&D_display_800CA388, D_display_800CA38C[D_display_800CA220], 0.1f, 10.0f, 0.0f); sp4C.z = D_display_800CA388; - Matrix_RotateX(gCalcMatrix, (player->unk_0E8 + D_display_800CA380) * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E4 + D_display_800CA384) * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, (player->unk_0E8 + D_display_800CA380) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->unk_0E4 + D_display_800CA384) * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); gPlayerCamEye.x = player->pos.x + sp40.x; gPlayerCamEye.y = player->pos.y + sp40.y + 20.0f; @@ -1515,40 +1525,40 @@ void Play_Draw(void) { Player* opponent; Player* player = &gPlayer[gPlayerNum]; - D_display_800CA228 = 0; + sDrawCockpit = 0; if (gHitCount > 511) { gHitCount = 511; } Matrix_Push(&gGfxMatrix); - if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Math_SmoothStepToF(&D_display_800CA230, 0.01f, 0.2f, 0.002f, 0.0f); } else { Math_SmoothStepToF(&D_display_800CA230, 0.0f, 0.2f, 0.002f, 0.0f); } - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 10.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.0f + D_display_800CA230, 1.0f - D_display_800CA230, 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.0f + D_display_800CA230, 1.0f - D_display_800CA230, 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f + D_display_800CA230, 1.0f - D_display_800CA230, 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f + D_display_800CA230, 1.0f - D_display_800CA230, 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); func_play_800B73E0(player); Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); if (gLevelMode == LEVELMODE_ON_RAILS) { - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, MTXF_APPLY); - tempVec.x = player->camEye.x - player->pos.x; - tempVec.y = player->camEye.y - player->pos.y; - tempVec.z = player->camEye.z - (player->unk_138 + player->unk_144); + tempVec.x = player->cam.eye.x - player->pos.x; + tempVec.y = player->cam.eye.y - player->pos.y; + tempVec.z = player->cam.eye.z - (player->unk_138 + player->unk_144); Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamEye); gPlayerCamEye.x += player->pos.x; gPlayerCamEye.y += player->pos.y; gPlayerCamEye.z += player->unk_138 + player->unk_144; - tempVec.x = player->camAt.x - player->pos.x; - tempVec.y = player->camAt.y - player->pos.y; - tempVec.z = player->camAt.z - (player->unk_138 + player->unk_144); + tempVec.x = player->cam.at.x - player->pos.x; + tempVec.y = player->cam.at.y - player->pos.y; + tempVec.z = player->cam.at.z - (player->unk_138 + player->unk_144); Matrix_MultVec3f(gCalcMatrix, &tempVec, &gPlayerCamAt); gPlayerCamAt.x += player->pos.x; gPlayerCamAt.y += player->pos.y; @@ -1557,28 +1567,28 @@ void Play_Draw(void) { if ((player->cockpitView != 0) && (player->unk_110 > 5.0f)) { gPlayerCamAt.x += SIN_DEG(gGameFrameCount * 150.0f) * player->unk_110 * 0.2f; } - } else if (player->state_1C8 == PLAYERSTATE_1C8_7) { + } else if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { func_display_800578C4(player); } else { - gPlayerCamEye.x = player->camEye.x; - gPlayerCamEye.y = player->camEye.y; - gPlayerCamEye.z = player->camEye.z; - gPlayerCamAt.x = player->camAt.x; - gPlayerCamAt.y = player->camAt.y; - gPlayerCamAt.z = player->camAt.z; + gPlayerCamEye.x = player->cam.eye.x; + gPlayerCamEye.y = player->cam.eye.y; + gPlayerCamEye.z = player->cam.eye.z; + gPlayerCamAt.x = player->cam.at.x; + gPlayerCamAt.y = player->cam.at.y; + gPlayerCamAt.z = player->cam.at.z; } - player->unk_058 = -Math_Atan2F(gPlayerCamEye.x - gPlayerCamAt.x, gPlayerCamEye.z - gPlayerCamAt.z); - player->unk_05C = -Math_Atan2F(gPlayerCamEye.y - gPlayerCamAt.y, - sqrtf(SQ(gPlayerCamEye.z - gPlayerCamAt.z) + SQ(gPlayerCamEye.x - gPlayerCamAt.x))); - Matrix_RotateY(gCalcMatrix, -player->unk_058, 0); - Matrix_RotateX(gCalcMatrix, player->unk_05C, 1); - Matrix_RotateZ(gCalcMatrix, -player->unk_034 * M_DTOR, 1); + player->camYaw = -Math_Atan2F(gPlayerCamEye.x - gPlayerCamAt.x, gPlayerCamEye.z - gPlayerCamAt.z); + player->camPitch = -Math_Atan2F(gPlayerCamEye.y - gPlayerCamAt.y, + sqrtf(SQ(gPlayerCamEye.z - gPlayerCamAt.z) + SQ(gPlayerCamEye.x - gPlayerCamAt.x))); + Matrix_RotateY(gCalcMatrix, -player->camYaw, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->camPitch, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -player->camRoll * M_DTOR, MTXF_APPLY); tempVec.x = 0.0f; tempVec.y = 100.0f; tempVec.z = 0.0f; Matrix_MultVec3f(gCalcMatrix, &tempVec, &playerCamUp); if (D_ctx_80178410 != 0) { - D_ctx_80178428 = DEG_TO_RAD(gPlayer[0].unk_034); + D_ctx_80178428 = DEG_TO_RAD(gPlayer[0].camRoll); func_play_800B6F50(gPlayerCamEye.x, gPlayerCamEye.y, gPlayerCamEye.z, gPlayerCamAt.x, gPlayerCamAt.y, gPlayerCamAt.z); func_bg_8003DAF0(); @@ -1587,12 +1597,12 @@ void Play_Draw(void) { func_bg_80040450(); Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, gPlayerCamEye.x, gPlayerCamEye.y, gPlayerCamEye.z, gPlayerCamAt.x, gPlayerCamAt.y, - gPlayerCamAt.z, playerCamUp.x, playerCamUp.y, playerCamUp.z, 1); + gPlayerCamAt.z, playerCamUp.x, playerCamUp.y, playerCamUp.z, MTXF_APPLY); if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { if ((gCurrentLevel == LEVEL_TITANIA) && - ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2) || (gPlayer[0].unk_19C != 0))) { + ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) || (gPlayer[0].unk_19C != 0))) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Ground_801B58AC(&gMasterDisp, D_ctx_80177CC8); D_ctx_80177CC8 = 0.0f; @@ -1612,11 +1622,11 @@ void Play_Draw(void) { func_display_800564C0(opponent, 0); func_display_80057814(opponent); } - if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { Lights_SetOneLight(&gMasterDisp, gLight2x, -1 * gLight2y, gLight2z, gLight2R, gLight2G, gLight2B, gAmbientR, gAmbientG, gAmbientB); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY); for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { opponentPos.x = opponent->pos.x; opponentPos.y = opponent->pos.y; @@ -1631,17 +1641,17 @@ void Play_Draw(void) { TexturedLine_Draw(); gReflectY = 1; PlayerShot_Draw(); - if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY); gReflectY = -1; PlayerShot_Draw(); Matrix_Pop(&gGfxMatrix); } gReflectY = -1; - if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY); for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { if (sPlayersVisible[i] != 0) { func_display_80055B58(opponent); @@ -1660,7 +1670,8 @@ void Play_Draw(void) { } if ((gCurrentLevel != LEVEL_AQUAS) && (((gCurrentLevel != LEVEL_CORNERIA) && (gCurrentLevel != LEVEL_VENOM_ANDROSS)) || - ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)))) { + ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) && + (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)))) { Effect_Draw(0); } gReflectY = 1; @@ -1671,18 +1682,19 @@ void Play_Draw(void) { func_display_80056230(opponent); } } - if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Aquas_801AA20C(); } if (((gCurrentLevel == LEVEL_CORNERIA) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) && - ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2))) { + ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO))) { Effect_Draw(0); } BonusText_DrawAll(); Matrix_Pop(&gGfxMatrix); func_display_80057248(); func_display_80057504(); - if (D_display_800CA228 != 0) { + if (sDrawCockpit != 0) { func_display_80053B18(); } for (i = 0, opponent = gPlayer; i < gCamCount; i++, opponent++) { @@ -1697,11 +1709,12 @@ void Play_Draw(void) { } } } - if ((gLevelMode == LEVELMODE_UNK_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if ((gLevelMode == LEVELMODE_UNK_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Turret_801A6164(gPlayer); } func_bg_80040954(); - if ((gCamCount != 1) && ((player->state_1C8 == PLAYERSTATE_1C8_3) || (player->state_1C8 == PLAYERSTATE_1C8_5))) { + if ((gCamCount != 1) && + ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_U_TURN))) { func_hud_8008FA84(); func_hud_8008CA44(); } diff --git a/src/engine/fox_edata.c b/src/engine/fox_edata.c index ef1ff097..c5e08d6a 100644 --- a/src/engine/fox_edata.c +++ b/src/engine/fox_edata.c @@ -6,7 +6,7 @@ f32* D_edata_800CF964[] = { NULL }; void func_edata_800594F0(Object_80* obj80) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_6007D90); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); @@ -14,7 +14,7 @@ void func_edata_800594F0(Object_80* obj80) { void func_edata_800595D0(Object_80* obj80) { RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_6007CF0); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); diff --git a/src/engine/fox_edata_info.c b/src/engine/fox_edata_info.c index fffa8a53..6d684587 100644 --- a/src/engine/fox_edata_info.c +++ b/src/engine/fox_edata_info.c @@ -364,8 +364,8 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_ACTOR_268 */ {(void*) Aquas_801BDE6C, 1, (ObjectFunc) Aquas_801BD54C, D_AQ_6031570, 10000.0f, 0, 0, 0, 0, 0.0f, 0 }, /* OBJ_ACTOR_269 */ {(void*) Aquas_801BD264, 1, (ObjectFunc) Aquas_801BC9A0, D_AQ_6030D20, 2000.0f, 0, 0, 40, 0, 0.0f, 0 }, /* OBJ_ACTOR_270 */ {(void*) Aquas_801BEB1C, 1, (ObjectFunc) Aquas_801BE3F8, D_AQ_60314C8, 1000.0f, 0, 0, 40, 0, 0.0f, 0 }, - /* OBJ_ACTOR_271 */ {(void*) func_360_8002E694, 2, (ObjectFunc) func_360_8002E670, D_BO_6011B24, 0.0f, 0, 0, 39, 0, 730.0f, 1 }, - /* OBJ_ACTOR_272 */ {(void*) func_360_8002E6DC, 1, (ObjectFunc) func_360_8002E6B8, D_BO_6011BF4, 0.0f, 0, 0, 39, 0, 150.0f, 1 }, + /* OBJ_ACTOR_271 */ {(void*) Actor271_Draw, 2, (ObjectFunc) Actor271_Update, D_BO_6011B24, 0.0f, 0, 0, 39, 0, 730.0f, 1 }, + /* OBJ_ACTOR_272 */ {(void*) Actor272_Draw, 1, (ObjectFunc) Actor272_Update, D_BO_6011BF4, 0.0f, 0, 0, 39, 0, 150.0f, 1 }, /* OBJ_ACTOR_273 */ {(void*) Fortuna_80188FE4, 2, (ObjectFunc) Fortuna_80188AD0, D_FO_600FF30, 0.0f, 0, 0, 39, 0, 220.0f, 1 }, /* OBJ_ACTOR_274 */ {(void*) SectorZ_8019E3A8, 1, (ObjectFunc) SectorZ_8019E234, gDefaultCubeHitbox200, 0.0f, 0, 0, 39, 0, 1.0f, 0 }, /* OBJ_ACTOR_275 */ {(void*) Solar_8019F7AC, 1, (ObjectFunc) Solar_8019F20C, gDefaultCubeHitbox100, 200.0f, 0, 0, 39, 0, 1.0f, 1 }, @@ -402,8 +402,8 @@ ObjectInfo D_edata_800CC124[0x190] = { /* OBJ_BOSS_306 */ {(void*) Titania_801982A8, 1, (ObjectFunc) Titania_80197A94,D_TI_801B83A8, 1000.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_ZO */ {(void*) Zoness_801949DC, 2, (ObjectFunc) Zoness_80194A84, D_ZO_602C044, 1000.0f, 0, 0, 40, 0, 1.0f, 10 }, /* OBJ_BOSS_308 */ {(void*) func_hud_8008FE78, 1, (ObjectFunc) func_hud_800907C4, D_FO_600FFE0, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, - /* OBJ_BOSS_309 */ {(void*) func_360_8002E604, 1, (ObjectFunc) func_360_8002E5E0, gHitboxNone, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, - /* OBJ_BOSS_310 */ {(void*) func_360_8002E64C, 1, (ObjectFunc) func_360_8002E628, gHitboxNone, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, + /* OBJ_BOSS_309 */ {(void*) Boss309_Draw, 1, (ObjectFunc) Boss309_Update, gHitboxNone, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, + /* OBJ_BOSS_310 */ {(void*) Boss310_Draw, 1, (ObjectFunc) Boss310_Update, gHitboxNone, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_311 */ {(void*) Bolse_80191AFC, 2, (ObjectFunc) Bolse_801912FC, D_BO_6011C80, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_312 */ {(void*) Venom2_80196288, 2, (ObjectFunc) Venom2_80196210, D_VE2_60166F4, 0.0f, 0, 0, 40, 1, 0.0f, 10 }, /* OBJ_BOSS_313 */ {(void*) SectorZ_8019E98C, 1, (ObjectFunc) SectorZ_8019E454, D_SZ_6009388, 0.0f, 0, 0, 40, 0, 0.0f, 10 }, diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index 29d1506b..4e8f6a9c 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -31,10 +31,10 @@ WingInfo D_edisplay_80161630; char D_edisplay_800CF970[] = "$Id: fox_edisplay.c,v 1.196 1997/05/08 08:31:50 morita Exp $"; void func_edisplay_800596C0(void) { - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 13.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.02f, 0.98f, 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 13.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.02f, 0.98f, 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 13.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.02f, 0.98f, 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 13.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.02f, 0.98f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } @@ -46,7 +46,7 @@ void func_edisplay_800597C0(s32 arg0) { } void Graphics_SetScaleMtx(f32 scale) { - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } @@ -92,7 +92,7 @@ void Actor202_Draw(Actor202* this) { Vec3f sp30[30]; f32 temp = D_edisplay_800CF9B0[this->unk_0B6] - 114.0f; - Matrix_Translate(gGfxMatrix, 0.f, -temp, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.f, -temp, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Animation_GetFrameData(&D_ME_601E8C4, this->unk_0B6, sp30); Animation_DrawSkeleton(1, D_ME_601E9D0, sp30, NULL, func_edisplay_800599A4, &this->index, &gIdentityMatrix); @@ -135,33 +135,33 @@ void FogShadow_Draw(FogShadow* this) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 180); switch (this->unk_45) { case OBJ_80_0: - Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.7f, 1); + Matrix_Scale(gGfxMatrix, 2.0f, 1.0f, 0.7f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; case OBJ_80_21: - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.7f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.7f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; case OBJ_80_6: case OBJ_80_7: - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 10.55f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 10.55f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_Gfx_800DAC20); break; case OBJ_80_56: - Matrix_Scale(gGfxMatrix, 1.6f, 1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.6f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; case OBJ_80_20: - Matrix_Scale(gGfxMatrix, 1.2f, 1.0f, 1.3f, 1); + Matrix_Scale(gGfxMatrix, 1.2f, 1.0f, 1.3f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; case OBJ_80_22: - Matrix_Scale(gGfxMatrix, 2.2f, 1.0f, 1.4f, 1); + Matrix_Scale(gGfxMatrix, 2.2f, 1.0f, 1.4f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; @@ -170,7 +170,7 @@ void FogShadow_Draw(FogShadow* this) { } void func_edisplay_80059F68(Object_80* obj80) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -95.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -95.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_602DA20); } @@ -181,7 +181,7 @@ void func_edisplay_80059FDC(Object_80* obj80) { void func_edisplay_8005A010(Sprite* sprite) { if (sprite->unk_48 == 0) { - Matrix_RotateY(gGfxMatrix, M_PI / 2, 1); + Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_60361F0); } @@ -239,14 +239,14 @@ Gfx* D_edisplay_800CFC7C[] = { D_ZO_601B570, D_ZO_601B710, D_ZO_60209B0, D_ZO_60 void Actor189_Draw(Actor189* this) { switch (this->state) { case 0: - Matrix_Translate(gGfxMatrix, 18.0f, 15.0f, -15.0f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Translate(gGfxMatrix, 18.0f, 15.0f, -15.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_arwing_3016660); break; case 1: - Matrix_Translate(gGfxMatrix, -18.0f, 15.0f, -15.0f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Translate(gGfxMatrix, -18.0f, 15.0f, -15.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_arwing_3015D80); break; @@ -439,13 +439,13 @@ void func_edisplay_8005ADAC(Actor* actor) { sp5C *= 1.111f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); - Matrix_Scale(gGfxMatrix, sp5C, sp5C * 0.7f, sp5C, 1); - Matrix_RotateZ(gGfxMatrix, -actor->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -actor->obj.rot.y * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); - Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].unk_05C, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp5C, sp5C * 0.7f, sp5C, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -actor->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); func_display_8005465C(gLevelType); Matrix_Pop(&gGfxMatrix); @@ -459,20 +459,20 @@ void func_edisplay_8005ADAC(Actor* actor) { RCP_SetupDL_64_2(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 70.0f, -10.0f, -100.0f, 1); - Matrix_Scale(gGfxMatrix, sp5C, 1.0f, 50.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, 1); + Matrix_Translate(gGfxMatrix, 70.0f, -10.0f, -100.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp5C, 1.0f, 50.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102A8A0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -70.0f, -10.0f, -100.0f, 1); - Matrix_Scale(gGfxMatrix, sp5C, 1.0f, 50.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, 1); + Matrix_Translate(gGfxMatrix, -70.0f, -10.0f, -100.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp5C, 1.0f, 50.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * sp54, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102A8A0); Matrix_Pop(&gGfxMatrix); @@ -495,11 +495,11 @@ void func_edisplay_8005B1E8(Actor* actor, s32 levelType) { scale *= 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); - Matrix_RotateZ(gGfxMatrix, -actor->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -actor->obj.rot.y * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -actor->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); func_display_8005465C(levelType); Matrix_Pop(&gGfxMatrix); @@ -512,15 +512,15 @@ void func_edisplay_8005B388(Actor* actor) { Matrix_MultVec3f(gGfxMatrix, &sp3C, &sp30); if ((((fabsf(sp30.z) < 3000.0f) && (fabsf(sp30.x) < 3000.0f) && (gBossActive == 0)) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) || (gCurrentLevel == LEVEL_VENOM_ANDROSS) || - (gCurrentLevel == LEVEL_VENOM_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7)) && + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) || (gCurrentLevel == LEVEL_VENOM_ANDROSS) || + (gCurrentLevel == LEVEL_VENOM_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) && (gCurrentLevel != LEVEL_MACBETH) && (gCurrentLevel != LEVEL_TITANIA)) { if (actor->obj.id == OBJ_ACTOR_195) { - if (((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) && + if (((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (actor->index == 10)) || - ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) && (gPlayer[0].unk_1D0 >= 100) && + ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gPlayer[0].unk_1D0 >= 100) && (gCurrentLevel == LEVEL_KATINA) && (actor->index == 1)) || - ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) && + ((gCurrentLevel == LEVEL_SECTOR_Y) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) && (actor->state == 5))) { D_edisplay_80161630.rightState = gPlayer[0].wings.rightState; D_edisplay_80161630.leftState = gPlayer[0].wings.leftState; @@ -537,7 +537,7 @@ void func_edisplay_8005B388(Actor* actor) { D_edisplay_80161630.unk_14 = D_edisplay_80161630.unk_18 = D_edisplay_80161630.unk_1C = D_edisplay_80161630.unk_20 = D_edisplay_80161630.unk_38 = D_edisplay_80161630.unk_24 = 0.0f; D_edisplay_80161630.unk_28 = actor->fwork[17]; - D_edisplay_80161630.unk_2C = actor->iwork[14]; + D_edisplay_80161630.modelId = actor->iwork[14]; D_edisplay_80161630.unk_30 = actor->fwork[20]; D_edisplay_80161630.unk_34 = actor->fwork[19]; if (gLevelType == LEVELTYPE_SPACE) { @@ -556,14 +556,14 @@ void func_edisplay_8005B388(Actor* actor) { } void func_edisplay_8005B6A4(Actor* actor) { - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_6024B60); } void func_edisplay_8005B71C(Actor* actor) { RCP_SetupDL_29(actor->unk_046, gFogGreen, gFogBlue, gFogAlpha, actor->unk_048, gFogFar); - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_6018C00); } @@ -592,14 +592,14 @@ void func_edisplay_8005B848(Actor* actor) { if ((gGameFrameCount % 2) != 0) { scale = 1.7f; } - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); actor->iwork[11] = 1; - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); func_edisplay_8005B1E8(actor, 2); } void func_edisplay_8005B9A4(Actor* actor) { - Matrix_Translate(gGfxMatrix, 0.0f, -124.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -124.0f, 0.0f, MTXF_APPLY); Animation_GetFrameData(&D_CO_6029528, actor->unk_0B6, actor->vwork); Animation_DrawSkeleton(1, D_CO_6029674, actor->vwork, NULL, NULL, actor, &gIdentityMatrix); } @@ -627,8 +627,8 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { switch (objId) { case OBJ_EFFECT_374: if (gEffects[index].state == 0) { - Matrix_Scale(gGfxMatrix, 1.2f, 0.0f, 1.2f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Scale(gGfxMatrix, 1.2f, 0.0f, 1.2f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102A8A0); } @@ -639,8 +639,8 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { case OBJ_ACTOR_EVENT: switch (gActors[index].unk_0B4) { case EINFO_3: - Matrix_Scale(gGfxMatrix, 2.3f, 0.0f, 2.3f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Scale(gGfxMatrix, 2.3f, 0.0f, 2.3f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102A010); break; @@ -649,17 +649,17 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 255); temp_fv0 = gActors[index].fwork[15] * 3.0f; - Matrix_Scale(gGfxMatrix, temp_fv0, temp_fv0, temp_fv0, 1); - Matrix_RotateX(gGfxMatrix, -M_PI / 2, 1); + Matrix_Scale(gGfxMatrix, temp_fv0, temp_fv0, temp_fv0, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); break; default: temp1 = D_edisplay_800CFCCC[gGameFrameCount % 8U]; temp2 = D_edisplay_800CFCCC[(gGameFrameCount + 4) % 8U]; - Matrix_Scale(gGfxMatrix, 1.4f + temp1, 0.0f, 1.4f + temp2, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, 1); + Matrix_Scale(gGfxMatrix, 1.4f + temp1, 0.0f, 1.4f + temp2, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_1032780); @@ -670,11 +670,11 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; case OBJ_BOSS_316: - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) { RCP_SetupDL(&gMasterDisp, 0x40); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 200); } - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Graphics_SetScaleMtx(150.0f); gSPDisplayList(gMasterDisp++, D_102A8A0); break; @@ -703,7 +703,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { break; case OBJ_ACTOR_192: gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 150); - Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, gActors[index].scale, 1); + Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, gActors[index].scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_CO_6034B90); break; @@ -713,10 +713,10 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_RotateX(gGfxMatrix, gActors[index].fwork[0], 1); - Matrix_RotateZ(gGfxMatrix, gActors[index].fwork[2], 1); - Matrix_Scale(gGfxMatrix, gActors[index].scale, 1.0f, gActors[index].scale, 1); - Matrix_RotateX(gGfxMatrix, -M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, gActors[index].fwork[0], MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gActors[index].fwork[2], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gActors[index].scale, 1.0f, gActors[index].scale, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -725,12 +725,12 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 120.0f, 1); - Matrix_RotateX(gGfxMatrix, gActors[index].fwork[1] * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, gActors[index].fwork[2] * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, gActors[index].obj.rot.y * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 6.0f, 1.0f, 7.5f, 1); - Matrix_RotateX(gGfxMatrix, -M_PI / 2, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 120.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gActors[index].fwork[1] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gActors[index].fwork[2] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gActors[index].obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 6.0f, 1.0f, 7.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -738,11 +738,11 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { RCP_SetupDL(&gMasterDisp, 0x45); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_RotateX(gGfxMatrix, gActors[index].fwork[1], 1); - Matrix_RotateZ(gGfxMatrix, gActors[index].fwork[2], 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 1.2f, 1.0f, 1.2f, 1); - Matrix_RotateX(gGfxMatrix, -M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, gActors[index].fwork[1], MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gActors[index].fwork[2], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.2f, 1.0f, 1.2f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -750,7 +750,7 @@ void func_edisplay_8005BAB4(ObjectId objId, s32 index) { RCP_SetupDL_48(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 255); - Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, 1); + Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -767,7 +767,7 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x40); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); - Matrix_Scale(gGfxMatrix, 3.2f, 3.2f, 3.2f, 1); + Matrix_Scale(gGfxMatrix, 3.2f, 3.2f, 3.2f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); gSPDisplayList(gMasterDisp++, D_1023C80); @@ -777,13 +777,13 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); - Matrix_RotateZ(gGfxMatrix, this->unk_58 * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, this->unk_58 * M_DTOR, MTXF_APPLY); for (i = 0; i < 8; i++) { Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, i * 45.0f * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, 2.0f * this->scale, 0.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, (gGameFrameCount + (i * 110.0f)) * M_DTOR * 7.2f * this->unk_54, 1); + Matrix_RotateZ(gGfxMatrix, i * 45.0f * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 2.0f * this->scale, 0.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (gGameFrameCount + (i * 110.0f)) * M_DTOR * 7.2f * this->unk_54, MTXF_APPLY); Graphics_SetScaleMtx(2.0f * this->unk_50); gSPDisplayList(gMasterDisp++, D_101CAE0); Matrix_Pop(&gGfxMatrix); @@ -850,8 +850,8 @@ void ItemLasers_Draw(ItemLasers* this) { void ItemMeteoWarp_Draw(ItemMeteoWarp* this) { s32 i; - this->obj.rot.y = (Math_Atan2F(gPlayer[gPlayerNum].camEye.x - this->obj.pos.x, - gPlayer[gPlayerNum].camEye.z - (this->obj.pos.z + D_ctx_80177D20)) * + this->obj.rot.y = (Math_Atan2F(gPlayer[gPlayerNum].cam.eye.x - this->obj.pos.x, + gPlayer[gPlayerNum].cam.eye.z - (this->obj.pos.z + D_ctx_80177D20)) * 180.0f) / M_PI; if (this->state != 0) { @@ -863,8 +863,8 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK | G_LIGHTING); for (i = 0; i < 7; i++) { Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, (i * 360.0f / 7.0f) * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, 0.0f, this->scale, 0.0f, 1); + Matrix_RotateZ(gGfxMatrix, (i * 360.0f / 7.0f) * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, this->scale, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102FE80); Matrix_Pop(&gGfxMatrix); @@ -874,68 +874,68 @@ void ItemMeteoWarp_Draw(ItemMeteoWarp* this) { void func_edisplay_8005D008(Object* obj, s32 drawType) { if (drawType == 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, 1); - Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, 0); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW); Matrix_Push(&gGfxMatrix); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); Matrix_Pop(&gGfxMatrix); - Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); - Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } } void func_edisplay_8005D1F0(Object* obj, s32 drawType) { if (drawType == 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, 1); - Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, 0); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW); Matrix_Push(&gGfxMatrix); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); Matrix_Pop(&gGfxMatrix); - Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); - Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } } void func_edisplay_8005D3CC(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawType) { if (drawType == 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, 1); - Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, 0); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, obj->pos.x, obj->pos.y, obj->pos.z, MTXF_NEW); Matrix_Push(&gGfxMatrix); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); Matrix_Pop(&gGfxMatrix); - Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * xRot, 1); - Matrix_RotateZ(gCalcMatrix, M_DTOR * zRot, 1); - Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * xRot, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, M_DTOR * zRot, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, obj->pos.y, obj->pos.z + D_ctx_80177D20, MTXF_APPLY); Matrix_Copy(&D_edisplay_801615F0, gGfxMatrix); - Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, 1); - Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } } @@ -1047,10 +1047,10 @@ void Actor_DrawAllRange(Actor* this) { D_edisplay_801615EC = 0; if (this->info.drawType == 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, 1); - Matrix_Translate(gCalcMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 0); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_ctx_80177D20, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_NEW); Matrix_Push(&gGfxMatrix); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0); Matrix_Pop(&gGfxMatrix); var_fv0 = 0.0f; @@ -1062,12 +1062,12 @@ void Actor_DrawAllRange(Actor* this) { if ((var_fv0 > D_edisplay_801615E0.z) && (D_edisplay_801615E0.z > var_fv1)) { if (fabsf(D_edisplay_801615E0.x) < (fabsf(D_edisplay_801615E0.z * 0.5f) + 500.0f)) { if (fabsf(D_edisplay_801615E0.y) < (fabsf(D_edisplay_801615E0.z * 0.5f) + 500.0f)) { - Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); this->info.draw(&this->obj); D_edisplay_801615EC = 1; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (this->obj.id == OBJ_ACTOR_ALLRANGE) && + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->obj.id == OBJ_ACTOR_ALLRANGE) && (this->aiType == AI360_MISSILE)) { gTeamArrowsViewPos[0] = D_edisplay_801615E0; } @@ -1075,9 +1075,10 @@ void Actor_DrawAllRange(Actor* this) { } } } else { - Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp50, &D_edisplay_801615E0); - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) || + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) || ((this->obj.id == OBJ_ACTOR_ALLRANGE) && (this->aiType >= AI360_GREAT_FOX)) || ((this->obj.id == OBJ_ACTOR_195) && (this->info.bonus != 0))) { var_ft5 = var_fv0 = 3000.0f; @@ -1093,13 +1094,13 @@ void Actor_DrawAllRange(Actor* this) { if (fabsf(D_edisplay_801615E0.x) < (fabsf(D_edisplay_801615E0.z * var_fa1) + var_ft5)) { if (fabsf(D_edisplay_801615E0.y) < (fabsf(D_edisplay_801615E0.z * var_fa1) + var_ft5)) { if (this->info.draw != NULL) { - Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); this->info.draw(&this->obj); D_edisplay_801615EC = 1; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (((this->obj.id == OBJ_ACTOR_ALLRANGE) && ((this->aiType <= AI360_PEPPY) || (this->aiType == AI360_KATT) || (this->aiType == AI360_BILL))) || @@ -1218,9 +1219,9 @@ void Effect_DrawAllRange(Effect* this) { if (this->info.unk_14 == -1) { Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z + D_ctx_80177D20, - 1); + MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); } Matrix_MultVec3f(gGfxMatrix, &sp4C, &sp40); if ((gCurrentLevel == LEVEL_SECTOR_Z) || (gCurrentLevel == LEVEL_BOLSE)) { @@ -1232,9 +1233,9 @@ void Effect_DrawAllRange(Effect* this) { if (fabsf(sp40.x) < (fabsf(sp40.z * 0.5f) + 500.0f)) { if (fabsf(sp40.y) < (fabsf(sp40.z * 0.5f) + 500.0f)) { if (this->info.draw != NULL) { - Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); this->info.draw(&this->obj); } @@ -1253,16 +1254,16 @@ void Item_Draw(Item* this, s32 arg1) { Vec3f sp38; u8 var_v0; - Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp44, &sp38); var_v0 = 0; if ((sp38.z < 0.0f) && (sp38.z > -12000.0f)) { if (fabsf(sp38.x) < (fabsf(sp38.z * 0.5f) + 500.0f)) { if (fabsf(sp38.y) < (fabsf(sp38.z * 0.5f) + 500.0f)) { if (this->info.draw != NULL) { - Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (this->info.drawType == 0) { gSPDisplayList(gMasterDisp++, this->info.dList); @@ -1282,19 +1283,19 @@ void Item_Draw(Item* this, s32 arg1) { } void func_edisplay_8005EA24(Actor* actor) { - Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->fwork[25] + 3.0f, actor->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->fwork[25] + 3.0f, actor->obj.pos.z, MTXF_APPLY); if (gCurrentLevel == LEVEL_FORTUNA) { - Matrix_RotateY(gGfxMatrix, actor->fwork[27], 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[26], 1); - Matrix_RotateZ(gGfxMatrix, actor->fwork[28], 1); - Matrix_RotateY(gGfxMatrix, -actor->fwork[27], 1); + Matrix_RotateY(gGfxMatrix, actor->fwork[27], MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[26], MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, actor->fwork[28], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -actor->fwork[27], MTXF_APPLY); } - Matrix_Scale(gGfxMatrix, 1.4f, 0.0f, 1.4f, 1); - Matrix_RotateY(gGfxMatrix, (actor->obj.rot.y + 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, 1.4f, 0.0f, 1.4f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, (actor->obj.rot.y + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (actor->aiType <= AI360_PEPPY) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 30.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1032780); } else if (gCurrentLevel == LEVEL_KATINA) { @@ -1321,29 +1322,29 @@ void func_edisplay_8005ECD8(s32 index, Object* obj) { switch (obj->id) { case OBJ_ACTOR_230: Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f + gActors[index].fwork[1], - obj->pos.z + D_ctx_80177D20, 1); + obj->pos.z + D_ctx_80177D20, MTXF_APPLY); break; case OBJ_ACTOR_229: case OBJ_ACTOR_231: Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f + gActors[index].fwork[0], - obj->pos.z + D_ctx_80177D20, 1); + obj->pos.z + D_ctx_80177D20, MTXF_APPLY); break; case OBJ_BOSS_316: - Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f + gCameraShakeY, obj->pos.z, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f + gCameraShakeY, obj->pos.z, MTXF_APPLY); break; default: - Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f, obj->pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, obj->pos.x, gGroundLevel + 2.0f, obj->pos.z + D_ctx_80177D20, MTXF_APPLY); break; } if ((D_ctx_801784AC != 4) || (obj->id == OBJ_ACTOR_EVENT) || (obj->id == OBJ_ACTOR_195) || (obj->id == OBJ_ACTOR_TEAM_BOSS)) { - Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, 1); - Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 0.0f, 1.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, obj->rot.y * M_DTOR, MTXF_APPLY); } if ((obj->id < OBJ_BOSS_292) && (obj->id != OBJ_ACTOR_230) && (obj->id != OBJ_ACTOR_229) && (obj->id != OBJ_ACTOR_231)) { - Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); func_edisplay_8005BAB4(obj->id, index); @@ -1378,8 +1379,8 @@ void func_edisplay_8005F0E8(f32* sfxSrc, Vec3f* pos) { if (gCamCount != 1) { sfxSrc[0] = sfxSrc[1] = sfxSrc[2] = 0.0f; } else { - Matrix_RotateY(gCalcMatrix, gPlayer[0].unk_058, 0); - Matrix_RotateX(gCalcMatrix, gPlayer[0].unk_05C, 1); + Matrix_RotateY(gCalcMatrix, gPlayer[0].camYaw, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, gPlayer[0].camPitch, MTXF_APPLY); sp2C.x = pos->x - gPlayerCamEye.x; sp2C.y = pos->y - gPlayerCamEye.y; sp2C.z = pos->z + D_ctx_80177D20 - gPlayerCamEye.z; @@ -1440,9 +1441,9 @@ void Object_58_Draw(Object_58* this) { sp38 = 0.9f; } if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { - Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z, MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1); + Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, MTXF_APPLY); } Matrix_MultVec3f(gGfxMatrix, &sp54, &sp48); if ((sp48.z < sp44) && (sp40 < sp48.z)) { @@ -1450,15 +1451,15 @@ void Object_58_Draw(Object_58* this) { if (fabsf(sp48.x) < (fabsf(sp48.z * sp38) + sp3C)) { func_edisplay_8005F670(&this->obj.pos); if (this->obj.id == OBJ_80_131) { - Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, M_PI / 2, 1); - Matrix_Translate(gGfxMatrix, -551.0f, 0.0f, 0.0f, 1); + Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, -551.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE2_6007650); } else { - Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, this->info.dList); } @@ -1485,7 +1486,7 @@ void func_edisplay_8005F670(Vec3f* arg0) { sp9C.y = arg0->y - D_ctx_80178374; sp9C.z = arg0->z - D_ctx_80178378; temp_fv0 = (VEC3F_MAG(&sp9C)); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { var_fs0 = 700.0f / temp_fv0; } else { var_fs0 = 200.0f / temp_fv0; @@ -1499,10 +1500,10 @@ void func_edisplay_8005F670(Vec3f* arg0) { sp94 = Math_Atan2F(sp9C.x, sp9C.z); sp98 = -Math_Atan2F(sp9C.y, sqrtf(SQ(sp9C.x) + SQ(sp9C.z))); Matrix_Push(&gCalcMatrix); - Matrix_RotateZ(gCalcMatrix, gPlayer[gPlayerNum].unk_034 * D_ctx_80177950 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -gPlayer[gPlayerNum].unk_05C, 1); - Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].unk_058 + sp94, 1); - Matrix_RotateX(gCalcMatrix, sp98, 1); + Matrix_RotateZ(gCalcMatrix, gPlayer[gPlayerNum].camRoll * D_ctx_80177950 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -gPlayer[gPlayerNum].camPitch, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].camYaw + sp94, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, sp98, MTXF_APPLY); sp6C.x = 0.0f; sp6C.y = 0.0f; sp6C.z = -100.0f; @@ -1520,11 +1521,11 @@ bool func_edisplay_8005F9DC(Vec3f* arg0) { Vec3f sp2C; Vec3f sp20; - Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].unk_058, 0); - Matrix_RotateX(gCalcMatrix, gPlayer[gPlayerNum].unk_05C, 1); - sp2C.x = arg0->x - gPlayer[gPlayerNum].camEye.x; - sp2C.y = arg0->y - gPlayer[gPlayerNum].camEye.y; - sp2C.z = arg0->z - gPlayer[gPlayerNum].camEye.z; + Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].camYaw, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); + sp2C.x = arg0->x - gPlayer[gPlayerNum].cam.eye.x; + sp2C.y = arg0->y - gPlayer[gPlayerNum].cam.eye.y; + sp2C.z = arg0->z - gPlayer[gPlayerNum].cam.eye.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp2C, &sp20); if ((sp20.z < 1000.0f) && (sp20.z > -13000.0f)) { if (fabsf(sp20.x) < (fabsf(sp20.z * 0.4f) + 2000.0f)) { @@ -1633,8 +1634,8 @@ void Object_DrawAll(s32 arg0) { case LEVELMODE_ON_RAILS: case LEVELMODE_UNK_2: Matrix_Push(&gGfxMatrix); - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) || - (gCurrentLevel == LEVEL_AQUAS)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gCurrentLevel == LEVEL_AQUAS)) { func_edisplay_8005F670(&actor->obj.pos); } func_edisplay_800597C0(arg0); @@ -1685,8 +1686,8 @@ void Effect_DrawAll(s32 arg0) { for (i = 0, effect = gEffects; i < ARRAY_COUNT(gEffects); i++, effect++) { if (effect->obj.status >= OBJ_ACTIVE) { if (effect->info.unk_14 == 1) { - effect->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].unk_058); - effect->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].unk_05C); + effect->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); + effect->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].camPitch); } if (gLevelMode == LEVELMODE_ALL_RANGE) { Matrix_Push(&gGfxMatrix); @@ -1723,12 +1724,12 @@ void Effect_DrawAll(s32 arg0) { void Object_Draw(s32 arg0) { gReflectY = 1; Object_DrawAll(1); - if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { gReflectY = -1; Lights_SetOneLight(&gMasterDisp, gLight1x, -1 * gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, gAmbientG, gAmbientB); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY); Object_DrawAll(-1); Matrix_Pop(&gGfxMatrix); Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, gLight1R, gLight1G, gLight1B, gAmbientR, @@ -1740,10 +1741,10 @@ void Effect_Draw(u8 arg0) { if (arg0 == 0) { gReflectY = 1; Effect_DrawAll(1); - } else if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + } else if ((gGroundType == GROUNDTYPE_WATER) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { gReflectY = -1; Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, -1.0f, 1.0f, MTXF_APPLY); Effect_DrawAll(-1); Matrix_Pop(&gGfxMatrix); } @@ -1778,26 +1779,27 @@ void TexturedLine_Draw(void) { if (gTexturedLines[i].mode != 0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z + D_ctx_80177D20, 1); - Matrix_RotateY(gGfxMatrix, texLine->unk_20, 1); - Matrix_RotateX(gGfxMatrix, texLine->unk_1C, 1); - Matrix_RotateZ(gGfxMatrix, texLine->unk_20, 1); - Matrix_Scale(gGfxMatrix, texLine->unk_28, texLine->unk_28, texLine->unk_24, 1); + Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z + D_ctx_80177D20, + MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, texLine->unk_20, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, texLine->unk_20, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, texLine->unk_28, texLine->unk_28, texLine->unk_24, MTXF_APPLY); if ((gCurrentLevel == LEVEL_AQUAS) || (gCurrentLevel == LEVEL_VENOM_ANDROSS)) { s32 alpha = ((gGameFrameCount % 2) != 0) ? 180 : 50; gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, alpha); if (gCurrentLevel == LEVEL_AQUAS) { - Matrix_Scale(gGfxMatrix, 0.01f, 0.3f, 0.0025f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -200.0f, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 5.0f * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, 0.01f, 0.3f, 0.0025f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -200.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 5.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_60119A0); } else if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.0025f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -200.0f, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 25.0f * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.0025f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -200.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 25.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C017440); } @@ -1826,11 +1828,11 @@ void TexturedLine_DrawPath(s32 index) { } gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, texLine->unk_2C, texLine->unk_2D, texLine->unk_2E, texLine->unk_2F); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z, 1); - Matrix_RotateY(gGfxMatrix, texLine->unk_20, 1); - Matrix_RotateX(gGfxMatrix, texLine->unk_1C, 1); - Matrix_RotateZ(gGfxMatrix, texLine->unk_1C, 1); - Matrix_Scale(gGfxMatrix, texLine->unk_28, 1.0f, texLine->unk_24, 1); + Matrix_Translate(gGfxMatrix, texLine->unk_04.x, texLine->unk_04.y, texLine->unk_04.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, texLine->unk_20, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, texLine->unk_1C, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, texLine->unk_28, 1.0f, texLine->unk_24, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_edisplay_800CFD80); diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index 5be131bd..16c0687e 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -53,7 +53,7 @@ void BonusText_Update(void) { if (gLevelMode == LEVELMODE_ON_RAILS) { bonus->pos.z -= D_ctx_80177D08; - } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { + } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { bonus->pos.x += gPlayer[0].vel.x; bonus->pos.z += gPlayer[0].vel.z; } @@ -83,16 +83,16 @@ void BonusText_Draw(BonusText* bonus) { f32 sp50; if (bonus->timer <= 45) { - Matrix_Translate(gGfxMatrix, bonus->pos.x, bonus->pos.y, bonus->pos.z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, bonus->pos.x, bonus->pos.y, bonus->pos.z + D_ctx_80177D20, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &sp60, &sp54); if ((fabsf(sp54.x) < 20000.0f) && (fabsf(sp54.y) < 20000.0f)) { if ((sp54.z < 0.0f) && (sp54.z > -20000.0f)) { sp50 = (VEC3F_MAG(&sp54)) * 0.0015f * 0.2f; - Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].unk_058, 1); - Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].unk_05C, 1); - Matrix_Scale(gGfxMatrix, sp50, sp50, 1.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, bonus->unk_10, 0.0f, 1); + Matrix_RotateY(gGfxMatrix, -gPlayer[gPlayerNum].camYaw, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gPlayer[gPlayerNum].camPitch, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp50, sp50, 1.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, bonus->unk_10, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (bonus->hits <= 10) { @@ -206,8 +206,8 @@ void func_effect_80077A7C(Effect* effect) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); gDPSetEnvColor(gMasterDisp++, 255, 255, 255, effect->unk_44); - Matrix_Scale(gGfxMatrix, effect->scale1, effect->scale2, 1.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 20.0f, 0.0f, 1); + Matrix_Scale(gGfxMatrix, effect->scale1, effect->scale2, 1.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 20.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6024220); RCP_SetupDL(&gMasterDisp, 0x40); @@ -220,7 +220,7 @@ void func_effect_80077B84(Effect* effect) { Graphics_SetScaleMtx(effect->scale2); if ((effect->scale1 == 71.0f) || - ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) && (gCurrentLevel == LEVEL_CORNERIA))) { + ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gCurrentLevel == LEVEL_CORNERIA))) { RCP_SetupDL(&gMasterDisp, 0x26); } else { RCP_SetupDL(&gMasterDisp, 0x43); @@ -349,14 +349,14 @@ void func_effect_800780F8(Effect* effect) { for (i = 0; i < 10; i++) { if ((i >= effect->unk_48) && (i < effect->unk_46)) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -60.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 0.8f, 3.0f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -60.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.8f, 3.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102F5E0); Matrix_Pop(&gGfxMatrix); } - Matrix_Translate(gGfxMatrix, 0.0f, -120.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, D_800D1534[effect->unk_4C][i] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -120.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_800D1534[effect->unk_4C][i] * M_DTOR, MTXF_APPLY); } } @@ -375,7 +375,7 @@ void func_effect_80078438(Effect* effect) { void func_effect_800784B4(Effect* effect) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_46); Graphics_SetScaleMtx(effect->scale2); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BG_PLANET_200D750); } @@ -400,9 +400,9 @@ void func_effect_80078604(Effect* effect) { void func_effect_8007868C(Effect* effect) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); if (effect->unk_44 >= 2) { - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1029780); @@ -412,8 +412,8 @@ void func_effect_8007868C(Effect* effect) { void func_effect_8007879C(Effect* effect) { RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Scale(gGfxMatrix, effect->scale2 * 0.6f, 1.0f, effect->scale2 * 3.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2 * 0.6f, 1.0f, effect->scale2 * 3.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1029780); RCP_SetupDL(&gMasterDisp, 0x40); @@ -594,8 +594,8 @@ void func_effect_8007905C(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal yAng = Math_Atan2F(sp3C.x - xPos, sp3C.z - zPos); sp38 = sqrtf(SQ(sp3C.x - xPos) + SQ(sp3C.z - zPos)); xAng = -Math_Atan2F(sp3C.y - yPos, sp38); - Matrix_RotateY(gCalcMatrix, yAng, 0); - Matrix_RotateX(gCalcMatrix, xAng, 1); + Matrix_RotateY(gCalcMatrix, yAng, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, xAng, MTXF_APPLY); sp54.x = RAND_FLOAT_CENTERED(50.0f); sp54.y = RAND_FLOAT_CENTERED(50.0f); sp54.z = RAND_FLOAT(10.0f) + 150.0f; @@ -683,7 +683,8 @@ void func_effect_8007968C(Effect* effect) { effect->vel.y -= 0.5f; } - if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) && (gCsFrameCount > 175)) { + if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && + (gCsFrameCount > 175)) { effect->vel.x *= 0.95f; effect->vel.y *= 0.95f; effect->vel.z *= 0.95f; @@ -710,7 +711,7 @@ bool func_effect_800798C4(s32 arg0, Gfx** arg1, Vec3f* arg2, Vec3f* arg3, void* void func_effect_800798F0(Effect* effect) { Vec3f frameJointTable[50]; - if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7)) { + if ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { func_edisplay_8005F670(&effect->obj.pos); } @@ -840,16 +841,16 @@ void func_effect_800798F0(Effect* effect) { case 1: switch ((s32) (effect->index % 4U)) { case 0: - Matrix_Scale(gGfxMatrix, 1.0f, 0.3f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 0.3f, 1.0f, MTXF_APPLY); break; case 1: - Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, MTXF_APPLY); break; case 2: - Matrix_Scale(gGfxMatrix, 1.0f, 0.5f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 0.5f, 1.0f, MTXF_APPLY); break; case 3: - Matrix_Scale(gGfxMatrix, 0.5f, 1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 1.0f, 1.0f, MTXF_APPLY); break; } Matrix_SetGfxMtx(&gMasterDisp); @@ -900,7 +901,7 @@ void func_effect_8007A28C(Effect* effect) { void func_effect_8007A3C0(Effect* effect) { if (gReflectY > 0) { - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_64_2(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); @@ -1046,7 +1047,7 @@ void func_effect_8007AA60(Effect* effect) { RCP_SetupDL(&gMasterDisp, 0x44); gDPSetPrimColor(gMasterDisp++, 0, 0, 31, 10, 00, effect->unk_44); gDPSetEnvColor(gMasterDisp++, 141, 73, 5, 0); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, 1.0f, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_800D178C[effect->unk_4C]); effect->unk_4C = effect->unk_48; @@ -1467,11 +1468,11 @@ void func_effect_8007BC7C(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { } void func_effect_8007BCE8(Effect* effect) { - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { - effect->obj.rot.x = RAD_TO_DEG(gPlayer[0].unk_05C); - effect->obj.rot.y = RAD_TO_DEG(-gPlayer[0].unk_058); + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { + effect->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); + effect->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_6) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) { effect->unk_46 = 2; effect->vel.y -= 0.13f; } @@ -1699,7 +1700,7 @@ void func_effect_8007C6FC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 scal if (Rand_ZeroOne() < 0.5f) { effect->unk_48 = -effect->unk_48; } - if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_6)) { + if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT)) { effect->unk_4A = 180; } else { effect->unk_4A = 255; @@ -1736,7 +1737,7 @@ void func_effect_8007C8C4(Effect* effect) { s32 var_v0; var_v0 = 0; - if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_6)) { + if ((gCurrentLevel == LEVEL_FORTUNA) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT)) { var_v0 = 3; } @@ -1780,7 +1781,7 @@ void func_effect_8007CAF0(Effect* effect) { gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, effect->unk_4A); gSPDisplayList(gMasterDisp++, D_102A010); } else { - Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); + Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_4A); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20031B0); @@ -1964,7 +1965,7 @@ void func_effect_8007D2C8(f32 xPos, f32 yPos, f32 zPos, f32 scale2) { void func_effect_8007D2F4(Effect* effect) { if (gLevelType == LEVELTYPE_PLANET) { - if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7)) { + if ((gCurrentLevel == LEVEL_KATINA) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { effect->vel.y += 0.1f; if (effect->timer_50 == 0) { effect->unk_4C++; @@ -1977,7 +1978,7 @@ void func_effect_8007D2F4(Effect* effect) { } } } else { - if ((gCurrentLevel == LEVEL_MACBETH) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) && + if ((gCurrentLevel == LEVEL_MACBETH) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (effect->vel.x != 0)) { Math_SmoothStepToF(&effect->vel.x, -1.0f, 1.0f, 1.0f, 0.0f); Math_SmoothStepToF(&effect->vel.z, 4.0f, 1.0f, 1.0f, 0.0f); @@ -2053,14 +2054,14 @@ void func_effect_8007D55C(Effect* effect) { gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D184C[effect->unk_4C][0], D_800D184C[effect->unk_4C][1], D_800D184C[effect->unk_4C][2], D_800D184C[effect->unk_4C][3]); scale = D_800D17F8[effect->unk_4C] - 0.5f; - Matrix_Scale(gGfxMatrix, scale, scale, 1.0f, 1); + Matrix_Scale(gGfxMatrix, scale, scale, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_800D17A4[effect->unk_4C]); return; } gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 100, effect->unk_44); if (effect->unk_4C == 0) { - Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); + Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_800D18A0[effect->unk_4C]); return; @@ -2173,7 +2174,7 @@ void func_effect_8007DB70(Effect* effect) { switch (effect->state) { case 0: effect->vel.y -= 0.5f; - if ((effect->timer_50 == 0) && ((func_enmy_8006351C(1000, &effect->obj.pos, &sp54, 1) != 0) || + if ((effect->timer_50 == 0) && ((Object_CheckCollision(1000, &effect->obj.pos, &sp54, 1) != 0) || (effect->obj.pos.y < (gGroundLevel + 10.0f)))) { effect->vel.y = 0.0f; if (effect->obj.pos.y < (gGroundLevel + 10.0f)) { @@ -2228,7 +2229,7 @@ void func_effect_8007DED4(Effect* effect) { break; case 1: - Matrix_Scale(gGfxMatrix, effect->scale1, effect->scale2, 2.5f, 1); + Matrix_Scale(gGfxMatrix, effect->scale1, effect->scale2, 2.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_40(); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -2380,8 +2381,8 @@ void func_effect_8007E6B8(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo temp_ft4 = sqrtf(SQ(gPlayer[0].pos.x - xPos) + SQ(gPlayer[0].unk_138 - zPos)); sp54 = -Math_Atan2F(gPlayer[0].pos.y - yPos, temp_ft4); - Matrix_RotateY(gCalcMatrix, sp50, 0); - Matrix_RotateX(gCalcMatrix, sp54, 1); + Matrix_RotateY(gCalcMatrix, sp50, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, sp54, MTXF_APPLY); sp40.x = 0.0f; sp40.y = 0.0f; @@ -2433,12 +2434,12 @@ void func_effect_8007E93C(Effect* effect, u32 objId, f32 xPos, f32 yPos, f32 zPo effect->obj.pos.z = zPos; Object_SetInfo(&effect->info, effect->obj.id); - sp50 = Math_Atan2F(gPlayer[0].camEye.x - xPos, gPlayer[0].camEye.z - zPos); - temp_ft4 = sqrtf(SQ(gPlayer[0].camEye.x - xPos) + SQ(gPlayer[0].camEye.z - zPos)); - sp54 = -Math_Atan2F(gPlayer[0].camEye.y - yPos, temp_ft4); + sp50 = Math_Atan2F(gPlayer[0].cam.eye.x - xPos, gPlayer[0].cam.eye.z - zPos); + temp_ft4 = sqrtf(SQ(gPlayer[0].cam.eye.x - xPos) + SQ(gPlayer[0].cam.eye.z - zPos)); + sp54 = -Math_Atan2F(gPlayer[0].cam.eye.y - yPos, temp_ft4); - Matrix_RotateY(gCalcMatrix, sp50, 0); - Matrix_RotateX(gCalcMatrix, sp54, 1); + Matrix_RotateY(gCalcMatrix, sp50, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, sp54, MTXF_APPLY); sp40.x = 0.0f; sp40.y = 0.0f; @@ -2547,12 +2548,12 @@ void func_effect_8007EE68(ObjectId objId, Vec3f* pos, Vec3f* rot, Vec3f* arg3, V s32 i; Vec3f sp68; - Matrix_RotateY(gCalcMatrix, arg3->y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, arg3->x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, arg3->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, arg3->y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, arg3->x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, arg3->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, arg4, &sp68); for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) { @@ -2596,7 +2597,7 @@ void func_effect_8007F11C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 spee void func_effect_8007F20C(ObjectId objId, f32 xPos, f32 yPos, f32 zPos, f32 speed) { s32 i; - if ((fabsf(zPos - gPlayer[0].camEye.z) > 300.0f) || (fabsf(xPos - gPlayer[0].camEye.x) > 300.0f)) { + if ((fabsf(zPos - gPlayer[0].cam.eye.z) > 300.0f) || (fabsf(xPos - gPlayer[0].cam.eye.x) > 300.0f)) { for (i = ARRAY_COUNT(gEffects) - 1; i >= 0; i--) { if (gEffects[i].obj.status == OBJ_FREE) { Matrix_Push(&gCalcMatrix); @@ -2864,8 +2865,8 @@ void func_effect_8007FE88(Effect* effect) { if ((gPlayer[0].unk_280 != 0) || (gPlayer[0].timer_27C != 0)) { effect->obj.rot.y = 90.0f; effect->obj.rot.x = RAND_FLOAT(360.0f); - Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); srcVelocity.x = 0.0f; srcVelocity.y = 0.0f; srcVelocity.z = 100.0f; @@ -2911,7 +2912,7 @@ void func_effect_8007FE88(Effect* effect) { velocity.z = effect->vel.z; if (gCurrentLevel != LEVEL_MACBETH) { - if (func_enmy_8006351C(1000, &effect->obj.pos, &velocity, 2) != 0) { + if (Object_CheckCollision(1000, &effect->obj.pos, &velocity, 2) != 0) { func_effect_8007D10C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); Object_Kill(&effect->obj, effect->sfxSource); } @@ -2963,8 +2964,8 @@ void func_effect_8008040C(Effect* effect) { yRot = Math_Atan2F(gPlayer[0].pos.x - effect->obj.pos.x, gPlayer[0].unk_138 - effect->obj.pos.z); temp = sqrtf(SQ(gPlayer[0].pos.x - effect->obj.pos.x) + SQ(gPlayer[0].unk_138 - effect->obj.pos.z)); xRot = -Math_Atan2F(gPlayer[0].pos.y - effect->obj.pos.y, temp); - Matrix_RotateY(gCalcMatrix, yRot, 0); - Matrix_RotateX(gCalcMatrix, xRot, 1); + Matrix_RotateY(gCalcMatrix, yRot, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, xRot, MTXF_APPLY); srcVelocity.y = 0.0f; srcVelocity.x = 0.0f; srcVelocity.z = 100.0f; @@ -2997,8 +2998,8 @@ void func_effect_8008040C(Effect* effect) { if ((gPlayer[0].unk_280 != 0) || (gPlayer[0].timer_27C != 0)) { effect->obj.rot.y = 90.0f; effect->obj.rot.x = RAND_FLOAT(360.0f); - Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, effect->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); srcVelocity.y = 0.0f; srcVelocity.x = 0.0f; srcVelocity.z = 100.0f; @@ -3041,7 +3042,7 @@ void func_effect_8008040C(Effect* effect) { sp3C.y = effect->vel.y; sp3C.z = effect->vel.z; - if (func_enmy_8006351C(1000, &effect->obj.pos, &sp3C, 2) != 0) { + if (Object_CheckCollision(1000, &effect->obj.pos, &sp3C, 2) != 0) { func_effect_8007D10C(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 2.0f); Object_Kill(&effect->obj, effect->sfxSource); } @@ -3058,7 +3059,7 @@ void func_effect_8008092C(Effect* effect) { RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255); - Matrix_Scale(gGfxMatrix, 4.0f, 2.0f, 4.0f, 1); + Matrix_Scale(gGfxMatrix, 4.0f, 2.0f, 4.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6018AF0); break; @@ -3067,8 +3068,8 @@ void func_effect_8008092C(Effect* effect) { RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255); - Matrix_RotateZ(gGfxMatrix, 30.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 1.5f, 3.0f, 1); + Matrix_RotateZ(gGfxMatrix, 30.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 1.5f, 3.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); break; @@ -3186,7 +3187,7 @@ void func_effect_80080D04(Effect* effect) { case 10: RCP_SetupDL(&gMasterDisp, 0x41); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_48); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TI_A000000); RCP_SetupDL(&gMasterDisp, 0x40); @@ -3238,19 +3239,19 @@ void func_effect_80080D04(Effect* effect) { case 16: Graphics_SetScaleMtx(effect->scale2); gDPSetPrimColor(gMasterDisp++, 0, 0, 96, 96, 255, 255); - Matrix_Translate(gGfxMatrix, 34.14f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 34.14f, 0.0f, 0.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 0.25f, 1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.25f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102F5E0); Matrix_Pop(&gGfxMatrix); for (i = 0; i < 7; i++) { - Matrix_Translate(gGfxMatrix, 0.0f, 10.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_PI / 4, 1); - Matrix_Translate(gGfxMatrix, 1.0f, 20.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 10.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 1.0f, 20.0f, 0.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 0.25f, 1.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.25f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102F5E0); Matrix_Pop(&gGfxMatrix); @@ -3277,13 +3278,13 @@ void func_effect_80080D04(Effect* effect) { for (i = 0; i < 10; i++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -60.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 0.8f, 3.0f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -60.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.8f, 3.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102F5E0); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -120.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, D_800D1534[D_800D18E4][i] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -120.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_800D1534[D_800D18E4][i] * M_DTOR, MTXF_APPLY); } break; @@ -3498,7 +3499,7 @@ void func_effect_80081C5C(Effect* effect) { effect->vel.z, RAND_FLOAT(0.05f) + 0.05f, 0); } - if (func_enmy_8006351C(effect->index, &effect->obj.pos, &velocity, 1) != 0) { + if (Object_CheckCollision(effect->index, &effect->obj.pos, &velocity, 1) != 0) { func_effect_8007B344(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 3.0f, 7); Object_Kill(&effect->obj, effect->sfxSource); } @@ -3525,7 +3526,7 @@ void func_effect_80081C5C(Effect* effect) { Math_SmoothStepToF(&effect->scale2, 0.5f, 0.01f, 0.02f, 0.0f); } - if (func_enmy_8006351C(effect->index, &effect->obj.pos, &velocity, 1) != 0) { + if (Object_CheckCollision(effect->index, &effect->obj.pos, &velocity, 1) != 0) { Object_Kill(&effect->obj, effect->sfxSource); func_effect_8007D0E0(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 1.0f); } @@ -3563,7 +3564,7 @@ void func_effect_80081C5C(Effect* effect) { (RAND_FLOAT_CENTERED(effect->scale2) * 50.0f) + effect->obj.pos.z, effect->vel.x, effect->vel.y, effect->vel.z, RAND_FLOAT(0.03f) + 0.05f, 10); } - if (func_enmy_8006351C(effect->index, &effect->obj.pos, &velocity, 1) != 0) { + if (Object_CheckCollision(effect->index, &effect->obj.pos, &velocity, 1) != 0) { func_effect_8007B344(effect->obj.pos.x, effect->obj.pos.y, effect->obj.pos.z, 3.0f, 7); Object_Kill(&effect->obj, effect->sfxSource); } @@ -3653,8 +3654,8 @@ void func_effect_80081C5C(Effect* effect) { case 8: Math_SmoothStepToF(D_ctx_801779A8, 30.0f, 1.0f, 5.0f, 0.0f); - Matrix_RotateY(gCalcMatrix, gBosses[0].obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, gBosses[0].obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, gBosses[0].obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, gBosses[0].obj.rot.x * M_DTOR, MTXF_APPLY); velocity.y = 0.0f; velocity.x = 0; @@ -3723,8 +3724,8 @@ void func_effect_80081C5C(Effect* effect) { yRotDeg = Math_RadToDeg(Math_Atan2F(posXDiff, posZDiff)); xRotDeg = Math_RadToDeg(-Math_Atan2F(posYDiff, sqrtf(SQ(posXDiff) + SQ(posZDiff)))); - Matrix_RotateY(gCalcMatrix, M_DTOR * yRotDeg, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * xRotDeg, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRotDeg, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * xRotDeg, MTXF_APPLY); velocity.x = velocity.y = 0.0f; velocity.z = 20.0f; @@ -3764,13 +3765,13 @@ void func_effect_80081C5C(Effect* effect) { } if ((((gGameFrameCount % 16) == 0)) && (effect->timer_50 == 0)) { D_800D18EC = - RAD_TO_DEG(Math_Atan2F(gPlayer[0].camEye.x - gBosses[0].obj.pos.x, - gPlayer[0].camEye.z - (gBosses[0].obj.pos.z + D_ctx_80177D20))); + RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x, + gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + D_ctx_80177D20))); D_800D18E8 = RAD_TO_DEG( - -Math_Atan2F(gPlayer[0].camEye.y - gBosses[0].obj.pos.y, - sqrtf(SQ(gPlayer[0].camEye.z - (gBosses[0].obj.pos.z + D_ctx_80177D20)) + - SQ(gPlayer[0].camEye.x - gBosses[0].obj.pos.x)))); + -Math_Atan2F(gPlayer[0].cam.eye.y - gBosses[0].obj.pos.y, + sqrtf(SQ(gPlayer[0].cam.eye.z - (gBosses[0].obj.pos.z + D_ctx_80177D20)) + + SQ(gPlayer[0].cam.eye.x - gBosses[0].obj.pos.x)))); } if (gBosses[0].timer_050 == 0) { gBosses[0].swork[39] = effect->index; @@ -3792,8 +3793,8 @@ void func_effect_80081C5C(Effect* effect) { effect->obj.rot.y = gBosses[0].obj.rot.y; effect->obj.rot.z += 30.0f; - Matrix_RotateY(gCalcMatrix, gBosses[0].obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, gBosses[0].obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, gBosses[0].obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, gBosses[0].obj.rot.x * M_DTOR, MTXF_APPLY); velocity.x = velocity.y = 0.0f; velocity.z = 250.0f; @@ -3864,7 +3865,7 @@ void func_effect_80082F78(Effect* effect) { switch (effect->state) { case 0: RCP_SetupDL(&gMasterDisp, 0x31); - Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 0.7f, 0.7f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 32, 32, 255, 255); @@ -3880,7 +3881,7 @@ void func_effect_80082F78(Effect* effect) { case 2: RCP_SetupDL(&gMasterDisp, 0x31); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 32, 32, 255, 255); @@ -3924,7 +3925,7 @@ void func_effect_80082F78(Effect* effect) { case 8: RCP_SetupDL(&gMasterDisp, 0x31); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 0, 128, 255); @@ -3933,7 +3934,7 @@ void func_effect_80082F78(Effect* effect) { case 9: RCP_SetupDL(&gMasterDisp, 0x31); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->scale1); gDPSetEnvColor(gMasterDisp++, 255, 255, 128, 255); @@ -3945,7 +3946,7 @@ void func_effect_80082F78(Effect* effect) { Texture_Scroll(D_A6_6012840, 16, 16, 0); } RCP_SetupDL(&gMasterDisp, 0x35); - Matrix_Scale(gGfxMatrix, effect->unk_60.x, effect->unk_60.y, effect->unk_60.z, 1); + Matrix_Scale(gGfxMatrix, effect->unk_60.x, effect->unk_60.y, effect->unk_60.z, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6012550); @@ -4050,15 +4051,15 @@ void func_effect_800837EC(Effect* effect) { break; } - effect->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].camEye.x - effect->obj.pos.x, - gPlayer[0].camEye.z - (effect->obj.pos.z + D_ctx_80177D20))); + effect->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - effect->obj.pos.x, + gPlayer[0].cam.eye.z - (effect->obj.pos.z + D_ctx_80177D20))); } void func_effect_80083B8C(Effect* effect) { RCP_SetupDL_49(); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); gDPSetEnvColor(gMasterDisp++, 36, 45, 28, 255); - Matrix_Scale(gGfxMatrix, effect->unk_60.x, effect->scale2 * effect->unk_60.y, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->unk_60.x, effect->scale2 * effect->unk_60.y, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_601BAD0); RCP_SetupDL(&gMasterDisp, 0x40); @@ -4120,8 +4121,8 @@ void func_effect_80083D2C(f32 xPos, f32 yPos, f32 zPos, f32 srcZ) { yRot = Math_Atan2F(x, z); xRot = -Math_Atan2F(y, sqrtf(SQ(x) + SQ(z))); - Matrix_RotateY(gCalcMatrix, yRot, 0); - Matrix_RotateX(gCalcMatrix, xRot, 1); + Matrix_RotateY(gCalcMatrix, yRot, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, xRot, MTXF_APPLY); src.x = src.y = 0.0f; src.z = srcZ; @@ -4152,12 +4153,12 @@ void func_effect_80083FA8(Effect* effect) { return; } - effect->obj.rot.y = RAD_TO_DEG(-gPlayer[0].unk_058); - effect->obj.rot.x = RAD_TO_DEG(gPlayer[0].unk_05C); + effect->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); + effect->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); effect->obj.rot.z += 20.0f; - Matrix_RotateZ(gCalcMatrix, effect->unk_60.z * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, effect->unk_46 * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, effect->unk_60.z * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, effect->unk_46 * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = effect->scale1; @@ -4196,14 +4197,14 @@ void func_effect_80084194(Effect* effect) { if (gCurrentLevel != LEVEL_AQUAS) { RCP_SetupDL(&gMasterDisp, 0x31); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); tmp = effect->unk_44 * 4; gDPSetEnvColor(gMasterDisp++, D_800D18F0[tmp + 0], D_800D18F0[tmp + 1], D_800D18F0[tmp + 2], 255); } else { RCP_SetupDL(&gMasterDisp, 0x31); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, D_800D1950[effect->unk_44]); gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255); diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 3f31b401..ba0c56ad 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -94,13 +94,13 @@ bool func_enmy_80060FE4(Vec3f* arg0, f32 arg1) { Vec3f sp2C; Vec3f sp20; - if ((gLevelMode != LEVELMODE_ALL_RANGE) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((gLevelMode != LEVELMODE_ALL_RANGE) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { return true; } - Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].unk_058, 0); - sp2C.x = arg0->x - gPlayer[gPlayerNum].camEye.x; + Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].camYaw, MTXF_NEW); + sp2C.x = arg0->x - gPlayer[gPlayerNum].cam.eye.x; sp2C.y = 0.0f; - sp2C.z = arg0->z - gPlayer[gPlayerNum].camEye.z; + sp2C.z = arg0->z - gPlayer[gPlayerNum].cam.eye.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp2C, &sp20); if ((sp20.z < 1000.0f) && (arg1 < sp20.z) && (fabsf(sp20.x) < (fabsf(sp20.z * 0.5f) + 2000.0f))) { @@ -116,13 +116,13 @@ bool func_enmy_80061148(Vec3f* arg0, f32 arg1) { if (gLevelMode != LEVELMODE_ALL_RANGE) { return true; } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { return func_enmy_80060FE4(arg0, arg1); } - Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].unk_058, 0); - sp2C.x = arg0->x - gPlayer[gPlayerNum].camEye.x; + Matrix_RotateY(gCalcMatrix, gPlayer[gPlayerNum].camYaw, MTXF_NEW); + sp2C.x = arg0->x - gPlayer[gPlayerNum].cam.eye.x; sp2C.y = 0.0f; - sp2C.z = arg0->z - gPlayer[gPlayerNum].camEye.z; + sp2C.z = arg0->z - gPlayer[gPlayerNum].cam.eye.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp2C, &sp20); if ((sp20.z < 0.0f) && (arg1 < sp20.z) && (fabsf(sp20.x) < (fabsf(sp20.z * 0.5f) + 500.0f))) { @@ -393,9 +393,9 @@ void func_enmy_80061F0C(Actor* actor, ObjectInit* objInit, s32 index) { actor->iwork[1] = gPrevEventActorIndex; actor->iwork[10] = gActors[gPrevEventActorIndex].aiType; actor->fwork[22] = D_play_80161A54; - Matrix_RotateZ(gCalcMatrix, -D_ctx_80177E88.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -D_ctx_80177E88.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -D_ctx_80177E88.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -D_ctx_80177E88.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -D_ctx_80177E88.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -D_ctx_80177E88.y * M_DTOR, MTXF_APPLY); sp24.x = actor->obj.pos.x - D_ctx_80177F10.x; sp24.y = actor->obj.pos.y - D_ctx_80177F10.y; sp24.z = actor->obj.pos.z - D_ctx_80177F10.z; @@ -517,7 +517,7 @@ void func_enmy_80062568(void) { } } -void func_enmy_80062664(void) { +void Object_LoadFromInit(void) { ObjectInit* objInit; f32 xMax; f32 xMin; @@ -650,7 +650,7 @@ void func_enmy_80062D04(f32 xPos, f32 yPos) { } } -bool func_enmy_80062DBC(Vec3f* pos, f32* hitboxData, Object* obj, f32 xRot, f32 yRot, f32 zRot) { +bool Object_CheckHitboxCollision(Vec3f* pos, f32* hitboxData, Object* obj, f32 xRot, f32 yRot, f32 zRot) { s32 i; Vec3f hitRot; Vec3f hitPos; @@ -681,16 +681,16 @@ bool func_enmy_80062DBC(Vec3f* pos, f32* hitboxData, Object* obj, f32 xRot, f32 hitPos.y = pos->y; hitPos.z = pos->z; } else { - Matrix_RotateZ(gCalcMatrix, -hitRot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -hitRot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -hitRot.y * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -obj->rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -obj->rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -hitRot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -hitRot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -hitRot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -obj->rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, MTXF_APPLY); if ((xRot != 0.0f) || (yRot != 0.0f) || (zRot != 0.0f)) { - Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, MTXF_APPLY); } sp80.x = pos->x - obj->pos.x; sp80.y = pos->y - obj->pos.y; @@ -711,40 +711,40 @@ bool func_enmy_80062DBC(Vec3f* pos, f32* hitboxData, Object* obj, f32 xRot, f32 return false; } -bool func_enmy_800631A8(Vec3f* posD, f32* hitboxData, Vec3f* posA) { +bool Object_CheckSingleHitbox(Vec3f* checkPos, f32* hitboxData, Vec3f* hitboxPos) { if ((s32) hitboxData[0] != 0) { - if ((fabsf(hitboxData[1] + posA->z - posD->z) < (hitboxData[2] + 20.0f)) && - (fabsf(hitboxData[5] + posA->x - posD->x) < (hitboxData[6] + 20.0f)) && - (fabsf(hitboxData[3] + posA->y - posD->y) < (hitboxData[4] + 20.0f))) { + if ((fabsf(hitboxData[1] + hitboxPos->z - checkPos->z) < (hitboxData[2] + 20.0f)) && + (fabsf(hitboxData[5] + hitboxPos->x - checkPos->x) < (hitboxData[6] + 20.0f)) && + (fabsf(hitboxData[3] + hitboxPos->y - checkPos->y) < (hitboxData[4] + 20.0f))) { return true; } } return false; } -bool func_enmy_8006326C(Vec3f* arg0, Vec3f* arg1, ObjectId objId, Object* obj) { +bool Object_CheckPolyCollision(Vec3f* pos, Vec3f* vel, ObjectId objId, Object* obj) { Vec3f sp74; Vec3f sp68; - Vec3f sp5C; - Vec3f sp50; + Vec3f relPos; + Vec3f objPos; Vec3f sp44; s32 colId; s32 pad1[2]; f32 sp30[2]; s32 pad2; - sp74.x = arg0->x - obj->pos.x; - sp74.z = arg0->z - obj->pos.z; + sp74.x = pos->x - obj->pos.x; + sp74.z = pos->z - obj->pos.z; if (((fabsf(sp74.x) < 1100.0f) && (fabsf(sp74.z) < 1100.0f)) || (objId == OBJ_ACTOR_180)) { - sp74.y = arg0->y - obj->pos.y; - Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, 0); + sp74.y = pos->y - obj->pos.y; + Matrix_RotateY(gCalcMatrix, -obj->rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp74, &sp68); - sp5C.x = obj->pos.x + sp68.x; - sp5C.y = obj->pos.y + sp68.y; - sp5C.z = obj->pos.z + sp68.z; - sp50.x = obj->pos.x; - sp50.y = obj->pos.y; - sp50.z = obj->pos.z; + relPos.x = obj->pos.x + sp68.x; + relPos.y = obj->pos.y + sp68.y; + relPos.z = obj->pos.z + sp68.z; + objPos.x = obj->pos.x; + objPos.y = obj->pos.y; + objPos.z = obj->pos.z; if ((objId == OBJ_ACTOR_180) || (objId == OBJ_80_149) || (objId == OBJ_80_150) || (objId == OBJ_BOSS_308) || (objId == OBJ_BOSS_313) || (objId == OBJ_BOSS_312) || (objId == OBJ_BOSS_309) || (objId == OBJ_80_39)) { colId = COL1_0; @@ -764,7 +764,7 @@ bool func_enmy_8006326C(Vec3f* arg0, Vec3f* arg1, ObjectId objId, Object* obj) { } else if (objId == OBJ_BOSS_313) { colId = COL1_8; } - if (func_col1_800998FC(&sp5C, &sp50, arg1, colId, &sp44, sp30) > 0) { + if (func_col1_800998FC(&relPos, &objPos, vel, colId, &sp44, sp30) > 0) { return true; } } else { @@ -786,7 +786,7 @@ bool func_enmy_8006326C(Vec3f* arg0, Vec3f* arg1, ObjectId objId, Object* obj) { } else if ((objId == OBJ_80_4) || (objId == OBJ_80_5)) { colId = COL2_1; } - if (func_col2_800A3690(&sp5C, &sp50, colId, &sp44)) { + if (func_col2_800A3690(&relPos, &objPos, colId, &sp44)) { return true; } } @@ -794,7 +794,7 @@ bool func_enmy_8006326C(Vec3f* arg0, Vec3f* arg1, ObjectId objId, Object* obj) { return false; } -s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { +s32 Object_CheckCollision(s32 index, Vec3f* pos, Vec3f* vel, s32 mode) { Object_58* obj58; Object_80* obj80; Sprite* sprite; @@ -810,12 +810,12 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { if ((obj58->obj.id == OBJ_80_1) || (obj58->obj.id == OBJ_80_3) || (obj58->obj.id == OBJ_80_117) || (obj58->obj.id == OBJ_80_141) || (obj58->obj.id == OBJ_80_150) || (obj58->obj.id == OBJ_80_149) || (obj58->obj.id == OBJ_80_148) || (obj58->obj.id == OBJ_80_140)) { - if (func_enmy_8006326C(pos, arg2, obj58->obj.id, &obj58->obj)) { + if (Object_CheckPolyCollision(pos, vel, obj58->obj.id, &obj58->obj)) { return 999; } } else if ((fabsf(pos->x - obj58->obj.pos.x) < 2000.0f) && (fabsf(pos->z - obj58->obj.pos.z) < 2000.0f)) { - if (func_enmy_80062DBC(pos, obj58->info.hitbox, &obj58->obj, 0.0f, 0.0f, 0.0f)) { + if (Object_CheckHitboxCollision(pos, obj58->info.hitbox, &obj58->obj, 0.0f, 0.0f, 0.0f)) { return 2; } } @@ -827,11 +827,11 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { if (obj80->obj.status == OBJ_ACTIVE) { if ((obj80->obj.id == OBJ_80_1) || (obj80->obj.id == OBJ_80_4) || (obj80->obj.id == OBJ_80_5) || (obj80->obj.id == OBJ_80_2) || (obj80->obj.id == OBJ_80_39) || (obj80->obj.id == OBJ_80_3)) { - if (func_enmy_8006326C(pos, arg2, obj80->obj.id, &obj80->obj)) { + if (Object_CheckPolyCollision(pos, vel, obj80->obj.id, &obj80->obj)) { return 2; } } else if ((fabsf(pos->x - obj80->obj.pos.x) < 2000.0f) && (fabsf(pos->z - obj80->obj.pos.z) < 2000.0f)) { - if (func_enmy_80062DBC(pos, obj80->info.hitbox, &obj80->obj, 0.0f, 0.0f, 0.0f)) { + if (Object_CheckHitboxCollision(pos, obj80->info.hitbox, &obj80->obj, 0.0f, 0.0f, 0.0f)) { return i + 10; } } @@ -841,7 +841,7 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { for (i = 0; i < ARRAY_COUNT(gSprites); i++, sprite++) { if ((sprite->obj.status == OBJ_ACTIVE) && (fabsf(pos->x - sprite->obj.pos.x) < 500.0f) && (fabsf(pos->z - sprite->obj.pos.z) < 500.0f) && - func_enmy_800631A8(pos, sprite->info.hitbox, &sprite->obj.pos)) { + Object_CheckSingleHitbox(pos, sprite->info.hitbox, &sprite->obj.pos)) { if ((sprite->obj.id == OBJ_SPRITE_FO_POLE) || (sprite->obj.id == OBJ_SPRITE_CO_TREE) || (sprite->obj.id == OBJ_SPRITE_CO_TREE)) { sprite->unk_46 = 1; @@ -849,14 +849,14 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { return 0; } } - if ((arg3 == 0) || (arg3 == 2) || (arg3 == 3)) { - if (arg3 != 2) { + if ((mode == 0) || (mode == 2) || (mode == 3)) { + if (mode != 2) { boss = gBosses; for (i = 0; i < ARRAY_COUNT(gBosses); i++, boss++) { if (boss->obj.status == OBJ_ACTIVE) { if ((boss->obj.id == OBJ_BOSS_308) || (boss->obj.id == OBJ_BOSS_312) || (boss->obj.id == OBJ_BOSS_313) || (boss->obj.id == OBJ_BOSS_309)) { - if (func_enmy_8006326C(pos, arg2, boss->obj.id, &boss->obj)) { + if (Object_CheckPolyCollision(pos, vel, boss->obj.id, &boss->obj)) { return 2; } } else if (boss->obj.id == OBJ_BOSS_310) { @@ -878,7 +878,7 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { } if ((fabsf(pos->x - boss->obj.pos.x) < 2000.0f) && (fabsf(pos->z - boss->obj.pos.z) < 2000.0f)) { - if (func_enmy_80062DBC(pos, boss->info.hitbox, &boss->obj, 0.0f, 0.0f, 0.0f)) { + if (Object_CheckHitboxCollision(pos, boss->info.hitbox, &boss->obj, 0.0f, 0.0f, 0.0f)) { return 2; } } @@ -892,12 +892,12 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { (fabsf(pos->z - actor->obj.pos.z) < 1500.0f) && (index != i) && (actor->info.unk_16 != 2) && !((actor->obj.id == OBJ_ACTOR_ALLRANGE) && (actor->aiType <= AI360_PEPPY)) && (actor->timer_0C2 == 0)) { if (actor->obj.id == OBJ_ACTOR_180) { - if (func_enmy_8006326C(pos, arg2, actor->obj.id, &actor->obj)) { + if (Object_CheckPolyCollision(pos, vel, actor->obj.id, &actor->obj)) { return 2; } } else if (actor->scale < 0.0f) { - if (func_enmy_80062DBC(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x, actor->vwork[29].y, - actor->vwork[29].z + actor->unk_0F4.z)) { + if (Object_CheckHitboxCollision(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x, + actor->vwork[29].y, actor->vwork[29].z + actor->unk_0F4.z)) { actor->unk_0D0 = 1; actor->damage = 10; actor->unk_0D2 = -1; @@ -906,8 +906,8 @@ s32 func_enmy_8006351C(s32 index, Vec3f* pos, Vec3f* arg2, s32 arg3) { actor->unk_0D8.z = pos->z; return 2; } - } else if ((arg3 != 2) && (arg3 != 3)) { - if (func_enmy_800631A8(pos, actor->info.hitbox, &actor->obj.pos)) { + } else if ((mode != 2) && (mode != 3)) { + if (Object_CheckSingleHitbox(pos, actor->info.hitbox, &actor->obj.pos)) { actor->unk_0D0 = 1; actor->damage = 10; actor->unk_0D2 = -1; @@ -1579,8 +1579,8 @@ void func_enmy_800656D4(Actor* actor) { sp8C.x = actor->vel.x; sp8C.y = actor->vel.y; sp8C.z = actor->vel.z; - if ((func_enmy_8006351C(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->unk_0D0 != 0) || - (actor->obj.pos.y < (gGroundLevel + 10.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7)) { + if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp8C, 1) != 0) || (actor->unk_0D0 != 0) || + (actor->obj.pos.y < (gGroundLevel + 10.0f)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 3.0f); Object_Kill(&actor->obj, actor->sfxSource); if (actor->unk_0D0 != 0) { @@ -1603,7 +1603,7 @@ void func_enmy_800656D4(Actor* actor) { if (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 100.0f) { actor->iwork[10] = 1; } - if (gPlayer[0].camEye.z < (actor->obj.pos.z + D_ctx_80177D20)) { + if (gPlayer[0].cam.eye.z < (actor->obj.pos.z + D_ctx_80177D20)) { Object_Kill(&actor->obj, actor->sfxSource); } } @@ -1673,7 +1673,7 @@ void Actor_Despawn(Actor* actor) { } if (actor->obj.id == OBJ_ACTOR_ALLRANGE) { if ((actor->aiType >= AI360_WOLF) && (actor->aiType < AI360_KATT)) { - func_360_8002E3E0(actor); + AllRange_GetStarWolfHits(actor); } } } @@ -1818,8 +1818,8 @@ void func_enmy_80066A8C(Object_80* obj80) { sp64.x = 120.0f; } for (yf = 0.0f; yf < 680.0f; yf += 100.0f) { - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, MTXF_APPLY); sp64.y = yf; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); func_effect_8007D0E0(obj80->obj.pos.x + sp58.x, obj80->obj.pos.y + sp58.y, obj80->obj.pos.z + sp58.z, 4.0f); @@ -1836,7 +1836,7 @@ void func_enmy_80066C00(Object_80* obj80) { if (obj80->obj.rot.y > 90.0f) { sp64.x = 100.0f; } - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, MTXF_NEW); for (zf = -180.0f; zf <= 0.0f; zf += 30.0f) { sp64.z = zf; @@ -1879,7 +1879,7 @@ void Sprite167_Update(Sprite167* this) { void func_enmy_80066EA8(Object_80* obj80) { obj80->obj.rot.y = 0.0f; - if (gPlayer[0].camEye.x < obj80->obj.pos.x) { + if (gPlayer[0].cam.eye.x < obj80->obj.pos.x) { obj80->obj.rot.y = 271.0f; } } @@ -1890,7 +1890,7 @@ void func_enmy_80066EE4(Sprite* sprite) { void func_enmy_80066EF0(Item* item) { f32 var_fa1; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY)) { Object_Kill(&item->obj, item->sfxSource); } if ((gLevelMode == LEVELMODE_ON_RAILS) && (gLastPathChange == 0)) { @@ -1944,7 +1944,7 @@ void func_enmy_800671D0(Item* item) { var_v0 = 7; } if (!(var_v0 & gGameFrameCount)) { - Matrix_RotateY(gCalcMatrix, gGameFrameCount * 23.0f * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, gGameFrameCount * 23.0f * M_DTOR, MTXF_NEW); sp40.x = 50.0f; sp40.y = RAND_FLOAT_CENTERED(120.0f); sp40.z = 0.0f; @@ -2025,8 +2025,8 @@ void ActorSupplies_Update(ActorSupplies* this) { Object_Kill(&this->obj, this->sfxSource); } } - gRadarMarks[63].unk_00 = 1; - gRadarMarks[63].unk_02 = 103; + gRadarMarks[63].status = 1; + gRadarMarks[63].type = 103; gRadarMarks[63].pos.x = this->obj.pos.x; gRadarMarks[63].pos.y = this->obj.pos.y; gRadarMarks[63].pos.z = this->obj.pos.z; @@ -2039,9 +2039,9 @@ void ActorSupplies_Draw(Actor* actor) { Lights_SetOneLight(&gMasterDisp, -60, -60, 60, 150, 150, 150, 20, 20, 20); for (i = 0; i < 6; i++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_enmy_800CFEC4[i].x, D_enmy_800CFEC4[i].y, D_enmy_800CFEC4[i].z, 1); - Matrix_RotateY(gGfxMatrix, D_enmy_800CFF0C[i].y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_enmy_800CFF0C[i].x * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, D_enmy_800CFEC4[i].x, D_enmy_800CFEC4[i].y, D_enmy_800CFEC4[i].z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_enmy_800CFF0C[i].y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_enmy_800CFF0C[i].x * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_10177C0); Matrix_Pop(&gGfxMatrix); @@ -2206,14 +2206,14 @@ void ItemSupplyRing_Update(Item* this) { this->obj.pos.z += (gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.5f; } this->obj.rot.z += 22.0f; - Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].unk_058), 0.2f, 10.0f, + Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.0f, 0.0f); if (this->timer_48 == 0) { Object_Kill(&this->obj, this->sfxSource); } if (this->scale > 0.3f) { - Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 37.0f * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 37.0f * M_DTOR, MTXF_APPLY); sp4C.x = 0.0f; sp4C.y = this->scale * 100.0f; sp4C.z = 0.0f; @@ -2277,7 +2277,7 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) { } gRingPassCount++; if (gRingPassCount >= 7) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_8; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE; gPlayer[0].unk_1D0 = 0; AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0); gNextPlanetPath = 2; @@ -2345,14 +2345,14 @@ void ItemRingCheck_Update(Item* item) { void ItemPathChange_Update(Item* this) { gLastPathChange = this->obj.id; - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_3) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE) { Object_Kill(&this->obj, this->sfxSource); } else if (((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X)) && (gLevelStage == 1)) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; Object_Kill(&this->obj, this->sfxSource); } else if (gCurrentLevel == LEVEL_TRAINING) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_9; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; gPlayer[0].unk_1D0 = 0; Object_Kill(&this->obj, this->sfxSource); } else if (this->state == 0) { @@ -2418,10 +2418,10 @@ void ItemPathChange_Update(Item* this) { } void Sprite_UpdateDoodad(Sprite* this) { - this->obj.rot.y = - (Math_Atan2F(gPlayer[0].camEye.x - this->obj.pos.x, gPlayer[0].camEye.z - (this->obj.pos.z + D_ctx_80177D20)) * - 180.0f) / - M_PI; + this->obj.rot.y = (Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, + gPlayer[0].cam.eye.z - (this->obj.pos.z + D_ctx_80177D20)) * + 180.0f) / + M_PI; if (this->unk_46 != 0) { this->obj.status = OBJ_FREE; func_effect_8007A6F0(&this->obj.pos, 0x1903400F); @@ -2495,10 +2495,10 @@ void Actor_Move(Actor* actor) { if ((actor->obj.id == OBJ_ACTOR_236) || (gCurrentLevel == LEVEL_MACBETH) || ((actor->obj.id == OBJ_ACTOR_EVENT) && (actor->unk_0B4 == EINFO_56))) { var_fv0 = 8000.0f; - } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) { + } else if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { var_fv0 = 100000.0f; } - if (((gPlayer[0].camEye.z + actor->info.unk_10) < (actor->obj.pos.z + D_ctx_80177D20)) || + if (((gPlayer[0].cam.eye.z + actor->info.unk_10) < (actor->obj.pos.z + D_ctx_80177D20)) || ((actor->obj.pos.z + D_ctx_80177D20) < -15000.0f) || (actor->obj.pos.y < (gPlayer[0].unk_0B0 - var_fv0)) || ((gPlayer[0].unk_0B0 + var_fv0) < actor->obj.pos.y) || ((gPlayer[0].unk_0AC + var_fv0) < actor->obj.pos.x) || @@ -2534,20 +2534,20 @@ void Boss_Move(Boss* boss) { boss->obj.pos.y += boss->vel.y; boss->obj.pos.z += boss->vel.z; boss->vel.y -= boss->gravity; - if ((D_ctx_80161AB8 != 0) && ((boss->obj.pos.z + D_ctx_80177D20) > (boss->info.unk_10 - gPlayer[0].camEye.z))) { - if (gPlayer[0].camEye.z) {} // fake + if ((D_ctx_80161AB8 != 0) && ((boss->obj.pos.z + D_ctx_80177D20) > (boss->info.unk_10 - gPlayer[0].cam.eye.z))) { + if (gPlayer[0].cam.eye.z) {} // fake Object_Kill(&boss->obj, boss->sfxSource); } } void Object80_Move(Object_80* obj80) { - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { obj80->obj.pos.z += obj80->unk_60; if (obj80->info.unk_10 < obj80->obj.pos.z) { Object_Kill(&obj80->obj, obj80->sfxSource); } } else if ((gLevelMode == LEVELMODE_ON_RAILS) && (gBossActive != 2)) { - f32 temp_fv0 = fabsf(obj80->obj.pos.x - gPlayer[0].camEye.x); + f32 temp_fv0 = fabsf(obj80->obj.pos.x - gPlayer[0].cam.eye.x); f32 var_fa0 = 500.0f; if ((obj80->obj.id == OBJ_80_6) || (obj80->obj.id == OBJ_80_7)) { @@ -2557,7 +2557,7 @@ void Object80_Move(Object_80* obj80) { if ((fabsf(gPlayer[0].unk_114) > 1.0f) || (gCurrentLevel == LEVEL_MACBETH)) { temp_fv0 = 0.0f; } - temp_fv0 -= gPlayer[0].camEye.z; + temp_fv0 -= gPlayer[0].cam.eye.z; if ((obj80->info.unk_10 - temp_fv0) < (obj80->obj.pos.z + D_ctx_80177D20)) { Object_Kill(&obj80->obj, obj80->sfxSource); } @@ -2566,7 +2566,7 @@ void Object80_Move(Object_80* obj80) { void Sprite_Move(Sprite* sprite) { if (D_ctx_80161AB8 != 0) { - f32 temp_fv0 = fabsf(sprite->obj.pos.x - gPlayer[0].camEye.x); + f32 temp_fv0 = fabsf(sprite->obj.pos.x - gPlayer[0].cam.eye.x); f32 var_fa0 = 500.0f; if (((sprite->obj.id == OBJ_SPRITE_FOG_SHADOW) && @@ -2575,7 +2575,7 @@ void Sprite_Move(Sprite* sprite) { var_fa0 = 1000.0f; } temp_fv0 = ((temp_fv0 - var_fa0) < 0.0f) ? 0.0f * 1.7f : (temp_fv0 - var_fa0) * 1.7f; - temp_fv0 -= gPlayer[0].camEye.z; + temp_fv0 -= gPlayer[0].cam.eye.z; if ((sprite->info.unk_10 - temp_fv0) < (sprite->obj.pos.z + D_ctx_80177D20)) { sprite->obj.status = OBJ_FREE; } @@ -2587,10 +2587,10 @@ void Effect_Move(Effect* effect) { effect->obj.pos.y += effect->vel.y; effect->obj.pos.z += effect->vel.z; if (D_ctx_80161AB8 != 0) { - if ((gPlayer[0].camEye.z + effect->info.unk_10) < (effect->obj.pos.z + D_ctx_80177D20)) { + if ((gPlayer[0].cam.eye.z + effect->info.unk_10) < (effect->obj.pos.z + D_ctx_80177D20)) { Object_Kill(&effect->obj, effect->sfxSource); - } else if ((fabsf(effect->obj.pos.y - gPlayer[0].camEye.y) > 25000.0f) || - (fabsf(effect->obj.pos.x - gPlayer[0].camEye.x) > 25000.0f)) { + } else if ((fabsf(effect->obj.pos.y - gPlayer[0].cam.eye.y) > 25000.0f) || + (fabsf(effect->obj.pos.x - gPlayer[0].cam.eye.x) > 25000.0f)) { Object_Kill(&effect->obj, effect->sfxSource); } } @@ -2598,7 +2598,7 @@ void Effect_Move(Effect* effect) { void Item_Move(Item* item) { if (D_ctx_80161AB8 != 0) { - f32 temp = (0.0f - gPlayer[0].camEye.z); + f32 temp = (0.0f - gPlayer[0].cam.eye.z); if ((item->info.unk_10 - temp) < (item->obj.pos.z + D_ctx_80177D20)) { Object_Kill(&item->obj, item->sfxSource); @@ -2811,9 +2811,9 @@ void TexturedLine_Update(TexturedLine* this) { if (gGameState == GSTATE_PLAY) { if (((this->mode == 1) || (this->mode == 101) || (this->mode == 50)) && - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (gPlayer[0].unk_1F4 == 0)) { - Matrix_RotateX(gCalcMatrix, -this->unk_1C, 0); - Matrix_RotateY(gCalcMatrix, -this->unk_20, 1); + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (gPlayer[0].unk_1F4 == 0)) { + Matrix_RotateX(gCalcMatrix, -this->unk_1C, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -this->unk_20, MTXF_APPLY); sp44.x = gPlayer[gPlayerNum].pos.x - this->unk_04.x; sp44.y = gPlayer[gPlayerNum].pos.y - this->unk_04.y; sp44.z = gPlayer[gPlayerNum].unk_138 - this->unk_04.z; @@ -2866,14 +2866,14 @@ void Object_Update(void) { D_ctx_80161AB8 = 0; if ((gLevelMode == LEVELMODE_ON_RAILS) && - ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_1) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_4) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_9) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_6))) { + ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_INIT) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_DOWN) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_START_360) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT))) { D_ctx_80161AB8 = 1; } if (gLevelMode != LEVELMODE_ALL_RANGE) { - if ((D_ctx_80178488 != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { - func_enmy_80062664(); + if ((gLoadLevelObjects != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { + Object_LoadFromInit(); } for (i = 0, obj80 = gObjects80; i < ARRAY_COUNT(gObjects80); i++, obj80++) { if (obj80->obj.status != OBJ_FREE) { diff --git a/src/engine/fox_enmy2.c b/src/engine/fox_enmy2.c index c47ceaca..64ffb490 100644 --- a/src/engine/fox_enmy2.c +++ b/src/engine/fox_enmy2.c @@ -109,7 +109,7 @@ void Obj54_Update(Object80_54* this) { Texture_Scroll(D_CO_60038F8, 32, 32, 1); if ((gGameFrameCount % 4) == 0) { - Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); sp18.x = RAND_FLOAT_CENTERED(700.0f); sp18.y = RAND_FLOAT(50.0f); @@ -135,10 +135,10 @@ void Actor201_Update(Actor201* this) { this->timer_0BC = 20; } sp2C = this->obj.pos.z + D_ctx_80177D20; - this->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.x - this->obj.pos.x, gPlayer[0].camEye.z - sp2C)); - this->obj.rot.x = - -Math_RadToDeg(Math_Atan2F(gPlayer[0].camEye.y - this->obj.pos.y, - sqrtf(SQ(gPlayer[0].camEye.z - sp2C) + SQ(gPlayer[0].camEye.x - this->obj.pos.x)))); + this->obj.rot.y = Math_RadToDeg(Math_Atan2F(gPlayer[0].cam.eye.x - this->obj.pos.x, gPlayer[0].cam.eye.z - sp2C)); + this->obj.rot.x = -Math_RadToDeg( + Math_Atan2F(gPlayer[0].cam.eye.y - this->obj.pos.y, + sqrtf(SQ(gPlayer[0].cam.eye.z - sp2C) + SQ(gPlayer[0].cam.eye.x - this->obj.pos.x)))); } void Actor202_Update(Actor202* this) { @@ -294,15 +294,15 @@ void Actor194_8006B46C(Actor194* this, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, arg1, arg2, arg3 + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, arg1, arg2, arg3 + D_ctx_80177D20, MTXF_APPLY); if (arg7 != 1) { - Matrix_RotateY(gGfxMatrix, M_DTOR * arg5, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * arg4, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * arg6, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * arg5, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * arg4, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * arg6, MTXF_APPLY); } - Matrix_Scale(gGfxMatrix, arg8, arg8, 1.0f, 1); + Matrix_Scale(gGfxMatrix, arg8, arg8, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (arg7 != 1) { @@ -623,7 +623,7 @@ void Actor189_Update(Actor189* this) { case 52: case 53: case 55: - if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + if (((this->timer_0BC == 0) || (Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || (this->obj.pos.y < (gGroundLevel + 10.0f))) && (this->timer_0BE == 0)) { func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); @@ -634,7 +634,7 @@ void Actor189_Update(Actor189* this) { case 56: Math_SmoothStepToF(&this->scale, 0.0f, 0.1f, 2.0f, 0.0001f); - if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + if (((this->timer_0BC == 0) || (Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || (this->obj.pos.y < (gGroundLevel + 10.0f))) && (this->timer_0BE == 0)) { func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); @@ -655,7 +655,7 @@ void Actor189_Update(Actor189* this) { this->obj.rot.y += this->fwork[1]; this->obj.rot.z += this->fwork[2]; - if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + if (((this->timer_0BC == 0) || (Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || (this->obj.pos.y < (gGroundLevel + 10.0f))) && (this->timer_0BE == 0)) { func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 50.0f, this->scale * 10.0f); @@ -665,7 +665,7 @@ void Actor189_Update(Actor189* this) { break; case 54: - if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + if (((this->timer_0BC == 0) || (Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || (this->obj.pos.y < (gGroundLevel + 10.0f))) && (this->timer_0BE == 0)) { func_effect_8007B8F8(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + 70.0f, this->scale * 20.0f); @@ -683,7 +683,7 @@ void Actor189_Update(Actor189* this) { this->obj.rot.x += this->fwork[0]; this->obj.rot.y += this->fwork[1]; this->obj.rot.z += this->fwork[2]; - if (func_enmy_8006351C(this->index, &this->obj.pos, &D_tank_800C9F2C, 1) != 0) { + if (Object_CheckCollision(this->index, &this->obj.pos, &D_tank_800C9F2C, 1) != 0) { this->vel.x *= -0.7f; } if (this->obj.pos.y < gGroundLevel) { @@ -696,7 +696,7 @@ void Actor189_Update(Actor189* this) { this->obj.rot.y += this->fwork[1]; this->obj.rot.z += this->fwork[2]; - if (func_enmy_8006351C(this->index, &this->obj.pos, &D_tank_800C9F2C, 1) != 0) { + if (Object_CheckCollision(this->index, &this->obj.pos, &D_tank_800C9F2C, 1) != 0) { this->vel.x *= -0.7f; } @@ -731,12 +731,14 @@ void Actor189_Update(Actor189* this) { this->obj.rot.z += this->fwork[12]; if (this->state == 70) { - if ((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + if ((this->timer_0BC == 0) || + (Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || (this->obj.pos.y < (gGroundLevel + 10.0f))) { Object_Kill(&this->obj, this->sfxSource); } } else if (this->state == 39) { - if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + if (((this->timer_0BC == 0) || + (Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || (this->obj.pos.y < (gGroundLevel + 10.0f))) && (this->timer_0BE == 0)) { func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 10.0f); @@ -745,7 +747,7 @@ void Actor189_Update(Actor189* this) { } } else if (((this->state >= 41) && (this->state < 45)) || (this->state == 59)) { if (((this->timer_0BC == 0) || - (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0)) && + (Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0)) && (this->timer_0BE == 0)) { func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f * this->scale); Object_Kill(&this->obj, this->sfxSource); @@ -759,7 +761,8 @@ void Actor189_Update(Actor189* this) { if ((this->timer_0BC & 3) == 0) { func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->scale); } - if (((this->timer_0BC == 0) || (func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + if (((this->timer_0BC == 0) || + (Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || (this->obj.pos.y < (gGroundLevel + 10.0f))) && (this->timer_0BE == 0)) { func_effect_8007BFFC(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, this->vel.x, this->vel.y, @@ -771,7 +774,7 @@ void Actor189_Update(Actor189* this) { if ((this->state == 3) && ((this->timer_0BC % 8) == 0)) { func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 1.5f); } - if ((func_enmy_8006351C(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || + if ((Object_CheckCollision(this->index, &this->obj.pos, &D_800D0030, 1) != 0) || (this->obj.pos.y < (gGroundLevel + 10.0f))) { if (gLevelType == LEVELTYPE_SPACE) { func_effect_8007D0E0(this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, 2.0f); @@ -838,7 +841,7 @@ void func_enmy2_8006D0F4(Actor* actor) { hitboxData = D_edata_800CF964[gObjects80[i].obj.id]; count = *hitboxData; if (count != 0) { - Matrix_RotateY(gCalcMatrix, -gObjects80[i].obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -gObjects80[i].obj.rot.y * M_DTOR, MTXF_NEW); spA8.x = actor->obj.pos.x - gObjects80[i].obj.pos.x; spA8.y = actor->obj.pos.y - gObjects80[i].obj.pos.y; @@ -1108,7 +1111,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { this->unk_0C9 = 1; } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if (this->unk_0B4 == EINFO_86) { Audio_PlayFanfare(SEQ_ID_KATT, 20, 10, 10); } @@ -1255,7 +1258,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { case EV_OPC(EVOP_PLAY_MSG): msg = Message_PtrFromId(actorScript[this->aiIndex + 1]); - if ((msg != NULL) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if ((msg != NULL) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Radio_PlayMessage(msg, actorScript[this->aiIndex] & 0x1FF); } this->aiIndex += 2; @@ -1742,11 +1745,11 @@ void ActorEvent_8006F254(ActorEvent* this) { Vec3f sp54; Vec3f sp48; - Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; sp54.y = 0.0f; @@ -1764,9 +1767,9 @@ void ActorEvent_ProcessActions(ActorEvent* this) { Vec3f sp6C; Sprite* sprite; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (this->unk_0B4 != EINFO_52) && (this->unk_0B4 != EINFO_103) && - (this->unk_0B4 != EINFO_104) && (this->unk_0B4 != EINFO_48) && (this->unk_0B4 != EINFO_49) && - (this->unk_0B4 != EINFO_50)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (this->unk_0B4 != EINFO_52) && + (this->unk_0B4 != EINFO_103) && (this->unk_0B4 != EINFO_104) && (this->unk_0B4 != EINFO_48) && + (this->unk_0B4 != EINFO_49) && (this->unk_0B4 != EINFO_50)) { switch (this->unk_048) { case EVACT_NONE: break; @@ -1808,11 +1811,11 @@ void ActorEvent_ProcessActions(ActorEvent* this) { break; case EVACT_5: - Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); sp78.x = 0.0f; sp78.y = 0.0f; @@ -1908,7 +1911,7 @@ void ActorEvent_ProcessActions(ActorEvent* this) { break; case EVACT_17: - if (this->obj.pos.z < (gPlayer[0].camEye.z - 600.0f)) { + if (this->obj.pos.z < (gPlayer[0].cam.eye.z - 600.0f)) { func_effect_8007F20C(OBJ_EFFECT_353, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z, gEnemyShotSpeed); } @@ -1933,8 +1936,8 @@ void ActorEvent_ProcessActions(ActorEvent* this) { sp54 = Math_RadToDeg(sp54); sp58 = -Math_Atan2F(sp60, sqrtf(SQ(sp64) + SQ(sp5C))); sp58 = Math_RadToDeg(sp58); - Matrix_RotateY(gCalcMatrix, M_DTOR * sp54, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * sp58, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * sp54, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * sp58, MTXF_APPLY); sp6C.x = 0.0f; sp6C.y = 0.0f; sp6C.z = 50.0f; @@ -2218,7 +2221,7 @@ void ActorEvent_800701E0(ActorEvent* this) { sp3C.y = this->vel.y; sp3C.z = this->vel.z; - if ((func_enmy_8006351C(this->index, &this->obj.pos, &sp3C, 0) != 0) || + if ((Object_CheckCollision(this->index, &this->obj.pos, &sp3C, 0) != 0) || (this->obj.pos.y < (gGroundLevel + 20.0f))) { this->obj.status = OBJ_DYING; this->obj.pos.z -= this->vel.z; @@ -2783,9 +2786,9 @@ void ActorEvent_80071DC0(ActorEvent* this) { s32 rInd; Vec3f sp38; - Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); if (this->unk_0B4 == EINFO_30) { rInd = RAND_FLOAT(ARRAY_COUNT(D_800D1074) - 1.1f); // off by 1 error? @@ -2872,7 +2875,7 @@ void ActorEvent_800722EC(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) Vec3f sp20; Effect_Initialize(effect); - Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, 0); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_NEW); sp2C.x = 0.0f; sp2C.y = 0.0f; sp2C.z = 20.0f; @@ -2955,7 +2958,7 @@ void ActorEvent_Update(ActorEvent* this) { Vec3f spAC; Vec3f spA0; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) || (D_ctx_8017828C != 0)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) || (D_ctx_8017828C != 0)) { Object_Kill(&this->obj, this->sfxSource); return; } @@ -3032,14 +3035,14 @@ void ActorEvent_Update(ActorEvent* this) { spE8 = this->obj.pos.z; if ((this->unk_0B4 == EINFO_33) || (this->unk_0B4 == EINFO_68)) { - Matrix_RotateZ(gCalcMatrix, -(this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -(this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, MTXF_APPLY); if ((this->state == EVSTATE_14) || (this->state == EVSTATE_15)) { - spB8.x = gPlayer[0].camEye.x - spF0; - spB8.y = gPlayer[0].camEye.y - (spEC + 25.0f); - spB8.z = (gPlayer[0].camEye.z * 15.0f) - spE8; + spB8.x = gPlayer[0].cam.eye.x - spF0; + spB8.y = gPlayer[0].cam.eye.y - (spEC + 25.0f); + spB8.z = (gPlayer[0].cam.eye.z * 15.0f) - spE8; } else { spB8.x = gPlayer[0].pos.x - spF0; spB8.y = gPlayer[0].pos.y - (spEC + 25.0f); @@ -3068,17 +3071,17 @@ void ActorEvent_Update(ActorEvent* this) { Math_SmoothStepToAngle(&this->fwork[15], spE4, 0.2f, this->fwork[24], 0.001f); if (((this->timer_0BC % 32) == 0) && (spFC == 0)) { - Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->vwork[29].y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, this->vwork[29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_APPLY); spB8.x = 0.0f; spB8.y = 25.0f; spB8.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spB8, &spA0); - Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, this->fwork[15] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->fwork[15] * M_DTOR, MTXF_APPLY); spB8.x = 0.0f; spB8.y = 0.0f; @@ -3101,9 +3104,9 @@ void ActorEvent_Update(ActorEvent* this) { } } else { if ((this->state == EVSTATE_14) || (this->state == EVSTATE_15)) { - spCC = gPlayer[0].camEye.x; - spC8 = gPlayer[0].camEye.y; - spC4 = gPlayer[0].camEye.z; + spCC = gPlayer[0].cam.eye.x; + spC8 = gPlayer[0].cam.eye.y; + spC4 = gPlayer[0].cam.eye.z; } else { spCC = gPlayer[0].pos.x; spC8 = gPlayer[0].pos.y; @@ -3256,9 +3259,9 @@ void ActorEvent_Update(ActorEvent* this) { if (gActors[this->iwork[9]].obj.status != OBJ_ACTIVE) { this->iwork[13] = 0; } else { - Matrix_RotateY(gCalcMatrix, gActors[this->iwork[9]].obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, gActors[this->iwork[9]].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, gActors[this->iwork[9]].obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, gActors[this->iwork[9]].obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, gActors[this->iwork[9]].obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, gActors[this->iwork[9]].obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &this->vwork[28], &spAC); this->obj.pos.x = gActors[this->iwork[9]].obj.pos.x + spAC.x; this->obj.pos.y = gActors[this->iwork[9]].obj.pos.y + spAC.y; @@ -3340,9 +3343,9 @@ void ActorEvent_Update(ActorEvent* this) { } Math_SmoothStepToAngle(&this->obj.rot.z, this->fwork[23], 0.2f, 100.0f, 0.0001f); - Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (this->vwork[29].z + this->unk_0F4.z) * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); spB8.x = 0.0f; spB8.y = 0.0f; @@ -3368,7 +3371,7 @@ void ActorEvent_Update(ActorEvent* this) { this->vel.z -= D_ctx_80177D08; } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_8) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ENTER_WARP_ZONE) { this->vel.z = 100.0f; } @@ -3522,7 +3525,7 @@ void ActorEvent_Update(ActorEvent* this) { break; case 0: - Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); if ((this->obj.pos.y + sp90.y) > -30.0f) { @@ -3543,7 +3546,7 @@ void ActorEvent_Update(ActorEvent* this) { sp84.z = 0.0f; effect->unk_44 = 10; effect->scale2 = 1.0f; - Matrix_RotateY(gCalcMatrix, (RAND_FLOAT(180.0f) + 180.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (RAND_FLOAT(180.0f) + 180.0f) * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp84, &sp78); effect->vel.x = sp78.x; effect->vel.y = sp78.y; @@ -3561,7 +3564,7 @@ void ActorEvent_Update(ActorEvent* this) { if ((fabsf(this->fwork[0]) > 10.0f) && ((gGameFrameCount % 2) == 0)) { effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { - Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, this->unk_0F4.z * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_800D1290, &sp90); effect->unk_78 = effect->unk_7A = 11; @@ -3736,11 +3739,11 @@ bool ActorEvent_OverrideLimbDraw2(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* var_s1 = 1.0f / 70.925f; } - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (*dList != NULL) { @@ -3800,9 +3803,9 @@ void ActorEvent_Draw(ActorEvent* this) { (this->unk_0B4 != EINFO_13) && (this->unk_0B4 != EINFO_72) && (this->unk_0B4 != EINFO_28) && (this->scale > 0.5f)) { sp40 = SIN_DEG(this->timer_0C6 * 400.0f) * this->timer_0C6; - Matrix_RotateY(gGfxMatrix, M_DTOR * sp40, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * sp40, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * sp40, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * sp40, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * sp40, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sp40, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } } @@ -3901,7 +3904,7 @@ void ActorEvent_Draw(ActorEvent* this) { break; case EINFO_9: - Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); Animation_GetFrameData(&D_ENMY_PLANET_40001A4, this->unk_0B6, sp114); Animation_DrawSkeleton(1, D_ENMY_PLANET_4000270, sp114, NULL, NULL, this, &gIdentityMatrix); break; @@ -3909,8 +3912,8 @@ void ActorEvent_Draw(ActorEvent* this) { case EINFO_18: if (this->fwork[0] > 0.1f) { this->iwork[11] = 1; - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, MTXF_APPLY); func_edisplay_8005B1E8(this, 2); } break; @@ -3918,8 +3921,8 @@ void ActorEvent_Draw(ActorEvent* this) { case EINFO_19: if (this->fwork[0] > 0.1f) { this->iwork[11] = 1; - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); - Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.5f, 2.5f, 2.5f, MTXF_APPLY); func_edisplay_8005B1E8(this, 2); } break; @@ -3933,7 +3936,7 @@ void ActorEvent_Draw(ActorEvent* this) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6018BF0); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, MTXF_APPLY); this->iwork[11] = 1; func_edisplay_8005B1E8(this, 2); break; @@ -3942,7 +3945,7 @@ void ActorEvent_Draw(ActorEvent* this) { gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6019730); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -30.0f, MTXF_APPLY); this->iwork[11] = 1; func_edisplay_8005B1E8(this, 2); break; @@ -3964,15 +3967,15 @@ void ActorEvent_Draw(ActorEvent* this) { break; case EINFO_31: - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_A6_600E0C0); break; case EINFO_33: Animation_GetFrameData(&D_ENMY_SPACE_400A30C, this->unk_0B6, sp114); - Matrix_RotateY(gGfxMatrix, M_PI, 1); - Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); Animation_DrawSkeleton(1, D_ENMY_SPACE_400A398, sp114, ActorEvent_OverrideLimbDraw1, NULL, this, &gIdentityMatrix); Math_SmoothStepToF(&this->fwork[16], 0.0f, 0.3f, 2.0f, 0.0001f); @@ -3998,22 +4001,22 @@ void ActorEvent_Draw(ActorEvent* this) { Animation_GetFrameData(&D_ZO_601F874, this->unk_0B6, sp114); sp114[2].z -= this->fwork[15]; gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, 1); + Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); Animation_DrawSkeleton(1, D_ZO_601F920, sp114, NULL, NULL, this, &gIdentityMatrix); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); break; case EINFO_64: Matrix_Push(&gGfxMatrix); - Matrix_RotateX(gGfxMatrix, this->unk_0F4.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, this->unk_0F4.y * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, this->unk_0F4.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, this->unk_0F4.y * M_DTOR, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, this->fwork[15], 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, this->fwork[15], 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600CAA0); Matrix_Pop(&gGfxMatrix); gSPDisplayList(gMasterDisp++, D_ME_600C130); - Matrix_Translate(gGfxMatrix, 0.0f, -this->fwork[15], 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -this->fwork[15], 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_600C740); Matrix_Pop(&gGfxMatrix); @@ -4037,14 +4040,14 @@ void ActorEvent_Draw(ActorEvent* this) { break; case EINFO_80: - Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, 1); + Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_9011200); break; case EINFO_81: if (this->fwork[15] > 0.001f) { - Matrix_Scale(gGfxMatrix, this->fwork[15], this->fwork[15], this->fwork[15], 1); + Matrix_Scale(gGfxMatrix, this->fwork[15], this->fwork[15], this->fwork[15], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Texture_BlendRGBA16(this->fwork[16], 16 * 11, D_VE1_9003890, D_VE1_9003DF0, D_VE1_9003330); gSPDisplayList(gMasterDisp++, D_VE1_9002CF0); @@ -4058,7 +4061,7 @@ void ActorEvent_Draw(ActorEvent* this) { break; case EINFO_83: - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); Animation_GetFrameData(&D_AQ_602201C, this->unk_0B6, sp114); Animation_DrawSkeleton(1, D_AQ_60220E8, sp114, NULL, NULL, this, &gIdentityMatrix); break; @@ -4211,7 +4214,7 @@ void func_enmy2_800763A4(Actor* actor) { sp4C.y = actor->vel.y; sp4C.z = actor->vel.z; - sp60 = func_enmy_8006351C(actor->index, &actor->obj.pos, &sp4C, 0); + sp60 = Object_CheckCollision(actor->index, &actor->obj.pos, &sp4C, 0); if ((sp60 != 0) || (actor->obj.pos.y < (gGroundLevel + 30.0f))) { if ((Rand_ZeroOne() < 0.5f) && (actor->timer_04C < 3) && (gLevelType == LEVELTYPE_PLANET) && diff --git a/src/engine/fox_fade.c b/src/engine/fox_fade.c index 8bb57049..91272082 100644 --- a/src/engine/fox_fade.c +++ b/src/engine/fox_fade.c @@ -15,12 +15,12 @@ void func_fade_80084488(s32 arg0) { RCP_SetupDL_12(); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -150.0f, 0); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -150.0f, MTXF_NEW); for (var_s1 = 0; var_s1 < MIN(360, arg0 * 15); var_s1 += 15) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, MIN((arg0 - (var_s1 / 15)) * 15, 255)); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, var_s1 * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 0.53f, 1.0f, 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, var_s1 * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.53f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_Gfx_800D9688); Matrix_Pop(&gGfxMatrix); diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c index 0346696a..8e818cdc 100644 --- a/src/engine/fox_game.c +++ b/src/engine/fox_game.c @@ -7,7 +7,7 @@ f32 D_game_80161A10; f32 D_game_80161A14; s32 gPlayerInactive[4]; s32 D_game_80161A28; -u8 D_game_80161A2C; +u8 gShowHud; u16 gNextLevelStage; u16 gNextLevel; u16 gNextGameState; @@ -253,15 +253,15 @@ void Game_Draw(s32 playerNum) { break; case DRAW_TITLE: func_bg_8003DAF0(); - OvlMenu_CallFunction(104, NULL); + OvlMenu_CallFunction(OVLCALL_TITLE_DRAW, NULL); break; case DRAW_OPTION: func_bg_8003DAF0(); - OvlMenu_CallFunction(108, NULL); + OvlMenu_CallFunction(OVLCALL_OPTION_DRAW, NULL); break; case DRAW_MAP: func_bg_8003DAF0(); - OvlMenu_CallFunction(106, NULL); + OvlMenu_CallFunction(OVLCALL_MAP_DRAW, NULL); break; case DRAW_PLAY: gPlayerNum = playerNum; @@ -269,7 +269,7 @@ void Game_Draw(s32 playerNum) { break; case DRAW_UNK_MAP: func_bg_8003DAF0(); - OvlMenu_CallFunction(110, NULL); + OvlMenu_CallFunction(OVLCALL_UNKMAP_DRAW, NULL); break; case DRAW_UNK_VS: func_versus_800C2190(); @@ -392,8 +392,7 @@ void Game_Update(void) { D_ctx_80177D20 = 0.0f; D_hud_8016170C = gCsFrameCount = D_ctx_80177830 = gLevelStatusScreenTimer = gLevelClearScreenTimer = D_versus_80178754 = gVersusMode = D_ctx_80177AE0 = D_ctx_80178410 = D_ctx_80177B40 = gPlayState = - gOptionMenuStatus = gDrawMode = gShowBossHealth = D_game_80161A2C = gBgColor = - gFillScreenAlpha = 0; + gOptionMenuStatus = gDrawMode = gShowBossHealth = gShowHud = gBgColor = gFillScreenAlpha = 0; gNextGameState = D_ctx_80177C94 = D_ctx_80177CAC = D_ctx_80177CB4 = D_ctx_80177CBC = D_ctx_80177CC4 = D_ctx_80177C9C = D_ctx_80177CA4 = D_play_80161A5C = D_game_80161A34 = 0; for (i = 0; i < 4; i++) { @@ -450,10 +449,10 @@ void Game_Update(void) { func_8001D8A8(2, gVolumeSettings[2]); break; case GSTATE_TITLE: - OvlMenu_CallFunction(103, NULL); + OvlMenu_CallFunction(OVLCALL_TITLE_UPDATE, NULL); break; case GSTATE_MENU: - OvlMenu_CallFunction(107, NULL); + OvlMenu_CallFunction(OVLCALL_OPTION_UPDATE, NULL); break; case GSTATE_MAP: Map_8019E8D0(); @@ -465,7 +464,7 @@ void Game_Update(void) { Play_Main(); break; case GSTATE_GAME_OVER: - OvlMenu_CallFunction(109, NULL); + OvlMenu_CallFunction(OVLCALL_GAME_OVER_UPDATE, NULL); break; case GSTATE_ENDING: gDrawMode = DRAW_ENDING; @@ -520,7 +519,7 @@ void Game_Update(void) { gPlayerFillScreenGreens[0], gPlayerFillScreenBlues[0], gPlayerFillScreenAlphas[0]); if ((gDrawMode == DRAW_PLAY) || (gDrawMode == DRAW_ENDING)) { func_radio_800BB5D0(); - if (D_game_80161A2C != 0) { + if (gShowHud != 0) { func_hud_8008FA84(); func_hud_8008CA44(); } diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index 69c10c92..717c642b 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -198,15 +198,15 @@ void func_hud_80084B94(s32 arg0) { RCP_SetupDL(&gMasterDisp, 0x24); if (arg0 == 0) { for (i = 1; i < 4; i++) { - if (((gTeamShields[i] != 0) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) && (gTeamShields[i] <= 0) && - (gTeamShields[i] != -2)) { + if (((gTeamShields[i] != 0) || (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) && + (gTeamShields[i] <= 0) && (gTeamShields[i] != -2)) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_800D1A70[i - 1].x, D_800D1A70[i - 1].y, D_800D1A70[i - 1].z, 1); - Matrix_Scale(gGfxMatrix, 0.68f, 0.68f, 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_PI / 4, 1); + Matrix_Translate(gGfxMatrix, D_800D1A70[i - 1].x, D_800D1A70[i - 1].y, D_800D1A70[i - 1].z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.68f, 0.68f, 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_500B600); - Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, 1); + Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_500B600); Matrix_Pop(&gGfxMatrix); @@ -214,12 +214,12 @@ void func_hud_80084B94(s32 arg0) { } } else { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -234.0f, -167.0f, -600.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_PI / 4, 1); - Matrix_Scale(gGfxMatrix, 0.68f, 0.68f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, -234.0f, -167.0f, -600.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.68f, 0.68f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_500B600); - Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, 1); + Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_500B600); Matrix_Pop(&gGfxMatrix); @@ -366,8 +366,8 @@ void func_hud_80085944(void) { scale += 0.06f; } - Matrix_Translate(gGfxMatrix, x, y, -100.0f, 0); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Translate(gGfxMatrix, x, y, -100.0f, MTXF_NEW); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 180, 180, 0, 50); gSPDisplayList(gMasterDisp++, D_1012110); @@ -387,9 +387,9 @@ void func_hud_80085944(void) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_800D1AC4[i + 1], D_800D1AD8[i + 1], -100.0f, 0); - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_801618B0[0], 1); - Matrix_Scale(gGfxMatrix, D_801618B0[i + 2], D_801618B0[i + 2], D_801618B0[i + 2], 1); + Matrix_Translate(gGfxMatrix, D_800D1AC4[i + 1], D_800D1AD8[i + 1], -100.0f, MTXF_NEW); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_801618B0[0], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_801618B0[i + 2], D_801618B0[i + 2], D_801618B0[i + 2], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); @@ -415,8 +415,8 @@ void func_hud_80085944(void) { scale += 0.06f; } - Matrix_Translate(gGfxMatrix, x, y, -100.0f, 0); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Translate(gGfxMatrix, x, y, -100.0f, MTXF_NEW); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (D_80161860[i + 1] == 2) { @@ -468,7 +468,7 @@ void func_hud_80086110(f32 arg0, f32 arg1, s32 arg2) { ((gPlayState == PLAY_PAUSE) || (D_ctx_80177830 == 1) || (gLevelStatusScreenTimer != 0))) { RCP_SetupDL(&gMasterDisp, 0x4C); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); - if ((arg2 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7)) { + if ((arg2 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { Graphics_DisplaySmallText(arg0 + (8.0f * temp) + 4.0f, arg1 + 2.0f, 1.0f, 1.0f, " OK "); } else { Graphics_DisplaySmallText(arg0 + (8.0f * temp) + 4.0f, arg1 + 2.0f, 1.0f, 1.0f, "DOWN"); @@ -1371,8 +1371,8 @@ void func_hud_80088784(s32 arg0) { RCP_SetupDL(&gMasterDisp, 0x24); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, D_800D1DC8[arg0]); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 3.9f, -3.3f, -100.0f, 0); - Matrix_Scale(gGfxMatrix, 0.37f, 0.37f, 0.37f, 1); + Matrix_Translate(gGfxMatrix, 3.9f, -3.3f, -100.0f, MTXF_NEW); + Matrix_Scale(gGfxMatrix, 0.37f, 0.37f, 0.37f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gLevelType == LEVELTYPE_PLANET) { @@ -1448,7 +1448,7 @@ void func_hud_80088970(void) { break; case 2: - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 32; @@ -1567,7 +1567,7 @@ void func_hud_80088970(void) { gSavedHitCount = D_ctx_80177CA0 = 0; func_8001CA24(0); - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_6; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_NEXT; gScreenFlashTimer = 0; gPlayer[0].timer_1F8 = 0; gFillScreenAlpha = gFillScreenAlphaTarget = 255; @@ -1711,7 +1711,7 @@ void func_hud_80088970(void) { void func_hud_80089670(void) { RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - Matrix_Scale(gGfxMatrix, 18.64f, 21.04f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 18.64f, 21.04f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -1719,7 +1719,7 @@ void func_hud_80089670(void) { void func_hud_80089710(void) { RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - Matrix_Scale(gGfxMatrix, 11.0f, 11.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 11.0f, 11.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -1727,7 +1727,7 @@ void func_hud_80089710(void) { void func_hud_800897B0(void) { RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - Matrix_Scale(gGfxMatrix, 130.0f, 130.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 130.0f, 130.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024830); } @@ -1735,7 +1735,7 @@ void func_hud_800897B0(void) { void func_hud_80089850(void) { RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, 255); - Matrix_Scale(gGfxMatrix, 125.0f, 125.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 125.0f, 125.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102A8A0); } @@ -1743,7 +1743,7 @@ void func_hud_80089850(void) { void func_hud_800898F0(void) { RCP_SetupDL(&gMasterDisp, 1); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 208, 80, 255); - Matrix_Scale(gGfxMatrix, 30.0f, 30.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 30.0f, 30.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SZ_6004570); } @@ -1769,7 +1769,7 @@ void func_hud_80089994(s32 arg0) { RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, D_800D1E14[arg0][0], D_800D1E14[arg0][1], D_800D1E14[arg0][2], D_800D1E14[arg0][3]); - Matrix_Scale(gGfxMatrix, var_fv1, var_fv2, 1.0f, 1); + Matrix_Scale(gGfxMatrix, var_fv1, var_fv2, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1015510); } @@ -1777,7 +1777,7 @@ void func_hud_80089994(s32 arg0) { void func_hud_80089AF4(void) { RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, 255); - Matrix_Scale(gGfxMatrix, 54.0f, 54.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 54.0f, 54.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_STAR_WOLF_F014180); } @@ -1785,7 +1785,7 @@ void func_hud_80089AF4(void) { void func_hud_80089B94(void) { RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 92, 92, 255); - Matrix_Scale(gGfxMatrix, 54.0f, 54.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 54.0f, 54.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_D0098B0); } @@ -1803,7 +1803,7 @@ void func_hud_80089C38(void) { alpha *= 255.0f / 10.0f; gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, alpha); - Matrix_Scale(gGfxMatrix, 15.0f, 15.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 15.0f, 15.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024230); } @@ -1829,8 +1829,8 @@ void func_hud_80089D28(void) { } gDPSetPrimColor(gMasterDisp++, 0, 0, 255, gb, gb, 255); - Matrix_Translate(gGfxMatrix, 0.0f, -185.92001f, 0, 1); - Matrix_Scale(gGfxMatrix, 3.55f, 0.13f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -185.92001f, 0, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.55f, 0.13f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024230); } @@ -1853,7 +1853,7 @@ void RadarMark_Draw(s32 arg0) { var_a1 = 1; } - if (gPlayer[arg0].state_1C8 == PLAYERSTATE_1C8_13) { + if (gPlayer[arg0].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY) { break; } } @@ -1949,11 +1949,11 @@ void func_hud_8008A240(void) { Item* item; for (i = 0; i < gCamCount; i++) { - if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_6) { + if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_NEXT) { continue; } - gRadarMarks[i].unk_00 = 1; - gRadarMarks[i].unk_02 = i; + gRadarMarks[i].status = 1; + gRadarMarks[i].type = i; gRadarMarks[i].unk_10 = gPlayer[i].unk_114 + gPlayer[i].unk_0E8; gRadarMarks[i].pos.z = gPlayer[i].unk_138; gRadarMarks[i].pos.x = gPlayer[i].pos.x; @@ -1966,7 +1966,7 @@ void func_hud_8008A240(void) { continue; } - if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_3) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_ACTIVE) { continue; } @@ -1975,15 +1975,15 @@ void func_hud_8008A240(void) { } if ((gGameFrameCount % 64) != 0) { - gRadarMarks[i].unk_02 = 999; + gRadarMarks[i].type = 999; } } if (gVersusMode == 1) { for (i = 0, item = gItems; i < 20; i++, item++) { if (item->obj.status >= OBJ_ACTIVE) { - gRadarMarks[item->index + 50].unk_00 = 1; - gRadarMarks[item->index + 50].unk_02 = 103; + gRadarMarks[item->index + 50].status = 1; + gRadarMarks[item->index + 50].type = 103; gRadarMarks[item->index + 50].pos.x = item->obj.pos.x; gRadarMarks[item->index + 50].pos.y = item->obj.pos.y; gRadarMarks[item->index + 50].pos.z = item->obj.pos.z; @@ -2124,7 +2124,7 @@ s32 func_hud_8008A4DC(void) { } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x1, y1, z1, 1); + Matrix_Translate(gGfxMatrix, x1, y1, z1, MTXF_APPLY); if ((gCurrentLevel == LEVEL_SECTOR_Z) && (D_hud_80161710 != 0)) { Matrix_Push(&gGfxMatrix); @@ -2134,26 +2134,26 @@ s32 func_hud_8008A4DC(void) { } for (i = 64; i >= 0; i--) { - if ((gRadarMarks[i].unk_00 == 0) || (fabsf(gRadarMarks[i].pos.x) >= (temp2 + 1000.0f)) || + if ((gRadarMarks[i].status == 0) || (fabsf(gRadarMarks[i].pos.x) >= (temp2 + 1000.0f)) || (fabsf(gRadarMarks[i].pos.z) >= (temp2 + 1000.0f))) { continue; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, gRadarMarks[i].pos.x * 0.008f, -gRadarMarks[i].pos.z * 0.008f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, gRadarMarks[i].pos.x * 0.008f, -gRadarMarks[i].pos.z * 0.008f, 0.0f, MTXF_APPLY); - if (gRadarMarks[i].unk_02 == 103) { + if (gRadarMarks[i].type == 103) { gRadarMarks[i].unk_10 = 45.0f; } - Matrix_RotateZ(gGfxMatrix, M_DTOR * gRadarMarks[i].unk_10, 1); - Matrix_Scale(gGfxMatrix, scale, scale, 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * gRadarMarks[i].unk_10, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - RadarMark_Draw(gRadarMarks[i].unk_02); + RadarMark_Draw(gRadarMarks[i].type); Matrix_Pop(&gGfxMatrix); - gRadarMarks[i].unk_00 = 0; + gRadarMarks[i].status = 0; } Matrix_Pop(&gGfxMatrix); @@ -2562,8 +2562,8 @@ void func_hud_8008BAE4(void) { RCP_SetupDL(&gMasterDisp, 0xC); gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, alpha); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -53.9f, -38.5f, -139.4f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, -53.9f, -38.5f, -139.4f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_800D1A40); Matrix_Pop(&gGfxMatrix); @@ -2744,22 +2744,22 @@ void func_hud_8008C6F4(s32 idx, s32 arg1) { Matrix_Push(&gGfxMatrix); if (gPlayer[0].cockpitView) { - Matrix_RotateZ(gGfxMatrix, M_DTOR * gPlayer[0].unk_034, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * gPlayer[0].camRoll, MTXF_APPLY); } if (D_800D1F88[idx]) { - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_800D1F88[idx], 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_800D1F88[idx], MTXF_APPLY); } if (arg1 != 0) { Matrix_Translate(gGfxMatrix, D_800D1EF8[idx] + D_800D1FE8[idx], D_800D1F28[idx] + D_800D2018[idx], - D_800D1F58[idx], 1); + D_800D1F58[idx], MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, D_800D1EF8[idx], D_800D1F28[idx], D_800D1F58[idx], 1); + Matrix_Translate(gGfxMatrix, D_800D1EF8[idx], D_800D1F28[idx], D_800D1F58[idx], MTXF_APPLY); } - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_800D1FB8[idx], 1); - Matrix_Scale(gGfxMatrix, 0.026f, 0.026f, 0.026f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_800D1FB8[idx], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.026f, 0.026f, 0.026f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x3E); @@ -3723,13 +3723,13 @@ s32 func_hud_80090200(Boss* boss) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); - player->camEye.x = boss->fwork[4] = boss->obj.pos.x; - player->camEye.y = boss->fwork[5] = boss->obj.pos.y + 500.0f; - player->camEye.z = boss->fwork[6] = boss->obj.pos.z + 4000.0f; + player->cam.eye.x = boss->fwork[4] = boss->obj.pos.x; + player->cam.eye.y = boss->fwork[5] = boss->obj.pos.y + 500.0f; + player->cam.eye.z = boss->fwork[6] = boss->obj.pos.z + 4000.0f; - player->camAt.x = boss->obj.pos.x; - player->camAt.y = boss->obj.pos.y; - player->camAt.z = boss->obj.pos.z; + player->cam.at.x = boss->obj.pos.x; + player->cam.at.y = boss->obj.pos.y; + player->cam.at.z = boss->obj.pos.z; boss->fwork[7] = 0.0f; boss->fwork[8] = 0.0f; @@ -3791,21 +3791,21 @@ s32 func_hud_80090200(Boss* boss) { src.y = boss->fwork[5] - boss->obj.pos.y; src.z = boss->fwork[6] - boss->obj.pos.z; - Matrix_Translate(gCalcMatrix, boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * boss->fwork[7], 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * boss->fwork[8], 1); + Matrix_Translate(gCalcMatrix, boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * boss->fwork[7], MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * boss->fwork[8], MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); - player->camEye.x = dest.x; - player->camEye.y = dest.y; - player->camEye.z = dest.z; + player->cam.eye.x = dest.x; + player->cam.eye.y = dest.y; + player->cam.eye.z = dest.z; - player->camAt.x = boss->obj.pos.x; - player->camAt.y = boss->obj.pos.x; - player->camAt.z = boss->obj.pos.x; + player->cam.at.x = boss->obj.pos.x; + player->cam.at.y = boss->obj.pos.x; + player->cam.at.z = boss->obj.pos.x; - player->camAt.x += COS_DEG(boss->timer_050 * 60.0f) * boss->fwork[9]; - player->camAt.y += SIN_DEG(boss->timer_050 * 179.0f) * boss->fwork[9]; + player->cam.at.x += COS_DEG(boss->timer_050 * 60.0f) * boss->fwork[9]; + player->cam.at.y += SIN_DEG(boss->timer_050 * 179.0f) * boss->fwork[9]; } } @@ -4147,7 +4147,7 @@ void func_hud_800914FC(Actor* actor) { actor->state = 3; } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { if ((actor->state != 2) && (actor->state != 3)) { actor->iwork[4] = 1; actor->state = 2; @@ -4351,7 +4351,7 @@ bool func_hud_80091F00(Actor* actor) { AUDIO_PLAY_SFX(0x2903300E, actor->sfxSource, 4); func_effect_8007D10C(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 1.5f); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, MTXF_NEW); if (Rand_ZeroOne() < 0.5f) { sp40.x = -20.0f; @@ -4421,8 +4421,8 @@ bool func_hud_80091F00(Actor* actor) { } void func_hud_80092244(Actor* actor) { - gRadarMarks[actor->index].unk_00 = 1; - gRadarMarks[actor->index].unk_02 = actor->aiType; + gRadarMarks[actor->index].status = 1; + gRadarMarks[actor->index].type = actor->aiType; gRadarMarks[actor->index].pos.x = actor->obj.pos.x; gRadarMarks[actor->index].pos.y = actor->obj.pos.y; gRadarMarks[actor->index].pos.z = actor->obj.pos.z; @@ -4432,7 +4432,7 @@ void func_hud_80092244(Actor* actor) { void func_hud_800922F4(Actor* actor) { s32 temp; - if ((gTeamShields[actor->aiType] < 64) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { + if ((gTeamShields[actor->aiType] < 64) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { temp = 8 - 1; if (gTeamShields[actor->aiType] > 16) { temp = 16 - 1; @@ -4501,8 +4501,9 @@ bool func_hud_800924E0(Actor* actor) { Math_SmoothStepToAngle(&actor->obj.rot.z, 0.0f, 0.1f, 5.0f, 0.0f); actor->obj.rot.x = actor->vwork[29].x + (360.0f - actor->fwork[19]); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * ((actor->unk_0F4.x + actor->vwork[29].x) + actor->fwork[19])), 1); + Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * ((actor->unk_0F4.x + actor->vwork[29].x) + actor->fwork[19])), + MTXF_APPLY); src.z = actor->fwork[1]; src.y = 0.0f; @@ -4642,7 +4643,7 @@ bool func_hud_800927A0(Actor* actor) { actor->obj.pos.y += actor->fwork[28]; Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0U); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * (actor->unk_0F4.x + actor->vwork[29].x + actor->fwork[19])), 1); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * (actor->unk_0F4.x + actor->vwork[29].x + actor->fwork[19])), MTXF_APPLY); src.z = actor->fwork[1]; src.y = 0.0f; @@ -4729,14 +4730,14 @@ void ActorTeamBoss_Update(ActorTeamBoss* this) { } if ((this->iwork[10] != 0) && (gLevelMode == LEVELMODE_ALL_RANGE) && (this->iwork[9] == 0) && - (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { + (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { this->unk_048 = 2; this->unk_04A = 0; } if ((gLevelMode == LEVELMODE_ALL_RANGE) && (fabsf(this->obj.pos.x > var_fv1) || fabsf(this->obj.pos.z > var_fv1)) && - (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { + (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { this->unk_048 = 2; this->unk_04A = 1; } @@ -4776,7 +4777,7 @@ void func_hud_80093164(Actor* actor) { if (actor->state == 0) { switch (actor->unk_0B6) { case 1: - if ((player->state_1C8 != PLAYERSTATE_1C8_2) || (actor->unk_0B6 != 1)) { + if ((player->state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO) || (actor->unk_0B6 != 1)) { if (gCsFrameCount > 1588) { actor->fwork[0] = 5.0f; } else { @@ -4799,8 +4800,8 @@ void func_hud_80093164(Actor* actor) { } } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = actor->fwork[0]; @@ -4842,7 +4843,8 @@ void func_hud_800933D8(f32 x, f32 y, f32 z, f32 arg3) { effect->obj.pos.y = y; effect->obj.pos.z = z; - if ((player->state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) { + if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && + (player->unk_1D0 < 2)) { effect->scale1 = 0.4f; effect->unk_44 = 0; effect->unk_46 = 24; @@ -4932,13 +4934,13 @@ void func_hud_800935E8(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaTarget = 0; - player->camEye.x = gCsCamEyeX = -3061.2f; - player->camEye.y = gCsCamEyeY = 1745.9f; - player->camEye.z = gCsCamEyeZ = -5786.0f; + player->cam.eye.x = gCsCamEyeX = -3061.2f; + player->cam.eye.y = gCsCamEyeY = 1745.9f; + player->cam.eye.z = gCsCamEyeZ = -5786.0f; - player->camAt.x = gCsCamAtX = 300.0f; - player->camAt.y = gCsCamAtY = 2200.0f; - player->camAt.z = gCsCamAtZ = -5700.0f; + player->cam.at.x = gCsCamAtX = 300.0f; + player->cam.at.y = gCsCamAtY = 2200.0f; + player->cam.at.z = gCsCamAtZ = -5700.0f; D_801616A0.x = 5.18f; D_801616A0.y = 124.17f; @@ -4962,8 +4964,8 @@ void func_hud_800935E8(Player* player) { src.y = D_800D2320[i].y + RAND_FLOAT(12.0f); src.z = D_800D2320[i].z; - Matrix_Translate(gCalcMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * 30.0f, 1); + Matrix_Translate(gCalcMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * 30.0f, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); x = dest.x; @@ -4981,8 +4983,8 @@ void func_hud_800935E8(Player* player) { src.y = D_800D2320[i].y + RAND_FLOAT(12.0f); src.z = D_800D2320[i].z; - Matrix_Translate(gCalcMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * 30.0f, 1); + Matrix_Translate(gCalcMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * 30.0f, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); x = dest.x; @@ -5082,7 +5084,7 @@ void func_hud_800935E8(Player* player) { D_ctx_80177AB0 = 0; - player->unk_034 = 60.0f; + player->camRoll = 60.0f; player->timer_1F8 = 1000; player->unk_0E8 = 30.0f; @@ -5111,21 +5113,21 @@ void func_hud_800935E8(Player* player) { src.y = D_ctx_80177A48[3]; src.z = D_ctx_80177A48[4]; - Matrix_Translate(gCalcMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * 30.0f, 1); + Matrix_Translate(gCalcMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * 30.0f, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); gCsCamEyeX = dest.x; gCsCamEyeY = dest.y; gCsCamEyeZ = dest.z; - player->camAt.x = gCsCamAtX = gCsCamEyeX; - player->camAt.y = gCsCamAtY = gCsCamEyeY + 100.0f; - player->camAt.z = gCsCamAtZ = gCsCamEyeZ + 10.0f; + player->cam.at.x = gCsCamAtX = gCsCamEyeX; + player->cam.at.y = gCsCamAtY = gCsCamEyeY + 100.0f; + player->cam.at.z = gCsCamAtZ = gCsCamEyeZ + 10.0f; - player->camEye.x = gCsCamEyeX; - player->camEye.y = gCsCamEyeY; - player->camEye.z = gCsCamEyeZ; + player->cam.eye.x = gCsCamEyeX; + player->cam.eye.y = gCsCamEyeY; + player->cam.eye.z = gCsCamEyeZ; } if (player->timer_1F8 == 774) { @@ -5146,8 +5148,8 @@ void func_hud_800935E8(Player* player) { temp2 = SIN_DEG(gGameFrameCount * 70.0f) * temp; } - player->camEye.y = gCsCamEyeY + temp2; - player->camAt.y = gCsCamEyeY + 100.0f; + player->cam.eye.y = gCsCamEyeY + temp2; + player->cam.at.y = gCsCamEyeY + 100.0f; Math_SmoothStepToF(&player->unk_018, -1200.0f, 0.02f, 60.0f, 0.0f); @@ -5155,8 +5157,8 @@ void func_hud_800935E8(Player* player) { src.y = 0.0f; src.z = player->unk_018; - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->pos.z, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * 30.0f, 1); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->pos.z, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * 30.0f, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); player->pos.x = dest.x; @@ -5164,7 +5166,7 @@ void func_hud_800935E8(Player* player) { player->pos.z = dest.z; if (((player->timer_1F8 % 8) == 0) && (player->timer_1F8 > 740)) { - func_effect_8007D9DC(player->camEye.x, 1600.0f, player->camEye.z, 10.0f, 100.0f, 0); + func_effect_8007D9DC(player->cam.eye.x, 1600.0f, player->cam.eye.z, 10.0f, 100.0f, 0); } if ((player->unk_018 > -200.0f) && (D_ctx_80177A10[8] < 6)) { @@ -5179,9 +5181,9 @@ void func_hud_800935E8(Player* player) { if (((gGameFrameCount % 3) == 0) && (player->timer_1F8 <= 740)) { for (i = 0; i < 8; i++) { - Aquas_801AC8A8(player->camEye.x + RAND_FLOAT_CENTERED(D_800D22C4), - player->camEye.y + 260.0f + RAND_FLOAT_CENTERED(D_800D22C8), - player->camEye.z + RAND_FLOAT_CENTERED(D_800D22CC), 1.0f, 0); + Aquas_801AC8A8(player->cam.eye.x + RAND_FLOAT_CENTERED(D_800D22C4), + player->cam.eye.y + 260.0f + RAND_FLOAT_CENTERED(D_800D22C8), + player->cam.eye.z + RAND_FLOAT_CENTERED(D_800D22CC), 1.0f, 0); } } } @@ -5205,16 +5207,16 @@ void func_hud_800935E8(Player* player) { player->pos.y = 350.0f; player->pos.z = 0.0f; - player->camEye.x = player->pos.x * (600.0f / player->unk_09C); - player->camEye.y = player->pos.y * (1040.0f / player->unk_0A0); - player->camEye.y -= 50.0f; + player->cam.eye.x = player->pos.x * (600.0f / player->unk_09C); + player->cam.eye.y = player->pos.y * (1040.0f / player->unk_0A0); + player->cam.eye.y -= 50.0f; - player->camAt.x = player->pos.x * (600.0f / player->unk_09C); - player->camAt.y = player->pos.y * (1050.0f / player->unk_0A0); - player->camAt.y += player->unk_060 * 10.0f; + player->cam.at.x = player->pos.x * (600.0f / player->unk_09C); + player->cam.at.y = player->pos.y * (1050.0f / player->unk_0A0); + player->cam.at.y += player->unk_060 * 10.0f; player->pos.z += 1000.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; D_ctx_80177A48[0] = 0.1f; @@ -5230,8 +5232,8 @@ void func_hud_800935E8(Player* player) { Object_Kill(&actor->obj, actor->sfxSource); - player->camEye.z = gCsCamEyeZ = 800.0f; - player->camAt.z = gCsCamAtZ = 0.0f; + player->cam.eye.z = gCsCamEyeZ = 800.0f; + player->cam.at.z = gCsCamAtZ = 0.0f; case 6: player->unk_060 = SIN_DEG(player->unk_0F4 * 0.7f) * 0.5f; @@ -5261,11 +5263,11 @@ void func_hud_800935E8(Player* player) { if (player->timer_1F8 <= 900) { gLevelStatusScreenTimer = 50; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = 0; player->timer_1F8 = 0; - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); AUDIO_PLAY_BGM(SEQ_ID_AQUAS); @@ -5279,8 +5281,8 @@ void func_hud_800935E8(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), 0); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -5298,12 +5300,12 @@ void func_hud_800935E8(Player* player) { player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); } // unused data @@ -5316,7 +5318,7 @@ f32 D_800D24CC = 0.02f; void func_hud_80094954(Effect* effect) { Player* player = &gPlayer[0]; - if ((player->state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) { + if ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 < 2)) { switch (effect->state) { case 0: effect->unk_44 += effect->unk_46; @@ -5347,12 +5349,12 @@ void func_hud_80094954(Effect* effect) { } effect->obj.rot.z += effect->unk_48; } else { - if (player->state_1C8 == PLAYERSTATE_1C8_7) { - effect->obj.rot.x = RAD_TO_DEG(player->unk_05C); - effect->obj.rot.y = RAD_TO_DEG(-player->unk_058); + if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { + effect->obj.rot.x = RAD_TO_DEG(player->camPitch); + effect->obj.rot.y = RAD_TO_DEG(-player->camYaw); } - if (player->state_1C8 == PLAYERSTATE_1C8_6) { + if (player->state_1C8 == PLAYERSTATE_1C8_NEXT) { effect->unk_46 = 2; if (player->unk_1D0 >= 4) { effect->vel.y -= 0.13f; @@ -5362,8 +5364,8 @@ void func_hud_80094954(Effect* effect) { effect->scale2 += 0.8f; effect->unk_4A -= effect->unk_46; - if ((effect->unk_4A < 0) || - ((player->state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 == 5))) { + if ((effect->unk_4A < 0) || ((player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && + (gCurrentLevel == LEVEL_AQUAS) && (player->unk_1D0 == 5))) { Object_Kill(&effect->obj, effect->sfxSource); } effect->obj.rot.z += effect->unk_48; @@ -5371,7 +5373,8 @@ void func_hud_80094954(Effect* effect) { } void func_hud_80094BBC(Effect* effect) { - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].unk_1D0 < 2)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && (gCurrentLevel == LEVEL_AQUAS) && + (gPlayer[0].unk_1D0 < 2)) { RCP_SetupDL(&gMasterDisp, 0x44); gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 21, 34, effect->unk_4A); gDPSetEnvColor(gMasterDisp++, 255, 255, 251, 0); @@ -5635,8 +5638,8 @@ void func_hud_80095604(Player* player) { src.y = 300.0f; src.z = 1000.0f; - Matrix_Translate(gCalcMatrix, D_ctx_80177A48[1], D_ctx_80177A48[2], D_ctx_80177A48[3], 0); - Matrix_RotateY(gCalcMatrix, -(M_DTOR * D_ctx_80177A48[5]), 1); + Matrix_Translate(gCalcMatrix, D_ctx_80177A48[1], D_ctx_80177A48[2], D_ctx_80177A48[3], MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -(M_DTOR * D_ctx_80177A48[5]), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); } @@ -5646,14 +5649,14 @@ void func_hud_80095604(Player* player) { dest.z = gBosses[0].obj.pos.z + 1000.0f; } if (gCsFrameCount >= 90) { - dest.x = player->camEye.x; - dest.y = player->camEye.y; - dest.z = player->camEye.z + 200.0f - D_ctx_80177D20; + dest.x = player->cam.eye.x; + dest.y = player->cam.eye.y; + dest.z = player->cam.eye.z + 200.0f - D_ctx_80177D20; } Math_SmoothStepToAngle(&player->unk_130, 0.0f, 0.05f, 1.2f, 0.0001f); Math_SmoothStepToAngle(&player->unk_12C, 0.0f, 0.05f, 1.2f, 0.0001f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); x = player->pos.x - dest.x; @@ -5684,17 +5687,17 @@ void func_hud_80095604(Player* player) { src.z = D_ctx_80177A48[9]; Matrix_Translate(gCalcMatrix, gBosses[0].obj.pos.x, gBosses[0].obj.pos.y, - gBosses[0].obj.pos.z + D_ctx_80177D20, 0); - Matrix_RotateY(gCalcMatrix, -(M_DTOR * D_ctx_80177A48[4]), 1); + gBosses[0].obj.pos.z + D_ctx_80177D20, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -(M_DTOR * D_ctx_80177A48[4]), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); Math_SmoothStepToF(&gCsCamEyeX, dest.x, 0.02f, player->unk_0D0, 0.001f); Math_SmoothStepToF(&gCsCamEyeY, dest.y, 0.02f, player->unk_0D0, 0.001f); Math_SmoothStepToF(&gCsCamEyeZ, dest.z, 0.02f, player->unk_0D0, 0.001f); - player->camEye.x = gCsCamEyeX; - player->camEye.y = gCsCamEyeY; - player->camEye.z = gCsCamEyeZ; + player->cam.eye.x = gCsCamEyeX; + player->cam.eye.y = gCsCamEyeY; + player->cam.eye.z = gCsCamEyeZ; if (gCsFrameCount < 200) { Math_SmoothStepToF(&gCsCamAtX, gBosses[0].obj.pos.x, 0.03f, 100.0f, 0.001f); @@ -5711,9 +5714,9 @@ void func_hud_80095604(Player* player) { } } - player->camAt.x = gCsCamAtX; - player->camAt.y = gCsCamAtY; - player->camAt.z = gCsCamAtZ; + player->cam.at.x = gCsCamAtX; + player->cam.at.y = gCsCamAtY; + player->cam.at.z = gCsCamAtZ; D_ctx_80177A48[0] = 0.0f; break; @@ -5779,17 +5782,17 @@ void func_hud_80095604(Player* player) { src.y = actor->fwork[2]; src.z = actor->fwork[3]; - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138 + D_ctx_80177D20, 0); - Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), 1); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138 + D_ctx_80177D20, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = player->pos.z - 50.0f + D_ctx_80177D20; - player->camEye.x = gCsCamEyeX = dest.x; - player->camEye.y = gCsCamEyeY = dest.y; - player->camEye.z = gCsCamEyeZ = dest.z; + player->cam.eye.x = gCsCamEyeX = dest.x; + player->cam.eye.y = gCsCamEyeY = dest.y; + player->cam.eye.z = gCsCamEyeZ = dest.z; D_ctx_80177A48[0] = 1.0f; @@ -5845,8 +5848,8 @@ void func_hud_80095604(Player* player) { src.y = actor->fwork[2]; src.z = actor->fwork[3]; - Matrix_Translate(gCalcMatrix, actor->fwork[4], actor->fwork[5], actor->fwork[6], 0); - Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), 1); + Matrix_Translate(gCalcMatrix, actor->fwork[4], actor->fwork[5], actor->fwork[6], MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -(M_DTOR * actor->unk_0F4.y), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); gCsCamEyeX = dest.x; @@ -5860,7 +5863,7 @@ void func_hud_80095604(Player* player) { if (gFillScreenAlpha == 255) { D_play_800D3180[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1; - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; Audio_FadeOutAll(10); D_ctx_8017837C = 4; @@ -5931,8 +5934,8 @@ void func_hud_80095604(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), 0); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * player->unk_0E4), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -5970,12 +5973,12 @@ void func_hud_80095604(Player* player) { player->unk_178 += 20.0f; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.001f); } void func_hud_80096A74(Player* player) { @@ -5995,13 +5998,13 @@ void func_hud_80096A74(Player* player) { player->unk_1D0 = 1; gFillScreenAlpha = gFillScreenAlphaTarget = 255; - player->camEye.x = gCsCamEyeX = 0.0f; - player->camEye.y = gCsCamEyeY = player->pos.y + D_ctx_80177A48[1]; - player->camEye.z = gCsCamEyeZ = 0.0f; + player->cam.eye.x = gCsCamEyeX = 0.0f; + player->cam.eye.y = gCsCamEyeY = player->pos.y + D_ctx_80177A48[1]; + player->cam.eye.z = gCsCamEyeZ = 0.0f; - player->camAt.x = gCsCamAtX = 0.0f; - player->camAt.y = gCsCamAtY = 0.0f; - player->camAt.z = gCsCamAtZ = 0.0f; + player->cam.at.x = gCsCamAtX = 0.0f; + player->cam.at.y = gCsCamAtY = 0.0f; + player->cam.at.z = gCsCamAtZ = 0.0f; D_ctx_80177A48[0] = 1.0f; D_ctx_80177A48[2] = 0.0f; @@ -6022,17 +6025,17 @@ void func_hud_80096A74(Player* player) { if (gCsFrameCount > 60) { Math_SmoothStepToF(&D_ctx_80177A48[4], 3.0f, 0.05f, 1000.0f, 0.001f); } - player->unk_034 += D_ctx_80177A48[4]; - if (player->unk_034 >= 360.0f) { - player->unk_034 -= 360.0f; + player->camRoll += D_ctx_80177A48[4]; + if (player->camRoll >= 360.0f) { + player->camRoll -= 360.0f; } - if (player->unk_034 < 0.0f) { - player->unk_034 += 360.0f; + if (player->camRoll < 0.0f) { + player->camRoll += 360.0f; } } if (gCsFrameCount >= 140) { - Math_SmoothStepToAngle(&player->unk_034, 0.0f, 0.05f, 3.0f, 0.001f); + Math_SmoothStepToAngle(&player->camRoll, 0.0f, 0.05f, 3.0f, 0.001f); Math_SmoothStepToF(&D_ctx_80177A48[1], 200.0f, 0.2f, 6.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[2], 200.0f, 0.2f, 6.0f, 0.0f); D_ctx_80177A48[0] = 0.2f; @@ -6057,7 +6060,7 @@ void func_hud_80096A74(Player* player) { case 2: D_ctx_80177A48[0] = 0.12f; - Math_SmoothStepToAngle(&player->unk_034, 0.0f, 0.05f, 3.0f, 0.001f); + Math_SmoothStepToAngle(&player->camRoll, 0.0f, 0.05f, 3.0f, 0.001f); Math_SmoothStepToF(&D_ctx_80177A48[1], (player->pos.y * player->unk_148 + 50.0f), 0.2f, 10.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[2], 400.0f, 0.2f, 6.0f, 0.0f); Math_SmoothStepToF(&player->pos.y, 350.0f, 0.1f, 40.0f, 0.0f); @@ -6083,14 +6086,14 @@ void func_hud_80096A74(Player* player) { if (gCsFrameCount == 300) { D_ctx_80177CE8 = 0; gLevelStatusScreenTimer = 50; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_0D0 = D_play_80161A54; player->unk_1D0 = 0; player->timer_1F8 = 0; player->unk_014 = 0.0f; player->unk_018 = 0.0f; - player->unk_034 = 0.0f; - D_ctx_80178488 = 1; + player->camRoll = 0.0f; + gLoadLevelObjects = 1; } break; } @@ -6120,8 +6123,8 @@ void func_hud_80096A74(Player* player) { } } - Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), 0); - Matrix_RotateX(gCalcMatrix, -(M_DTOR * (player->unk_0E4)), 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * (player->unk_0E8 + player->unk_114 + 180.0f), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(M_DTOR * (player->unk_0E4)), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -6140,10 +6143,10 @@ void func_hud_80096A74(Player* player) { player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); } diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index a46b0a58..d1204be6 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -131,7 +131,7 @@ void func_play_800A3FEC(void) { *var_s1 = *var_s0 = 0.0f; } spB4[*spB0].n.ob[1] = (s16) *var_s3 + (s16) *var_s0; - Matrix_RotateZ(gCalcMatrix, *var_s3 * sp88 * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, *var_s3 * sp88 * M_DTOR, MTXF_NEW); spC4.x = 120.0f; spC4.y = 0.0f; spC4.z = 0.0f; @@ -235,10 +235,10 @@ void func_play_800A4C40(Player* player) { Vec3f sp30; if (gGroundType == GROUNDTYPE_WATER) { - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -(player->unk_0F8 * M_DTOR), 1); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -(player->unk_0F8 * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp54, &sp3C); Matrix_MultVec3f(gCalcMatrix, &sp48, &sp30); if (player->pos.y < (gGroundLevel + 100.0f)) { @@ -861,8 +861,8 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) { func_play_800A5FA0(player->sfxSource, 0x0903A00F, player->num); } } - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, player->unk_0F8 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->unk_0F8 * M_DTOR, MTXF_APPLY); sp44.z = 0.0f; switch (player->unk_21C) { case 0: @@ -1086,26 +1086,26 @@ s32 func_play_800A7974(Player* player, f32* hitboxData, s32* index, f32 xPos, f3 for (i = 0; i < count; i++, hitboxData += 6) { spA0 = 0; if (*hitboxData == HITBOX_ROTATED) { - Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, MTXF_APPLY); hitboxData += 4; spA0 = 1; } else { if (*hitboxData >= HITBOX_SHADOW) { hitboxData++; } - Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, MTXF_APPLY); } if (!((arg9 == 0) && (argA == 0) && (argB == 0))) { - Matrix_RotateZ(gCalcMatrix, -argB * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -arg9 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -argA * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -argB * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -arg9 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -argA * M_DTOR, MTXF_APPLY); } if ((yRot == 0.0f) && (zRot == 0.0f) && (xRot == 0.0f) && (spA0 == 0)) { var_fv0 = player->hit3.x; @@ -1384,7 +1384,7 @@ s32 func_play_800A8304(Player* player, ObjectId objId, f32 arg2, f32 arg3, f32 a sp84.x = arg2; sp84.y = arg3; sp84.z = arg4; - Matrix_RotateY(gCalcMatrix, -arg6 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -arg6 * M_DTOR, MTXF_NEW); sp78.x = player->vel.x; sp78.y = player->vel.y; sp78.z = player->vel.z; @@ -1450,7 +1450,7 @@ void func_play_800A86E4(Player* player) { for (i = 0, item = gItems; i < ARRAY_COUNT(gItems); i++, item++) { if ((item->obj.status == OBJ_ACTIVE) && - ((player->state_1C8 == PLAYERSTATE_1C8_3) || (player->state_1C8 == PLAYERSTATE_1C8_5)) && + ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (player->state_1C8 == PLAYERSTATE_1C8_U_TURN)) && (item->timer_4A == 0) && func_play_800A7974(player, item->info.hitbox, &sp6C, item->obj.pos.x, item->obj.pos.y, item->obj.pos.z, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)) { @@ -1494,7 +1494,7 @@ void func_play_800A8804(Player* playerA, Player* playerB) { void func_play_800A887C(Player* player) { Vec3f sp3C; - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, 0); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, MTXF_NEW); if (player->form == FORM_LANDMASTER) { player->unk_10C = 0.0f; player->unk_104 = 0.0f; @@ -1525,8 +1525,8 @@ void func_play_800A887C(Player* player) { Matrix_MultVec3f(gCalcMatrix, &sp3C, &player->hit4); } if ((player->form == FORM_ARWING) || (player->form == FORM_BLUE_MARINE)) { - Matrix_RotateY(gCalcMatrix, (player->unk_114 + 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -(player->unk_0F8 * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -(player->unk_0F8 * M_DTOR), MTXF_APPLY); sp3C.y = 0.0f; sp3C.z = 0.0f; if (player->wings.leftState == WINGSTATE_INTACT) { @@ -1595,7 +1595,7 @@ void func_play_800A8BA4(Player* player) { break; } } else if (player->form == FORM_ARWING) { - if ((player->hit1.y < (gGroundLevel + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_4)) { + if ((player->hit1.y < (gGroundLevel + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) { if (gGroundType == GROUNDTYPE_WATER) { player->unk_1F4 = 7; player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.5f; @@ -1608,7 +1608,7 @@ void func_play_800A8BA4(Player* player) { func_effect_8007BC7C(player->hit1.x, player->hit1.y, player->hit1.z, 6.0f); } } - if ((player->hit2.y < (gGroundLevel + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_4)) { + if ((player->hit2.y < (gGroundLevel + 13.0f)) && (player->state_1C8 != PLAYERSTATE_1C8_DOWN)) { if (gGroundType == GROUNDTYPE_WATER) { player->unk_1F4 = 7; player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.5f; @@ -1685,7 +1685,7 @@ void func_play_800A8BA4(Player* player) { } else { Player_ApplyDamage(player, temp_v0, obj58->info.damage); if (obj58->obj.id == OBJ_80_131) { - Matrix_RotateY(gCalcMatrix, (obj58->obj.rot.y + 180.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (obj58->obj.rot.y + 180.0f) * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_800D3040[sp98 - 1], &spBC); player->unk_0D8.x = spBC.x; player->unk_0D8.y = spBC.y; @@ -1700,10 +1700,10 @@ void func_play_800A8BA4(Player* player) { } if ((obj58->obj.id == OBJ_80_135) || (obj58->obj.id == OBJ_80_136)) { if (obj58->obj.id == OBJ_80_135) { - Matrix_RotateY(gCalcMatrix, (obj58->obj.rot.y + 180.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (obj58->obj.rot.y + 180.0f) * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_800D3088[sp98 - 1], &spBC); } else { - Matrix_RotateY(gCalcMatrix, obj58->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, obj58->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_800D30B8[sp98 - 1], &spBC); } player->unk_0D8.x = spBC.x; @@ -1785,7 +1785,7 @@ void func_play_800A8BA4(Player* player) { Player_ApplyDamage(player, temp_v0, obj80->info.damage); if ((obj80->obj.id == OBJ_80_48) || (obj80->obj.id == OBJ_80_55) || (obj80->obj.id == OBJ_80_49)) { - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, MTXF_NEW); spC8.x = -(player->unk_0D0 + player->unk_110) * 0.7f; spC8.y = 0.0f; spC8.z = 0.0f; @@ -1807,8 +1807,8 @@ void func_play_800A8BA4(Player* player) { player->pos.x = player->unk_090.x; player->timer_498 = 5; } else if (obj80->obj.id == OBJ_80_131) { - Matrix_RotateY(gCalcMatrix, (obj80->obj.rot.y + 180.0f) * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, -obj80->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (obj80->obj.rot.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, -obj80->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_800D3040[sp98 - 1], &spBC); player->unk_0D8.x = spBC.x; player->unk_0D8.y = spBC.y; @@ -2019,7 +2019,7 @@ void func_play_800A8BA4(Player* player) { func_play_800A86E4(player); if (gCamCount == 4) { for (opponent = &gPlayer[3], i = 3; i >= 0; i--, opponent--) { - if ((i != gPlayerNum) && (opponent->state_1C8 == PLAYERSTATE_1C8_3)) { + if ((i != gPlayerNum) && (opponent->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { spC8.x = 25.0f; if (player->form == FORM_ON_FOOT) { spC8.x = 4.0f; @@ -2074,7 +2074,7 @@ void func_play_800A8BA4(Player* player) { player->unk_0D8.y = 30.0f; player->unk_0E4 = (player->unk_0D0 + player->unk_110) * 0.8f; } - if (player->state_1C8 == PLAYERSTATE_1C8_4) { + if (player->state_1C8 == PLAYERSTATE_1C8_DOWN) { player->timer_220 = 2; func_effect_8007AFD0(player->pos.x, player->unk_138, 30.0f, 0.0f, 5.0f); func_effect_8007AFD0(player->pos.x, player->unk_138, -30.0f, 0.0f, 5.0f); @@ -2201,7 +2201,7 @@ void func_play_800AA800(Player* player) { tempy = obj58->obj.pos.y; tempz = obj58->obj.pos.z; sp120 = obj58->obj.rot.y; - Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, MTXF_NEW); spEC.x = player->pos.x - tempx; spEC.y = 0.0f; spEC.z = player->unk_138 - tempz; @@ -2251,7 +2251,7 @@ void func_play_800AA800(Player* player) { sp120 = obj80->obj.rot.y; if ((obj80->obj.id == OBJ_80_3) || (obj80->obj.id == OBJ_80_2) || (obj80->obj.id == OBJ_80_47) || (obj80->obj.id == OBJ_80_4) || (obj80->obj.id == OBJ_80_5)) { - Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, MTXF_NEW); for (var_fs1 = var_fs0 = -50.0f; var_fs0 > -500.0f; var_fs0 -= 5.0f, var_fs1 -= 5.0f) { spEC.x = player->pos.x - tempx; spEC.y = player->pos.y + var_fs0 - tempy; @@ -2306,12 +2306,12 @@ void func_play_800AA800(Player* player) { spFC = hitboxData[2]; spF8 = hitboxData[3]; hitboxData += 4; - Matrix_RotateZ(gCalcMatrix, -spF8 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -sp100 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -spFC * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -spF8 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -sp100 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -spFC * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, MTXF_APPLY); } else { - Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -sp120 * M_DTOR, MTXF_NEW); } hitbox = (Hitbox*) hitboxData; for (var_fs0 = var_fs1 = -50.0f; var_fs0 > -500.0f; var_fs0 -= 5.0f, var_fs1 -= 5.0f) { @@ -2557,7 +2557,7 @@ void Play_Init(void) { if (gCurrentLevel != LEVEL_VERSUS) { gOverlayStage = 0; } - D_game_80161A2C = 1; + gShowHud = 1; D_ctx_80177A98 = D_ctx_80177AB0 = 1; D_ctx_80177AC8 = D_800D2F54 = 0; D_display_800CA230 = D_800D2F58 = 0.0f; @@ -2622,7 +2622,7 @@ void Play_Init(void) { if (gCurrentLevel == LEVEL_AQUAS) { D_ctx_80177CC0 = 1000.0f; } - D_ctx_80178488 = false; + gLoadLevelObjects = false; gCamCount = 1; if (gCurrentLevel == LEVEL_VERSUS) { gCamCount = 4; @@ -2633,7 +2633,7 @@ void Play_Init(void) { MEM_ARRAY_ALLOCATE(gPlayer, gCamCount); func_play_800AB2AC(); for (i = 0; i < gCamCount; i++) { - gPlayer[i].state_1C8 = PLAYERSTATE_1C8_1; + gPlayer[i].state_1C8 = PLAYERSTATE_1C8_INIT; gPlayerFillScreenAlphas[i] = D_ctx_801783C0[i] = 0; gControllerRumbleTimers[i] = 0; D_ctx_80177C30[i] = 0; @@ -2696,10 +2696,10 @@ void func_play_800AC290(Player* player, PlayerShot* shot, f32 arg2, f32 arg3, Pl Vec3f sp2C; PlayerShot_Initialize(shot); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); if (gVersusMode && (shotId <= PLAYERSHOT_1)) { arg5 *= 0.5f; } @@ -2762,28 +2762,28 @@ void func_play_800AC650(Player* player, PlayerShot* shot, PlayerShotId shotId, f Vec3f sp3C; PlayerShot_Initialize(shot); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -player->unk_180 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -player->unk_180 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); sp54.x = 0; sp54.y = 0; sp54.z = arg3; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); - Matrix_Translate(gCalcMatrix, 0.0f, player->unk_18C + 30.0f, 0, 0); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, 1); - Matrix_Translate(gCalcMatrix, 0.0f, -30.0f, 0, 1); - Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, 1); - Matrix_Translate(gCalcMatrix, 0.0f, 51.0f, -4.0f, 1); - Matrix_RotateY(gCalcMatrix, -player->unk_180 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, 0.0f, player->unk_18C + 30.0f, 0, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (-player->unk_12C - player->unk_130) * M_DTOR, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, -30.0f, 0, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, player->unk_084, player->unk_080, 0.0f, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, 51.0f, -4.0f, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -player->unk_180 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); sp54.x = 0; sp54.y = 7; sp54.z = 0; @@ -2892,10 +2892,10 @@ void func_play_800ACDC0(Player* player, PlayerShot* shot, PlayerShotId shotId) { Vec3f sp44; PlayerShot_Initialize(shot); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_134) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); - Matrix_RotateX(gCalcMatrix, player->unk_154 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_154 * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; if (shotId == PLAYERSHOT_3) { @@ -2904,12 +2904,12 @@ void func_play_800ACDC0(Player* player, PlayerShot* shot, PlayerShotId shotId) { sp5C.z = 150.0f; } Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp5C, &sp50); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_134) * M_DTOR), 1); - Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), 1); - Matrix_Translate(gCalcMatrix, 0.0f, player->unk_080, 0, 1); - Matrix_Translate(gCalcMatrix, -10.0f, 25.0f, 0.0f, 1); - Matrix_RotateX(gCalcMatrix, player->unk_154 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + player->unk_134 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -((player->unk_0F8 + player->unk_0F0 + player->unk_134) * M_DTOR), MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, player->unk_080, 0, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, -10.0f, 25.0f, 0.0f, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_154 * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; sp5C.z = 0; @@ -2956,8 +2956,8 @@ bool func_play_800AD118(s32 playerNum) { } if (gVersusMode) { for (i = 0; i < gCamCount; i++) { - if (((gPlayer[playerNum].state_1C8 == PLAYERSTATE_1C8_3) || - (gPlayer[playerNum].state_1C8 == PLAYERSTATE_1C8_5)) && + if (((gPlayer[playerNum].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[playerNum].state_1C8 == PLAYERSTATE_1C8_U_TURN)) && (D_ctx_80177B00[i][playerNum] != 0)) { return false; } @@ -2979,7 +2979,7 @@ bool func_play_800AD1F4(Player* player) { func_enmy_80060F30(player->sfxSource, 0x0900302D, player->num); } if ((!(gInputHold->button & R_TRIG) || !(gInputHold->button & Z_TRIG) || (player->form != FORM_ARWING) || - (player->state_1C8 != PLAYERSTATE_1C8_3)) && + (player->state_1C8 != PLAYERSTATE_1C8_ACTIVE)) && ((gGameFrameCount % 4) == 0) && func_play_800AD118(player->num)) { if (gChargeTimers[player->num] > 20) { for (i = 0; i < 13; i++) { @@ -3273,27 +3273,27 @@ void func_play_800AE278(Player* player) { if (player->pos.x > 12000.0f) { var_v0 = true; player->pos.x -= 24000.0f; - player->camEye.x -= 24000.0f; - player->camAt.x -= 24000.0f; + player->cam.eye.x -= 24000.0f; + player->cam.at.x -= 24000.0f; } if (player->pos.x < -12000.0f) { var_v0 = true; player->pos.x += 24000.0f; - player->camEye.x += 24000.0f; - player->camAt.x += 24000.0f; + player->cam.eye.x += 24000.0f; + player->cam.at.x += 24000.0f; } if (player->pos.z > 12000.0f) { var_v0 = true; player->pos.z -= 24000.0f; - player->camEye.z -= 24000.0f; - player->camAt.z -= 24000.0f; + player->cam.eye.z -= 24000.0f; + player->cam.at.z -= 24000.0f; } if (player->pos.z < -12000.0f) { var_v0 = true; player->pos.z += 24000.0f; - player->camEye.z += 24000.0f; - player->camAt.z += 24000.0f; + player->cam.eye.z += 24000.0f; + player->cam.at.z += 24000.0f; } if (var_v0) { D_ctx_80177B00[player->num][0] = D_ctx_80177B00[player->num][1] = D_ctx_80177B00[player->num][2] = @@ -3311,7 +3311,7 @@ void func_play_800AE278(Player* player) { var_fv1 = 100000.0f; } if ((var_fv1 < fabsf(player->pos.x)) || (var_fv1 < fabsf(player->pos.z))) { - player->state_1C8 = PLAYERSTATE_1C8_5; + player->state_1C8 = PLAYERSTATE_1C8_U_TURN; player->unk_19C = 0; player->unk_1D0 = 0; player->unk_000 = 0.0f; @@ -3339,7 +3339,7 @@ void func_play_800AE4A4(Player* player) { sp7C = -gInputPress->stick_x; sp78 = gInputPress->stick_y; Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 5.0f, 0.01f); - Matrix_RotateZ(gCalcMatrix, -player->unk_12C * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, -player->unk_12C * M_DTOR, MTXF_NEW); sp4C.x = sp7C * 0.75f; sp4C.y = sp78 * 0.75f; sp4C.z = 0.0f; @@ -3406,8 +3406,8 @@ void func_play_800AE4A4(Player* player) { } Math_SmoothStepToF(&player->unk_0EC, sp7C * 0.6f * var_fv1, 0.1f, var_fv0, 0.03f); player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp4C.x = 0.0f; sp4C.y = 0.0f; if (player->wings.rightState <= WINGSTATE_BROKEN) { @@ -3497,8 +3497,8 @@ void func_play_800AECAC(Player* player) { temp = -gInputPress->stick_x * 0.68f; Math_SmoothStepToF(&player->unk_0E8, temp, 0.1f, 2.0f, 0.0f); player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp4C.x = 0.0f; sp4C.y = 0.0f; sp4C.z = player->unk_0D0; @@ -3547,7 +3547,7 @@ void func_play_800AF07C(Player* player) { Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 5.0f, 0.01f); if (player->cockpitView != 0) { - Matrix_RotateZ(gCalcMatrix, player->unk_12C * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, player->unk_12C * M_DTOR, MTXF_NEW); sp68.z = 0.0f; sp68.x = stickX; @@ -3558,7 +3558,7 @@ void func_play_800AF07C(Player* player) { stickX = sp5C.x; stickY = sp5C.y; } else { - Matrix_RotateZ(gCalcMatrix, (-player->unk_12C) * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, (-player->unk_12C) * M_DTOR, MTXF_NEW); sp68.z = 0.0f; sp68.x = stickX * 0.75f; @@ -3627,8 +3627,8 @@ void func_play_800AF07C(Player* player) { } Math_SmoothStepToF(&player->unk_0EC, (stickX * 0.6f) * var_fv1, 0.1f, var_fv0, 0.03f); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp68.x = 0.0f; sp68.y = 0.0f; @@ -3639,8 +3639,8 @@ void func_play_800AF07C(Player* player) { sp44.x *= 1.4f; sp44.y *= 1.4f; - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp5C); sp68.x = 0.0f; @@ -3774,9 +3774,9 @@ void func_play_800AF928(Player* player) { Math_SmoothStepToF(&player->unk_11C, player->unk_0E8 * var_fa0, 0.1f, var_fa1, 0.05f); player->unk_114 += player->unk_11C; player->unk_114 = Math_ModF(player->unk_114, 360.0f); - Matrix_RotateX(gCalcMatrix, player->unk_104 * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, player->unk_10C * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, player->unk_104 * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->unk_10C * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); sp44.x = 0.0f; sp44.y = 0.0f; sp44.z = player->unk_0D0; @@ -3872,7 +3872,7 @@ void func_play_800B0194(Player* player) { s32 sp44; s32 pad; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; var_fa0 = 0.0f; if (player->pos.y > 10.0f) { var_fa0 = 20.0f; @@ -3926,9 +3926,9 @@ void func_play_800B0194(Player* player) { Math_SmoothStepToF(&player->unk_11C, -sp74 * D_ctx_80177970 * var_fv0, 0.2f, var_fa0, 0.0f); player->unk_114 += player->unk_11C; player->unk_114 = Math_ModF(player->unk_114, 360.0f); - Matrix_RotateX(gCalcMatrix, player->unk_104 * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, player->unk_10C * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, player->unk_104 * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->unk_10C * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); sp58.x = 0.0f; sp58.y = 0.0f; sp58.z = player->unk_0D0; @@ -4099,12 +4099,12 @@ void func_play_800B0F50(Player* playerx) { player->unk_194 = 1.0f; gRadioState = D_ctx_80177D68 = D_ctx_801782A4 = 0; D_ctx_8017853C = D_ctx_80177D50 = 0.0f; - player->camEye.z = 400.0f; + player->cam.eye.z = 400.0f; player->unk_148 = 0.77699995f; player->unk_14C = 0.77699995f; player->unk_01C = 1.0f; player->unk_068 = -1000.0f; - player->camAt.z = player->camEye.z - 1000.0f; + player->cam.at.z = player->cam.eye.z - 1000.0f; D_ctx_80177950 = 1.0f; if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { player->unk_240 = 1; @@ -4205,8 +4205,8 @@ void func_play_800B0F50(Player* playerx) { player->pos.z -= 200.0f; player->unk_138 -= 200.0f; } - player->camEye.y = (player->pos.y * player->unk_148) + 10.0f; - player->camEye.x = player->pos.x * player->unk_148; + player->cam.eye.y = (player->pos.y * player->unk_148) + 10.0f; + player->cam.eye.x = player->pos.x * player->unk_148; gPlayerCamAt.x = gPlayerCamAt.y = gPlayerCamAt.z = gPlayerCamEye.x = gPlayerCamEye.y = gPlayerCamEye.z = 0.0f; @@ -4250,7 +4250,7 @@ void func_play_800B0F50(Player* playerx) { } func_play_800B7184(player, 1); } - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_204 = gLevelType; if ((gLevelMode == LEVELMODE_ALL_RANGE) && !gVersusMode) { player->pos.z = 8000.0f; @@ -4280,7 +4280,7 @@ void func_play_800B0F50(Player* playerx) { gAllRangeCheckpoint = 0; switch (gCurrentLevel) { case LEVEL_CORNERIA: - player->state_1C8 = PLAYERSTATE_1C8_2; + player->state_1C8 = PLAYERSTATE_1C8_LEVEL_INTRO; player->unk_204 = 1; gGroundType = gSavedGroundType = GROUNDTYPE_WATER; func_play_800A3FB0(); @@ -4302,10 +4302,10 @@ void func_play_800B0F50(Player* playerx) { case LEVEL_KATINA: case LEVEL_SECTOR_Z: case LEVEL_VENOM_2: - player->state_1C8 = PLAYERSTATE_1C8_2; + player->state_1C8 = PLAYERSTATE_1C8_LEVEL_INTRO; break; case LEVEL_METEO: - player->state_1C8 = PLAYERSTATE_1C8_2; + player->state_1C8 = PLAYERSTATE_1C8_LEVEL_INTRO; break; } } else { @@ -4329,7 +4329,7 @@ void func_play_800B0F50(Player* playerx) { Macbeth_801ACFBC(); } } - if (player->state_1C8 == PLAYERSTATE_1C8_2) { + if (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) { player->unk_234 = 1; switch (gCurrentLevel) { case LEVEL_CORNERIA: @@ -4404,7 +4404,7 @@ void func_play_800B0F50(Player* playerx) { player->sfx.form = player->form; func_display_80057814(player); if (!gVersusMode && (((gCurrentLevel != LEVEL_TITANIA) && (gCurrentLevel != LEVEL_SOLAR)) || gVersusMode || - (player->state_1C8 != PLAYERSTATE_1C8_2))) { + (player->state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO))) { func_8001C8B8(gPlayerNum); } if ((player->form == FORM_ARWING) && !gVersusMode) { @@ -4650,7 +4650,7 @@ void func_play_800B2574(Player* player) { } } if ((gInputHold->button & gBoostButton[player->num]) && !(gInputHold->button & gBrakeButton[player->num]) && - (player->state_1C8 != PLAYERSTATE_1C8_5) && !player->unk_2B4) { + (player->state_1C8 != PLAYERSTATE_1C8_U_TURN) && !player->unk_2B4) { if (player->unk_2BC == 0.0f) { func_play_800A5FA0(player->sfxSource, 0x09000002, player->num); player->unk_194 = 5.0f; @@ -4732,7 +4732,7 @@ void func_play_800B2C00(Player* player) { (D_Timer_80177A38[gPlayerNum] != 0)) { D_Timer_80177A00[gPlayerNum] = 0; D_Timer_80177A38[gPlayerNum] = 0; - player->state_1C8 = PLAYERSTATE_1C8_5; + player->state_1C8 = PLAYERSTATE_1C8_U_TURN; player->unk_1D0 = 0; player->unk_19C = 1; player->unk_000 = 0.0f; @@ -4744,7 +4744,7 @@ void func_play_800B2C00(Player* player) { } } if ((gInputHold->button & gBrakeButton[player->num]) && !(gInputHold->button & gBoostButton[player->num]) && - (player->state_1C8 != PLAYERSTATE_1C8_5) && !player->unk_2B4) { + (player->state_1C8 != PLAYERSTATE_1C8_U_TURN) && !player->unk_2B4) { if (player->unk_2BC == 0.0f) { func_play_800A5FA0(player->sfxSource, 0x09000003, player->num); if ((gLevelMode == LEVELMODE_ALL_RANGE) && (gInputPress->button & gBrakeButton[player->num])) { @@ -5001,7 +5001,7 @@ void func_play_800B39E0(Player* player) { player->unk_1F4--; if (player->form == FORM_ARWING) { player->unk_134 = (SIN_DEG(player->unk_1F4 * 400.0f) * player->unk_1F4) * D_800D3164[player->unk_21C]; - if (player->state_1C8 == PLAYERSTATE_1C8_3) { + if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { player->unk_084 = (SIN_DEG(player->unk_1F4 * 400.0f) * player->unk_1F4) * D_800D3164[player->unk_21C] * 0.8f; } @@ -5086,7 +5086,7 @@ void func_play_800B41E0(Player* player) { } void func_play_800B41EC(Player* player) { - player->state_1C8 = PLAYERSTATE_1C8_4; + player->state_1C8 = PLAYERSTATE_1C8_DOWN; if (!gVersusMode) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); @@ -5102,7 +5102,7 @@ void func_play_800B41EC(Player* player) { player->unk_1F4 = 0; player->timer_220 = 0; player->unk_134 = 0.0f; - D_game_80161A2C = 0; + gShowHud = 0; } void func_play_800B42B0(Player* player) { @@ -5235,7 +5235,7 @@ void func_play_800B44C4(Player* player) { void func_play_800B46F8(Player* player) { s32 teamId; - if ((player->state_1C8 == PLAYERSTATE_1C8_3) && (D_ctx_8017796C >= 0)) { + if ((player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (D_ctx_8017796C >= 0)) { D_ctx_8017796C++; if (D_ctx_8017796C > 960) { D_ctx_8017796C = 0; @@ -5276,7 +5276,7 @@ void func_play_800B46F8(Player* player) { } // lots of fakery -void Player_Update1(Player* player) { +void Player_Update(Player* player) { f32 sp1CC; f32 sp1C8; s32 sp1C4; @@ -5306,11 +5306,11 @@ void Player_Update1(Player* player) { *gControllerRumble = 1; } } - if (player->state_1C8 >= PLAYERSTATE_1C8_2) { + if (player->state_1C8 >= PLAYERSTATE_1C8_LEVEL_INTRO) { func_play_800B39E0(player); } player->flags_228 = 0; - if ((player->state_1C8 >= PLAYERSTATE_1C8_2) && (player->form == FORM_ARWING) && !gVersusMode) { + if ((player->state_1C8 >= PLAYERSTATE_1C8_LEVEL_INTRO) && (player->form == FORM_ARWING) && !gVersusMode) { switch (player->unk_204) { case 0: sp1C4 = Animation_GetFrameData(&D_arwing_3015AF4, 0, sp58); @@ -5330,26 +5330,26 @@ void Player_Update1(Player* player) { player->whooshTimer--; } switch (player->state_1C8) { - case PLAYERSTATE_1C8_0: + case PLAYERSTATE_1C8_STANDBY: player->unk_234 = 0; - D_game_80161A2C = 0; + gShowHud = 0; gPauseEnabled = 0; break; - case PLAYERSTATE_1C8_1: + case PLAYERSTATE_1C8_INIT: func_play_800B0F50(player); gFillScreenAlphaTarget = 0; gPauseEnabled = 0; break; - case PLAYERSTATE_1C8_2: - D_game_80161A2C = 0; + case PLAYERSTATE_1C8_LEVEL_INTRO: + gShowHud = 0; gPauseEnabled = 0; - player->wings.unk_2C = 1; - func_demo_8004A52C(player); + player->wings.modelId = 1; + Cutscene_LevelStart(player); break; - case PLAYERSTATE_1C8_3: - D_game_80161A2C = 1; + case PLAYERSTATE_1C8_ACTIVE: + gShowHud = 1; func_play_800B46F8(player); - player->wings.unk_2C = 0; + player->wings.modelId = 0; D_hud_80161704 = 255; if ((!gVersusMode || (D_ctx_80177E7C != 0)) && (player->unk_4DC == 0) && (gInputPress->button & U_CBUTTONS) && @@ -5359,14 +5359,14 @@ void Player_Update1(Player* player) { } else { AUDIO_PLAY_SFX(0x4900002D, gDefaultSfxSource, 4); if (gLevelMode == LEVELMODE_ON_RAILS) { - player->unk_034 = 0.0f; + player->camRoll = 0.0f; } } player->unk_014 = 0.1f; } switch (gLevelMode) { case LEVELMODE_ON_RAILS: - D_ctx_80178488 = true; + gLoadLevelObjects = true; func_play_800B42B0(player); player->unk_234 = 1; break; @@ -5380,7 +5380,7 @@ void Player_Update1(Player* player) { sp1C4 = RAND_INT(3.9f); } while (gPlayerInactive[sp1C4]); player->unk_288 = sp1C4 + 1; - player->state_1C8 = PLAYERSTATE_1C8_13; + player->state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; player->unk_1D0 = 0; func_play_800B5FBC(player, player->unk_288 - 1, 1); } else { @@ -5401,27 +5401,27 @@ void Player_Update1(Player* player) { } break; case LEVELMODE_UNK_2: - D_ctx_80178488 = true; + gLoadLevelObjects = true; Turret_801A5AD4(player); func_play_800A8BA4(player); break; } break; - case PLAYERSTATE_1C8_4: - func_demo_8004E3D8(player); + case PLAYERSTATE_1C8_DOWN: + Cutscene_PlayerDown(player); break; - case PLAYERSTATE_1C8_5: + case PLAYERSTATE_1C8_U_TURN: if (gVersusMode) { D_ctx_80177B00[player->num][0] = D_ctx_80177B00[player->num][1] = D_ctx_80177B00[player->num][2] = D_ctx_80177B00[player->num][3] = 0; } - player->wings.unk_2C = 1; + player->wings.modelId = 1; Math_SmoothStepToF(&player->wings.unk_04, 0.0f, 0.1f, 5.0f, 0); Math_SmoothStepToF(&player->wings.unk_08, 0.0f, 0.1f, 5.0f, 0); Math_SmoothStepToF(&player->wings.unk_0C, 0.0f, 0.1f, 5.0f, 0); Math_SmoothStepToF(&player->wings.unk_10, 0.0f, 0.1f, 5.0f, 0); func_play_800B40AC(player); - func_demo_8004CCC0(player); + Cutscene_UTurn(player); if (gCurrentLevel == LEVEL_KATINA) { func_play_800A8BA4(player); } else { @@ -5429,39 +5429,39 @@ void Player_Update1(Player* player) { func_play_800A86E4(player); } break; - case PLAYERSTATE_1C8_7: + case PLAYERSTATE_1C8_LEVEL_COMPLETE: player->cockpitView = 0; gPauseEnabled = 0; func_play_800B40AC(player); - func_demo_8004C930(player); + Cutscene_LevelComplete(player); func_play_800A4C40(player); - D_game_80161A2C = gChargeTimers[player->num] = 0; + gShowHud = gChargeTimers[player->num] = 0; break; - case PLAYERSTATE_1C8_8: + case PLAYERSTATE_1C8_ENTER_WARP_ZONE: gPauseEnabled = 0; func_play_800B40AC(player); - func_demo_80049C0C(player); - D_game_80161A2C = 0; + Cutscene_EnterWarpZone(player); + gShowHud = 0; break; - case PLAYERSTATE_1C8_9: + case PLAYERSTATE_1C8_START_360: gPauseEnabled = 0; func_play_800B40AC(player); - func_demo_8004AAF4(player); + Cutscene_AllRangeMode(player); func_play_800B2130(player); - gChargeTimers[player->num] = player->cockpitView = D_game_80161A2C = 0; + gChargeTimers[player->num] = player->cockpitView = gShowHud = 0; break; - case PLAYERSTATE_1C8_10: + case PLAYERSTATE_1C8_GFOX_REPAIR: gPauseEnabled = 0; - func_360_8002E700(player); - D_game_80161A2C = 0; + AllRange_GreatFoxRepair(player); + gShowHud = 0; break; - case PLAYERSTATE_1C8_11: + case PLAYERSTATE_1C8_ANDROSS_MOUTH: Andross_8018C390(player); func_play_800B40AC(player); break; case PLAYERSTATE_1C8_12: break; - case PLAYERSTATE_1C8_13: + case PLAYERSTATE_1C8_VS_STANDBY: player->unk_234 = 0; if (gPlayerInactive[player->num] == true) { func_play_800B5FBC(player, player->unk_288 - 1, 0); @@ -5480,8 +5480,8 @@ void Player_Update1(Player* player) { func_play_800B5FBC(player, player->unk_288 - 1, 0); } break; - case PLAYERSTATE_1C8_6: - D_game_80161A2C = 0; + case PLAYERSTATE_1C8_NEXT: + gShowHud = 0; if (!gVersusMode) { gPauseEnabled = 0; } @@ -5489,16 +5489,16 @@ void Player_Update1(Player* player) { player->vel.z = player->vel.x = player->vel.y = player->unk_0D8.x = player->unk_0D8.y = 0.0f; if ((gLevelMode == LEVELMODE_ALL_RANGE) && (D_ctx_8017837C == 7)) { - player->camEye.x += 1.0f; - player->camEye.z += 1.5f; + player->cam.eye.x += 1.0f; + player->cam.eye.z += 1.5f; } if ((gCurrentLevel == LEVEL_ZONESS) || (gCurrentLevel == LEVEL_SOLAR)) { - Math_SmoothStepToF(&player->camEye.y, 500.0f, 0.05f, 10.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, player->unk_138 + D_ctx_80177D20 + 500.0f, 0.05f, 20.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, 500.0f, 0.05f, 10.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, player->unk_138 + D_ctx_80177D20 + 500.0f, 0.05f, 20.0f, 0.0f); } if (player->timer_1F8 == 0) { if (gCamCount == 4) { - player->state_1C8 = PLAYERSTATE_1C8_13; + player->state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; player->timer_1F8 = 200; } else { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; @@ -5513,42 +5513,41 @@ void Player_Update1(Player* player) { Audio_SetBaseSfxReverb(0); D_ctx_80161A94[0] = gGoldRingCount[0]; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { - if (1) {} - if (1) {} - if (1) {} - if (1) {} - if (1) {} D_ctx_80177C94 = gGoldRingCount[0]; } - if (D_ctx_8017837C != 4) { - if (D_ctx_8017837C != 7) { - gDrawMode = DRAW_NONE; - } else if (gCurrentLevel == LEVEL_TRAINING) { - gGameState = GSTATE_MENU; - gNextGameStateTimer = 2; - gOptionMenuStatus = OPTION_WAIT; - gDrawMode = DRAW_NONE; - D_game_80161A34 = 7; - D_ctx_80178410 = 0; - } else { - if ((gCurrentLevel == LEVEL_SECTOR_X) || (gCurrentLevel == LEVEL_METEO)) { - gLevelStage = 0; - } - if (gLifeCount[gPlayerNum] < 0) { - gNextGameState = GSTATE_GAME_OVER; - D_ctx_80161A94[0] = 0; + switch (D_ctx_8017837C) { + case 7: + if (gCurrentLevel == LEVEL_TRAINING) { + gGameState = GSTATE_MENU; + gNextGameStateTimer = 2; + gOptionMenuStatus = OPTION_WAIT; + gDrawMode = DRAW_NONE; + D_game_80161A34 = 7; + D_ctx_80178410 = 0; } else { - gPlayState = PLAY_INIT; + if ((gCurrentLevel == LEVEL_SECTOR_X) || (gCurrentLevel == LEVEL_METEO)) { + gLevelStage = 0; + } + if (gLifeCount[gPlayerNum] < 0) { + gNextGameState = GSTATE_GAME_OVER; + D_ctx_80161A94[0] = 0; + } else { + gPlayState = PLAY_INIT; + } + gBombCount[gPlayerNum] = 3; + gLaserStrength[gPlayerNum] = LASERS_SINGLE; + gLoadLevelObjects = true; + gDrawMode = DRAW_NONE; } - gBombCount[gPlayerNum] = 3; - gLaserStrength[gPlayerNum] = LASERS_SINGLE; - D_ctx_80178488 = true; + break; + case 4: + gNextGameState = GSTATE_MAP; + D_game_80161A34 = 7; gDrawMode = DRAW_NONE; - } - } else { - gNextGameState = GSTATE_MAP; - D_game_80161A34 = 7; - gDrawMode = DRAW_NONE; + break; + default: + gDrawMode = DRAW_NONE; + break; } if (1) {} } @@ -5572,7 +5571,7 @@ void Player_Update1(Player* player) { Math_SmoothStepToF(&player->unk_09C, sp1C8, 1.0f, 10.0f, 0.0f); if (player->form == FORM_ARWING) { Math_SmoothStepToF(&player->unk_194, player->unk_190, 0.5f, 5.0f, 0.0f); - if (player->unk_2B4 && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if (player->unk_2B4 && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { player->unk_190 = 0.5f; } else { player->unk_190 = 1.0f; @@ -5590,14 +5589,14 @@ void func_play_800B56BC(Player* player) { f32 temp; gCsCamEyeX = (player->pos.x - player->unk_0AC) * player->unk_148; - if (((player->form == FORM_ARWING) && (player->state_1C8 == PLAYERSTATE_1C8_3)) || - (player->state_1C8 == PLAYERSTATE_1C8_5)) { + if (((player->form == FORM_ARWING) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) || + (player->state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gCsCamEyeY = (player->pos.y - player->unk_0B0) * player->unk_148; } var_fv1 = gInputPress->stick_x; var_fv0 = -gInputPress->stick_y; - if ((player->state_1C8 != PLAYERSTATE_1C8_3) || (player->unk_4DC != 0)) { + if ((player->state_1C8 != PLAYERSTATE_1C8_ACTIVE) || (player->unk_4DC != 0)) { var_fv0 = 0.0f; var_fv1 = 0; } @@ -5636,24 +5635,24 @@ void func_play_800B56BC(Player* player) { if (player->unk_4DC != 0) { gCsCamEyeZ += 200.0f; gCsCamAtY = (player->pos.y - player->unk_0B0) * 0.9f; - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, 0.1f, 8.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, 0.1f, 8.0f, 0.0f); Math_SmoothStepToF(&player->unk_018, 0.2f, 1.0f, 0.05f, 0.0f); } else { - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, 0.2f, 20.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, 0.2f, 20.0f, 0.0f); Math_SmoothStepToF(&player->unk_018, 1.0f, 1.0f, 0.05f, 0.0f); } gCsCamAtY += player->unk_0B0 + (D_800D2F58 * 0.5f); - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, player->unk_014, 1000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, player->unk_018, 1000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, player->unk_014, 1000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, player->unk_018, 1000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, player->unk_014, 1000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, player->unk_014, 1000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, player->unk_018, 1000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, player->unk_014, 1000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, player->unk_018, 1000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, player->unk_014, 1000.0f, 0.0f); Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.05f, 0.0f); temp = -player->unk_0EC; if (gLevelType == LEVELTYPE_PLANET) { - Math_SmoothStepToF(&player->unk_034, temp * 0.3f, 0.1f, 1.5f, 0.0f); + Math_SmoothStepToF(&player->camRoll, temp * 0.3f, 0.1f, 1.5f, 0.0f); } else if (gLevelType == LEVELTYPE_SPACE) { - Math_SmoothStepToF(&player->unk_034, temp * 0.2f, 0.1f, 1.5f, 0.0f); + Math_SmoothStepToF(&player->camRoll, temp * 0.2f, 0.1f, 1.5f, 0.0f); } } @@ -5664,8 +5663,8 @@ void func_play_800B5D30(Player* player, s32 arg1) { s32 pad2; s32 pad3; - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_134) * M_DTOR * 0.75f, 0); - Matrix_RotateX(gCalcMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR * 0.75f, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_134) * M_DTOR * 0.75f, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, (player->unk_0E4 + player->unk_134) * M_DTOR * 0.75f, MTXF_APPLY); sp4C.x = 0; sp4C.y = 0; sp4C.z = -1000.0f; @@ -5676,21 +5675,21 @@ void func_play_800B5D30(Player* player, s32 arg1) { gCsCamAtX = player->pos.x + sp40.x; gCsCamAtY = player->pos.y + player->unk_080 + sp40.y; gCsCamAtZ = player->unk_138 + D_ctx_80177D20 + sp40.z; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, player->unk_014, 100.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, player->unk_014, 100.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, player->unk_014, 50.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, player->unk_014, 100.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, player->unk_014, 100.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, player->unk_014, 100.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, player->unk_014, 100.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, player->unk_014, 100.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, player->unk_014, 50.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, player->unk_014, 100.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, player->unk_014, 100.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, player->unk_014, 100.0f, 0.0f); Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.05f, 0); - player->unk_034 = -(player->unk_0F8 + player->unk_0F0); + player->camRoll = -(player->unk_0F8 + player->unk_0F0); if (arg1 != 0) { - player->camEye.x = gCsCamEyeX; - player->camEye.y = gCsCamEyeY; - player->camEye.z = gCsCamEyeZ; - player->camAt.x = gCsCamAtX; - player->camAt.y = gCsCamAtY; - player->camAt.z = gCsCamAtZ; + player->cam.eye.x = gCsCamEyeX; + player->cam.eye.y = gCsCamEyeY; + player->cam.eye.z = gCsCamEyeZ; + player->cam.at.x = gCsCamAtX; + player->cam.at.y = gCsCamAtY; + player->cam.at.z = gCsCamAtZ; } } @@ -5707,7 +5706,7 @@ void func_play_800B5FBC(Player* player, s32 playerNum, bool arg2) { if (((var_v0 & gGameFrameCount) == (gPlayerNum * 32)) || arg2) { for (i = 0; i < 100; i++) { playerNum = RAND_INT(3.9f); - if ((gPlayer[playerNum].state_1C8 != PLAYERSTATE_1C8_13) && !gPlayerInactive[playerNum]) { + if ((gPlayer[playerNum].state_1C8 != PLAYERSTATE_1C8_VS_STANDBY) && !gPlayerInactive[playerNum]) { break; } } @@ -5715,7 +5714,7 @@ void func_play_800B5FBC(Player* player, s32 playerNum, bool arg2) { playerNum = 0; } player->unk_288 = playerNum + 1; - Matrix_RotateY(gCalcMatrix, gPlayer[playerNum].unk_114 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, gPlayer[playerNum].unk_114 * M_DTOR, MTXF_NEW); switch (gPlayer[playerNum].form) { case FORM_ARWING: sp58.x = 300.0f; @@ -5735,30 +5734,30 @@ void func_play_800B5FBC(Player* player, s32 playerNum, bool arg2) { } sp58.y = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); - player->camEye.x = gPlayer[playerNum].pos.x + sp4C.x; - player->camEye.y = gPlayer[playerNum].pos.y + 50.0f; - player->camEye.z = gPlayer[playerNum].unk_138 + sp4C.z; + player->cam.eye.x = gPlayer[playerNum].pos.x + sp4C.x; + player->cam.eye.y = gPlayer[playerNum].pos.y + 50.0f; + player->cam.eye.z = gPlayer[playerNum].unk_138 + sp4C.z; } - player->camAt.x = gPlayer[playerNum].pos.x; - player->camAt.y = gPlayer[playerNum].pos.y; - player->camAt.z = gPlayer[playerNum].unk_138; + player->cam.at.x = gPlayer[playerNum].pos.x; + player->cam.at.y = gPlayer[playerNum].pos.y; + player->cam.at.z = gPlayer[playerNum].unk_138; switch (gPlayer[playerNum].form) { case FORM_ARWING: - player->camEye.x += gPlayer[playerNum].vel.x * 0.5f; - player->camEye.z += gPlayer[playerNum].vel.z * 0.5f; + player->cam.eye.x += gPlayer[playerNum].vel.x * 0.5f; + player->cam.eye.z += gPlayer[playerNum].vel.z * 0.5f; break; case FORM_LANDMASTER: - player->camEye.x += gPlayer[playerNum].vel.x * 0.7f; - player->camEye.z += gPlayer[playerNum].vel.z * 0.7f; + player->cam.eye.x += gPlayer[playerNum].vel.x * 0.7f; + player->cam.eye.z += gPlayer[playerNum].vel.z * 0.7f; break; case FORM_ON_FOOT: - player->camEye.x += gPlayer[playerNum].vel.x * 0.7f; - player->camEye.z += gPlayer[playerNum].vel.z * 0.7f; - player->camEye.y = gPlayer[playerNum].unk_068 + 20.0f; - player->camAt.y = gPlayer[playerNum].unk_068 + 20.0f; + player->cam.eye.x += gPlayer[playerNum].vel.x * 0.7f; + player->cam.eye.z += gPlayer[playerNum].vel.z * 0.7f; + player->cam.eye.y = gPlayer[playerNum].unk_068 + 20.0f; + player->cam.at.y = gPlayer[playerNum].unk_068 + 20.0f; break; } - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.05f, 5.0f, 0.00001f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.05f, 5.0f, 0.00001f); } void func_play_800B63BC(Player* player, s32 arg1) { @@ -5775,8 +5774,8 @@ void func_play_800B63BC(Player* player, s32 arg1) { f32 atY; f32 atZ; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.2f * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.2f * M_DTOR, MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; if (player->cockpitView != 0) { @@ -5804,7 +5803,7 @@ void func_play_800B63BC(Player* player, s32 arg1) { var_fv0 = (player->unk_4DC != 0) ? 1.0f : 0.79f; atY = (player->pos.y * (var_fv0)) + player->unk_134 + (player->unk_060 * 5.0f); atY += (player->unk_02C * 0.5f); - if (player->state_1C8 == PLAYERSTATE_1C8_5) { + if (player->state_1C8 == PLAYERSTATE_1C8_U_TURN) { atY = player->pos.y; } atZ = player->pos.z; @@ -5817,25 +5816,25 @@ void func_play_800B63BC(Player* player, s32 arg1) { eyeZ += sp68.z; atX += sp68.x; atZ += sp68.z; - if (player->state_1C8 == PLAYERSTATE_1C8_3) { - Math_SmoothStepToF(&player->camEye.x, eyeX, player->unk_014, 30000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, eyeY, player->unk_014, 30000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, eyeZ, player->unk_014, 30000.0f, 0); - Math_SmoothStepToF(&player->unk_034, player->unk_0E8 * -0.3f, 0.1f, 1.0f, 0); + if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { + Math_SmoothStepToF(&player->cam.eye.x, eyeX, player->unk_014, 30000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, eyeY, player->unk_014, 30000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, eyeZ, player->unk_014, 30000.0f, 0); + Math_SmoothStepToF(&player->camRoll, player->unk_0E8 * -0.3f, 0.1f, 1.0f, 0); Math_SmoothStepToF(&player->unk_014, 0.2f, 0.1f, 0.005f, 0.0f); } - Math_SmoothStepToF(&player->camAt.x, atX, player->unk_01C, 30000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, atY, player->unk_018, 30000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, atZ, player->unk_01C, 30000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, atX, player->unk_01C, 30000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, atY, player->unk_018, 30000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, atZ, player->unk_01C, 30000.0f, 0); Math_SmoothStepToF(&player->unk_018, 0.2f, 0.1f, 0.005f, 0); Math_SmoothStepToF(&player->unk_01C, 1.0f, 0.1f, 0.005f, 0); if (arg1 != 0) { - player->camEye.x = eyeX; - player->camEye.y = eyeY; - player->camEye.z = eyeZ; - player->camAt.x = atX; - player->camAt.y = atY; - player->camAt.z = atZ; + player->cam.eye.x = eyeX; + player->cam.eye.y = eyeY; + player->cam.eye.z = eyeZ; + player->cam.at.x = atX; + player->cam.at.y = atY; + player->cam.at.z = atZ; } } @@ -5846,10 +5845,10 @@ void func_play_800B6848(Player* player, s32 arg1) { f32 sp40; f32 sp3C; - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.2f * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.2f)) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.2f * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; if (player->cockpitView) { sp54.y = 150.0f; @@ -5868,9 +5867,9 @@ void func_play_800B6848(Player* player, s32 arg1) { sp40 = player->pos.y + sp48.y - (player->unk_02C * 0.6f); sp3C = player->pos.z + sp48.z; - player->camAt.x = player->pos.x + player->unk_134; - player->camAt.y = player->pos.y + 60.0f + player->unk_02C + player->unk_134; - player->camAt.z = player->pos.z; + player->cam.at.x = player->pos.x + player->unk_134; + player->cam.at.y = player->pos.y + 60.0f + player->unk_02C + player->unk_134; + player->cam.at.z = player->pos.z; Math_SmoothStepToF(&player->unk_028, 2.0f * player->unk_0E8, 0.05f, 2.0f, 0.02f); sp54.x = -player->unk_028; sp54.y = 0.0f; @@ -5878,16 +5877,16 @@ void func_play_800B6848(Player* player, s32 arg1) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); sp44 += sp48.x; sp3C += sp48.z; - player->camAt.x += sp48.x; - player->camAt.z += sp48.z; - Math_SmoothStepToF(&player->camEye.x, sp44, 0.1f, 200.0f, 0.001f); - Math_SmoothStepToF(&player->camEye.y, sp40, 0.1f, 200.0f, 0.001f); - Math_SmoothStepToF(&player->camEye.z, sp3C, 0.1f, 200.0f, 0.001f); - Math_SmoothStepToF(&player->unk_034, player->unk_12C * -0.1f, 0.1f, 1.0f, 0.01f); + player->cam.at.x += sp48.x; + player->cam.at.z += sp48.z; + Math_SmoothStepToF(&player->cam.eye.x, sp44, 0.1f, 200.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.y, sp40, 0.1f, 200.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.z, sp3C, 0.1f, 200.0f, 0.001f); + Math_SmoothStepToF(&player->camRoll, player->unk_12C * -0.1f, 0.1f, 1.0f, 0.01f); if (arg1 != 0) { - player->camEye.x = sp44; - player->camEye.y = sp40; - player->camEye.z = sp3C; + player->cam.eye.x = sp44; + player->cam.eye.y = sp40; + player->cam.eye.z = sp3C; } } @@ -5896,10 +5895,10 @@ void func_play_800B6BFC(Player* player, s32 arg1) { Vec3f sp58; Vec3f sp4C; - Matrix_RotateX(gCalcMatrix, player->unk_0FC * M_DTOR, 0); - Matrix_RotateZ(gCalcMatrix, player->unk_100 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.02f)) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.02f * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, player->unk_0FC * M_DTOR, MTXF_NEW); + Matrix_RotateZ(gCalcMatrix, player->unk_100 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + (player->unk_134 * 0.02f)) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_134 * 0.02f * M_DTOR, MTXF_APPLY); sp64.x = 0.0f; sp64.y = 20.0f; sp64.z = 60.0f - player->unk_08C; @@ -5910,10 +5909,10 @@ void func_play_800B6BFC(Player* player, s32 arg1) { sp4C.y = (player->unk_068 + 10.0f + sp58.y) - (player->unk_02C * 0.8f); sp4C.z = player->pos.z + sp58.z; - player->camAt.x = player->pos.x + player->unk_134 * 0.1f; - player->camAt.y = player->unk_068 + (player->pos.y - player->unk_068) * 0.4f + 18.0f + player->unk_02C * 1.5f + - player->unk_134 * 0.1f; - player->camAt.z = player->pos.z; + player->cam.at.x = player->pos.x + player->unk_134 * 0.1f; + player->cam.at.y = player->unk_068 + (player->pos.y - player->unk_068) * 0.4f + 18.0f + player->unk_02C * 1.5f + + player->unk_134 * 0.1f; + player->cam.at.z = player->pos.z; Math_SmoothStepToF(&player->unk_028, player->unk_0E8 * (player->unk_0D0 + 5.0f) * 0.04f, 0.05f, 2.0f, 0.02f); sp64.x = -player->unk_028; @@ -5922,17 +5921,17 @@ void func_play_800B6BFC(Player* player, s32 arg1) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); sp4C.x += sp58.x; sp4C.z += sp58.z; - player->camAt.x += sp58.x; - player->camAt.z += sp58.z; + player->cam.at.x += sp58.x; + player->cam.at.z += sp58.z; - Math_SmoothStepToF(&player->camEye.x, sp4C.x, 0.3f, 65.0f, 0.001f); - Math_SmoothStepToF(&player->camEye.y, sp4C.y, 0.3f, 65.0f, 0.001f); - Math_SmoothStepToF(&player->camEye.z, sp4C.z, 0.3f, 65.0f, 0.001f); - Math_SmoothStepToF(&player->unk_034, player->unk_12C * -0.1f, 0.1f, 1.0f, 0.01f); + Math_SmoothStepToF(&player->cam.eye.x, sp4C.x, 0.3f, 65.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.y, sp4C.y, 0.3f, 65.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.z, sp4C.z, 0.3f, 65.0f, 0.001f); + Math_SmoothStepToF(&player->camRoll, player->unk_12C * -0.1f, 0.1f, 1.0f, 0.01f); if (arg1 != 0) { - player->camEye.x = sp4C.x; - player->camEye.y = sp4C.y; - player->camEye.z = sp4C.z; + player->cam.eye.x = sp4C.x; + player->cam.eye.y = sp4C.y; + player->cam.eye.z = sp4C.z; } } @@ -5955,14 +5954,15 @@ void func_play_800B6F50(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar } var_ft5 = 0.0f; if (gCurrentLevel == LEVEL_UNK_15) { - var_ft5 = gPlayer[0].camEye.y * 0.03f; + var_ft5 = gPlayer[0].cam.eye.y * 0.03f; } sp30 = (2.0f * (-sp2C * (-8.0f / 3.0f * M_RTOD))) + 3000.0f + D_ctx_80178430 + var_ft5; sp34 = (2.0f * (sp28 * (-8.0f / 3.0f * M_RTOD))) + 3000.0f + D_ctx_8017842C; sp20 = D_ctx_80178420; D_ctx_80178420 = Math_ModF(sp34, 480.0f); D_ctx_80178424 = Math_ModF(sp30, 360.0f); - if ((gGameState == GSTATE_PLAY) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) && (gCurrentLevel == LEVEL_METEO)) { + if ((gGameState == GSTATE_PLAY) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && + (gCurrentLevel == LEVEL_METEO)) { if (fabsf(D_ctx_80178420 - sp20) < 50.0f) { D_bg_8015F96C = 0.0f; if (fabsf(D_ctx_80178420 - sp20) > 3.0f) { @@ -5986,9 +5986,9 @@ void func_play_800B7184(Player* player, s32 arg1) { } } -void Player_Update2(Player* player) { +void Player_UpdateCamera(Player* player) { switch (player->state_1C8) { - case PLAYERSTATE_1C8_3: + case PLAYERSTATE_1C8_ACTIVE: switch (gLevelMode) { case LEVELMODE_ON_RAILS: if (player->form == FORM_ARWING) { @@ -6011,25 +6011,25 @@ void Player_Update2(Player* player) { break; } break; - case PLAYERSTATE_1C8_5: - player->unk_034 -= player->unk_034 * 0.1f; + case PLAYERSTATE_1C8_U_TURN: + player->camRoll -= player->camRoll * 0.1f; func_play_800B7184(player, 0); break; - case PLAYERSTATE_1C8_4: + case PLAYERSTATE_1C8_DOWN: if ((gLevelMode == LEVELMODE_ON_RAILS) && (player->form == FORM_ARWING)) { - player->camEye.x += (player->pos.x - player->camEye.x) * 0.1f; - player->camEye.y += (player->pos.y - player->camEye.y) * 0.1f; - player->camEye.z -= player->vel.z * 0.2f; + player->cam.eye.x += (player->pos.x - player->cam.eye.x) * 0.1f; + player->cam.eye.y += (player->pos.y - player->cam.eye.y) * 0.1f; + player->cam.eye.z -= player->vel.z * 0.2f; if (player->unk_1D0 != 0) { - player->camEye.z -= player->vel.z * 0.2f; + player->cam.eye.z -= player->vel.z * 0.2f; } - player->camAt.x += (player->pos.x - player->camAt.x) * 0.1f; - player->camAt.y += (player->pos.y - player->camAt.y) * 0.1f; - player->camAt.z = player->unk_138 + D_ctx_80177D20 - 1.0f; + player->cam.at.x += (player->pos.x - player->cam.at.x) * 0.1f; + player->cam.at.y += (player->pos.y - player->cam.at.y) * 0.1f; + player->cam.at.z = player->unk_138 + D_ctx_80177D20 - 1.0f; } break; - case PLAYERSTATE_1C8_6: - case PLAYERSTATE_1C8_7: + case PLAYERSTATE_1C8_NEXT: + case PLAYERSTATE_1C8_LEVEL_COMPLETE: break; } } @@ -6039,7 +6039,7 @@ void func_play_800B73E0(Player* player) { Vec3f sp38; f32 pad; - if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_2)) { + if ((gCurrentLevel == LEVEL_AQUAS) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_INTRO)) { D_ctx_801784D4 = D_ctx_801784C8 = D_ctx_801784C8 = D_ctx_801784FC = D_ctx_801784C8 = 110.0f; if (gGameFrameCount & 0x20) { D_ctx_801784D4 = D_ctx_801784C8 = D_ctx_801784C8 = D_ctx_801784FC = D_ctx_801784C8 = 90.0f; @@ -6096,14 +6096,14 @@ void func_play_800B73E0(Player* player) { D_ctx_80178570 = gLight1R; D_ctx_80178574 = gLight1G; D_ctx_80178578 = gLight1B; - pad = player->unk_034; - Matrix_RotateZ(gCalcMatrix, M_DTOR * pad, 0); - Matrix_RotateX(gCalcMatrix, -player->unk_05C, 1); - Matrix_RotateY(gCalcMatrix, player->unk_058, 1); + pad = player->camRoll; + Matrix_RotateZ(gCalcMatrix, M_DTOR * pad, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -player->camPitch, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->camYaw, MTXF_APPLY); Matrix_Push(&gCalcMatrix); - Matrix_RotateX(gCalcMatrix, M_DTOR * D_ctx_801784B8, 1); - Matrix_RotateY(gCalcMatrix, M_DTOR * D_ctx_801784BC, 1); - Matrix_RotateZ(gCalcMatrix, M_DTOR * D_ctx_801784C0, 1); + Matrix_RotateX(gCalcMatrix, M_DTOR * D_ctx_801784B8, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, M_DTOR * D_ctx_801784BC, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, M_DTOR * D_ctx_801784C0, MTXF_APPLY); sp44.x = 0.0f; sp44.y = 0.0f; sp44.z = 100.0f; @@ -6112,9 +6112,9 @@ void func_play_800B73E0(Player* player) { gLight1y = sp38.y; gLight1z = sp38.z; Matrix_Pop(&gCalcMatrix); - Matrix_RotateX(gCalcMatrix, M_DTOR * D_ctx_801784EC, 1); - Matrix_RotateY(gCalcMatrix, M_DTOR * D_ctx_801784F0, 1); - Matrix_RotateZ(gCalcMatrix, M_DTOR * D_ctx_801784F4, 1); + Matrix_RotateX(gCalcMatrix, M_DTOR * D_ctx_801784EC, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, M_DTOR * D_ctx_801784F0, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, M_DTOR * D_ctx_801784F4, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); gLight2x = sp38.x; gLight2y = sp38.y; @@ -6151,8 +6151,8 @@ void Play_UpdateLevel(void) { } break; case LEVEL_VENOM_2: - if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) && (gLevelStage == 2)) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gLevelStage == 2)) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; gPlayer[0].unk_234 = 1; gPlayer[0].pos.z = 15000.0f; @@ -6182,7 +6182,7 @@ void Play_UpdateLevel(void) { case LEVEL_SECTOR_X: if (gLevelStage == 1) { gBlurAlpha = 128; - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { Math_SmoothStepToF(&D_bg_8015F960, 0.0f, 1.0f, 1.0f, 0.0f); } else { Math_SmoothStepToF(&D_bg_8015F960, 128.0f, 1.0f, 1.0f, 0.0f); @@ -6190,7 +6190,7 @@ void Play_UpdateLevel(void) { } if ((gCurrentLevel == LEVEL_SECTOR_X) && (gLevelStage == 0) && (gRingPassCount == 4)) { gRingPassCount++; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_8; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE; gPlayer[0].unk_1D0 = 0; gOverlayStage = 1; AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0); @@ -6213,7 +6213,7 @@ void Play_UpdateLevel(void) { for (D_ctx_80177CE8; D_ctx_80177CE8 >= 10.0f; D_ctx_80177CE8 -= 10.0f) { Texture_Scroll(D_SO_6005710, 32, 32, 1); } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_6) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) { Texture_Scroll(D_SO_6005710, 32, 32, 1); } Texture_Mottle(D_SO_601E1E8, D_SO_6020F60, 3); @@ -6243,7 +6243,7 @@ void Play_UpdateLevel(void) { #endif } - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && ((gGameFrameCount & cycleMask) == 0)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && ((gGameFrameCount & cycleMask) == 0)) { gPlayer[0].shields--; if (gPlayer[0].shields <= 0) { gPlayer[0].shields = 0; @@ -6258,7 +6258,7 @@ void Play_UpdateLevel(void) { } shields = MIN(gPlayer[0].shields, 255); func_8001D1C8(shields, heightParam); - if (((gGameFrameCount % 8) == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { + if (((gGameFrameCount % 8) == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -80.0f, gPlayer[0].unk_138 + (RAND_FLOAT(2000.0f) + -6000.0f), RAND_FLOAT(10.0f) + 20.0f); // check @@ -6273,12 +6273,12 @@ void Play_UpdateLevel(void) { for (D_ctx_80177CE8; D_ctx_80177CE8 >= 20.0f; D_ctx_80177CE8 -= 20.0f) { Texture_Scroll(D_ZO_602C2CC, 32, 32, 1); } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_6) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_NEXT) { Texture_Scroll(D_ZO_602C2CC, 32, 32, 1); } func_hud_8008C104(D_ZO_602C2CC, D_ZO_600D990); - if (func_play_800A73E4(&sp3C, &sp40, gPlayer[0].camEye.x, gPlayer[0].camEye.y, - gPlayer[0].camEye.z - D_ctx_80177D20)) { + if (func_play_800A73E4(&sp3C, &sp40, gPlayer[0].cam.eye.x, gPlayer[0].cam.eye.y, + gPlayer[0].cam.eye.z - D_ctx_80177D20)) { gLight1R = 0; gLight1G = 7; gLight1B = 10; @@ -6316,14 +6316,14 @@ void Play_Update(void) { } for (i = 0; i < gCamCount; i++) { gPlayer[i].num = gPlayerNum = i; - Player_Update1(&gPlayer[i]); + Player_Update(&gPlayer[i]); } Object_Update(); PlayerShot_Update(); BonusText_Update(); for (i = 0; i < gCamCount; i++) { gPlayer[i].num = gPlayerNum = i; - Player_Update2(&gPlayer[i]); + Player_UpdateCamera(&gPlayer[i]); } gCameraShakeY = 0.0f; if (gCameraShake != 0) { @@ -6404,8 +6404,8 @@ void Play_Main(void) { } func_play_800B86A4(&gPlayer[0].pos.z); func_play_800B86A4(&gPlayer[0].unk_138); - gPlayer[0].camEye.z += 15000.0f; - gPlayer[0].camAt.z += 15000.0f; + gPlayer[0].cam.eye.z += 15000.0f; + gPlayer[0].cam.at.z += 15000.0f; gPlayer[0].unk_144 = gPlayer[0].unk_140 = D_ctx_80177D08 = D_ctx_80177D20 = 0.0f; } if (gPlayState != PLAY_PAUSE) { @@ -6434,7 +6434,7 @@ void Play_Main(void) { gDrawMode = DRAW_PLAY; Play_Update(); if ((gControllerPress[gMainController].button & START_BUTTON) && - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_2) && + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && gSaveFile.save.data.planet[D_800D2F6C[gCurrentLevel]].normalClear) { Audio_ClearVoice(); Audio_SetBaseSfxReverb(0); @@ -6463,7 +6463,7 @@ void Play_Main(void) { case PLAY_PAUSE: if (!gVersusMode) { if ((gControllerPress[gMainController].button & R_TRIG) && (gPlayer[0].form != FORM_BLUE_MARINE) && - (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_0)) { + (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) { if (gShowCrosshairs[0] = 1 - gShowCrosshairs[0]) { AUDIO_PLAY_SFX(0x49000019, gDefaultSfxSource, 4); } else { diff --git a/src/engine/fox_radio.c b/src/engine/fox_radio.c index bd2d8ee9..0a7938bf 100644 --- a/src/engine/fox_radio.c +++ b/src/engine/fox_radio.c @@ -744,7 +744,7 @@ void func_radio_800BB5D0(void) { } if ((gActors[var_v1].obj.status != OBJ_ACTIVE) && (gGameFrameCount & 4) && - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (D_ctx_801782A4 != 2) && (D_ctx_801782A4 != 3) && + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (D_ctx_801782A4 != 2) && (D_ctx_801782A4 != 3) && (D_ctx_801782A4 != 1000)) { RCP_SetupDL(&gMasterDisp, 0x4C); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); @@ -881,8 +881,8 @@ void func_radio_800BC040(void) { ((s32) D_ctx_80177D68 == RCID_PEPPY)) { Matrix_Push(&gGfxMatrix); RCP_SetupDL_36(); - Matrix_Translate(gGfxMatrix, -150.0f, -115.0f, -443.0f, 1); - Matrix_Scale(gGfxMatrix, 0.068f, 0.068f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, -150.0f, -115.0f, -443.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.068f, 0.068f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gPlayerNum = 0; Matrix_Pop(&gGfxMatrix); diff --git a/src/engine/fox_std_lib.c b/src/engine/fox_std_lib.c index d4a08d11..21654459 100644 --- a/src/engine/fox_std_lib.c +++ b/src/engine/fox_std_lib.c @@ -168,10 +168,10 @@ void Animation_DrawLimb(s32 mode, Limb* limb, Limb** skeleton, Vec3f* jointTable override = overrideLimbDraw(limbIndex - 1, &dList, &trans, &rot, data); } if (!override) { - Matrix_Translate(gCalcMatrix, trans.x, trans.y, trans.z, 1); - Matrix_RotateZ(gCalcMatrix, rot.z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot.x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, trans.x, trans.y, trans.z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot.x * M_DTOR, MTXF_APPLY); if (dList != NULL) { if (mode >= 2) { Matrix_MultVec3f(gCalcMatrix, &origin, &pos); @@ -179,7 +179,7 @@ void Animation_DrawLimb(s32 mode, Limb* limb, Limb** skeleton, Vec3f* jointTable func_edisplay_8005F670(&pos); } } - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, dList); } @@ -231,12 +231,12 @@ void Animation_DrawSkeleton(s32 mode, Limb** skeletonSegment, Vec3f* jointTable, override = overrideLimbDraw(rootIndex - 1, &dList, &baseTrans, &baseRot, data); } if (override == 0) { - Matrix_Translate(gCalcMatrix, baseTrans.x, baseTrans.y, baseTrans.z, 1); - Matrix_RotateZ(gCalcMatrix, baseRot.z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, baseRot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, baseRot.x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, baseTrans.x, baseTrans.y, baseTrans.z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, baseRot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, baseRot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, baseRot.x * M_DTOR, MTXF_APPLY); if (dList != NULL) { - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, dList); } @@ -250,7 +250,7 @@ void Animation_DrawSkeleton(s32 mode, Limb** skeletonSegment, Vec3f* jointTable, } Matrix_Pop(&gCalcMatrix); if (mode >= 2) { - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); } } @@ -366,19 +366,19 @@ void Animation_GetSkeletonBoundingBox(Limb** skeletonSegment, Animation* animati } else { var_t6 = frameData[(s16) key[1].z]; } - Matrix_RotateZ(gGfxMatrix, (((s32) var_t6 * 360.0f) / 65536.0f) * M_DTOR, 0); + Matrix_RotateZ(gGfxMatrix, (((s32) var_t6 * 360.0f) / 65536.0f) * M_DTOR, MTXF_NEW); if (frame < (s16) key[1].yLen) { var_t6 = frameData[(s16) key[1].y + frame]; } else { var_t6 = frameData[(s16) key[1].y]; } - Matrix_RotateY(gGfxMatrix, (((s32) var_t6 * 360.0f) / 65536.0f) * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, (((s32) var_t6 * 360.0f) / 65536.0f) * M_DTOR, MTXF_APPLY); if (frame < (s16) key[1].xLen) { var_t6 = frameData[(s16) key[1].x + frame]; } else { var_t6 = frameData[(s16) key[1].x]; } - Matrix_RotateX(gGfxMatrix, (((s32) var_t6 * 360.0f) / 65536.0f) * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, (((s32) var_t6 * 360.0f) / 65536.0f) * M_DTOR, MTXF_APPLY); vtxFound = false; if (limb->dList != NULL) { Animation_FindBoundingBox(limb->dList, 8192, min, max, &vtxFound, &vtxCount, &vtxList); @@ -522,8 +522,8 @@ s32 Math_PursueVec3f(Vec3f* pos, Vec3f* target, Vec3f* rot, f32 stepSize, f32 sc targetRotX = Math_RadToDeg(-Math_Atan2F(diff.y, sqrtf(SQ(diff.x) + SQ(diff.z)))); Math_SmoothStepToAngle(&rot->y, targetRotY, scaleTurn, maxTurn, 0.0f); Math_SmoothStepToAngle(&rot->x, targetRotX, scaleTurn, maxTurn, 0.0f); - Matrix_RotateY(&worldTransform, rot->y * M_DTOR, 0); - Matrix_RotateX(&worldTransform, rot->x * M_DTOR, 1); + Matrix_RotateY(&worldTransform, rot->y * M_DTOR, MTXF_NEW); + Matrix_RotateX(&worldTransform, rot->x * M_DTOR, MTXF_APPLY); localStep.z = stepSize; Matrix_MultVec3fNoTranslate(&worldTransform, &localStep, &worldStep); @@ -712,8 +712,8 @@ void Graphics_FillRectangle(Gfx** gfxPtr, s32 ulx, s32 uly, s32 lrx, s32 lry, u8 void Math_Vec3fFromAngles(Vec3f* step, f32 xRot, f32 yRot, f32 stepsize) { Vec3f sp1C; - Matrix_RotateY(gCalcMatrix, yRot * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, xRot * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, yRot * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, xRot * M_DTOR, MTXF_APPLY); sp1C.x = sp1C.y = 0.0f; sp1C.z = stepsize; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp1C, step); diff --git a/src/engine/fox_tank.c b/src/engine/fox_tank.c index 73872a9d..b5fb01ad 100644 --- a/src/engine/fox_tank.c +++ b/src/engine/fox_tank.c @@ -37,7 +37,7 @@ void func_tank_80043280(u16* text0, u16* text1, f32 zRot) { Matrix_Push(&gCalcMatrix); text0 = SEGMENTED_TO_VIRTUAL(text0); text1 = SEGMENTED_TO_VIRTUAL(text1); - Matrix_RotateZ(gCalcMatrix, M_DTOR * zRot, 0); + Matrix_RotateZ(gCalcMatrix, M_DTOR * zRot, MTXF_NEW); sp74.z = 0.0f; for (i = 0, dy = 0.0f; i < 32; i++, dy += 1.0f) { for (j = 0, dx = 0.0f; j < 32; j++, dx += 1.0f) { @@ -65,7 +65,7 @@ void func_tank_80043468(Player* player) { sp54 = ((player->pos.x - player->unk_0AC) * player->unk_148) + (player->unk_0E8 * 0.5f); sp48 = sp54 + (player->unk_0E8 * -5.0f); - sp40 = player->camEye.z - 1000.0f; + sp40 = player->cam.eye.z - 1000.0f; sp54 += player->unk_0AC; sp48 += player->unk_0AC; if (player->unk_1D4 != 0) { @@ -102,15 +102,15 @@ void func_tank_80043468(Player* player) { } } if (player->vel.y < -20.0f) { - Math_SmoothStepToF(&player->camAt.y, sp4C - 100.0f, 0.2f, player->unk_014 * 20.0f, 0.00001f); + Math_SmoothStepToF(&player->cam.at.y, sp4C - 100.0f, 0.2f, player->unk_014 * 20.0f, 0.00001f); } - Math_SmoothStepToF(&player->camEye.x, sp54, 0.1f, player->unk_014 * 20.0f, 0.00001f); - Math_SmoothStepToF(&player->camEye.y, sp50, 0.1f, player->unk_014 * 7.0f, 0.00001f); - Math_SmoothStepToF(&player->camAt.y, sp4C, 0.1f, player->unk_014 * 7.0f, 0.00001f); - Math_SmoothStepToF(&player->camAt.x, sp48, 0.1f, player->unk_014 * 20.0f, 0.00001f); - Math_SmoothStepToF(&player->camEye.z, 200.0f, 0.1f, player->unk_014 * 10.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, sp40, 1.0f, player->unk_014 * 10.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, player->unk_0EC * -0.4f, 0.1f, 1.0f, 0.01f); + Math_SmoothStepToF(&player->cam.eye.x, sp54, 0.1f, player->unk_014 * 20.0f, 0.00001f); + Math_SmoothStepToF(&player->cam.eye.y, sp50, 0.1f, player->unk_014 * 7.0f, 0.00001f); + Math_SmoothStepToF(&player->cam.at.y, sp4C, 0.1f, player->unk_014 * 7.0f, 0.00001f); + Math_SmoothStepToF(&player->cam.at.x, sp48, 0.1f, player->unk_014 * 20.0f, 0.00001f); + Math_SmoothStepToF(&player->cam.eye.z, 200.0f, 0.1f, player->unk_014 * 10.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, sp40, 1.0f, player->unk_014 * 10.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, player->unk_0EC * -0.4f, 0.1f, 1.0f, 0.01f); Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.1f, 0.0f); } @@ -155,13 +155,13 @@ void func_tank_80043B18(Player* player) { Vec3f sp3C; f32 sp38; - Matrix_Translate(gCalcMatrix, 0.0f, player->unk_18C + 30.0f, 0, 0); - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -player->unk_12C * M_DTOR, 1); - Matrix_Translate(gCalcMatrix, 0.0f, -30.0f, 0, 1); + Matrix_Translate(gCalcMatrix, 0.0f, player->unk_18C + 30.0f, 0, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (player->unk_0EC + player->unk_0F0) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -player->unk_12C * M_DTOR, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, -30.0f, 0, MTXF_APPLY); sp48.y = 0.0f; sp48.z = -20.0f; sp38 = player->unk_114; @@ -247,7 +247,7 @@ void func_tank_800441C8(Player* player, f32* hitboxData, f32 xPos, f32 yPos, f32 f32 y; f32 z; - Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, MTXF_NEW); count = *hitboxData++; if (count != 0) { for (i = 0; i < count; i++, hitboxData += 6) { @@ -490,7 +490,7 @@ void func_tank_80044868(Player* player) { if ((gCurrentLevel == LEVEL_TITANIA) && (gBossActive == 0)) { func_tank_80043280(D_landmaster_3005EA8, D_TI_6009BB8, gGameFrameCount * -55.0f); } - if ((gCurrentLevel == LEVEL_MACBETH) && (player->state_1C8 == PLAYERSTATE_1C8_7)) { + if ((gCurrentLevel == LEVEL_MACBETH) && (player->state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE)) { func_tank_80043280(D_landmaster_3005EA8, *D_Tex_800DACB8, gGameFrameCount * -55.0f); } } @@ -760,7 +760,7 @@ void func_tank_800460E0(Player* player, f32* hitboxData, f32 arg2, f32 arg3, f32 s32 i; s32 count; - Matrix_RotateY(gCalcMatrix, -arg6 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -arg6 * M_DTOR, MTXF_NEW); count = *hitboxData++; if (count != 0) { for (i = 0; i < count; i++, hitboxData += 6) { @@ -829,7 +829,7 @@ void func_tank_8004641C(Player* player, s32 arg1, f32 arg2, f32 arg3, f32 arg4, Vec3f sp58; Vec3f sp4C; - Matrix_RotateY(gCalcMatrix, -arg6 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -arg6 * M_DTOR, MTXF_NEW); sp70.x = player->vel.x; sp70.y = player->vel.y; sp70.z = player->vel.z; @@ -997,26 +997,26 @@ s32 func_tank_80046E40(Player* player, f32* hitboxData, s32* index, f32 xPos, f3 for (i = 0; i < spB4; i++, hitboxData += 6) { spA0 = 0; if (hitboxData[0] == HITBOX_ROTATED) { - Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -hitboxData[3] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -hitboxData[1] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -hitboxData[2] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, MTXF_APPLY); hitboxData += 4; spA0 = 1.0f; } else { if (hitboxData[0] == HITBOX_SHADOW) { hitboxData++; } - Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -zRot * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -xRot * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -yRot * M_DTOR, MTXF_APPLY); } if ((arg9 != 0) || (argA != 0) || (argB != 0)) { - Matrix_RotateZ(gCalcMatrix, -argB * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -arg9 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -argA * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -argB * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -arg9 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -argA * M_DTOR, MTXF_APPLY); } if ((yRot == 0.0f) && (zRot == 0.0f) && (xRot == 0.0f) && (spA0 == 0)) { var_fv0 = player->hit1.x; @@ -1294,7 +1294,7 @@ void func_tank_80047FBC(Player* player) { if (!(D_800C9F08 & 1)) { Math_SmoothStepToF(&player->unk_0EC, -((player->vel.z / 5.0f) * 4.0f), 0.4f, 8.0f, 0.01f); if (player->unk_0EC >= 3.0f) { - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { AUDIO_PLAY_SFX(0x19000065, player->sfxSource, 0); } D_800C9F08 |= 1; diff --git a/src/engine/fox_versus.c b/src/engine/fox_versus.c index 4c13e2e3..7b128683 100644 --- a/src/engine/fox_versus.c +++ b/src/engine/fox_versus.c @@ -321,7 +321,7 @@ void func_versus_800BDE44(void) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); for (i = 0; i < 4; i++) { - if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_5)) { + if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { if ((D_ctx_80177C30[i] != D_80178808[i]) || (D_80178810[i])) { D_80178810[i] += 4; if (D_80178810[i] > 15) { @@ -643,7 +643,7 @@ s32 func_versus_800BF17C(void) { for (i = 0, ret = 0; i < 4; i++) { D_80178850[i] = 1; - if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_13) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_VS_STANDBY) { D_80178850[i] = 0; D_801787F8[i] = 150; continue; @@ -767,7 +767,7 @@ void func_versus_800BF750(void) { RCP_SetupDL(&gMasterDisp, 0x4C); for (i = 0; i < 4; i++) { - if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_3) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_ACTIVE) { continue; } for (j = 0, temp = 0; j < 4; j++) { @@ -790,10 +790,10 @@ s32 func_versus_800BF9AC(void) { switch (D_ctx_801778AC) { case 0: for (i = 0, var_a3 = 0; i < 4; i++) { - if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_13) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_VS_STANDBY) { D_801787A8 = i; } - if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_13) { + if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY) { var_a3 += 1; } } @@ -828,7 +828,7 @@ s32 func_versus_800BF9AC(void) { if (gPlayer[j].unk_288 >= 0) { gPlayer[j].unk_288 = i + 1; } - gPlayer[j].state_1C8 = PLAYERSTATE_1C8_13; + gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; } D_ctx_80177E74 = 1; D_801787A8 = i; @@ -837,10 +837,10 @@ s32 func_versus_800BF9AC(void) { case 1: for (i = 0, var_a3 = 0; i < 4; i++) { - if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_13) { + if (gPlayer[i].state_1C8 != PLAYERSTATE_1C8_VS_STANDBY) { D_801787A8 = i; } - if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_13) { + if (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY) { var_a3 += 1; } } @@ -869,7 +869,7 @@ s32 func_versus_800BF9AC(void) { if (gPlayer[j].unk_288 >= 0) { gPlayer[j].unk_288 = i + 1; } - gPlayer[j].state_1C8 = PLAYERSTATE_1C8_13; + gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; } D_ctx_80177E74 = 1; break; @@ -881,7 +881,8 @@ s32 func_versus_800BF9AC(void) { if (D_ctx_801778AC == 2) { for (i = 0; i < 4; i++) { - if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_4) || (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_13)) { + if ((gPlayer[i].state_1C8 == PLAYERSTATE_1C8_DOWN) || + (gPlayer[i].state_1C8 == PLAYERSTATE_1C8_VS_STANDBY)) { D_ctx_80177C30[i] = D_80178838[i] = D_80178808[i] = D_80178810[i] = 0; D_80178820[i] += 1; } @@ -994,7 +995,7 @@ s32 func_versus_800BF9AC(void) { gPlayer[j].unk_288 = i + 1; } - gPlayer[j].state_1C8 = PLAYERSTATE_1C8_13; + gPlayer[j].state_1C8 = PLAYERSTATE_1C8_VS_STANDBY; } D_ctx_80177E74 = 1; break; @@ -1959,7 +1960,7 @@ void func_versus_800C2244(Actor* actor) { actor->vel.y = 0.0f; } - func_360_8003088C(actor); + ActorAllRange_ApplyDamage(actor); if (actor->iwork[8]) { actor->iwork[8]--; @@ -1992,7 +1993,7 @@ void func_versus_800C26C8(void) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; actor->obj.id = 197; - Matrix_RotateY(gCalcMatrix, M_DTOR * RAND_FLOAT(360.0f), 0); + Matrix_RotateY(gCalcMatrix, M_DTOR * RAND_FLOAT(360.0f), MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); actor->obj.pos.x = dest.x; actor->obj.pos.y = dest.y; diff --git a/src/overlays/ovl_ending/fox_end1.c b/src/overlays/ovl_ending/fox_end1.c index 2b681e9c..65b193eb 100644 --- a/src/overlays/ovl_ending/fox_end1.c +++ b/src/overlays/ovl_ending/fox_end1.c @@ -104,12 +104,12 @@ void Ending_801876A4(void) { RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 240); Matrix_Translate(gGfxMatrix, D_ending_80196D08[i].pos.x, D_ending_80196D08[i].pos.y, D_ending_80196D08[i].pos.z, - 1); + MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_ending_80196D08[i].scale.x + 4.0f, D_ending_80196D08[i].scale.y + 4.0f, - D_ending_80196D08[i].scale.z + 4.0f, 1); - Matrix_RotateY(gGfxMatrix, D_ending_80196D08[i].rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, (D_ending_80196D08[i].rot.x + 5.0f) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, D_ending_80196D08[i].rot.z * M_DTOR, 1); + D_ending_80196D08[i].scale.z + 4.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_ending_80196D08[i].rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, (D_ending_80196D08[i].rot.x + 5.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_ending_80196D08[i].rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_6041070); Matrix_Pop(&gGfxMatrix); @@ -133,18 +133,18 @@ void Ending_80187860(s32 arg0, s32 arg1) { case 2: if (1) {} Matrix_Translate(gGfxMatrix, D_ending_80196D08[i].pos.x, D_ending_80196D08[i].pos.y - 10.0f, - D_ending_80196D08[i].pos.z, 1); + D_ending_80196D08[i].pos.z, MTXF_APPLY); break; default: Matrix_Translate(gGfxMatrix, D_ending_80196D08[i].pos.x, D_ending_80196D08[i].pos.y, - D_ending_80196D08[i].pos.z, 1); + D_ending_80196D08[i].pos.z, MTXF_APPLY); break; } Matrix_Scale(gGfxMatrix, D_ending_80196D08[i].scale.x, D_ending_80196D08[i].scale.y, - D_ending_80196D08[i].scale.z, 1); - Matrix_RotateY(gGfxMatrix, D_ending_80196D08[i].rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_ending_80196D08[i].rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, D_ending_80196D08[i].rot.z * M_DTOR, 1); + D_ending_80196D08[i].scale.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_ending_80196D08[i].rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_ending_80196D08[i].rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_ending_80196D08[i].rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((arg1 != 0) && (gCsFrameCount >= 394)) { switch (i) { @@ -452,11 +452,11 @@ void Ending_801888F4(void) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, D_ending_80196D08[sp29C].setupDL); Matrix_Translate(gGfxMatrix, D_ending_80196D08[sp29C].pos.x, D_ending_80196D08[sp29C].pos.y, - D_ending_80196D08[sp29C].pos.z, 1); + D_ending_80196D08[sp29C].pos.z, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_ending_80196D08[sp29C].scale.x, D_ending_80196D08[sp29C].scale.y, - D_ending_80196D08[sp29C].scale.z, 1); - Matrix_RotateY(gGfxMatrix, D_ending_80196D08[sp29C].rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_ending_80196D08[sp29C].rot.x * M_DTOR, 1); + D_ending_80196D08[sp29C].scale.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_ending_80196D08[sp29C].rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_ending_80196D08[sp29C].rot.x * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); switch (D_ending_80196D08[sp29C].unk_38) { @@ -822,9 +822,9 @@ void Ending_8018A024(void) { src.x = src.y = 0.0f; src.z = -100.0f; - Matrix_RotateX(gCalcMatrix, D_ctx_801784D0 * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, D_ctx_801784D4 * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, D_ctx_801784D8 * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, D_ctx_801784D0 * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, D_ctx_801784D4 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, D_ctx_801784D8 * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); gLight1x = dest.x; gLight1y = dest.y; @@ -868,12 +868,12 @@ void Ending_8018A2A8(void) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, D_ending_80196D08[i].prim.r, D_ending_80196D08[i].prim.g, D_ending_80196D08[i].prim.b, D_ending_80196D08[i].prim.a); Matrix_Translate(gGfxMatrix, D_ending_80196D08[i].pos.x, D_ending_80196D08[i].pos.y, D_ending_80196D08[i].pos.z, - 1); + MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_ending_80196D08[i].scale.x, D_ending_80196D08[i].scale.y, - D_ending_80196D08[i].scale.z, 1); - Matrix_RotateY(gGfxMatrix, D_ending_80196D08[i].rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_ending_80196D08[i].rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, D_ending_80196D08[i].rot.z * M_DTOR, 1); + D_ending_80196D08[i].scale.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_ending_80196D08[i].rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_ending_80196D08[i].rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_ending_80196D08[i].rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (D_ending_80196D08[i].skeleton == NULL) { @@ -1079,7 +1079,7 @@ void Ending_8018A96C(void) { void Ending_8018AAC4(void) { Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, gCsCamEyeX, gCsCamEyeY, gCsCamEyeZ, gCsCamAtX, gCsCamAtY, gCsCamAtZ, 0.0f, 100.0f, 0.0f, - 0); + MTXF_NEW); switch (D_ending_80196D00) { case 1: @@ -1646,8 +1646,8 @@ bool Ending_8018BCB0(void) { break; } - Matrix_RotateY(gCalcMatrix, (gActors[i].unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(gActors[i].unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (gActors[i].unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(gActors[i].unk_0F4.x * M_DTOR), MTXF_APPLY); sp78.x = 0.0f; sp78.y = 0.0f; @@ -1735,15 +1735,15 @@ void Ending_8018C21C(void) { if (gCsFrameCount < 780) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x11); - Matrix_Translate(gGfxMatrix, 0.0f, -1200.0f, -6000.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -1200.0f, -6000.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_700C8B0); Matrix_Pop(&gGfxMatrix); } else { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x11); - Matrix_Translate(gGfxMatrix, -2000.0f, -3000.0f, 3000.0f, 1); - Matrix_RotateY(gGfxMatrix, 110.0f * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, -2000.0f, -3000.0f, 3000.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, 110.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_700C8B0); Matrix_Pop(&gGfxMatrix); @@ -1759,11 +1759,11 @@ void Ending_8018C21C(void) { if (gActors[i].state == 0) { RCP_SetupDL(&gMasterDisp, 0x17); Matrix_Translate(gGfxMatrix, gActors[i].obj.pos.x, gActors[i].obj.pos.y, gActors[i].obj.pos.z, - 1); - Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, 1); - Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, 1); + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gGreatFoxIntact) { @@ -1782,17 +1782,17 @@ void Ending_8018C21C(void) { Matrix_Push(&gGfxMatrix); scale = &sp10C[gGameFrameCount % 2]; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, var_s1->x, var_s1->y, var_s1->z, 1); - Matrix_Scale(gGfxMatrix, scale->x, scale->y, scale->z, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Translate(gGfxMatrix, var_s1->x, var_s1->y, var_s1->z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale->x, scale->y, scale->z, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_7010970); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); scale = &spF4[gGameFrameCount % 2]; - Matrix_Translate(gGfxMatrix, var_s1->x, var_s1->y, var_s1->z - 60.0f, 1); - Matrix_Scale(gGfxMatrix, scale->x, scale->y, scale->z, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Translate(gGfxMatrix, var_s1->x, var_s1->y, var_s1->z - 60.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale->x, scale->y, scale->z, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_7010970); Matrix_Pop(&gGfxMatrix); @@ -1800,11 +1800,11 @@ void Ending_8018C21C(void) { } else { RCP_SetupDL(&gMasterDisp, 0x17); Matrix_Translate(gGfxMatrix, gActors[i].obj.pos.x, gActors[i].obj.pos.y, gActors[i].obj.pos.z, - 1); - Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, 1); - Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, 1); + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); func_demo_800515C4(); } @@ -1812,42 +1812,45 @@ void Ending_8018C21C(void) { case 1: RCP_SetupDL(&gMasterDisp, 0x17); - Matrix_Translate(gGfxMatrix, gActors[i].obj.pos.x, gActors[i].obj.pos.y, gActors[i].obj.pos.z, 1); - Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, 1); - Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, gActors[i].obj.pos.x, gActors[i].obj.pos.y, gActors[i].obj.pos.z, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_700F240); break; case 2: RCP_SetupDL(&gMasterDisp, 0x17); - Matrix_Translate(gGfxMatrix, gActors[i].obj.pos.x, gActors[i].obj.pos.y, gActors[i].obj.pos.z, 1); - Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, 1); - Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, gActors[i].obj.pos.x, gActors[i].obj.pos.y, gActors[i].obj.pos.z, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_700F320); break; case 3: RCP_SetupDL(&gMasterDisp, 0x17); - Matrix_Translate(gGfxMatrix, gActors[i].obj.pos.x, gActors[i].obj.pos.y, gActors[i].obj.pos.z, 1); - Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, 1); - Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, gActors[i].obj.pos.x, gActors[i].obj.pos.y, gActors[i].obj.pos.z, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, gActors[i].scale, gActors[i].scale, gActors[i].scale, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gActors[i].obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gActors[i].obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gActors[i].obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_D00B880); Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 64); gDPSetEnvColor(gMasterDisp++, 0, 255, 0, 64); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -66.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -66.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_7010970); Matrix_Pop(&gGfxMatrix); @@ -1875,18 +1878,18 @@ void Ending_8018C21C(void) { break; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 70.0f, 0.0f, -100.0f, 1); - Matrix_Scale(gGfxMatrix, spE4, 1.0f, 200.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Translate(gGfxMatrix, 70.0f, 0.0f, -100.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, spE4, 1.0f, 200.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_700C620); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -70.0f, 0.0f, -100.0f, 1); - Matrix_Scale(gGfxMatrix, spE4, 1.0f, 200.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Translate(gGfxMatrix, -70.0f, 0.0f, -100.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, spE4, 1.0f, 200.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -17.5f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_700C620); Matrix_Pop(&gGfxMatrix); diff --git a/src/overlays/ovl_ending/fox_end2.c b/src/overlays/ovl_ending/fox_end2.c index b0ee19ff..5f5532fb 100644 --- a/src/overlays/ovl_ending/fox_end2.c +++ b/src/overlays/ovl_ending/fox_end2.c @@ -122,9 +122,9 @@ void Ending_8018D4BC(s32 arg0, AssetInfo* asset) { Vec3f src; Vec3f dest; - Matrix_RotateY(gCalcMatrix, M_DTOR * D_ending_801985F0.y, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * D_ending_801985F0.x, 1); - Matrix_RotateZ(gCalcMatrix, M_DTOR * D_ending_801985F0.z, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * D_ending_801985F0.y, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * D_ending_801985F0.x, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, M_DTOR * D_ending_801985F0.z, MTXF_APPLY); src.x = asset->unk_18.x; src.y = asset->unk_18.y; @@ -324,10 +324,10 @@ void Ending_8018E1B8(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); Matrix_Scale(gGfxMatrix, asset->unk_30.x + (arg0 % 3) * 0.01f, asset->unk_30.y + (arg0 % 3) * 0.01f, - asset->unk_30.z + (arg0 % 3) * 0.01f, 1); + asset->unk_30.z + (arg0 % 3) * 0.01f, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); @@ -336,27 +336,30 @@ void Ending_8018E1B8(u32 arg0, AssetInfo* asset) { Matrix_RotateY(gGfxMatrix, M_DTOR * (-D_ending_801985F0.y + asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), - 1); + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * (-D_ending_801985F0.x + asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), - 1); + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_ending_801985F0.z + asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), - 1); + MTXF_APPLY); break; default: - Matrix_RotateY( - gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); - Matrix_RotateX( - gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); - Matrix_RotateZ( - gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + Matrix_RotateY(gGfxMatrix, + M_DTOR * + (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, + M_DTOR * + (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, + M_DTOR * + (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); break; } @@ -380,7 +383,7 @@ void Ending_8018E7B8(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); @@ -389,32 +392,35 @@ void Ending_8018E7B8(u32 arg0, AssetInfo* asset) { Matrix_RotateY(gGfxMatrix, M_DTOR * (-D_ending_801985F0.y + asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), - 1); + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * (-D_ending_801985F0.x + asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), - 1); + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_ending_801985F0.z + asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), - 1); + MTXF_APPLY); break; default: - Matrix_RotateY( - gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); - Matrix_RotateX( - gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); - Matrix_RotateZ( - gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + Matrix_RotateY(gGfxMatrix, + M_DTOR * + (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, + M_DTOR * + (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, + M_DTOR * + (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); break; } Matrix_Scale(gGfxMatrix, asset->unk_30.x + (arg0 % 3) * 0.5f, asset->unk_30.y + (arg0 % 3) * 0.5f, - asset->unk_30.z + (arg0 % 3) * 0.5f, 1); + asset->unk_30.z + (arg0 % 3) * 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -434,18 +440,21 @@ void Ending_8018EDB8(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); Matrix_RotateY(gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); + M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); + M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -467,18 +476,21 @@ void Ending_8018F2A8(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); Matrix_RotateY(gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); + M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); + M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -503,9 +515,9 @@ void Ending_8018F64C(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); @@ -514,27 +526,30 @@ void Ending_8018F64C(u32 arg0, AssetInfo* asset) { Matrix_RotateY(gGfxMatrix, M_DTOR * (-D_ending_801985F0.y + asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), - 1); + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * (-D_ending_801985F0.x + asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), - 1); + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_ending_801985F0.z + asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), - 1); + MTXF_APPLY); break; default: - Matrix_RotateY( - gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); - Matrix_RotateX( - gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); - Matrix_RotateZ( - gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + Matrix_RotateY(gGfxMatrix, + M_DTOR * + (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, + M_DTOR * + (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, + M_DTOR * + (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); break; } @@ -542,9 +557,10 @@ void Ending_8018F64C(u32 arg0, AssetInfo* asset) { gSPDisplayList(gMasterDisp++, D_D009A40); RCP_SetupDL(&gMasterDisp, 0x43); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 0.8f + (arg0 % 3) * 0.01f, 0.3f + (arg0 % 3) * 0.01f, 0.8f + (arg0 % 3) * 0.01f, 1); + Matrix_Scale(gGfxMatrix, 0.8f + (arg0 % 3) * 0.01f, 0.3f + (arg0 % 3) * 0.01f, 0.8f + (arg0 % 3) * 0.01f, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_7010970); @@ -566,9 +582,9 @@ void Ending_8018FC60(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); @@ -577,27 +593,30 @@ void Ending_8018FC60(u32 arg0, AssetInfo* asset) { Matrix_RotateY(gGfxMatrix, M_DTOR * (-D_ending_801985F0.y + asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), - 1); + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * (-D_ending_801985F0.x + asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), - 1); + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_ending_801985F0.z + asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), - 1); + MTXF_APPLY); break; default: - Matrix_RotateY( - gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); - Matrix_RotateX( - gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); - Matrix_RotateZ( - gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + Matrix_RotateY(gGfxMatrix, + M_DTOR * + (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, + M_DTOR * + (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, + M_DTOR * + (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); break; } @@ -605,9 +624,10 @@ void Ending_8018FC60(u32 arg0, AssetInfo* asset) { gSPDisplayList(gMasterDisp++, D_D00B880); RCP_SetupDL(&gMasterDisp, 0x43); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -50.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -50.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 0.5f + (arg0 % 3) * 0.01f, 0.3f + (arg0 % 3) * 0.01f, 0.5f + (arg0 % 3) * 0.01f, 1); + Matrix_Scale(gGfxMatrix, 0.5f + (arg0 % 3) * 0.01f, 0.3f + (arg0 % 3) * 0.01f, 0.5f + (arg0 % 3) * 0.01f, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_7010970); @@ -624,18 +644,21 @@ void Ending_80190274(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, D_ending_801985D0.x + asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, D_ending_801985D0.y + asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - D_ending_801985D0.z + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + D_ending_801985D0.z + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); Matrix_RotateY(gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); + M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); + M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -645,12 +668,12 @@ void Ending_80190274(u32 arg0, AssetInfo* asset) { void Ending_80190648(s32 arg0, AssetInfo* asset) { RCP_SetupDL(&gMasterDisp, asset->unk_08); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_ending_801985F0.y, 0); - Matrix_RotateX(gGfxMatrix, M_DTOR * D_ending_801985F0.x, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_ending_801985F0.z, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_ending_801985F0.y, MTXF_NEW); + Matrix_RotateX(gGfxMatrix, M_DTOR * D_ending_801985F0.x, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_ending_801985F0.z, MTXF_APPLY); - Matrix_Translate(gGfxMatrix, asset->unk_18.x, asset->unk_18.y, asset->unk_18.z, 1); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Translate(gGfxMatrix, asset->unk_18.x, asset->unk_18.y, asset->unk_18.z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_END_7002120); @@ -668,9 +691,9 @@ void Ending_80190778(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y - 6.0f + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.2f + asset->unk_70); @@ -679,31 +702,34 @@ void Ending_80190778(u32 arg0, AssetInfo* asset) { Matrix_RotateY(gGfxMatrix, M_DTOR * (-D_ending_801985F0.y + asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), - 1); + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * (-D_ending_801985F0.x + asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), - 1); + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_ending_801985F0.z + asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), - 1); + MTXF_APPLY); break; default: - Matrix_RotateY( - gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); - Matrix_RotateX( - gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); - Matrix_RotateZ( - gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + Matrix_RotateY(gGfxMatrix, + M_DTOR * + (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, + M_DTOR * + (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, + M_DTOR * + (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); break; } - Matrix_Translate(gGfxMatrix, 0.0f, 480.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 480.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -735,9 +761,9 @@ void Ending_80190CF0(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.2f + asset->unk_70); @@ -746,27 +772,30 @@ void Ending_80190CF0(u32 arg0, AssetInfo* asset) { Matrix_RotateY(gGfxMatrix, M_DTOR * (-D_ending_801985F0.y + asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), - 1); + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * (-D_ending_801985F0.x + asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), - 1); + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_ending_801985F0.z + asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), - 1); + MTXF_APPLY); break; default: - Matrix_RotateY( - gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); - Matrix_RotateX( - gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); - Matrix_RotateZ( - gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + Matrix_RotateY(gGfxMatrix, + M_DTOR * + (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, + M_DTOR * + (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, + M_DTOR * + (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); break; } @@ -797,18 +826,21 @@ void Ending_80191294(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); Matrix_RotateY(gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); + M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); + M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -824,9 +856,9 @@ void Ending_80191294(u32 arg0, AssetInfo* asset) { D_ending_80198590.unk_18 = D_ending_80198590.unk_1C; if ((arg0 > 520) && (arg0 < 720)) { - D_ending_80198590.unk_2C = 1; + D_ending_80198590.modelId = 1; } else { - D_ending_80198590.unk_2C = 0; + D_ending_80198590.modelId = 0; } D_ending_80198590.unk_38 = 0.0f; @@ -851,9 +883,9 @@ void Ending_80191710(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); @@ -862,27 +894,30 @@ void Ending_80191710(u32 arg0, AssetInfo* asset) { Matrix_RotateY(gGfxMatrix, M_DTOR * (-D_ending_801985F0.y + asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), - 1); + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, M_DTOR * (-D_ending_801985F0.x + asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), - 1); + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_ending_801985F0.z + asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), - 1); + MTXF_APPLY); break; default: - Matrix_RotateY( - gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); - Matrix_RotateX( - gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); - Matrix_RotateZ( - gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + Matrix_RotateY(gGfxMatrix, + M_DTOR * + (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, + M_DTOR * + (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, + M_DTOR * + (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); break; } @@ -907,18 +942,21 @@ void Ending_80191C7C(u32 arg0, AssetInfo* asset) { Matrix_Translate(gGfxMatrix, asset->unk_18.x + (arg0 - asset->unk_0C) * asset->unk_3C.x, asset->unk_18.y + (arg0 - asset->unk_0C) * asset->unk_3C.y, - asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, 1); + asset->unk_18.z + (arg0 - asset->unk_0C) * asset->unk_3C.z, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, 1); + Matrix_Scale(gGfxMatrix, asset->unk_30.x, asset->unk_30.y, asset->unk_30.z, MTXF_APPLY); temp = __sinf(arg0 * 0.1f + asset->unk_70); Matrix_RotateY(gGfxMatrix, - M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), 1); + M_DTOR * (asset->unk_24.y + temp * asset->unk_54.y + (arg0 - asset->unk_0C) * asset->unk_48.y), + MTXF_APPLY); Matrix_RotateX(gGfxMatrix, - M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), 1); + M_DTOR * (asset->unk_24.x + temp * asset->unk_54.x + (arg0 - asset->unk_0C) * asset->unk_48.x), + MTXF_APPLY); Matrix_RotateZ(gGfxMatrix, - M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), 1); + M_DTOR * (asset->unk_24.z + temp * asset->unk_54.z + (arg0 - asset->unk_0C) * asset->unk_48.z), + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -1013,7 +1051,7 @@ void Ending_801924EC(u32 arg0) { D_ending_801985D0.z += unkEnd54->unk_30.z; Matrix_LookAt(gGfxMatrix, D_ending_801985D0.x, D_ending_801985D0.y, D_ending_801985D0.z, - D_ending_801985E0.x, D_ending_801985E0.y, D_ending_801985E0.z, 0.0f, 1.0f, 0.0f, 1); + D_ending_801985E0.x, D_ending_801985E0.y, D_ending_801985E0.z, 0.0f, 1.0f, 0.0f, MTXF_APPLY); func_play_800B6F50(D_ending_801985D0.x, D_ending_801985D0.y, D_ending_801985D0.z, D_ending_801985E0.x, D_ending_801985E0.y, D_ending_801985E0.z); diff --git a/src/overlays/ovl_i1/fox_co.c b/src/overlays/ovl_i1/fox_co.c index d4dc0c4d..a1f5c0d5 100644 --- a/src/overlays/ovl_i1/fox_co.c +++ b/src/overlays/ovl_i1/fox_co.c @@ -100,8 +100,8 @@ void Corneria_Boss292_Init(Boss292* this) { gBossFrameCount = 0; if (gLevelMode == LEVELMODE_ON_RAILS) { - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_9; + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; gPlayer[0].unk_1D0 = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); @@ -171,8 +171,9 @@ void Corneria_80187AC8(Boss* boss) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 80); gCsFrameCount = 0; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8 = 0; gPlayer[0].unk_0E8 += gPlayer[0].unk_114; if (gPlayer[0].unk_0E8 > 360.0f) { @@ -433,9 +434,9 @@ void Corneria_80188A18(Boss* boss) { if ((gBossFrameCount > 1000) && (Rand_ZeroOne() < 0.3f)) { if (Rand_ZeroOne() < 0.5f) { - func_360_8002E4F8(gMsg_ID_2263, RCID_BOSS_CORNERIA); + AllRange_PlayMessage(gMsg_ID_2263, RCID_BOSS_CORNERIA); } else { - func_360_8002E4F8(gMsg_ID_2265, RCID_BOSS_CORNERIA); + AllRange_PlayMessage(gMsg_ID_2265, RCID_BOSS_CORNERIA); } } } @@ -508,7 +509,7 @@ void Corneria_80188D50(Boss* boss) { break; } } - Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_114 + gPlayer[0].unk_0E8) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_114 + gPlayer[0].unk_0E8) * M_DTOR, MTXF_NEW); sp48.x = 0.0f; sp48.y = 0.0f; sp48.z = -2500.0f; @@ -548,7 +549,7 @@ void Corneria_80189058(Boss* boss) { Vec3f sp6C = { 0.0f, 0.0f, -30.0f }; f32 sp5C; - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_9) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) { if (boss->swork[33] == 0) { boss->swork[33]++; gBossActive = 2; @@ -576,8 +577,8 @@ void Corneria_80189058(Boss* boss) { gBossFrameCount = 0; } gBossFrameCount++; - gRadarMarks[59].unk_00 = 1; - gRadarMarks[59].unk_02 = 102; + gRadarMarks[59].status = 1; + gRadarMarks[59].type = 102; gRadarMarks[59].pos.x = boss->obj.pos.x; gRadarMarks[59].pos.y = boss->obj.pos.y; gRadarMarks[59].pos.z = boss->obj.pos.z; @@ -1084,7 +1085,7 @@ void Corneria_8018A730(s32 limbIndex, Vec3f* rot, void* data) { } void Corneria_8018AA74(Boss* boss) { - Matrix_Translate(gCalcMatrix, 0.0f, 700.0f, 0.0f, 1); + Matrix_Translate(gCalcMatrix, 0.0f, 700.0f, 0.0f, MTXF_APPLY); Animation_DrawSkeleton(2, D_CO_602BE64, boss->vwork, Corneria_8018A434, Corneria_8018A730, boss, gCalcMatrix); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); @@ -1115,7 +1116,7 @@ s32 Corneria_8018AB64(Actor* actor) { sp7C.x = sp60[i] + actor->obj.pos.x; sp7C.y = actor->obj.pos.y; sp7C.z = sp50[i] + actor->obj.pos.z; - temp_v0 = func_enmy_8006351C(actor->index, &sp7C, &sp70, 1); + temp_v0 = Object_CheckCollision(actor->index, &sp7C, &sp70, 1); if ((temp_v0 != 0) && (temp_v0 >= 10)) { if ((gObjects80[temp_v0 - 10].obj.status == OBJ_ACTIVE) && (gObjects80[temp_v0 - 10].obj.id == OBJ_80_40)) { return temp_v0 - 9; @@ -1235,7 +1236,7 @@ void Corneria_8018B15C(Actor* actor) { temp_cos = COS_DEG(actor->obj.rot.y); actor->vel.z = actor->fwork[0] * temp_cos; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); switch (actor->state) { case 3: @@ -1485,7 +1486,7 @@ void Corneria_Boss293_Init(Boss293* this) { this->fwork[18] = -D_play_80161A54 - 10.0f; if (fabsf(gPlayer[0].unk_0AC) < 1.0f) { this->timer_05A = 30000; - this->obj.pos.z = (gPlayer[0].camEye.z - D_ctx_80177D20) - 2000.0f; + this->obj.pos.z = (gPlayer[0].cam.eye.z - D_ctx_80177D20) - 2000.0f; AUDIO_PLAY_SFX(0x31038018, this->sfxSource, 4); D_i1_8019B6D0 = 0; } else { @@ -1570,9 +1571,9 @@ void Corneria_8018C19C(Boss* boss) { f32* temp_a1; gBossFrameCount++; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); if (D_i1_8019B6D0 == 0) { if (boss->obj.pos.x > 6000.0f) { Object_Kill(&boss->obj, boss->sfxSource); @@ -1651,7 +1652,7 @@ void Corneria_8018C19C(Boss* boss) { } boss->vel.z = boss->fwork[18]; if (boss->state > 0) { - boss->fwork[3] = (gPlayer[0].camEye.z - D_ctx_80177D20) - 2500.0f; + boss->fwork[3] = (gPlayer[0].cam.eye.z - D_ctx_80177D20) - 2500.0f; } if (boss->state != 7) { Math_SmoothStepToF(&boss->fwork[4], boss->fwork[5], 0.1f, 2.0f, 0.00001f); @@ -1728,7 +1729,7 @@ void Corneria_8018C19C(Boss* boss) { boss->fwork[13] = 180.0f; boss->fwork[12] = 1.5f; boss->fwork[6] = 800.0f; - boss->fwork[3] = gPlayer[0].camEye.z - D_ctx_80177D20 - 2500.0f; + boss->fwork[3] = gPlayer[0].cam.eye.z - D_ctx_80177D20 - 2500.0f; boss->fwork[18] = -D_play_80161A54; AUDIO_PLAY_BGM(SEQ_ID_CO_BOSS_2 | SEQ_FLAG); boss->timer_050 = 40; @@ -1836,7 +1837,7 @@ void Corneria_8018C19C(Boss* boss) { } break; case 7: - boss->fwork[3] = (gPlayer[0].camEye.z - D_ctx_80177D20) - 4000.0f; + boss->fwork[3] = (gPlayer[0].cam.eye.z - D_ctx_80177D20) - 4000.0f; Math_SmoothStepToF(&boss->obj.pos.z, boss->fwork[3], 0.1f, 15.0f, 0.00001f); if (boss->timer_058 == 0) { @@ -1952,8 +1953,8 @@ void Corneria_8018C19C(Boss* boss) { boss->fwork[17] = 10.0f; boss->vel.y *= 1.5f; gNextPlanetPath = 1; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { func_boss_8004319C(gPlayer, boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z); } boss->health--; @@ -2104,9 +2105,9 @@ void Corneria_8018DDAC(Boss* boss) { boss->obj.rot.x = gBosses[0].obj.rot.x; boss->obj.rot.y = gBosses[0].obj.rot.y; boss->obj.rot.z = gBosses[0].obj.rot.z; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A78, &sp40); boss->obj.pos.x = gBosses[0].obj.pos.x + sp40.x; boss->obj.pos.y = gBosses[0].obj.pos.y + sp40.y; @@ -2114,7 +2115,7 @@ void Corneria_8018DDAC(Boss* boss) { boss->fwork[2] = gBosses[0].fwork[2]; break; case 1: - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_NEW); gBosses[0].fwork[15] += 0.5f; if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { @@ -2196,9 +2197,9 @@ void Corneria_8018E290(Boss* boss) { boss->obj.rot.x = gBosses[0].obj.rot.x; boss->obj.rot.y = gBosses[0].obj.rot.y; boss->obj.rot.z = gBosses[0].obj.rot.z; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199A90, &sp40); boss->obj.pos.x = gBosses[0].obj.pos.x + sp40.x; boss->obj.pos.y = gBosses[0].obj.pos.y + sp40.y; @@ -2206,7 +2207,7 @@ void Corneria_8018E290(Boss* boss) { boss->fwork[0] = gBosses[0].fwork[0]; break; case 1: - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_NEW); gBosses[0].fwork[15] += 0.5f; if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { @@ -2291,9 +2292,9 @@ void Corneria_8018E76C(Boss* boss) { boss->obj.rot.x = gBosses[0].obj.rot.x; boss->obj.rot.y = gBosses[0].obj.rot.y; boss->obj.rot.z = gBosses[0].obj.rot.z; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i1_80199AA8, &sp40); boss->obj.pos.x = gBosses[0].obj.pos.x + sp40.x; boss->obj.pos.y = gBosses[0].obj.pos.y + sp40.y; @@ -2301,7 +2302,7 @@ void Corneria_8018E76C(Boss* boss) { boss->fwork[1] = gBosses[0].fwork[1]; break; case 1: - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_NEW); gBosses[0].fwork[15] += 0.5f; if (((gGameFrameCount % 8) == 0) && (Rand_ZeroOne() < 0.5f)) { boss->timer_05C = 4; @@ -2355,7 +2356,7 @@ bool Corneria_8018ED1C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* void Corneria_8018ED78(Boss* boss) { - Matrix_Translate(gGfxMatrix, -D_i1_80199A78.x, -D_i1_80199A78.y, 0.0f, 1); + Matrix_Translate(gGfxMatrix, -D_i1_80199A78.x, -D_i1_80199A78.y, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Animation_GetFrameData(&D_CO_602D400, 0, boss->vwork); Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018ED1C, NULL, &boss->index, &gIdentityMatrix); @@ -2373,7 +2374,7 @@ bool Corneria_8018EE2C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* void Corneria_8018EE84(Boss* boss) { - Matrix_Translate(gGfxMatrix, -D_i1_80199A90.x, -D_i1_80199A90.y, 0.0f, 1); + Matrix_Translate(gGfxMatrix, -D_i1_80199A90.x, -D_i1_80199A90.y, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Animation_GetFrameData(&D_CO_602D400, 0, boss->vwork); Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018EE2C, NULL, &boss->index, &gIdentityMatrix); @@ -2391,7 +2392,7 @@ bool Corneria_8018EF38(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* void Corneria_8018EF90(Boss* boss) { - Matrix_Translate(gGfxMatrix, -D_i1_80199AA8.x, -D_i1_80199AA8.y, 0.0f, 1); + Matrix_Translate(gGfxMatrix, -D_i1_80199AA8.x, -D_i1_80199AA8.y, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Animation_GetFrameData(&D_CO_602D400, 0, boss->vwork); Animation_DrawSkeleton(1, D_CO_602D5AC, boss->vwork, Corneria_8018EF38, NULL, &boss->index, &gIdentityMatrix); @@ -2494,8 +2495,8 @@ void Corneria_8018F55C(Effect* effect) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; - effect->obj.pos.x = gPlayer[0].camEye.x + RAND_FLOAT_CENTERED(500.0f); - effect->obj.pos.y = gPlayer[0].camEye.y + RAND_RANGE(-280.0f, 70.0f); + effect->obj.pos.x = gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(500.0f); + effect->obj.pos.y = gPlayer[0].cam.eye.y + RAND_RANGE(-280.0f, 70.0f); effect->obj.id = OBJ_EFFECT_352; effect->timer_50 = 80; effect->unk_46 = 144; @@ -2584,8 +2585,8 @@ void Corneria_8018F880(Player* player) { } } - sp2C = -Math_Atan2F(player->camEye.x - sp3C, player->camEye.z - sp34); - sp30 = -Math_Atan2F(player->camEye.y - sp38, sqrtf(SQ(player->camEye.z - sp34) + SQ(player->camEye.x - sp3C))); + sp2C = -Math_Atan2F(player->cam.eye.x - sp3C, player->cam.eye.z - sp34); + sp30 = -Math_Atan2F(player->cam.eye.y - sp38, sqrtf(SQ(player->cam.eye.z - sp34) + SQ(player->cam.eye.x - sp3C))); sp44 = Math_RadToDeg(sp2C) - D_ctx_80177A48[4]; sp40 = Math_RadToDeg(sp30) - D_ctx_80177A48[5]; if (sp44 > 180.0f) { @@ -2632,7 +2633,7 @@ void Corneria_8018F880(Player* player) { D_ctx_80177A48[5] = Math_RadToDeg(sp30); player->flags_228 = 0; D_ctx_80177950 = -1.0f; - if ((Math_RadToDeg(gPlayer[0].unk_058) < 90.0f) || (Math_RadToDeg(gPlayer[0].unk_058) > 270.0f)) { + if ((Math_RadToDeg(gPlayer[0].camYaw) < 90.0f) || (Math_RadToDeg(gPlayer[0].camYaw) > 270.0f)) { D_ctx_80177950 = 1.0f; } player->vel.z = 0.0f; @@ -2658,12 +2659,12 @@ void Corneria_8018F880(Player* player) { actor0->iwork[14] = 2; actor1->iwork[14] = 3; actor2->iwork[14] = 4; - player->camEye.x = gCsCamEyeX = player->pos.x - 400.0f; - gPlayer[0].camEye.y = gCsCamEyeY = player->pos.y + 600.0f; - player->camEye.z = gCsCamEyeZ = player->unk_138 + 2000.0f; - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = player->unk_138 + 300.0f; + player->cam.eye.x = gCsCamEyeX = player->pos.x - 400.0f; + gPlayer[0].cam.eye.y = gCsCamEyeY = player->pos.y + 600.0f; + player->cam.eye.z = gCsCamEyeZ = player->unk_138 + 2000.0f; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = player->unk_138 + 300.0f; D_ctx_80177A48[0] = 0; D_ctx_80177A48[1] = D_ctx_80177A48[2] = 0; gFillScreenAlphaTarget = 255; @@ -2927,18 +2928,18 @@ void Corneria_8018F880(Player* player) { gLevelStatusScreenTimer = 80; player->pos.y = 350.0f; - player->camEye.x = player->pos.x; - player->camEye.y = (player->pos.y * player->unk_148) + 50.0f; - player->camEye.z = 30.0f; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->cam.eye.x = player->pos.x; + player->cam.eye.y = (player->pos.y * player->unk_148) + 50.0f; + player->cam.eye.z = 30.0f; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = 0; - player->camAt.x = player->pos.x; - player->camAt.y = (player->pos.y * player->unk_148) + 20.0f; - player->camAt.z = player->unk_138; + player->cam.at.x = player->pos.x; + player->cam.at.y = (player->pos.y * player->unk_148) + 20.0f; + player->cam.at.z = player->unk_138; D_ctx_80177950 = 1.0f; gPlayerFillScreenAlphas[0] = gPlayerFillScreenAlphas[1] = gPlayerFillScreenAlphas[2] = gPlayerFillScreenAlphas[3] = 0; - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; gFillScreenAlphaTarget = 0; player->timer_1F8 = 15; } @@ -2946,18 +2947,18 @@ void Corneria_8018F880(Player* player) { case 10: break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, player->unk_080 + gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY - player->unk_080, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, player->unk_080 + gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY - player->unk_080, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_04, D_ctx_80177A48[1], 0.2f, 1.0f, 0.0f); Math_SmoothStepToF(&player->wings.unk_0C, D_ctx_80177A48[2], 0.2f, 1.0f, 0.0f); player->wings.unk_08 = player->wings.unk_04; player->wings.unk_10 = player->wings.unk_0C; - player->camEye.y -= 3.0f; - player->camAt.y -= 3.0f; + player->cam.eye.y -= 3.0f; + player->cam.at.y -= 3.0f; player->pos.y -= 3.0f; actor0->vwork[20].y -= 3.0f; actor0->obj.pos.y -= 3.0f; @@ -2988,7 +2989,7 @@ void Corneria_80190F74(Actor* actor, s32 arg1) { Vec3f sp38; Player* player = &gPlayer[0]; - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_NEW); sp5C.x = D_i1_80199AE4[arg1]; sp5C.y = D_i1_80199AF0[arg1]; sp5C.z = D_i1_80199AFC[arg1]; @@ -3030,12 +3031,12 @@ void Corneria_80191160(Player* player) { player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 0.0f; Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->unk_110, 0.0f, 0.1f, 3.0f, 0.0f); if (player->unk_1D0 >= 3) { - player->camEye.y += 3.0f; - player->camAt.y += 3.0f; + player->cam.eye.y += 3.0f; + player->cam.at.y += 3.0f; player->pos.y += 3.0f; gActors[0].obj.pos.y += 3.0f; gActors[1].obj.pos.y += 3.0f; @@ -3047,8 +3048,8 @@ void Corneria_80191160(Player* player) { switch (player->unk_1D0) { case 0: Audio_StopSfxByBankAndSource(1, player->sfxSource); - sp54 = player->camEye.x - D_i1_8019B6D8[62]; - sp4C = player->camEye.z - D_i1_8019B6D8[64]; + sp54 = player->cam.eye.x - D_i1_8019B6D8[62]; + sp4C = player->cam.eye.z - D_i1_8019B6D8[64]; D_ctx_80177A48[0] = Math_RadToDeg(Math_Atan2F(sp54, sp4C)); D_ctx_80177A48[1] = sqrtf(SQ(sp54) + SQ(sp4C)); @@ -3066,17 +3067,17 @@ void Corneria_80191160(Player* player) { } else { D_ctx_80177A48[0] -= 0.5f; } - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[0] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[0] * M_DTOR, MTXF_NEW); sp64.x = 0.0f; sp64.y = 0.0f; sp64.z = D_ctx_80177A48[1]; Matrix_MultVec3f(gCalcMatrix, &sp64, &sp58); - Math_SmoothStepToF(&player->camEye.x, D_i1_8019B6D8[62] + sp58.x, 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, D_i1_8019B6D8[63] + 100.0f, 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, D_i1_8019B6D8[64] + sp58.z, 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, D_i1_8019B6D8[62], 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, D_i1_8019B6D8[63], 0.05f, 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, D_i1_8019B6D8[64], 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, D_i1_8019B6D8[62] + sp58.x, 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, D_i1_8019B6D8[63] + 100.0f, 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, D_i1_8019B6D8[64] + sp58.z, 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, D_i1_8019B6D8[62], 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, D_i1_8019B6D8[63], 0.05f, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, D_i1_8019B6D8[64], 0.05f, 500.0f, 0.0f); temp_fa0 = player->pos.x - D_i1_8019B6D8[62]; temp_fa1 = player->pos.z - D_i1_8019B6D8[64]; if (gCsFrameCount < 30) { @@ -3095,9 +3096,9 @@ void Corneria_80191160(Player* player) { Math_SmoothStepToAngle(&player->unk_0E4, 20.0f, 0.1f, 0.5f, 0.0001f); Math_SmoothStepToAngle(&player->unk_0EC, 0.0f, 0.1f, 1.0f, 0.0001f); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.05f, 1.0f, 0.005f, 0.0001f); - Math_SmoothStepToF(&player->camAt.x, player->pos.x, D_ctx_80177A48[2], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, player->pos.y, D_ctx_80177A48[2], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, player->pos.z, D_ctx_80177A48[2], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, player->pos.x, D_ctx_80177A48[2], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, player->pos.y, D_ctx_80177A48[2], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, player->pos.z, D_ctx_80177A48[2], 500.0f, 0.0f); if (gCsFrameCount == 350) { player->unk_1D0++; D_ctx_80177A48[2] = 0.0f; @@ -3113,24 +3114,24 @@ void Corneria_80191160(Player* player) { Math_SmoothStepToF(&player->unk_0D0, 0.0f, 0.1f, 2.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[2], 0.1f, 1.0f, 0.002f, 0); Math_SmoothStepToF(&D_ctx_80177A48[3], 0.1f, 1.0f, 0.002f, 0); - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_NEW); Matrix_Push(&gCalcMatrix); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[5] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[5] * M_DTOR, MTXF_APPLY); sp64.x = 0.0f; sp64.y = -200.0f; sp64.z = 800.0f; Matrix_MultVec3f(gCalcMatrix, &sp64, &sp58); - Math_SmoothStepToF(&player->camEye.x, player->pos.x + sp58.x, D_ctx_80177A48[2], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, player->pos.y + sp58.y, D_ctx_80177A48[2], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, player->pos.z + sp58.z, D_ctx_80177A48[2], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, player->pos.x + sp58.x, D_ctx_80177A48[2], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + sp58.y, D_ctx_80177A48[2], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, player->pos.z + sp58.z, D_ctx_80177A48[2], 500.0f, 0.0f); Matrix_Pop(&gCalcMatrix); sp64.x = 0.0f; sp64.y = 0; sp64.z = 150.0f; Matrix_MultVec3f(gCalcMatrix, &sp64, &sp58); - Math_SmoothStepToF(&player->camAt.x, player->pos.x + sp58.x, D_ctx_80177A48[3], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, player->pos.y + sp58.y, D_ctx_80177A48[3], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, player->pos.z + sp58.z, D_ctx_80177A48[3], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, player->pos.x + sp58.x, D_ctx_80177A48[3], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, player->pos.y + sp58.y, D_ctx_80177A48[3], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, player->pos.z + sp58.z, D_ctx_80177A48[3], 500.0f, 0.0f); D_ctx_80177A48[5] += D_ctx_80177A48[4]; if ((gCsFrameCount > 400) && (gCsFrameCount < 1000)) { @@ -3166,7 +3167,7 @@ void Corneria_80191160(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; D_play_800D3180[gCurrentLevel] = Play_CheckMedalStatus(150) + 1; @@ -3252,8 +3253,8 @@ void Corneria_80191160(Player* player) { } break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp64.x = 0.0f; sp64.y = 0.0f; sp64.z = player->unk_0D0 + player->unk_110; diff --git a/src/overlays/ovl_i1/fox_tr.c b/src/overlays/ovl_i1/fox_tr.c index c78f8b56..f53c398b 100644 --- a/src/overlays/ovl_i1/fox_tr.c +++ b/src/overlays/ovl_i1/fox_tr.c @@ -56,7 +56,7 @@ void Training_ItemRing_Update(ItemTrainingRing* this) { this->obj.pos.z += ((gPlayer[this->playerNum].unk_138 - this->obj.pos.z) * 0.05f); } this->obj.rot.z += 22.0f; - Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].unk_058), 0.2f, 10.0f, + Math_SmoothStepToAngle(&this->obj.rot.y, Math_RadToDeg(-gPlayer[this->playerNum].camYaw), 0.2f, 10.0f, 0.0f); if (this->timer_48 == 0) { Object_Kill(&this->obj, this->sfxSource); diff --git a/src/overlays/ovl_i1/fox_tr360.c b/src/overlays/ovl_i1/fox_tr360.c index 542cbc24..b543564b 100644 --- a/src/overlays/ovl_i1/fox_tr360.c +++ b/src/overlays/ovl_i1/fox_tr360.c @@ -147,10 +147,10 @@ void Training_80199024(Actor* actor) { actor->obj.pos.y = gGroundLevel + 40.0f; actor->vel.y = 0.0f; } - func_360_8003088C(actor); + ActorAllRange_ApplyDamage(actor); radarMark = &gRadarMarks[actor->index]; - radarMark->unk_00 = 1; - radarMark->unk_02 = actor->aiType; + radarMark->status = 1; + radarMark->type = actor->aiType; radarMark->pos.x = actor->obj.pos.x; radarMark->pos.y = actor->obj.pos.y; radarMark->pos.z = actor->obj.pos.z; @@ -184,7 +184,7 @@ void Training_8019949C(void) { var_v1 = 0; } - if (((gGameFrameCount % 4) == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if (((gGameFrameCount % 4) == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { sp44.x = 0.0f; sp44.y = 0.0f; sp44.z = -15000.0f; @@ -193,7 +193,7 @@ void Training_8019949C(void) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; actor->obj.id = OBJ_ACTOR_ALLRANGE; - Matrix_RotateY(gCalcMatrix, gGameFrameCount * 6.0f * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, gGameFrameCount * 6.0f * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); actor->obj.pos.x = sp38.x; actor->obj.pos.y = 2000.0f; diff --git a/src/overlays/ovl_i1/fox_ve1.c b/src/overlays/ovl_i1/fox_ve1.c index 99ab3f4e..f24a407a 100644 --- a/src/overlays/ovl_i1/fox_ve1.c +++ b/src/overlays/ovl_i1/fox_ve1.c @@ -345,9 +345,9 @@ void Venom1_80192518(Actor* actor) { } if ((actor->state == 1) || (actor->state == 2) || (actor->state == 3)) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); } switch (actor->state) { @@ -474,8 +474,8 @@ void Venom1_80192AA4(Actor* actor) { Vec3f dest; f32 y; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); if ((actor->obj.rot.y <= 30.0f) || (actor->obj.rot.y >= 330.0f)) { for (D_i1_80199FFC.x = -80.0f; D_i1_80199FFC.x <= 80.0f; D_i1_80199FFC.x += 40.0f) { @@ -488,8 +488,8 @@ void Venom1_80192AA4(Actor* actor) { src.x = 80.0f; } for (y = 0.0f; y <= 450.0f; y += 50.0f) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); src.y = y; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); } @@ -662,7 +662,7 @@ void Venom1_80192CD4(Actor* actor) { } void Venom1_80192E2C(Actor* actor) { - Matrix_Scale(gGfxMatrix, 1.0f, 0.5f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 0.5f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_901DA50); } @@ -679,9 +679,9 @@ void Venom1_80192EB0(Actor* actor) { s32 i; f32 var_ft4; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); switch (actor->state) { case 0: @@ -797,7 +797,7 @@ void Venom1_801933DC(Actor* actor) { } void Venom1_801934D0(Actor* actor) { - Matrix_Translate(gGfxMatrix, 0.0f, -488.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -488.0f, 0.0f, MTXF_APPLY); Animation_DrawSkeleton(0, D_VE1_900D164, actor->vwork, NULL, NULL, actor, &gIdentityMatrix); } @@ -881,11 +881,11 @@ bool Venom1_801937F4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* t override = false; for (i = 0; i < 18; i++) { if (limbIndex == D_i1_8019A748[i].limb) { - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (!(D_i1_8019B838[D_i1_8019A748[i].index].unk_7C & 1)) { if (D_i1_8019B838[D_i1_8019A748[i].index].unk_00 > 0) { @@ -1050,17 +1050,17 @@ void Venom1_80193D64(s32 limbIndex, Vec3f* rot, void* thisx) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_i1_8019A544[temp2 + var_s4].x + var_s7->unk_0C[var_s4].x, D_i1_8019A544[temp2 + var_s4].y + var_s7->unk_0C[var_s4].y, - D_i1_8019A544[temp2 + var_s4].z + var_s7->unk_0C[var_s4].z, 1); + D_i1_8019A544[temp2 + var_s4].z + var_s7->unk_0C[var_s4].z, MTXF_APPLY); Graphics_SetScaleMtx(2.0f); - Matrix_RotateY(gGfxMatrix, var_s7->unk_30[var_s4].y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, var_s7->unk_30[var_s4].x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, var_s7->unk_30[var_s4].z * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, var_s7->unk_30[var_s4].y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, var_s7->unk_30[var_s4].x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, var_s7->unk_30[var_s4].z * M_DTOR, MTXF_APPLY); if (((s32) var_s7->unk_30[var_s4].z % 2) != 0) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 96, 96, 255, 255); } - Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE1_900DF20); Matrix_Pop(&gGfxMatrix); @@ -1232,7 +1232,7 @@ void Venom1_80194398(Boss* boss) { break; } } - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); for (spF4 = 0; spF4 < ARRAY_COUNTU(D_i1_8019B838); spF4++) { if (D_i1_8019B838[spF4].unk_74 < D_i1_8019B838[spF4].unk_78) { @@ -1402,7 +1402,7 @@ void Venom1_80194398(Boss* boss) { actor->fwork[1] = 5.0f + RAND_FLOAT_CENTERED(1.0f); actor->fwork[2] = 5.0f + RAND_FLOAT_CENTERED(1.0f); } else { - Matrix_RotateY(gCalcMatrix, RAND_FLOAT(2.0f) * M_PI, 0); + Matrix_RotateY(gCalcMatrix, RAND_FLOAT(2.0f) * M_PI, MTXF_NEW); sp104.x = 15.0f + RAND_FLOAT(10.0f); sp104.z = 0.0f; sp104.y = 0.0f; @@ -1436,7 +1436,7 @@ void Venom1_80194398(Boss* boss) { actor->fwork[1] = 5.0f + RAND_FLOAT_CENTERED(1.0f); actor->fwork[2] = 5.0f + RAND_FLOAT_CENTERED(1.0f); } else { - Matrix_RotateY(gCalcMatrix, RAND_FLOAT(2.0f) * M_PI, 0); + Matrix_RotateY(gCalcMatrix, RAND_FLOAT(2.0f) * M_PI, MTXF_NEW); sp104.x = RAND_FLOAT(10.0f) + 15.0f; sp104.z = 0.0f; sp104.y = 0.0f; @@ -2322,9 +2322,9 @@ void Venom1_80198310(Boss* boss) { RCP_SetupDL(&gMasterDisp, 0x41); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_Translate(gGfxMatrix, 0.0f, -5.0f + gCameraShakeY, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 10.0f, 0.0f, 8.0f, 1); - Matrix_RotateX(gGfxMatrix, -90.0f * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -5.0f + gCameraShakeY, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 10.0f, 0.0f, 8.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -90.0f * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -2354,7 +2354,7 @@ void Venom1_80198414(void) { void Venom1_80198594(Boss* boss) { boss->obj.pos.z = gPlayer[0].pos.z; - if ((boss->timer_052 <= 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if ((boss->timer_052 <= 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Venom1_80198414(); } } @@ -2386,9 +2386,9 @@ void Venom1_8019864C(PlayerShot* playerShot) { if (count != 0) { for (j = 0; j < count; j++, hitboxData += 6) { if (hitboxData[1] > -100.0f) { - Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, MTXF_APPLY); sp88.x = playerShot->obj.pos.x - boss->obj.pos.x; sp88.y = playerShot->obj.pos.y - boss->obj.pos.y; diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c index 375a9f00..b3624136 100644 --- a/src/overlays/ovl_i2/fox_me.c +++ b/src/overlays/ovl_i2/fox_me.c @@ -68,7 +68,7 @@ void Meteo_8018756C(Actor* actor) { vec.y = actor->vel.y; vec.z = actor->vel.z; - if ((func_enmy_8006351C(actor->index, &actor->obj.pos, &vec, 0) != 0) || + if ((Object_CheckCollision(actor->index, &actor->obj.pos, &vec, 0) != 0) || (actor->obj.pos.y < (gGroundLevel + 20.0f))) { actor->obj.status = OBJ_DYING; } @@ -105,7 +105,7 @@ void Meteo_80187650(Actor* actor) { vec.x = actor->vel.x; vec.y = actor->vel.y; vec.z = actor->vel.z; - if ((func_enmy_8006351C(actor->index, &actor->obj.pos, &vec, 0) != 0) || + if ((Object_CheckCollision(actor->index, &actor->obj.pos, &vec, 0) != 0) || (actor->obj.pos.y < (gGroundLevel + 20.0f))) { func_effect_8007D2C8(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 10.0f); actor->obj.status = OBJ_DYING; @@ -121,7 +121,7 @@ void Meteo_801877C4(Actor* actor) { actor->obj.rot.z += 1.0f; - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_NEW); sp38.x = 0.0f; sp38.y = -1100.0f; @@ -412,7 +412,7 @@ void Meteo_80188344(Boss* boss) { boss->swork[0] = 0; - Matrix_RotateZ(gCalcMatrix, (boss->obj.rot.z - 45.0f) * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, (boss->obj.rot.z - 45.0f) * M_DTOR, MTXF_NEW); src.x = 0.0f; src.y = 156.0f; @@ -475,7 +475,7 @@ void Meteo_801887D0(Boss* boss) { gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 255, 0, 255); } - Matrix_RotateZ(gGfxMatrix, (M_PI / 4), 1); + Matrix_RotateZ(gGfxMatrix, (M_PI / 4), MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_60240B0); RCP_SetupDL_64(); @@ -484,16 +484,16 @@ void Meteo_801887D0(Boss* boss) { if (boss->swork[0] != 0) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, boss->swork[0]); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, M_DTOR * 90.0f * i, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 156.0f, 930.0f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * 90.0f * i, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 156.0f, 930.0f, MTXF_APPLY); if ((gGameFrameCount % 2) != 0) { - Matrix_Scale(gGfxMatrix, 6.0f, 9.0f, 5.0f, 1); + Matrix_Scale(gGfxMatrix, 6.0f, 9.0f, 5.0f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, 4.0f, 7.0f, 5.0f, 1); + Matrix_Scale(gGfxMatrix, 4.0f, 7.0f, 5.0f, MTXF_APPLY); } - Matrix_RotateZ(gGfxMatrix, 1.5707964f, 1); // (M_PI / 2) does not match + Matrix_RotateZ(gGfxMatrix, 1.5707964f, MTXF_APPLY); // (M_PI / 2) does not match Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_60263F0); Matrix_Pop(&gGfxMatrix); @@ -590,8 +590,8 @@ void Meteo_80188CAC(Effect* effect) { effect->scale2 = 1.0f; effect->unk_60.z += 20.0f; - Matrix_RotateZ(gCalcMatrix, effect->unk_60.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, effect->unk_60.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -650,8 +650,8 @@ void Meteo_80188FAC(Effect* effect) { effect->obj.rot.x = 10.0f; effect->obj.rot.z += 20.0f; - Matrix_RotateZ(gCalcMatrix, effect->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, effect->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -677,7 +677,7 @@ void Meteo_80188FAC(Effect* effect) { } void Meteo_80189114(Effect* effect) { - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { Object_Kill(&effect->obj, effect->sfxSource); } @@ -742,10 +742,10 @@ void Meteo_801892F0(Boss* boss, s32 arg1) { } if (arg1 < 4) { - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, M_DTOR * 90.0f * arg1, 1); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, M_DTOR * 90.0f * arg1, MTXF_APPLY); src.x = 0.0f; src.y = 200.0f; @@ -788,9 +788,9 @@ void Meteo_8018978C(Boss* boss) { gBossFrameCount++; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); if (gGameFrameCount & 0x10) { boss->swork[19] += 32; @@ -930,9 +930,9 @@ void Meteo_8018978C(Boss* boss) { boss->vel.x = 0.0f; boss->vel.y = 0.0f; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; gCsFrameCount = 0; } @@ -1260,7 +1260,7 @@ void Meteo_8018978C(Boss* boss) { boss->obj.rot.z = boss->obj.rot.z + ((0.0f - boss->obj.rot.z) * 0.02f); Math_SmoothStepToF(&boss->fwork[0x15], 4.0f, 1.0f, 0.1f, 0.0f); - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_6) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT) { gFillScreenRed = gFillScreenAlpha = gFillScreenGreen = gFillScreenBlue = 0; if ((boss->timer_050 == 10) || (boss->timer_050 == 30) || (boss->timer_050 == 50) || @@ -1509,15 +1509,15 @@ void Meteo_8018B7C4(s32 arg0) { RCP_SetupDL_64(); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 10.0f * effect, 10.0f * effect, 10.0f * effect, 1); + Matrix_Scale(gGfxMatrix, 10.0f * effect, 10.0f * effect, 10.0f * effect, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 70); gSPDisplayList(gMasterDisp++, D_102ED50); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 20.0f, 1); - Matrix_Scale(gGfxMatrix, 9.0f * effect, 9.0f * effect, 9.0f * effect, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 20.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 9.0f * effect, 9.0f * effect, 9.0f * effect, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 60); @@ -1525,8 +1525,8 @@ void Meteo_8018B7C4(s32 arg0) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 35.0f, 1); - Matrix_Scale(gGfxMatrix, 7.5f * effect, 7.5f * effect, 7.5f * effect, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 35.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 7.5f * effect, 7.5f * effect, 7.5f * effect, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 50); @@ -1534,8 +1534,8 @@ void Meteo_8018B7C4(s32 arg0) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 40.0f, 1); - Matrix_Scale(gGfxMatrix, 5.0f * effect, 5.0f * effect, 5.0f * effect, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 40.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 5.0f * effect, 5.0f * effect, 5.0f * effect, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 40); @@ -1560,38 +1560,38 @@ void Meteo_8018BACC(Boss* boss) { Matrix_Push(&gGfxMatrix); switch (i) { case 0: - Matrix_Translate(gGfxMatrix, 746.0f, 741.0f, 680.0f, 1); + Matrix_Translate(gGfxMatrix, 746.0f, 741.0f, 680.0f, MTXF_APPLY); break; case 1: - Matrix_Translate(gGfxMatrix, -746.0f, 741.0f, 680.0f, 1); + Matrix_Translate(gGfxMatrix, -746.0f, 741.0f, 680.0f, MTXF_APPLY); break; case 2: - Matrix_Translate(gGfxMatrix, -746.0f, -741.0f, 680.0f, 1); + Matrix_Translate(gGfxMatrix, -746.0f, -741.0f, 680.0f, MTXF_APPLY); break; case 3: - Matrix_Translate(gGfxMatrix, 746.0f, -741.0f, 680.0f, 1); + Matrix_Translate(gGfxMatrix, 746.0f, -741.0f, 680.0f, MTXF_APPLY); break; case 4: - Matrix_Translate(gGfxMatrix, 1283.0f, 0.0f, -340.0f, 1); + Matrix_Translate(gGfxMatrix, 1283.0f, 0.0f, -340.0f, MTXF_APPLY); break; case 5: - Matrix_Translate(gGfxMatrix, -1283.0f, 0.0f, -340.0f, 1); + Matrix_Translate(gGfxMatrix, -1283.0f, 0.0f, -340.0f, MTXF_APPLY); break; } if (i < 4) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 32, 32, 128); - Matrix_Scale(gGfxMatrix, var_fs1, var_fs1, var_fs1, 1); + Matrix_Scale(gGfxMatrix, var_fs1, var_fs1, var_fs1, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102ED50); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 128); - Matrix_Scale(gGfxMatrix, var_fs1 * 6.0f, var_fs1 * 6.0f, var_fs1 * 6.0f, 1); + Matrix_Scale(gGfxMatrix, var_fs1 * 6.0f, var_fs1 * 6.0f, var_fs1 * 6.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102ED50); } @@ -1610,25 +1610,25 @@ void Meteo_8018BACC(Boss* boss) { Matrix_Push(&gGfxMatrix); if (i == 4) { - Matrix_Translate(gGfxMatrix, 0.0f, 0, 300.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_PI / 4, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[21], boss->fwork[21], 1.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0, 300.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[21], boss->fwork[21], 1.0f, MTXF_APPLY); } if (i == 5) { - Matrix_Translate(gGfxMatrix, 0.0f, 330.0f, -1022.0f, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[22] * 3.2f, 2.0f * boss->fwork[22], 1.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 330.0f, -1022.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[22] * 3.2f, 2.0f * boss->fwork[22], 1.0f, MTXF_APPLY); } if (i == 6) { - Matrix_Translate(gGfxMatrix, 0.0f, -330.0f, -1022.0f, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[23] * 3.2f, 2.0f * boss->fwork[23], 1.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -330.0f, -1022.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[23] * 3.2f, 2.0f * boss->fwork[23], 1.0f, MTXF_APPLY); } if (i < 4) { - Matrix_RotateZ(gGfxMatrix, M_DTOR * 90.0f * i, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 200.0f, 500.0f, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[17 + i], boss->fwork[17 + i], 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * 90.0f * i, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 200.0f, 500.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[17 + i], boss->fwork[17 + i], 1.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); @@ -1653,23 +1653,23 @@ void Meteo_8018BACC(Boss* boss) { Matrix_Push(&gGfxMatrix); switch (i) { case 0: - Matrix_Translate(gGfxMatrix, 746.0f, 741.0f, 680.0f, 1); - Matrix_RotateZ(gGfxMatrix, -M_PI / 4, 1); + Matrix_Translate(gGfxMatrix, 746.0f, 741.0f, 680.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -M_PI / 4, MTXF_APPLY); break; case 1: - Matrix_Translate(gGfxMatrix, -746.0f, 741.0f, 680.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_PI / 4, 1); + Matrix_Translate(gGfxMatrix, -746.0f, 741.0f, 680.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); break; case 2: - Matrix_Translate(gGfxMatrix, -746.0f, -741.0f, 680.0f, 1); - Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 4, 1); + Matrix_Translate(gGfxMatrix, -746.0f, -741.0f, 680.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 4, MTXF_APPLY); break; case 3: - Matrix_Translate(gGfxMatrix, 746.0f, -741.0f, 680.0f, 1); - Matrix_RotateZ(gGfxMatrix, -3 * M_PI / 4, 1); + Matrix_Translate(gGfxMatrix, 746.0f, -741.0f, 680.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -3 * M_PI / 4, MTXF_APPLY); break; } @@ -1677,21 +1677,21 @@ void Meteo_8018BACC(Boss* boss) { Matrix_Push(&gGfxMatrix); if ((gGameFrameCount % 2) != 0) { - Matrix_Scale(gGfxMatrix, var_fs1 * 2.5f, var_fs1 * 2.5f, var_fs1 * 2.5f, 1); + Matrix_Scale(gGfxMatrix, var_fs1 * 2.5f, var_fs1 * 2.5f, var_fs1 * 2.5f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, var_fs1 * 3.0f, var_fs1 * 3.0f, var_fs1 * 3.0f, 1); + Matrix_Scale(gGfxMatrix, var_fs1 * 3.0f, var_fs1 * 3.0f, var_fs1 * 3.0f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102ED50); Matrix_Pop(&gGfxMatrix); - Matrix_RotateX(gGfxMatrix, -M_PI / 6, 1); + Matrix_RotateX(gGfxMatrix, -M_PI / 6, MTXF_APPLY); if ((gGameFrameCount % 2) != 0) { - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); } - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f * var_fs1, 2.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, -20.0f, 0.0f, 1); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f * var_fs1, 2.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, -20.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102F5E0); Matrix_Pop(&gGfxMatrix); @@ -1702,11 +1702,11 @@ void Meteo_8018BACC(Boss* boss) { var_fs1 = boss->fwork[11] - 15.0f; gDPSetPrimColor(gMasterDisp++, 0, 0, 160, 255, 160, 255); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 1300.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 1300.0f, MTXF_APPLY); if ((gGameFrameCount % 2) != 0) { - Matrix_Scale(gGfxMatrix, var_fs1 * 0.8f, var_fs1 * 0.8f, var_fs1 * 0.8f, 1); + Matrix_Scale(gGfxMatrix, var_fs1 * 0.8f, var_fs1 * 0.8f, var_fs1 * 0.8f, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, var_fs1, var_fs1, var_fs1, 1); + Matrix_Scale(gGfxMatrix, var_fs1, var_fs1, var_fs1, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102ED50); @@ -1726,24 +1726,24 @@ void Meteo_8018BACC(Boss* boss) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, D_i2_80195554[i]); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 700.0f, 0.0f, -(1235.0f - ((var_fs0 - 1.0f) * 89.2f)), 1); + Matrix_Translate(gGfxMatrix, 700.0f, 0.0f, -(1235.0f - ((var_fs0 - 1.0f) * 89.2f)), MTXF_APPLY); if ((gGameFrameCount % 2) != 0) { - Matrix_Scale(gGfxMatrix, var_fs0, var_fs0, var_fs0, 1); + Matrix_Scale(gGfxMatrix, var_fs0, var_fs0, var_fs0, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, var_fs0 * 1.1f, var_fs0 * 1.1f, var_fs0 * 1.1f, 1); + Matrix_Scale(gGfxMatrix, var_fs0 * 1.1f, var_fs0 * 1.1f, var_fs0 * 1.1f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ME_6023810); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -700.0f, 0.0f, -(1235.0f - ((var_fs0 - 1.0f) * 89.2f)), 1); + Matrix_Translate(gGfxMatrix, -700.0f, 0.0f, -(1235.0f - ((var_fs0 - 1.0f) * 89.2f)), MTXF_APPLY); if ((gGameFrameCount % 2) != 0) { - Matrix_Scale(gGfxMatrix, var_fs0, var_fs0, var_fs0, 1); + Matrix_Scale(gGfxMatrix, var_fs0, var_fs0, var_fs0, MTXF_APPLY); } else { - Matrix_Scale(gGfxMatrix, var_fs0 * 1.1f, var_fs0 * 1.1f, var_fs0 * 1.1f, 1); + Matrix_Scale(gGfxMatrix, var_fs0 * 1.1f, var_fs0 * 1.1f, var_fs0 * 1.1f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); @@ -1755,7 +1755,7 @@ void Meteo_8018BACC(Boss* boss) { if (boss->swork[0] > 0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 650.0f, 600.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 650.0f, 600.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Meteo_8018B7C4(boss->swork[0] - 1); Matrix_Pop(&gGfxMatrix); @@ -1763,7 +1763,7 @@ void Meteo_8018BACC(Boss* boss) { if (boss->swork[1] > 0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -650.0f, 600.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -650.0f, 600.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Meteo_8018B7C4(boss->swork[1] - 1); Matrix_Pop(&gGfxMatrix); @@ -1922,13 +1922,13 @@ void Meteo_8018CD8C(Player* player) { D_ctx_80177A48[2] = -13000.0f; D_ctx_80177A48[4] = -22000.0f; - player->camEye.x = gCsCamEyeX = player->pos.x + 100.0f; - player->camEye.y = gCsCamEyeY = player->pos.y; - player->camEye.z = gCsCamEyeZ = D_ctx_80177A48[1] + player->unk_138; + player->cam.eye.x = gCsCamEyeX = player->pos.x + 100.0f; + player->cam.eye.y = gCsCamEyeY = player->pos.y; + player->cam.eye.z = gCsCamEyeZ = D_ctx_80177A48[1] + player->unk_138; - player->camAt.x = gCsCamAtX = D_ctx_80177A48[2] + player->pos.x; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = D_ctx_80177A48[4] + player->unk_138; + player->cam.at.x = gCsCamAtX = D_ctx_80177A48[2] + player->pos.x; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = D_ctx_80177A48[4] + player->unk_138; player->unk_1D0 = 1; @@ -2013,7 +2013,7 @@ void Meteo_8018CD8C(Player* player) { } if (gCsFrameCount > 660) { - player->wings.unk_2C = 0; + player->wings.modelId = 0; } if (gCsFrameCount == 340) { @@ -2034,8 +2034,8 @@ void Meteo_8018CD8C(Player* player) { x = sqrtf((x * x) + (z * z)); sp68 = Math_RadToDeg(-Math_Atan2F(y, x)); - Matrix_RotateY(gCalcMatrix, M_DTOR * sp64, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * sp68, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * sp64, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * sp68, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); func_enmy2_8006EFA0(100, actor3->obj.pos.x + (D_ctx_80177A48[3] * 74.0f) + (sp4C.x * 0.6f), @@ -2066,22 +2066,22 @@ void Meteo_8018CD8C(Player* player) { if (player->timer_1F8 == 0) { AUDIO_PLAY_BGM(gBgmSeqId); gLevelStatusScreenTimer = 80; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = 0; player->timer_1F8 = 0; player->timer_1FC = 0; - player->camEye.x = player->pos.x; - player->camEye.y = (player->pos.y * player->unk_148) + 50.0f; - player->camEye.z = 400.0f; - player->camAt.x = player->pos.x; - player->camAt.y = (player->pos.y * player->unk_148) + 20.0f; - player->camAt.z = player->unk_138; + player->cam.eye.x = player->pos.x; + player->cam.eye.y = (player->pos.y * player->unk_148) + 50.0f; + player->cam.eye.z = 400.0f; + player->cam.at.x = player->pos.x; + player->cam.at.y = (player->pos.y * player->unk_148) + 20.0f; + player->cam.at.z = player->unk_138; for (i = 0; i < 4; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; break; } } @@ -2104,12 +2104,12 @@ void Meteo_8018CD8C(Player* player) { break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0.0f); } void Meteo_8018D9EC(Actor* actor) { @@ -2142,9 +2142,9 @@ void Meteo_8018DB6C(Actor* actor) { void Meteo_8018DBEC(Effect* effect) { if (effect->state == 1) { - Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); - Matrix_RotateZ(gGfxMatrix, M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); gSPDisplayList(gMasterDisp++, D_ME_60263F0); @@ -2153,14 +2153,14 @@ void Meteo_8018DBEC(Effect* effect) { void Meteo_8018DCE4(Effect* effect) { if (effect->state != 0) { - Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2 * 3.0f, 1); + Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2 * 3.0f, MTXF_APPLY); if ((gGameFrameCount % 2) != 0) { - Matrix_RotateZ(gGfxMatrix, M_PI, 1); + Matrix_RotateZ(gGfxMatrix, M_PI, MTXF_APPLY); } - Matrix_RotateX(gGfxMatrix, -M_PI / 2, 1); + Matrix_RotateX(gGfxMatrix, -M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 160, 255, 160, effect->unk_44); gSPDisplayList(gMasterDisp++, D_102F5E0); @@ -2168,8 +2168,8 @@ void Meteo_8018DCE4(Effect* effect) { } void Meteo_8018DE14(Effect* effect) { - Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_RotateX(gGfxMatrix, effect->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); @@ -2217,7 +2217,7 @@ void Meteo_8018E084(Player* player) { Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->unk_110, 0.0f, 0.1f, 3.0f, 0.0f); @@ -2230,12 +2230,12 @@ void Meteo_8018E084(Player* player) { D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 0.0f; - player->wings.unk_2C = 1; + player->wings.modelId = 1; gCsFrameCount = 0; case 1: - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); src.x = 0.0f; src.y = 0.0f; src.z = D_ctx_80177A48[2] + 2000.0f; @@ -2300,8 +2300,8 @@ void Meteo_8018E084(Player* player) { Math_SmoothStepToF(D_ctx_80177A48, 0.1f, 0.1f, 0.002f, 0.0f); - Matrix_RotateX(gCalcMatrix, D_ctx_80177A48[4] * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, D_ctx_80177A48[4] * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -2327,7 +2327,7 @@ void Meteo_8018E084(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; D_play_800D3180[LEVEL_METEO] = Play_CheckMedalStatus(0xC8) + 1; @@ -2437,21 +2437,21 @@ void Meteo_8018E084(Player* player) { case 1400: gActors[3].state = 1; - gActors[3].obj.pos.x = player->camEye.x - 700.0f; - gActors[3].obj.pos.y = player->camEye.y; - gActors[3].obj.pos.z = player->camEye.z - D_ctx_80177D20 + 1000.0f; + gActors[3].obj.pos.x = player->cam.eye.x - 700.0f; + gActors[3].obj.pos.y = player->cam.eye.y; + gActors[3].obj.pos.z = player->cam.eye.z - D_ctx_80177D20 + 1000.0f; break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; diff --git a/src/overlays/ovl_i2/fox_sx.c b/src/overlays/ovl_i2/fox_sx.c index 37dafd80..d3904498 100644 --- a/src/overlays/ovl_i2/fox_sx.c +++ b/src/overlays/ovl_i2/fox_sx.c @@ -26,9 +26,9 @@ void SectorX_8018F030(void) { actor->obj.id = OBJ_ACTOR_SLIPPY_SX; actor->unk_0B6 = 1; actor->obj.rot.y = 180.0f; - actor->obj.pos.x = gPlayer[0].camEye.x - 300.0f; - actor->obj.pos.y = gPlayer[0].camEye.y + 200.0f; - actor->obj.pos.z = gPlayer[0].camEye.z - D_ctx_80177D20 + 300.0f; + actor->obj.pos.x = gPlayer[0].cam.eye.x - 300.0f; + actor->obj.pos.y = gPlayer[0].cam.eye.y + 200.0f; + actor->obj.pos.z = gPlayer[0].cam.eye.z - D_ctx_80177D20 + 300.0f; actor->iwork[11] = 1; actor->aiType = AI360_SLIPPY; Object_SetInfo(&actor->info, actor->obj.id); @@ -45,8 +45,8 @@ void SectorX_8018F124(void) { actor->obj.status = OBJ_INIT; actor->obj.id = OBJ_ACTOR_SLIPPY_SX; actor->unk_0B6 = -1; - actor->obj.pos.x = gPlayer[0].camEye.x + 3000.0f; - actor->obj.pos.y = gPlayer[0].camEye.y - 3000.0f; + actor->obj.pos.x = gPlayer[0].cam.eye.x + 3000.0f; + actor->obj.pos.y = gPlayer[0].cam.eye.y - 3000.0f; actor->obj.pos.z = gPlayer[0].pos.z + 30000.0f; Object_SetInfo(&actor->info, actor->obj.id); actor->info.unk_10 = 100000.0f; @@ -59,8 +59,8 @@ void SectorX_8018F1DC(Actor* actor) { src.x = 0.0f; src.y = 0.0f; src.z = 100.0f; - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); func_enmy2_8006EEFC(actor->index, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->unk_0F4.x, @@ -102,7 +102,7 @@ void SectorX_8018F330(Actor* actor) { func_effect_8007A6F0(&actor->obj.pos, 0x2903A008); gBosses[0].swork[6] = 0; gTeamShields[TEAM_ID_SLIPPY] = -2; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; actor->timer_0BC = 200; actor->iwork[14] = 3; actor->fwork[0] = 0.0f; @@ -126,13 +126,13 @@ void SectorX_8018F330(Actor* actor) { Math_SmoothStepToF(&actor->fwork[0], 0.5f, 1.0f, 0.01f, 0); Math_SmoothStepToF(&actor->fwork[1], 0.1f, 1.0f, 0.01f, 0); - Math_SmoothStepToF(&gPlayer[0].camAt.x, actor->obj.pos.x, actor->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camAt.y, actor->obj.pos.y, actor->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camAt.z, actor->obj.pos.z + D_ctx_80177D20, actor->fwork[0], 100.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.x, actor->obj.pos.x - 30.0f, actor->fwork[1], 20.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.y, actor->obj.pos.y, actor->fwork[1], 20.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.x, actor->obj.pos.x, actor->fwork[0], 100.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.y, actor->obj.pos.y, actor->fwork[0], 100.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.z, actor->obj.pos.z + D_ctx_80177D20, actor->fwork[0], 100.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.x, actor->obj.pos.x - 30.0f, actor->fwork[1], 20.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.y, actor->obj.pos.y, actor->fwork[1], 20.0f, 0.0f); if (actor->timer_0BC == 0) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_3; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ACTIVE; if (gPlayer[0].cockpitView != 0) { func_play_800B5D30(&gPlayer[0], 1); } @@ -164,11 +164,11 @@ void SectorX_8018F884(Actor* actor) { break; case -1: - actor->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].unk_058); - actor->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].unk_05C); + actor->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); + actor->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].camPitch); RCP_SetupDL(&gMasterDisp, 0x40); gDPSetPrimColor(gMasterDisp++, 0, 0, 220, 70, 30, 255); - Matrix_Scale(gGfxMatrix, 70.0f, 70.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 70.0f, 70.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SX_60010C0); @@ -200,8 +200,8 @@ void SectorX_8018FA04(f32 x, f32 y, f32 z) { xRot = Math_Atan2F(gPlayer[0].pos.x - x, gPlayer[0].unk_138 - z); pad = sqrtf(SQ(gPlayer[0].pos.x - x) + SQ(gPlayer[0].unk_138 - z)); yRot = -Math_Atan2F(gPlayer[0].pos.y - y, pad); - Matrix_RotateY(gCalcMatrix, xRot, 0); - Matrix_RotateX(gCalcMatrix, yRot, 1); + Matrix_RotateY(gCalcMatrix, xRot, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, yRot, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = 60.0f; @@ -227,15 +227,15 @@ void SectorX_8018FBBC(Vec3f* pos) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(pos->x - actor->obj.pos.x) < 2500.0f) && (fabsf(pos->z - actor->obj.pos.z) < 2500.0f) && (actor->state != 1000) && (actor->timer_0C2 == 0) && (actor->scale < 0.0f) && - func_enmy_80062DBC(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x, actor->vwork[29].y, - actor->vwork[29].z + actor->unk_0F4.z)) { + Object_CheckHitboxCollision(pos, actor->info.hitbox, &actor->obj, actor->vwork[29].x, actor->vwork[29].y, + actor->vwork[29].z + actor->unk_0F4.z)) { func_play_800A6028(actor->sfxSource, 0x09000004); actor->state = 1000; xRot = Math_Atan2F(actor->obj.pos.x - pos->x, actor->obj.pos.z - pos->z); yRot = -Math_Atan2F(actor->obj.pos.y - pos->y, sqrtf(SQ(actor->obj.pos.x - pos->x) + SQ(actor->obj.pos.z - pos->z))); - Matrix_RotateY(gCalcMatrix, xRot, 0); - Matrix_RotateX(gCalcMatrix, yRot, 1); + Matrix_RotateY(gCalcMatrix, xRot, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, yRot, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = 20.0f; @@ -486,7 +486,7 @@ void SectorX_80190078(Boss* boss) { } } - if (((boss->state != 8) && (boss->state != 20)) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_3)) { + if (((boss->state != 8) && (boss->state != 20)) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_ACTIVE)) { boss->state = 8; boss->fwork[0] = 0.0f; Audio_KillSfxBySourceAndId(D_i2_80195D88, 0x31032061); @@ -885,7 +885,7 @@ void SectorX_80190078(Boss* boss) { boss->unk_04C++; if (boss->unk_04C >= Animation_GetFrameCount(&D_SX_60123BC)) { boss->unk_04C = Animation_GetFrameCount(&D_SX_60123BC) - 1; - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_0) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY) { boss->unk_04C = 0; boss->state = 10; boss->fwork[0] = 0.0f; @@ -1070,8 +1070,8 @@ void SectorX_80190078(Boss* boss) { } if (boss->timer_050 == 120) { - if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_6) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_4)) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_NEXT) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_DOWN)) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; gPlayer[0].unk_234 = 1; } @@ -1174,17 +1174,17 @@ bool SectorX_80192AF0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* *dList = NULL; } - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); if (*dList != NULL) { Matrix_Push(&gGfxMatrix); Matrix_Push(&gCalcMatrix); Matrix_MultVec3f(gCalcMatrix, &sp64, &sp58); func_edisplay_8005F670(&sp58); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); if (boss->swork[4] == 0) { @@ -1195,21 +1195,21 @@ bool SectorX_80192AF0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_i2_80195644.x, D_i2_80195644.y, D_i2_80195644.z, (u8) 1); - Matrix_RotateZ(gGfxMatrix, D_i2_80195650.z * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, D_i2_80195650.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_i2_80195650.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, 2.0f * gGameFrameCount * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[45], boss->fwork[45], boss->fwork[45], 1); + Matrix_Translate(gGfxMatrix, D_i2_80195644.x, D_i2_80195644.y, D_i2_80195644.z, (u8) MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_i2_80195650.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_i2_80195650.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_i2_80195650.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, 2.0f * gGameFrameCount * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[45], boss->fwork[45], boss->fwork[45], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SX_6009C30); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_i2_8019565C.x, D_i2_8019565C.y, D_i2_8019565C.z, (u8) 1); - Matrix_RotateZ(gGfxMatrix, D_i2_80195668.z * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, D_i2_80195668.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_i2_80195668.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, 2.0f * -gGameFrameCount * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[45], boss->fwork[45], boss->fwork[45], 1); + Matrix_Translate(gGfxMatrix, D_i2_8019565C.x, D_i2_8019565C.y, D_i2_8019565C.z, (u8) MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_i2_80195668.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_i2_80195668.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_i2_80195668.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, 2.0f * -gGameFrameCount * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[45], boss->fwork[45], boss->fwork[45], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SX_6009C30); } @@ -1357,8 +1357,8 @@ void SectorX_80193434(Boss* boss) { fwork *= 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[35], boss->fwork[36], boss->fwork[37], 1); - Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, 1); + Matrix_Translate(gGfxMatrix, boss->fwork[35], boss->fwork[36], boss->fwork[37], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102ED50); Matrix_Pop(&gGfxMatrix); @@ -1373,8 +1373,8 @@ void SectorX_80193434(Boss* boss) { fwork *= 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[38], boss->fwork[39], boss->fwork[40], 1); - Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, 1); + Matrix_Translate(gGfxMatrix, boss->fwork[38], boss->fwork[39], boss->fwork[40], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102ED50); Matrix_Pop(&gGfxMatrix); @@ -1393,14 +1393,14 @@ void SectorX_80193434(Boss* boss) { fwork *= 1.2f; } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[20], boss->fwork[21], boss->fwork[22], 1); - Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, 1); + Matrix_Translate(gGfxMatrix, boss->fwork[20], boss->fwork[21], boss->fwork[22], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SX_600F8A0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[23], boss->fwork[24], boss->fwork[25], 1); - Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, 1); + Matrix_Translate(gGfxMatrix, boss->fwork[23], boss->fwork[24], boss->fwork[25], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, fwork, fwork, fwork, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_SX_600F8A0); Matrix_Pop(&gGfxMatrix); @@ -1429,9 +1429,9 @@ void SectorX_801938D8(Actor* actor, s32 arg1) { Actor_Initialize(actor); actor->obj.status = OBJ_ACTIVE; actor->obj.id = OBJ_ACTOR_195; - actor->obj.pos.x = gPlayer[0].camEye.x + D_i2_801956EC[arg1].x; - actor->obj.pos.y = gPlayer[0].camEye.y + D_i2_801956EC[arg1].y; - actor->obj.pos.z = gPlayer[0].camEye.z + D_i2_801956EC[arg1].z; + actor->obj.pos.x = gPlayer[0].cam.eye.x + D_i2_801956EC[arg1].x; + actor->obj.pos.y = gPlayer[0].cam.eye.y + D_i2_801956EC[arg1].y; + actor->obj.pos.z = gPlayer[0].cam.eye.z + D_i2_801956EC[arg1].z; actor->state = 1; actor->iwork[11] = 1; actor->vel.z = -30.0f; @@ -1463,13 +1463,13 @@ void SectorX_80193A30(Player* player) { SectorX_80193800(&gActors[5 + i], i); } player->unk_1D0 = 1; - player->camEye.x = gCsCamEyeX = 100.0f; - player->camEye.y = gCsCamEyeY = 0.0f; - player->camEye.z = gCsCamEyeZ = -200.0f; - player->camAt.x = gCsCamAtX = 0.0f; - player->camAt.y = gCsCamAtY = 0.0f; - player->camAt.z = gCsCamAtZ = -1000.0f; - player->unk_034 = -5.0f; + player->cam.eye.x = gCsCamEyeX = 100.0f; + player->cam.eye.y = gCsCamEyeY = 0.0f; + player->cam.eye.z = gCsCamEyeZ = -200.0f; + player->cam.at.x = gCsCamAtX = 0.0f; + player->cam.at.y = gCsCamAtY = 0.0f; + player->cam.at.z = gCsCamAtZ = -1000.0f; + player->camRoll = -5.0f; player->unk_0D0 = 0.0f; gFillScreenAlpha = 255; /* fallthrough */ @@ -1480,19 +1480,19 @@ void SectorX_80193A30(Player* player) { D_ctx_80177A48[0] = 0.5f; gCsCamAtX = gActors[5].obj.pos.x; gCsCamAtZ = gActors[5].obj.pos.z; - player->unk_034 -= 0.1f; + player->camRoll -= 0.1f; if (gCsFrameCount == 140) { x = gActors[5].obj.pos.x; - y = gActors[5].obj.pos.y - (player->camEye.y + 50.0f); - z = gActors[5].obj.pos.z - (player->camEye.z + 20.0f); + y = gActors[5].obj.pos.y - (player->cam.eye.y + 50.0f); + z = gActors[5].obj.pos.z - (player->cam.eye.z + 20.0f); xzDeg = Math_RadToDeg(Math_Atan2F(x, z)); xyzDeg = Math_RadToDeg(-Math_Atan2F(y, sqrtf(SQ(x) + SQ(z)))); - Matrix_RotateY(gCalcMatrix, M_DTOR * xzDeg, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * xyzDeg, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * xzDeg, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * xyzDeg, MTXF_APPLY); src.y = src.x = 0.0f; src.z = 100.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); - func_enmy2_8006EEFC(100, 0.0f, player->camEye.y + 50.0f, player->camEye.z + 20.0f, dest.x, dest.y, + func_enmy2_8006EEFC(100, 0.0f, player->cam.eye.y + 50.0f, player->cam.eye.z + 20.0f, dest.x, dest.y, dest.z, xyzDeg, xzDeg, 0.0f); } if (gCsFrameCount == 143) { @@ -1514,9 +1514,9 @@ void SectorX_80193A30(Player* player) { case 2: if (gCsFrameCount == 170) { player->pos.x = 0.0f; - player->pos.y = player->camEye.y + 50.0f; + player->pos.y = player->cam.eye.y + 50.0f; player->unk_1D0 += 1; - player->pos.z = player->camEye.z + 20.0f; + player->pos.z = player->cam.eye.z + 20.0f; player->unk_194 = 10.0f; player->unk_190 = 10.0f; player->unk_0D0 = 30.0f; @@ -1538,7 +1538,7 @@ void SectorX_80193A30(Player* player) { Math_SmoothStepToF(D_ctx_80177A48, 0.1f, 1.0f, 0.01f, 0); } - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.5f, 0.07f, 0); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.5f, 0.07f, 0); Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.2f, 2.0f, 0); Math_SmoothStepToF(&player->unk_0E4, 20.0f, 0.1f, 1.0f, 0); @@ -1567,9 +1567,9 @@ void SectorX_80193A30(Player* player) { gActors[0].obj.pos.z -= player->pos.z; gActors[1].obj.pos.z -= player->pos.z; gActors[2].obj.pos.z -= player->pos.z; - player->camEye.z -= player->pos.z; + player->cam.eye.z -= player->pos.z; gCsCamEyeZ -= player->pos.z; - player->camAt.z -= player->pos.z; + player->cam.at.z -= player->pos.z; gCsCamAtZ -= player->pos.z; player->pos.z = 0.0f; player->unk_0D0 = 0.0f; @@ -1577,7 +1577,7 @@ void SectorX_80193A30(Player* player) { break; case 4: - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.2f, 0.5f, 0); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.2f, 0.5f, 0); Math_SmoothStepToF(&player->pos.y, 350.0f, 0.1f, 15.0f, 0); Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 2.0f, 0); gCsCamEyeX = player->pos.x; @@ -1592,28 +1592,28 @@ void SectorX_80193A30(Player* player) { player->unk_0D0 = D_play_80161A54; AUDIO_PLAY_BGM(gBgmSeqId); gLevelStatusScreenTimer = 80; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = player->timer_1F8 = player->timer_1FC = 0; - player->camEye.y = player->pos.y * player->unk_148 + 50.0f; - player->camEye.z = 400.0f; - player->camAt.y = player->pos.y * player->unk_148 + 20.0f; - player->camAt.z = player->unk_138; - player->camAt.x = player->camEye.x = player->pos.x; - D_ctx_80178488 = 1; + player->cam.eye.y = player->pos.y * player->unk_148 + 50.0f; + player->cam.eye.z = 400.0f; + player->cam.at.y = player->pos.y * player->unk_148 + 20.0f; + player->cam.at.z = player->unk_138; + player->cam.at.x = player->cam.eye.x = player->pos.x; + gLoadLevelObjects = 1; for (i = 0; i < 3; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } } break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = player->unk_0D0; @@ -1634,7 +1634,7 @@ void SectorX_801944D4(Actor* actor, s32 arg1) { Vec3f destB; Player* player = &gPlayer[0]; - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_NEW); srcA.x = D_i2_80195710[arg1]; srcA.y = D_i2_80195720[arg1]; srcA.z = D_i2_80195730[arg1]; @@ -1684,7 +1684,7 @@ void SectorX_80194728(Player* player) { Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->unk_0EC, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&player->unk_08C, 0.0f, 0.1f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&player->unk_110, 0.0f, 0.1f, 3.0f, 0.0f); @@ -1703,7 +1703,7 @@ void SectorX_80194728(Player* player) { D_ctx_80177A48[2] = 100.0f; D_ctx_80177A48[4] = 100.0f; D_ctx_80177A48[5] = 0.0f; - player->wings.unk_2C = 1; + player->wings.modelId = 1; func_play_800A6148(); case 1: @@ -1718,26 +1718,26 @@ void SectorX_80194728(Player* player) { Math_SmoothStepToF(&player->unk_0D0, 0.0f, 0.1f, 2.0f, 0.0f); Math_SmoothStepToF(D_ctx_80177A48, 0.1f, 1.0f, 0.002f, 0.0f); Math_SmoothStepToF(D_ctx_80177A48 + 1, 0.1f, 1.0f, 0.002f, 0.0f); - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); Matrix_Push(&gCalcMatrix); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, MTXF_APPLY); sp54.x = 0.0f; sp54.y = 30.0f; sp54.z = D_ctx_80177A48[4]; Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); - Math_SmoothStepToF(&player->camEye.x, player->pos.x + sp48.x, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, player->pos.y + sp48.y, D_ctx_80177A48[0], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, player->unk_138 + D_ctx_80177D20 + sp48.z, D_ctx_80177A48[0], 500.0f, + Math_SmoothStepToF(&player->cam.eye.x, player->pos.x + sp48.x, D_ctx_80177A48[0], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + sp48.y, D_ctx_80177A48[0], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, player->unk_138 + D_ctx_80177D20 + sp48.z, D_ctx_80177A48[0], 500.0f, 0.0f); Matrix_Pop(&gCalcMatrix); sp54.x = 0.0f; sp54.y = 0; sp54.z = D_ctx_80177A48[5]; Matrix_MultVec3f(gCalcMatrix, &sp54, &sp48); - Math_SmoothStepToF(&player->camAt.x, player->pos.x + sp48.x, D_ctx_80177A48[1], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, player->pos.y + sp48.y, D_ctx_80177A48[1], 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, player->unk_138 + D_ctx_80177D20 + sp48.z, D_ctx_80177A48[1], 500.0f, + Math_SmoothStepToF(&player->cam.at.x, player->pos.x + sp48.x, D_ctx_80177A48[1], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, player->pos.y + sp48.y, D_ctx_80177A48[1], 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, player->unk_138 + D_ctx_80177D20 + sp48.z, D_ctx_80177A48[1], 500.0f, 0.0f); break; case 2: @@ -1754,7 +1754,7 @@ void SectorX_80194728(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaTarget = 255; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; D_ctx_8017837C = 4; player->timer_1F8 = 0; func_play_800A6148(); @@ -1924,8 +1924,8 @@ void SectorX_80194728(Player* player) { break; } } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp54.x = 0.0f; sp54.y = 0.0f; sp54.z = player->unk_0D0 + player->unk_110; diff --git a/src/overlays/ovl_i3/fox_a6.c b/src/overlays/ovl_i3/fox_a6.c index 8a040fff..552dae57 100644 --- a/src/overlays/ovl_i3/fox_a6.c +++ b/src/overlays/ovl_i3/fox_a6.c @@ -551,17 +551,17 @@ void Area6_80187944(Boss* bossA6) { gBossFrameCount++; if ((bossA6->state < 6) || ((bossA6->state >= 8) && (bossA6->state < 12))) { - bossA6->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].camEye.x - bossA6->obj.pos.x, - gPlayer[0].camEye.z - (bossA6->obj.pos.z + D_ctx_80177D20))); + bossA6->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - bossA6->obj.pos.x, + gPlayer[0].cam.eye.z - (bossA6->obj.pos.z + D_ctx_80177D20))); bossA6->obj.rot.x = - RAD_TO_DEG(-Math_Atan2F(gPlayer[0].camEye.y - bossA6->obj.pos.y, - sqrtf(SQ(gPlayer[0].camEye.z - (bossA6->obj.pos.z + D_ctx_80177D20)) + - SQ(gPlayer[0].camEye.x - bossA6->obj.pos.x)))); + RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - bossA6->obj.pos.y, + sqrtf(SQ(gPlayer[0].cam.eye.z - (bossA6->obj.pos.z + D_ctx_80177D20)) + + SQ(gPlayer[0].cam.eye.x - bossA6->obj.pos.x)))); } - Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * M_DTOR, MTXF_APPLY); if ((bossA6->dmgType != DMG_NONE) && (bossA6->health > 0)) { bossA6->dmgType = DMG_NONE; @@ -669,18 +669,18 @@ void Area6_80187944(Boss* bossA6) { Math_SmoothStepToAngle(&bossA6->obj.rot.z, bossA6->fwork[A6_FWK_8], 0.05f, bossA6->fwork[A6_FWK_9], 0.00001f); if (bossA6->swork[A6_SWK_25] >= 2) { if (!(gGameFrameCount % 64U) && (Rand_ZeroOne() < 0.5f)) { - bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(500.0f) + gPlayer[0].camEye.x; + bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(500.0f) + gPlayer[0].cam.eye.x; } if (!(gGameFrameCount % 64U) && (Rand_ZeroOne() < 0.5f)) { - bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(500.0f) + gPlayer[0].camEye.y; + bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(500.0f) + gPlayer[0].cam.eye.y; } } else { if (!(gGameFrameCount % 32U) && (Rand_ZeroOne() < 0.7f)) { - bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].camEye.x; + bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.x; bossA6->fwork[A6_FWK_30] = 0.0f; } if (!(gGameFrameCount % 32U) && (Rand_ZeroOne() < 0.7f)) { - bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].camEye.y; + bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.y; bossA6->fwork[A6_FWK_31] = 0.0f; } } @@ -688,7 +688,7 @@ void Area6_80187944(Boss* bossA6) { if (bossA6->state != 0) { Math_SmoothStepToF(&bossA6->fwork[A6_FWK_4], bossA6->fwork[A6_FWK_5], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossA6->obj.pos.z, gPlayer[0].camEye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3], 0.1f, + Math_SmoothStepToF(&bossA6->obj.pos.z, gPlayer[0].cam.eye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3], 0.1f, bossA6->fwork[A6_FWK_4], 0.00001f); if (bossA6->state < 5) { sp120 = 2.0f; @@ -783,9 +783,9 @@ void Area6_80187944(Boss* bossA6) { sp104 = 10.0f; if ((bossA6->timer_050 != 0) && (bossA6->timer_050 < 200)) { - dx_11C = gPlayer[0].camEye.x - bossA6->obj.pos.x; - dy_118 = gPlayer[0].camEye.y - bossA6->obj.pos.y; - dz_114 = gPlayer[0].camEye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3] - bossA6->obj.pos.z; + dx_11C = gPlayer[0].cam.eye.x - bossA6->obj.pos.x; + dy_118 = gPlayer[0].cam.eye.y - bossA6->obj.pos.y; + dz_114 = gPlayer[0].cam.eye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3] - bossA6->obj.pos.z; sp104 = 100.0f; } @@ -797,8 +797,8 @@ void Area6_80187944(Boss* bossA6) { Math_SmoothStepToAngle(&bossA6->unk_078.y, yaw_10C, 1.0f, sp104, 0.00001f); Math_SmoothStepToAngle(&bossA6->unk_078.x, pitch_110, 1.0f, sp104, 0.00001f); - Matrix_RotateY(gCalcMatrix, bossA6->unk_078.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, bossA6->unk_078.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, bossA6->unk_078.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, bossA6->unk_078.x * M_DTOR, MTXF_APPLY); sp98.x = sp98.y = 0.0f; sp98.z = 30.0f; @@ -823,9 +823,9 @@ void Area6_80187944(Boss* bossA6) { Audio_KillSfxBySource(bossA6->sfxSource); AUDIO_PLAY_SFX(0x19004051, bossA6->sfxSource, 4); bossA6->timer_050 = 20; - bossA6->obj.pos.z = gPlayer[0].camEye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3]; - bossA6->fwork[A6_FWK_6] = bossA6->obj.pos.x = gPlayer[0].camEye.x; - bossA6->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].camEye.y; + bossA6->obj.pos.z = gPlayer[0].cam.eye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3]; + bossA6->fwork[A6_FWK_6] = bossA6->obj.pos.x = gPlayer[0].cam.eye.x; + bossA6->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].cam.eye.y; bossA6->state = 2; bossA6->vel.x = 0.0f; bossA6->vel.y = 0.0f; @@ -852,8 +852,8 @@ void Area6_80187944(Boss* bossA6) { Math_SmoothStepToF(&bossA6->fwork[A6_FWK_35], 1.2f, 0.1f, 0.1f, 0.0f); if (D_i3_801C22F0.unk_24 < 1.0f) { - bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].camEye.x; - bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].camEye.y; + bossA6->fwork[A6_FWK_6] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.x; + bossA6->fwork[A6_FWK_7] = RAND_FLOAT_CENTERED(1000.0f) + gPlayer[0].cam.eye.y; bossA6->fwork[A6_FWK_3] = -3700.0f + RAND_FLOAT_CENTERED(3000.0f); bossA6->fwork[A6_FWK_34] = 2.0f; bossA6->fwork[A6_FWK_35] = 1.2f; @@ -871,9 +871,9 @@ void Area6_80187944(Boss* bossA6) { if ((bossA6->swork[A6_SWK_25] != 1) && (D_i3_801C2250[A6_BSS_0] != 2)) { bossA6->fwork[A6_FWK_3] = RAND_FLOAT_CENTERED(1000.0f) + -3700.0f; } - bossA6->obj.pos.z = gPlayer[0].camEye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3]; - bossA6->fwork[A6_FWK_6] = bossA6->obj.pos.x = gPlayer[0].camEye.x; - bossA6->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].camEye.y; + bossA6->obj.pos.z = gPlayer[0].cam.eye.z - D_ctx_80177D20 + bossA6->fwork[A6_FWK_3]; + bossA6->fwork[A6_FWK_6] = bossA6->obj.pos.x = gPlayer[0].cam.eye.x; + bossA6->fwork[A6_FWK_7] = bossA6->obj.pos.y = gPlayer[0].cam.eye.y; } D_i3_801C22F0.unk_24 = 0.0f; bossA6->timer_050 = 50; @@ -1173,7 +1173,7 @@ void Area6_80187944(Boss* bossA6) { } for (var_s0 = 0; var_s0 < sp128; var_s0++) { - Matrix_RotateZ(gCalcMatrix, (360.0f / sp128) * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, (360.0f / sp128) * M_DTOR, MTXF_APPLY); sp98.x = 0.0f; sp98.y = 400.0f; sp98.z = 0.0f; @@ -1226,9 +1226,9 @@ void Area6_80187944(Boss* bossA6) { break; case 11: - if ((bossA6->timer_052 == 160) && - ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5))) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((bossA6->timer_052 == 160) && ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; } if (bossA6->timer_052 < 50) { @@ -1781,22 +1781,22 @@ void Area6_8018BCD4(Vec3f* arg0, f32 arg1, f32 arg2, Vec3f* arg3, s32 arg4, f32 Matrix_Push(&gGfxMatrix); Matrix_Push(&gCalcMatrix); Matrix_Copy(gCalcMatrix, &gIdentityMatrix); - Matrix_RotateZ(gCalcMatrix, M_DTOR * arg1, 1); - Matrix_Translate(gCalcMatrix, 0.0f, 100.0f, -223.0f, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg2, 1); + Matrix_RotateZ(gCalcMatrix, M_DTOR * arg1, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, 100.0f, -223.0f, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg2, MTXF_APPLY); for (i = 0; i < arg6; i++) { Matrix_Push(&gGfxMatrix); Matrix_Push(&gCalcMatrix); if (i == 11) { - Matrix_Scale(gCalcMatrix, 1.5f, 1.5f, 1.5f, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Scale(gCalcMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_600F1F0); Matrix_MultVec3f(gCalcMatrix, &sp90, arg3); } else { - Matrix_Scale(gCalcMatrix, 2.0f, 2.0f, 2.0f, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Scale(gCalcMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); gSPDisplayList(gMasterDisp++, D_A6_6015EE0); @@ -1806,9 +1806,9 @@ void Area6_8018BCD4(Vec3f* arg0, f32 arg1, f32 arg2, Vec3f* arg3, s32 arg4, f32 } Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gCalcMatrix); - Matrix_RotateY(gCalcMatrix, arg0[i].y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, arg0[i].x * M_DTOR, 1); - Matrix_Translate(gCalcMatrix, 0.0f, 0.0f, arg5, 1); + Matrix_RotateY(gCalcMatrix, arg0[i].y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, arg0[i].x * M_DTOR, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, 0.0f, arg5, MTXF_APPLY); } Matrix_Pop(&gGfxMatrix); } @@ -1830,19 +1830,19 @@ void Area6_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4) { Matrix_Push(&gCalcMatrix); Matrix_Copy(gCalcMatrix, &gIdentityMatrix); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_RotateZ(gCalcMatrix, (D_i3_801C22F0.unk_34 + arg1) * M_DTOR, 1); - Matrix_Translate(gCalcMatrix, 0.0f, -360.0f, 120.0f, 1); - Matrix_RotateX(gCalcMatrix, -(90.0f - arg3) * M_DTOR, 1); - Matrix_Scale(gCalcMatrix, 0.7f, 0.7f, 0.7f, 1); + Matrix_RotateZ(gCalcMatrix, (D_i3_801C22F0.unk_34 + arg1) * M_DTOR, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, 0.0f, -360.0f, 120.0f, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -(90.0f - arg3) * M_DTOR, MTXF_APPLY); + Matrix_Scale(gCalcMatrix, 0.7f, 0.7f, 0.7f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); for (i = 0; i < 5; i++) { Matrix_Push(&gGfxMatrix); Matrix_Push(&gCalcMatrix); if (i == 4) { - Matrix_RotateX(gCalcMatrix, 80.0f * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, (90.0f - arg3) * M_DTOR, 1); - Matrix_Scale(gCalcMatrix, var_fs3, var_fs3, 1.0f, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_RotateX(gCalcMatrix, 80.0f * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, (90.0f - arg3) * M_DTOR, MTXF_APPLY); + Matrix_Scale(gCalcMatrix, var_fs3, var_fs3, 1.0f, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) D_i3_801C22F0.r[arg4], (s32) D_i3_801C22F0.g[arg4], @@ -1853,18 +1853,18 @@ void Area6_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4) { } else { RCP_SetupDL(&gMasterDisp, 0x2F); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 64, 64, 192); - Matrix_Translate(gCalcMatrix, 0.0f, -60.0f, 0.0f, 1); - Matrix_Scale(gCalcMatrix, 2.0f, 3.0f, 1.0f, 1); - Matrix_RotateY(gCalcMatrix, M_DTOR * spAC, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Translate(gCalcMatrix, 0.0f, -60.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gCalcMatrix, 2.0f, 3.0f, 1.0f, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, M_DTOR * spAC, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_102F5E0); } Matrix_Pop(&gCalcMatrix); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gCalcMatrix, 0.0f, -120.0f, 0.0f, 1); - Matrix_RotateX(gCalcMatrix, -20.0f * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, arg0[i] * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, 0.0f, -120.0f, 0.0f, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -20.0f * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, arg0[i] * M_DTOR, MTXF_APPLY); } Matrix_Pop(&gCalcMatrix); Matrix_Pop(&gGfxMatrix); @@ -1882,8 +1882,8 @@ void Area6_8018C54C(Boss* bossA6) { RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_i3_801C22F0.unk_24); gDPSetEnvColor(gMasterDisp++, 255, 255, 0, 255); - Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, 1); - Matrix_RotateZ(gGfxMatrix, bossA6->fwork[A6_FWK_33] * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, bossA6->fwork[A6_FWK_33] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_101C2E0); } else if (D_i3_801C22F0.unk_24 != 0.0f) { @@ -1899,14 +1899,14 @@ void Area6_8018C54C(Boss* bossA6) { spAC.x = 0.0f; } spAC.y = spAC.z = 0.0f; - Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 6.0f * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, gGameFrameCount * 6.0f * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &spAC, &spB8); - Matrix_Translate(gGfxMatrix, spB8.x, spB8.y, 0.0f, 1); - Matrix_Scale(gGfxMatrix, bossA6->unk_3F8, bossA6->unk_3F8, bossA6->unk_3F8, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 10.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, bossA6->fwork[A6_FWK_34], bossA6->fwork[A6_FWK_35], 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, bossA6->fwork[A6_FWK_34], bossA6->fwork[A6_FWK_35], 1.0f, 1); + Matrix_Translate(gGfxMatrix, spB8.x, spB8.y, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, bossA6->unk_3F8, bossA6->unk_3F8, bossA6->unk_3F8, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, bossA6->fwork[A6_FWK_34], bossA6->fwork[A6_FWK_35], 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 10.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, bossA6->fwork[A6_FWK_34], bossA6->fwork[A6_FWK_35], 1.0f, MTXF_APPLY); } else { RCP_SetupDL(&gMasterDisp, 0x1B); if (bossA6->timer_05C & 1) { @@ -1925,9 +1925,9 @@ void Area6_8018C54C(Boss* bossA6) { if ((bossA6->swork[A6_SWK_33 + i] == 0) && (bossA6->state != 3) && (D_i3_801C2250[A6_BSS_2_0 + i] == 0) && ((gGameFrameCount % 4) == 0) && (bossA6->swork[A6_SWK_27 + i] != 0) && (gPlayState != 100)) { - Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, bossA6->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, bossA6->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, bossA6->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &bossA6->vwork[A6_VWK_1] + i, &spC4); func_effect_8007D0E0(bossA6->obj.pos.x + spC4.x, bossA6->obj.pos.y + spC4.y, bossA6->obj.pos.z + spC4.z, 20.0f); @@ -2037,8 +2037,8 @@ void Area6_8018C54C(Boss* bossA6) { } Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x47); - Matrix_Translate(gGfxMatrix, 0.0f, 2.0f, 70.0f, 1); - Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.7f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 2.0f, 70.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.7f, 1.7f, 1.7f, MTXF_APPLY); if (bossA6->timer_05C & 1) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); } else { @@ -2055,10 +2055,10 @@ void Area6_8018C54C(Boss* bossA6) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, bossA6->swork[A6_SWK_22], bossA6->swork[A6_SWK_23], bossA6->swork[A6_SWK_24], (s32) bossA6->fwork[A6_FWK_29]); } - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 74.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 74.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_A6_6011910); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 74.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 74.0f, MTXF_APPLY); } } @@ -2174,8 +2174,8 @@ void Area6_8018D920(Vec3f* arg0) { Vec3f sp50; Vec3f sp44; - Matrix_RotateY(gCalcMatrix, M_DTOR * sp60, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * sp5C, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * sp60, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * sp5C, MTXF_APPLY); sp50.x = 0.0f; sp50.y = 0.0f; sp50.z = 100.0f; @@ -2259,8 +2259,8 @@ void Area6_8018DA58(Actor* actor) { case 90: break; } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; sp5C.z = actor->fwork[0]; @@ -2321,8 +2321,8 @@ void Area6_8018DF74(Player* player) { sp74.x = 0.0f; sp74.y = 0.0f; sp74.z = D_ctx_80177A48[5]; - Matrix_Translate(gCalcMatrix, 0.0f, 350.0f, D_ctx_80177A48[6], 0); - Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), 1); + Matrix_Translate(gCalcMatrix, 0.0f, 350.0f, D_ctx_80177A48[6], MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp74, &sp68); gCsCamEyeX = sp68.x; gCsCamEyeY = sp68.y; @@ -2372,7 +2372,7 @@ void Area6_8018DF74(Player* player) { player->unk_0D0 = player->pos.z = 0.0f; } if (gCsFrameCount == 540) { - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; gLevelStatusScreenTimer = 50; player->pos.x = 0.0f; player->pos.z = 0.0f; @@ -2382,7 +2382,7 @@ void Area6_8018DF74(Player* player) { player->timer_1F8 = 0; AUDIO_PLAY_BGM(SEQ_ID_AREA_6 | SEQ_FLAG); - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; } break; } @@ -2448,9 +2448,9 @@ void Area6_8018DF74(Player* player) { func_play_800A6148(); break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); - if (player->state_1C8 != PLAYERSTATE_1C8_3) { + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); + if (player->state_1C8 != PLAYERSTATE_1C8_ACTIVE) { sp74.x = 0.0f; sp74.y = 0.0f; sp74.z = player->unk_0D0; @@ -2464,12 +2464,12 @@ void Area6_8018DF74(Player* player) { player->unk_138 = player->pos.z; } player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[1], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[1], 50000.0f, 0.001f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[1], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[1], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[1], 50000.0f, 0.001f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[1], 50000.0f, 0.001f); } void Area6_8018EA88(Actor* actor) { @@ -2552,7 +2552,7 @@ void Area6_8018ED78(Player* player) { case 0: gCsFrameCount = 0; player->unk_1D0 = 1; - player->wings.unk_2C = 1; + player->wings.modelId = 1; player->unk_194 = 5.0f; player->unk_190 = 2.0f; player->unk_0D0 = 60.0f; @@ -2562,7 +2562,7 @@ void Area6_8018ED78(Player* player) { case 1: Math_SmoothStepToAngle(&player->unk_130, 0.0f, 0.05f, 1.2f, 0.0001f); Math_SmoothStepToAngle(&player->unk_12C, 0.0f, 0.05f, 1.2f, 0.0001f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); if (gCsFrameCount < 60) { spf90.x = -100.0f; @@ -2588,9 +2588,9 @@ void Area6_8018ED78(Player* player) { Math_SmoothStepToF(&gCsCamEyeX, gBosses[0].obj.pos.x, 0.05f, 1000.0f, 0.001f); Math_SmoothStepToF(&gCsCamEyeY, gBosses[0].obj.pos.y, 0.05f, 1000.0f, 0.001f); Math_SmoothStepToF(&gCsCamEyeZ, gBosses[0].obj.pos.z + D_ctx_80177D20, 0.05f, 10.0f, 0.0001f); - player->camEye.x = gCsCamEyeX; - player->camEye.y = gCsCamEyeY; - player->camEye.z = gCsCamEyeZ; + player->cam.eye.x = gCsCamEyeX; + player->cam.eye.y = gCsCamEyeY; + player->cam.eye.z = gCsCamEyeZ; gCsCamAtX = gBosses[0].obj.pos.x; gCsCamAtY = gBosses[0].obj.pos.y; @@ -2654,7 +2654,7 @@ void Area6_8018ED78(Player* player) { player->pos.y = 200.0f; player->pos.z = 1000.0f; player->unk_08C = player->unk_0EC = player->unk_0E8 = player->unk_0E4 = player->unk_0D0 = - player->unk_110 = player->unk_034 = player->unk_12C = player->unk_130 = player->unk_4D8 = 0.0f; + player->unk_110 = player->camRoll = player->unk_12C = player->unk_130 = player->unk_4D8 = 0.0f; D_bg_8015F984 = (D_ctx_80177D20 * 0.00004f) + 0.5f; Area6_8018EC38(&gActors[1], 0); @@ -2664,9 +2664,9 @@ void Area6_8018ED78(Player* player) { D_ctx_80177A48[5] = 300.0f; D_ctx_80177A48[4] = 0.0f; D_ctx_80177A48[9] = 50.0f; - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = 0.0f; - player->camAt.z = gCsCamAtZ = player->pos.z + 50.0f + D_ctx_80177D20; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = 0.0f; + player->cam.at.z = gCsCamAtZ = player->pos.z + 50.0f + D_ctx_80177D20; } if (gFillScreenAlpha != 0) { gFillScreenAlphaTarget = 0; @@ -2704,19 +2704,19 @@ void Area6_8018ED78(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[5], 0.0f, 0.1f, 1000.0f, 0.001f); D_bg_8015F984 -= 0.005f; gCsCamAtX += 2.0f; - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = 0.0f; - player->camAt.z = gCsCamAtZ = D_ctx_80177A48[9] + player->pos.z + D_ctx_80177D20; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = 0.0f; + player->cam.at.z = gCsCamAtZ = D_ctx_80177A48[9] + player->pos.z + D_ctx_80177D20; } sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = D_ctx_80177A48[5]; - Matrix_Translate(gCalcMatrix, D_ctx_80177A48[1], 0.0f, D_ctx_80177A48[3] + D_ctx_80177D20, 0); - Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), 1); + Matrix_Translate(gCalcMatrix, D_ctx_80177A48[1], 0.0f, D_ctx_80177A48[3] + D_ctx_80177D20, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp78, &sp6C); - player->camEye.x = gCsCamEyeX = sp6C.x; - player->camEye.y = gCsCamEyeY = sp6C.y; - player->camEye.z = gCsCamEyeZ = sp6C.z; + player->cam.eye.x = gCsCamEyeX = sp6C.x; + player->cam.eye.y = gCsCamEyeY = sp6C.y; + player->cam.eye.z = gCsCamEyeZ = sp6C.z; if (gCsFrameCount == 1076) { Object_Kill(&gActors[0].obj, gActors[0].sfxSource); @@ -2796,8 +2796,8 @@ void Area6_8018ED78(Player* player) { if (gCsFrameCount >= 1076) { Math_SmoothStepToF(&player->unk_0D0, 50.0f, 0.1f, 1000.0f, 0.001f); } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); sp78.x = 0.0f; sp78.y = 0.0f; sp78.z = player->unk_0D0; @@ -2810,10 +2810,10 @@ void Area6_8018ED78(Player* player) { player->pos.z += player->vel.z; player->unk_138 = player->pos.z; player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0001f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0001f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0001f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0001f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0001f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0001f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0001f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0001f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0001f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0001f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0001f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0001f); } diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index ecb173f5..eaaa47e1 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -394,18 +394,18 @@ f32 Aquas_801A958C(s32 arg0, f32 arg1) { } void Aquas_801A95C8(void) { - Math_SmoothStepToF(&gPlayer[0].camEye.x, gCsCamEyeX, 0.1f, 50.0f, 0.0001f); - Math_SmoothStepToF(&gPlayer[0].camEye.y, gCsCamEyeY, 0.1f, 50.0f, 0.0001f); - Math_SmoothStepToF(&gPlayer[0].camEye.z, gCsCamEyeZ, 0.1f, 50.0f, 0.0001f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.x, gCsCamEyeX, 0.1f, 50.0f, 0.0001f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.y, gCsCamEyeY, 0.1f, 50.0f, 0.0001f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.z, gCsCamEyeZ, 0.1f, 50.0f, 0.0001f); - Math_SmoothStepToF(&gPlayer[0].camAt.x, gCsCamAtX, 0.1f, 50.0f, 0.0001f); - Math_SmoothStepToF(&gPlayer[0].camAt.y, gCsCamAtY, 0.1f, 50.0f, 0.0001f); - Math_SmoothStepToF(&gPlayer[0].camAt.z, gCsCamAtZ, 0.1f, 50.0f, 0.0001f); + Math_SmoothStepToF(&gPlayer[0].cam.at.x, gCsCamAtX, 0.1f, 50.0f, 0.0001f); + Math_SmoothStepToF(&gPlayer[0].cam.at.y, gCsCamAtY, 0.1f, 50.0f, 0.0001f); + Math_SmoothStepToF(&gPlayer[0].cam.at.z, gCsCamAtZ, 0.1f, 50.0f, 0.0001f); } void Aquas_801A96DC(Actor* actor) { - actor->obj.rot.y = RAD_TO_DEG(-gPlayer[0].unk_058); - actor->obj.rot.x = RAD_TO_DEG(gPlayer[0].unk_05C); + actor->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); + actor->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); } void Aquas_801A9728(Actor* actor, f32 radius, f32 scale, s32 spread) { @@ -577,8 +577,8 @@ void Aquas_801A9ED0(Player* player) { Vec3f sp64; f32* tempy; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); sp70.x = 0.0f; sp70.y = 0.0f; @@ -648,12 +648,12 @@ void Aquas_801AA20C(void) { } Matrix_Translate(gGfxMatrix, D_i3_801C41B8[0] + var_fs1, D_i3_801C41B8[1] + var_fs2, - D_i3_801C41B8[2] + gPlayer[0].unk_144, 1); - Matrix_Scale(gGfxMatrix, D_i3_801C41B8[5], D_i3_801C41B8[5], D_i3_801C41B8[5], 1); + D_i3_801C41B8[2] + gPlayer[0].unk_144, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i3_801C41B8[5], D_i3_801C41B8[5], D_i3_801C41B8[5], MTXF_APPLY); for (i = 0; i < 4; i++) { - Matrix_RotateZ(gGfxMatrix, M_PI / 2, 1); - Matrix_Translate(gGfxMatrix, var_fs1, var_fs2, 0.0f, 1); + Matrix_RotateZ(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, var_fs1, var_fs2, 0.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_blue_marine_3000470); @@ -661,8 +661,9 @@ void Aquas_801AA20C(void) { } } else { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 0, 0, 255); - Matrix_Translate(gGfxMatrix, D_i3_801C41B8[0], D_i3_801C41B8[1], D_i3_801C41B8[2] + gPlayer[0].unk_144, 1); - Matrix_Scale(gGfxMatrix, D_i3_801C41B8[5], D_i3_801C41B8[5], D_i3_801C41B8[5], 1); + Matrix_Translate(gGfxMatrix, D_i3_801C41B8[0], D_i3_801C41B8[1], D_i3_801C41B8[2] + gPlayer[0].unk_144, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i3_801C41B8[5], D_i3_801C41B8[5], D_i3_801C41B8[5], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_blue_marine_3000130); } @@ -787,7 +788,7 @@ void Aquas_801AA8E8(Player* player) { f32 var_fv1 = -gInputPress->stick_y; f32 temp; - if (player->state_1C8 != PLAYERSTATE_1C8_3) { + if (player->state_1C8 != PLAYERSTATE_1C8_ACTIVE) { var_fv0 = var_fv1 = 0.0f; } @@ -821,19 +822,19 @@ void Aquas_801AA8E8(Player* player) { gCsCamEyeZ = 240.0f; gCsCamAtZ = player->unk_138 + (D_ctx_80177D20 - 1.0f); - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, player->unk_014, 1000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, player->unk_014, 1000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, 0.2f, 30.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, player->unk_014, 1000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, player->unk_014, 1000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, 0.2f, 30.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, player->unk_014, 1000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, player->unk_014, 1000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, player->unk_014, 1000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, player->unk_014, 1000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, player->unk_014, 1000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, player->unk_014, 1000.0f, 0); Math_SmoothStepToF(&player->unk_014, 1.0f, 1.0f, 0.05f, 0.0f); temp = -player->unk_0EC; - Math_SmoothStepToF(&player->unk_034, temp * 0.3f, 0.1f, 1.5f, 0.0f); + Math_SmoothStepToF(&player->camRoll, temp * 0.3f, 0.1f, 1.5f, 0.0f); } void Aquas_801AACF8(Player* player) { @@ -950,8 +951,8 @@ void Aquas_801AACF8(Player* player) { player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp8C.x = sp8C.y = 0.0f; sp8C.z = player->unk_0D0; @@ -961,8 +962,8 @@ void Aquas_801AACF8(Player* player) { sp68.x *= 1.4f; sp68.y *= 1.4f; - Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, player->unk_114 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_120 * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp68, &sp80); @@ -1028,8 +1029,8 @@ void Aquas_801AACF8(Player* player) { player->unk_0F0 = SIN_DEG(player->unk_0F4) * 1.5f; if (player->pos.y < (D_ctx_80177CC0 + 50.0f)) { - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); sp8C.x = sp8C.y = 0.0f; sp8C.z = 70.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp8C, &sp80); @@ -1053,7 +1054,7 @@ void Aquas_801AB9B0(Player* player) { func_effect_8007D0E0(player->pos.x, player->pos.y, player->unk_138, 6.0f); func_effect_8007B344(player->pos.x, player->pos.y, player->unk_138, 3.0f, 5); func_effect_8007BFFC(player->pos.x, player->pos.y, player->unk_138, 0.0f, 0.0f, 0.0f, 3.0f, 80); - func_demo_8004D440(player); + Cutscene_KillPlayer(player); } void Aquas_801ABA40(PlayerShot* shot) { @@ -1069,9 +1070,9 @@ void Aquas_801ABA40(PlayerShot* shot) { D_i3_801C41B8[22] = shot->obj.pos.y; D_i3_801C41B8[23] = shot->obj.pos.z; - if ((fabsf(shot->obj.pos.z - (gPlayer[0].camEye.z - D_ctx_80177D20)) > 10000.0f) || - (fabsf(shot->obj.pos.y - gPlayer[0].camEye.y) > 1500.0f) || - ((fabsf(shot->obj.pos.x - gPlayer[0].camEye.x) > 4000.0f) && (shot->unk_5C != 0))) { + if ((fabsf(shot->obj.pos.z - (gPlayer[0].cam.eye.z - D_ctx_80177D20)) > 10000.0f) || + (fabsf(shot->obj.pos.y - gPlayer[0].cam.eye.y) > 1500.0f) || + ((fabsf(shot->obj.pos.x - gPlayer[0].cam.eye.x) > 4000.0f) && (shot->unk_5C != 0))) { shot->unk_64 = 0; } @@ -1139,8 +1140,8 @@ void Aquas_801ABA40(PlayerShot* shot) { Math_SmoothStepToF(&shot->unk_54, D_i3_801C4458, 0.1f, 50.0f, 0.0001f); } - Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, shot->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, shot->obj.rot.x * M_DTOR, MTXF_APPLY); sp60.x = sp60.y = 0.0f; sp60.z = shot->unk_54; Matrix_MultVec3f(gCalcMatrix, &sp60, &sp54); @@ -1220,8 +1221,8 @@ void Aquas_801AC274(Player* player) { D_i3_801C4190[5] = D_i3_801C4190[3] = 0; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); sp68.x = 0.0f; sp68.y = 0.0f; @@ -1363,8 +1364,8 @@ void Aquas_801AC918(Effect* effect) { } effect->scale1 += 33.0f; temp_fs0 = COS_DEG(effect->scale1) * 1.5f; - effect->vel.x = __cosf(gPlayer[0].unk_058) * temp_fs0; - effect->vel.z = __sinf(gPlayer[0].unk_058) * temp_fs0; + effect->vel.x = __cosf(gPlayer[0].camYaw) * temp_fs0; + effect->vel.z = __sinf(gPlayer[0].camYaw) * temp_fs0; break; case 1: @@ -1389,38 +1390,38 @@ void Aquas_801AC918(Effect* effect) { } effect->scale1 += 55.0f; temp_fs0 = COS_DEG(effect->scale1) * 2.5f; - effect->vel.x = __cosf(gPlayer[0].unk_058) * temp_fs0; - effect->vel.z = __sinf(gPlayer[0].unk_058) * temp_fs0; + effect->vel.x = __cosf(gPlayer[0].camYaw) * temp_fs0; + effect->vel.z = __sinf(gPlayer[0].camYaw) * temp_fs0; break; } } void Aquas_801ACBB4(Player* player) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -40.0f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -40.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_blue_marine_3000C70); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -4.5f, 1.2f, 1); - Matrix_RotateZ(gGfxMatrix, player->unk_178 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -4.5f, 1.2f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, player->unk_178 * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_blue_marine_3006DE0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 2.0f, 40.0f, 1); - Matrix_RotateY(gGfxMatrix, -player->unk_180 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 2.0f, 40.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -player->unk_180 * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_blue_marine_3006C70); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -19.0f, -3.6f, 1.2f, 1); - Matrix_RotateX(gGfxMatrix, player->unk_17C * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, -19.0f, -3.6f, 1.2f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_blue_marine_3000AF0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 19.0f, -3.6f, 1.2f, 1); - Matrix_RotateX(gGfxMatrix, player->unk_17C * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 19.0f, -3.6f, 1.2f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_blue_marine_3006AF0); Matrix_Pop(&gGfxMatrix); @@ -1437,8 +1438,8 @@ void Aquas_801ACE50(Player* player) { if (player->timer_27C != 0) { player->timer_27C--; player->unk_110 += 0.3f; - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); sp54.x = sp54.y = 0.0f; sp54.z = 70.0f; @@ -1474,7 +1475,7 @@ void Aquas_801ACE50(Player* player) { } if ((gBoostButton[player->num] & gInputHold->button) && (player->unk_230 == 0) && - (player->state_1C8 != PLAYERSTATE_1C8_5) && (player->unk_2B4 == 0)) { + (player->state_1C8 != PLAYERSTATE_1C8_U_TURN) && (player->unk_2B4 == 0)) { if (player->unk_2BC == 0) { AUDIO_PLAY_SFX(0x9004030, player->sfxSource, 4); } @@ -1514,7 +1515,7 @@ void Aquas_801ACE50(Player* player) { void Aquas_801AD328(Player* player) { player->sfx.brake = 0; if ((gBrakeButton[player->num] & gInputHold->button) && (player->unk_230 == 0) && - (player->state_1C8 != PLAYERSTATE_1C8_5) && (player->unk_2B4 == 0)) { + (player->state_1C8 != PLAYERSTATE_1C8_U_TURN) && (player->unk_2B4 == 0)) { if (player->unk_2BC == 0) { AUDIO_PLAY_SFX(0x9004031, player->sfxSource, 4); } @@ -1688,8 +1689,8 @@ void Aquas_801AD6C0(Actor* actor) { Math_SmoothStepToAngle(&actor->unk_0F4.y, sp68, 1.0f, 5.0f, 0.001f); Math_SmoothStepToAngle(&actor->unk_0F4.x, sp6C, 1.0f, 5.0f, 0.001f); - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->unk_0F4.x * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; @@ -1742,11 +1743,11 @@ void Aquas_801AD6C0(Actor* actor) { void Aquas_801ADF7C(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, u8 type, s32 flag, f32 scale, s32 index) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, xPos, yPos, zPos + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, xPos, yPos, zPos + D_ctx_80177D20, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, MTXF_APPLY); Graphics_SetScaleMtx(scale); @@ -1800,12 +1801,12 @@ void Aquas_801AE168(Actor* actor) { yRot = D_i3_801C27C0->rot.y; if (i >= 2) { - yRot = RAD_TO_DEG(Math_Atan2F(gPlayer[0].camEye.x - D_i3_801C27C0->pos.x, - gPlayer[0].camEye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20))); - xz = sqrtf(((gPlayer[0].camEye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20)) * - (gPlayer[0].camEye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20))) + - ((gPlayer[0].camEye.x - D_i3_801C27C0->pos.x) * (gPlayer[0].camEye.x - D_i3_801C27C0->pos.x))); - xRot = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].camEye.y - D_i3_801C27C0->pos.y, xz)); + yRot = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - D_i3_801C27C0->pos.x, + gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20))); + xz = sqrtf(((gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20)) * + (gPlayer[0].cam.eye.z - (D_i3_801C27C0->pos.z + D_ctx_80177D20))) + + ((gPlayer[0].cam.eye.x - D_i3_801C27C0->pos.x) * (gPlayer[0].cam.eye.x - D_i3_801C27C0->pos.x))); + xRot = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - D_i3_801C27C0->pos.y, xz)); } Aquas_801ADF7C(D_i3_801C27C0->pos.x, D_i3_801C27C0->pos.y, D_i3_801C27C0->pos.z, xRot, yRot, @@ -2016,7 +2017,7 @@ void Aquas_801AEB44(Actor* actor) { } Matrix_Scale(gGfxMatrix, actor->fwork[1] - 0.25f + ((1.5f - actor->scale) * 0.5f), actor->scale, actor->fwork[1], - 1); + MTXF_APPLY); if (actor->state != 0) { RCP_SetupDL(&gMasterDisp, 0x20); } else if (gBosses[0].swork[AQ_SWK_0] == 1) { @@ -2210,9 +2211,9 @@ void Aquas_801AFA5C(Actor* actor) { actor->iwork[3] = i + 1; sp48->iwork[0] = actor->iwork[0]; sp48->iwork[2] = actor->index + 1; - Matrix_RotateY(gCalcMatrix, sp48->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, sp48->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, sp48->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, sp48->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, sp48->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, sp48->obj.rot.z * M_DTOR, MTXF_APPLY); sp58.x = sp58.y = 0.0f; sp58.z = 60.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp58, &sp4C); @@ -2312,10 +2313,10 @@ void Aquas_801AFA5C(Actor* actor) { // OBJ_ACTOR_257 draw void Aquas_801B099C(Actor* actor) { - Matrix_RotateY(gGfxMatrix, (actor->obj.rot.x + actor->fwork[3]) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, (actor->obj.rot.y + actor->fwork[4]) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (actor->obj.rot.z + actor->fwork[5]) * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[1], actor->fwork[2], 1); + Matrix_RotateY(gGfxMatrix, (actor->obj.rot.x + actor->fwork[3]) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, (actor->obj.rot.y + actor->fwork[4]) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (actor->obj.rot.z + actor->fwork[5]) * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[1], actor->fwork[2], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((actor->timer_0C6 % 2) == 0) { RCP_SetupDL(&gMasterDisp, 0x39); @@ -2349,8 +2350,8 @@ void Aquas_801B0B60(Actor* actor) { switch (actor->state) { case 0: if (actor->timer_0BC == 0) { - Matrix_RotateY(gCalcMatrix, actor->fwork[2] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->fwork[1] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->fwork[2] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->fwork[1] * M_DTOR, MTXF_APPLY); sp44.x = sp44.y = 0.0f; sp44.z = 50.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); @@ -2367,8 +2368,8 @@ void Aquas_801B0B60(Actor* actor) { case 1: if (actor->timer_0BE == 0) { - Matrix_RotateY(gCalcMatrix, actor->fwork[4] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->fwork[3] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->fwork[4] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->fwork[3] * M_DTOR, MTXF_APPLY); sp44.x = sp44.y = 0.0f; sp44.z = 30.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp44, &sp38); @@ -2939,9 +2940,9 @@ void Aquas_801B134C(Boss* bossAQ) { func_boss_80042EC0(bossAQ); Radio_PlayMessage(gMsg_ID_15252, RCID_SLIPPY); D_ctx_8017796C = -1; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; } D_i3_801C4190[1] = 0; @@ -3459,16 +3460,16 @@ bool Aquas_801B42AC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* th } if (sp5C > 0.0f) { - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); if (*dList != NULL) { Matrix_MultVec3f(gCalcMatrix, &sp6C, &sp60); func_edisplay_8005F670(&sp60); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, sp5C, sp58, sp54, 1); + Matrix_Scale(gGfxMatrix, sp5C, sp58, sp54, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); Matrix_Pop(&gGfxMatrix); @@ -3646,7 +3647,7 @@ void Aquas_801B4E94(s32 limbIndex, Vec3f* rot, void* thisx) { void Aquas_801B504C(Actor* actor) { Vec3f sp30[30]; - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Animation_GetFrameData(&D_AQ_6005954, actor->unk_0B6, sp30); Animation_DrawSkeleton(3, D_AQ_6005A80, sp30, Aquas_801B4DDC, Aquas_801B4E94, actor, gCalcMatrix); } @@ -3740,8 +3741,8 @@ void Aquas_801B50E8(Actor* actor) { sp88.z = gPlayer[0].unk_138 - actor->obj.pos.z; actor->fwork[2] = Math_RadToDeg(Math_Atan2F(sp88.x, sp88.z)); actor->fwork[3] = Math_RadToDeg(-Math_Atan2F(sp88.y, sqrtf(SQ(sp88.x) + SQ(sp88.z)))); - Matrix_RotateY(gCalcMatrix, actor->fwork[2] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->fwork[3] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->fwork[2] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->fwork[3] * M_DTOR, MTXF_APPLY); sp7C.x = sp7C.y = 0.0f; sp7C.z = 40.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp7C, &sp70); @@ -3849,16 +3850,16 @@ bool Aquas_801B5C18(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* th } if (sp6C != 1.0f) { - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); if (*dList != NULL) { Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp58); func_edisplay_8005F670(&sp58); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, sp6C, sp68, sp64, 1); + Matrix_Scale(gGfxMatrix, sp6C, sp68, sp64, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); Matrix_Pop(&gGfxMatrix); @@ -3934,14 +3935,14 @@ void Aquas_801B619C(Actor* actor) { Matrix_Push(&gCalcMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Animation_GetFrameData(&D_AQ_6002628, actor->unk_0B6, sp40); Animation_DrawSkeleton(3, D_AQ_6002874, sp40, Aquas_801B5C18, Aquas_801B5F68, actor, gCalcMatrix); Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gCalcMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->fwork[8], actor->fwork[9], actor->fwork[10], 1); - Matrix_Scale(gGfxMatrix, actor->fwork[5], actor->fwork[6], actor->fwork[7], 1); + Matrix_Translate(gGfxMatrix, actor->fwork[8], actor->fwork[9], actor->fwork[10], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, actor->fwork[5], actor->fwork[6], actor->fwork[7], MTXF_APPLY); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) actor->iwork[12]); gDPSetEnvColor(gMasterDisp++, 127, 127, 0, (s32) actor->iwork[12]); @@ -4030,7 +4031,7 @@ void Aquas_801B638C(Actor* actor) { actor->vwork[9 + i].y = actor->obj.rot.y; actor->vwork[9 + i].z = actor->obj.rot.z; } - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); sp8C.x = sp8C.y = 0.0f; sp8C.z = -1400.0f; if (actor->iwork[14] != 0) { @@ -4085,8 +4086,8 @@ void Aquas_801B638C(Actor* actor) { } Math_SmoothStepToAngle(&actor->obj.rot.x, temp_fscc, 0.1f, 100.0f, 0.001f); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); sp8C.x = sp8C.y = 0.0f; sp8C.z = 10.0f; @@ -4210,8 +4211,8 @@ void Aquas_801B6FF8(Actor* actor) { temp_dz = 20.0f; } Math_SmoothStepToAngle(&actor->obj.rot.z, temp_dz, 0.1f, 1.0f, 0.f); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); sp9C.x = sp9C.y = 0.0f; sp9C.z = 10.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp9C, &sp90); @@ -4220,8 +4221,8 @@ void Aquas_801B6FF8(Actor* actor) { actor->vel.z = sp90.z - 20.0f; break; case 1: - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); sp9C.y = sp9C.x = 0.0f; sp9C.z = 19.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp9C, &sp90); @@ -4443,8 +4444,8 @@ void Aquas_801B7C78(Actor* actor) { } Math_SmoothStepToF(&actor->fwork[1], actor->fwork[2], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].camEye.z - D_ctx_80177D20 + actor->fwork[3], 0.1f, actor->fwork[1], - 0.00001); + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].cam.eye.z - D_ctx_80177D20 + actor->fwork[3], 0.1f, + actor->fwork[1], 0.00001); if ((actor->state == 1) && (fabsf(actor->fwork[7] - actor->obj.pos.z) >= 10000.0f)) { actor->timer_0C0 = 20; @@ -4522,7 +4523,7 @@ void Aquas_801B7C78(Actor* actor) { } } - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); if ((actor->unk_0B6 < 21) && (actor->state == 4) && (actor->iwork[3] != 0)) { j = actor->iwork[3] - 1; @@ -4535,8 +4536,8 @@ void Aquas_801B7C78(Actor* actor) { temp_fs2 = Math_RadToDeg(Math_Atan2F(spAC, temp_dz)); temp1 = Math_RadToDeg(-Math_Atan2F(temp_dy, sqrtf(SQ(spAC) + SQ(temp_dz)))); - Matrix_RotateY(gCalcMatrix, M_DTOR * temp_fs2, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * temp1, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * temp_fs2, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * temp1, MTXF_APPLY); sp90.x = sp90.y = 0.0f; sp90.z = 30.0f; @@ -4569,8 +4570,8 @@ void Aquas_801B7C78(Actor* actor) { temp_fs2 = Math_RadToDeg(Math_Atan2F(spAC, temp_dz)); temp1 = Math_RadToDeg(-Math_Atan2F(temp_dy, sqrtf(SQ(spAC) + SQ(temp_dz)))); - Matrix_RotateY(gCalcMatrix, M_DTOR * temp_fs2, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * temp1, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * temp_fs2, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * temp1, MTXF_APPLY); sp90.x = sp90.y = 0.0f; sp90.z = 50.0f; @@ -4604,8 +4605,8 @@ void Aquas_801B7C78(Actor* actor) { temp_dy = gPlayer[0].pos.y - 50.0f - actor->obj.pos.y; temp_dz = gPlayer[0].unk_138 - actor->obj.pos.z; temp1 = Math_RadToDeg(-Math_Atan2F(temp_dy, sqrtf(SQ(spAC) + SQ(temp_dz)))); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * temp1, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * temp1, MTXF_APPLY); sp90.x = sp90.y = 0.0f; sp90.z = 40.0f; @@ -4792,7 +4793,7 @@ void Aquas_801B90DC(Actor* actor) { } else { Animation_GetFrameData(&D_AQ_6024F80, actor->unk_0B6, sp30); } - Matrix_Translate(gCalcMatrix, 0.0f, -150.0f, 100.0f, 1); + Matrix_Translate(gCalcMatrix, 0.0f, -150.0f, 100.0f, MTXF_APPLY); Animation_DrawSkeleton(3, D_AQ_602512C, sp30, Aquas_801B8C50, Aquas_801B8D7C, actor, gCalcMatrix); } @@ -4810,8 +4811,8 @@ void Aquas_801B91A4(Actor* actor) { f32 spf98; f32 sp94; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); if ((actor->health == 0) && (actor->state > 0)) { actor->itemDrop = DROP_NONE; @@ -4907,8 +4908,8 @@ void Aquas_801B91A4(Actor* actor) { spf9C = gPlayer[0].unk_138 + RAND_FLOAT_CENTERED(200.0f) - actor->vwork[26].z; sp94 = Math_RadToDeg(Math_Atan2F(spfA4, spf9C)); spf98 = Math_RadToDeg(-Math_Atan2F(spA0, sqrtf(SQ(spfA4) + SQ(spf9C)))); - Matrix_RotateY(gCalcMatrix, M_DTOR * sp94, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * spf98, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * sp94, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * spf98, MTXF_APPLY); spC4.x = spC4.y = 0.0f; spC4.z = 70.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spC4, &spAC); @@ -4941,9 +4942,9 @@ void Aquas_801B91A4(Actor* actor) { actor->obj.rot.y += 20.0f; actor->fwork[2] += 20.0f; if (((gGameFrameCount % 4) == 0)) { - Matrix_RotateY(gCalcMatrix, actor->fwork[2] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->vwork[27].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->vwork[27].z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->fwork[2] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->vwork[27].x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->vwork[27].z * M_DTOR, MTXF_APPLY); Aquas_801AC8A8(actor->vwork[11].x + RAND_FLOAT_CENTERED(120.0f), actor->vwork[11].y + RAND_FLOAT_CENTERED(50.0f), actor->vwork[11].z + RAND_FLOAT_CENTERED(100.0f), 2.0f, 0); @@ -5033,13 +5034,13 @@ void Aquas_801B9DB0(s32 limbIndex, Vec3f* rot, void* thisx) { case 0: break; case 1: - Matrix_RotateX(gCalcMatrix, M_PI / 2, 1); + Matrix_RotateX(gCalcMatrix, M_PI / 2, MTXF_APPLY); break; case 2: - Matrix_RotateX(gCalcMatrix, M_PI, 1); + Matrix_RotateX(gCalcMatrix, M_PI, MTXF_APPLY); break; case 3: - Matrix_RotateX(gCalcMatrix, 3 * M_PI / 2, 1); + Matrix_RotateX(gCalcMatrix, 3 * M_PI / 2, MTXF_APPLY); break; } @@ -5068,10 +5069,10 @@ void Aquas_801BA108(Actor* actor) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 95, 31, 255); } - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); if (actor->state == 1) { - Matrix_RotateX(gCalcMatrix, (actor->obj.rot.x + 90.0f) * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, (actor->obj.rot.x + 90.0f) * M_DTOR, MTXF_APPLY); } Animation_GetFrameData(&D_AQ_6000AE4, actor->unk_0B6, sp40); @@ -5250,7 +5251,7 @@ void Aquas_801BA6A4(Actor* actor) { // OBJ_ACTOR_265 draw void Aquas_801BAD7C(Actor* actor) { - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_6014FD0); } @@ -5392,7 +5393,7 @@ void Aquas_801BB26C(Actor* actor) { } actor->iwork[13] = D_i3_801C4450 * 3; - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_NEW); sp54.x = 0.0f; sp54.y = actor->obj.rot.x * 10.0f; @@ -5418,7 +5419,7 @@ void Aquas_801BB26C(Actor* actor) { } } - Matrix_RotateZ(gCalcMatrix, (actor->obj.rot.z + 90.0f) * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, (actor->obj.rot.z + 90.0f) * M_DTOR, MTXF_NEW); sp54.x = 0.0f; sp54.y = actor->obj.rot.x * 10.0f; @@ -5484,8 +5485,8 @@ void Aquas_801BB79C(Actor* actor) { } else { for (i = 0, actor122 = gObjects80; i < 50; i++, actor122++) { if ((actor122->obj.status == OBJ_ACTIVE) && (actor122->obj.id == OBJ_80_122) && - func_enmy_80062DBC(&actor->obj.pos, actor122->info.hitbox, &actor122->obj, 0.0f, 0.0f, - 0.0f) && + Object_CheckHitboxCollision(&actor->obj.pos, actor122->info.hitbox, &actor122->obj, + 0.0f, 0.0f, 0.0f) && (actor->iwork[20] == 0)) { actor->iwork[20] = 50; actor->iwork[19]++; @@ -5510,8 +5511,8 @@ void Aquas_801BB79C(Actor* actor) { } else { for (i = 0, actor122 = gObjects80; i < 50; i++, actor122++) { if ((actor122->obj.status == OBJ_ACTIVE) && (actor122->obj.id == OBJ_80_122) && - (func_enmy_80062DBC(&actor->obj.pos, actor122->info.hitbox, &actor122->obj, 0.0f, 0.0f, - 0.0f) || + (Object_CheckHitboxCollision(&actor->obj.pos, actor122->info.hitbox, &actor122->obj, + 0.0f, 0.0f, 0.0f) || (actor->obj.pos.y < (gGroundLevel + 30.0f))) && (actor->iwork[20] == 0)) { actor->iwork[20] = 50; @@ -5556,7 +5557,7 @@ void Aquas_801BB79C(Actor* actor) { Aquas_801A92EC(actor, sp70->obj.pos.x, sp70->obj.pos.y, sp70->obj.pos.z, actor->iwork[13], i); if ((actor->fwork[21] > 200.0f) && (actor->iwork[17] != 0)) { - Matrix_RotateZ(gCalcMatrix, actor->fwork[20] * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, actor->fwork[20] * M_DTOR, MTXF_NEW); sp80.x = 0.0f; sp80.y = actor->fwork[21]; sp80.z = 0.0f; @@ -5590,7 +5591,7 @@ void Aquas_801BB79C(Actor* actor) { Aquas_801A92EC(actor, sp6C->obj.pos.x, sp6C->obj.pos.y, sp6C->obj.pos.z, actor->iwork[13] + 1, i); if ((actor->fwork[21] > 200.0f) && (actor->iwork[17] != 0)) { - Matrix_RotateZ(gCalcMatrix, (actor->fwork[20] + 90.0f) * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, (actor->fwork[20] + 90.0f) * M_DTOR, MTXF_NEW); sp80.x = 0.0f; sp80.y = actor->fwork[21]; sp80.z = 0.0f; @@ -5802,18 +5803,18 @@ bool Aquas_801BC530(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* th } if (sp54 > 0.0f) { - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); if (*dList != NULL) { Matrix_MultVec3f(gCalcMatrix, &sp64, &sp58); func_edisplay_8005F670(&sp58); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, sp54, sp50, sp4C, 1); + Matrix_Scale(gGfxMatrix, sp54, sp50, sp4C, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); Matrix_Pop(&gGfxMatrix); @@ -5917,7 +5918,7 @@ void Aquas_801BC9A0(Actor* actor) { Object_SetInfo(&actor269->info, actor269->obj.id); if (i == 0) { actor269->fwork[0] = RAND_FLOAT(360.0f); - Matrix_RotateY(gCalcMatrix, actor269->fwork[0] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor269->fwork[0] * M_DTOR, MTXF_NEW); spA4.x = spA4.y = spA4.z = 5.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA4, &sp98); actor269->vel.x = sp98.x; @@ -6052,8 +6053,8 @@ void Aquas_801BD3B0(Actor* actor, f32 x, f32 y, f32 z) { actor->fwork[6] = Math_RadToDeg(Math_Atan2F(x, z)); temp = sqrtf(SQ(x) + SQ(z)); actor->fwork[7] = Math_RadToDeg(-Math_Atan2F(y, temp)); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); Math_SmoothStepToF(&actor->fwork[4], 5.0f, 0.1f, 10.0f, 0); sp38.z = actor->fwork[4]; if (actor->iwork[2] != 0) { @@ -6141,7 +6142,7 @@ void Aquas_801BD54C(Actor* actor) { actor->timer_0BC = 0; } else { Math_SmoothStepToF(&actor->fwork[3], D_i3_801C04F4[actor->iwork[1]], 0.1f, 30.0f, 0.0001f); - Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].camEye.z - D_ctx_80177D20 - actor->fwork[3], 0.1f, + Math_SmoothStepToF(&actor->obj.pos.z, gPlayer[0].cam.eye.z - D_ctx_80177D20 - actor->fwork[3], 0.1f, 30.0f, 0.00001f); } @@ -6327,7 +6328,7 @@ void Aquas_801BE034(Actor* actor) { void Aquas_801BE0F0(Actor* actor) { RCP_SetupDL(&gMasterDisp, 0x3D); - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 255, 255, 255); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_SetGfxMtx(&gMasterDisp); @@ -6338,7 +6339,7 @@ void Aquas_801BE0F0(Actor* actor) { // OBJ_80_126 draw void Aquas_801BE1FC(Object_80* obj80) { - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_600EEF0); } @@ -6349,8 +6350,8 @@ void Aquas_801BE274(Actor* actor, f32 yRot, f32 xRot) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; Vec3f sp40; - Matrix_RotateY(gCalcMatrix, 0.017453292f * yRot, 0); - Matrix_RotateX(gCalcMatrix, 0.017453292f * xRot, 1); + Matrix_RotateY(gCalcMatrix, 0.017453292f * yRot, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, 0.017453292f * xRot, MTXF_APPLY); sp40.x = sp40.y = 0.0f; sp40.z = 50.0f; @@ -6478,8 +6479,8 @@ void Aquas_801BEB1C(Actor* actor) { if (actor->health != 0) { RCP_SetupDL(&gMasterDisp, 0x37); - Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[1], actor->fwork[2], 1); - Matrix_Translate(gGfxMatrix, 0.0f, -8.0f, 51.0f, 1); + Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[1], actor->fwork[2], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, -8.0f, 51.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_AQ_6002C10); } diff --git a/src/overlays/ovl_i3/fox_so.c b/src/overlays/ovl_i3/fox_so.c index 82b5913a..477f83e5 100644 --- a/src/overlays/ovl_i3/fox_so.c +++ b/src/overlays/ovl_i3/fox_so.c @@ -466,8 +466,8 @@ void Solar_8019F20C(Actor* actor) { } break; } - actor->obj.rot.y = RAD_TO_DEG(-gPlayer[0].unk_058); - actor->obj.rot.x = RAD_TO_DEG(gPlayer[0].unk_05C); + actor->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); + actor->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); if (((gGameFrameCount % 2) == 0)) { actor->unk_0B6++; if (actor->unk_0B6 >= 3) { @@ -479,8 +479,8 @@ void Solar_8019F20C(Actor* actor) { void Solar_8019F7AC(Actor* actor) { if (actor->state != 0) { Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gGfxMatrix, actor->unk_0F4.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, actor->unk_0F4.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->unk_0F4.x * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); switch (actor->obj.id) { case OBJ_ACTOR_275: @@ -544,7 +544,7 @@ void Solar_8019FAA4(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, if (gBossHealthBar != 0) { if (gBosses[0].fwork[SO_FWK_31] > 0.0f) { if (gBosses[0].swork[SO_SWK_0] != 7) { - Matrix_RotateY(gCalcMatrix, gBosses[0].obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, gBosses[0].obj.rot.y * M_DTOR, MTXF_NEW); sp44.y = 0.0f; sp44.z = 0.0f; sp44.x = gBosses[0].fwork[SO_FWK_31] * 5.0f; @@ -552,9 +552,9 @@ void Solar_8019FAA4(Boss* bossSO, Effect* effect, f32 xPos, f32 yPos, f32 zPos, effect->vel.x = sp38.x * hVelMod; effect->vel.z = gPlayer[0].vel.z + (sp38.z * hVelMod); } else { - Matrix_RotateZ(gCalcMatrix, bossSO->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, gBosses[0].obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, gBosses[0].unk_078.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, bossSO->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, gBosses[0].obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, gBosses[0].unk_078.y * M_DTOR, MTXF_APPLY); sp44.x = effect->obj.pos.x - bossSO->obj.pos.x; sp44.y = effect->obj.pos.y - bossSO->obj.pos.y; sp44.z = effect->obj.pos.z - bossSO->obj.pos.z; @@ -676,9 +676,9 @@ void Solar_801A0120(Effect* effect) { switch (effect->state) { case 0: - Matrix_Translate(gCalcMatrix, effect->vel.x, effect->vel.y, effect->vel.z, 0); - Matrix_RotateY(gCalcMatrix, effect->unk_60.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, effect->unk_60.x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, effect->vel.x, effect->vel.y, effect->vel.z, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, effect->unk_60.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, effect->unk_60.x * M_DTOR, MTXF_APPLY); sp3C.x = 0.0f; sp3C.y = 0.0f; sp3C.z = -effect->scale1; @@ -690,7 +690,7 @@ void Solar_801A0120(Effect* effect) { effect->unk_4C = 0; } } - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { func_effect_8007A774(&gPlayer[0], effect, effect->scale2 * 12.0f); } if (effect->unk_60.x > 190.0f) { @@ -757,7 +757,7 @@ void Solar_801A0120(Effect* effect) { effect->vel.z = gPlayer[0].vel.z; Math_SmoothStepToF(&effect->vel.y, -65.0f, 2.0f, 1.0f, 0.5f); } - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { func_effect_8007A774(&gPlayer[0], effect, effect->scale2 * 12.0f); } if (effect->obj.pos.y < -20.0f) { @@ -798,7 +798,7 @@ void Solar_801A0120(Effect* effect) { effect->vel.x = SIN_DEG(effect->unk_60.z) * (effect->unk_60.x * 10.0f); effect->vel.y = COS_DEG(effect->unk_60.z) * (effect->unk_60.x * 10.0f); effect->vel.z = gPlayer[0].vel.z + 15.0f; - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { func_effect_8007A774(&gPlayer[0], effect, effect->scale2 * 18.0f); if ((effect->unk_4C == 0) && ((effect->scale2 >= 9.8f) || (effect->scale2 <= 4.4f))) { AUDIO_PLAY_SFX(0x31033078, effect->sfxSource, 4); @@ -822,7 +822,7 @@ void Solar_801A0120(Effect* effect) { effect->vel.x = SIN_DEG(effect->unk_60.z) * sp50 * 50.0f; effect->vel.y = COS_DEG(effect->unk_60.z) * sp50 * 50.0f; effect->vel.z = gPlayer[0].vel.z + 80.0f; - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { func_effect_8007A774(&gPlayer[0], effect, effect->scale2 * 18.0f); if ((effect->unk_4C == 0) && ((effect->scale2 >= 9.8f) || (effect->scale2 <= 4.4f))) { AUDIO_PLAY_SFX(0x31033078, effect->sfxSource, 4); @@ -969,20 +969,20 @@ void Solar_801A10F4(Player* player) { gCsFrameCount = 0; Rand_SetSeed(1, 29100, 9786); player->unk_1D0 = 1; - player->camEye.x = -2000.0f; + player->cam.eye.x = -2000.0f; gCsCamEyeX = -2800.0f; - player->camEye.y = gCsCamEyeY = 120.0f; - player->camEye.z = -1800.0f; + player->cam.eye.y = gCsCamEyeY = 120.0f; + player->cam.eye.z = -1800.0f; gCsCamEyeZ = -2800.0f; - player->camAt.x = gCsCamAtX = -1000.0f; - player->camAt.y = 1400.0f; + player->cam.at.x = gCsCamAtX = -1000.0f; + player->cam.at.y = 1400.0f; gCsCamAtY = 400.0f; - player->camAt.z = gCsCamAtZ = -2300.0f; + player->cam.at.z = gCsCamAtZ = -2300.0f; D_ctx_80177A48[0] = 0.0045f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; player->unk_0D0 = 0.0f; gFillScreenAlpha = 255; @@ -1029,17 +1029,17 @@ void Solar_801A10F4(Player* player) { } if (gCsFrameCount == 410) { player->unk_1D0++; - player->camEye.x = 200.0f; + player->cam.eye.x = 200.0f; gCsCamEyeX = 800.0f; - player->camEye.y = 140.0f; + player->cam.eye.y = 140.0f; gCsCamEyeY = player->pos.y + 200.0f; - player->camEye.z = gCsCamEyeZ = 400.0f; + player->cam.eye.z = gCsCamEyeZ = 400.0f; - player->camAt.x = 400.0f; + player->cam.at.x = 400.0f; gCsCamAtX = 200.0f; - player->camAt.y = 140.0f; + player->cam.at.y = 140.0f; gCsCamAtY = 1200.0f; - player->camAt.z = -500.0f; + player->cam.at.z = -500.0f; player->pos.y = 1200.0f; player->pos.z = -2500.0f; @@ -1067,7 +1067,7 @@ void Solar_801A10F4(Player* player) { Object_Kill(&gActors[5].obj, gActors[5].sfxSource); Solar_801A0DF8(30.0f, -1500.0f, 160.0f, 3, 2.0f); } - if (player->camEye.z <= -2465.0f) { + if (player->cam.eye.z <= -2465.0f) { player->unk_1D0++; gCsCamEyeY = player->pos.y + 180.0f; gCsCamAtX = 0.0f; @@ -1079,7 +1079,7 @@ void Solar_801A10F4(Player* player) { case 3: D_ctx_80177CE8 += 60.0f; if (((gGameFrameCount % 4) == 0)) { - Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -400.0f - ((player->camEye.y - 1380.0f) * 0.3f), + Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -400.0f - ((player->cam.eye.y - 1380.0f) * 0.3f), RAND_FLOAT_CENTERED(2000.0f) + 500.0f + D_ctx_80177D20, RAND_FLOAT(20.0f) + 20.0f); } if (gCsFrameCount == 615) { @@ -1115,22 +1115,22 @@ void Solar_801A10F4(Player* player) { player->unk_0D0 = D_play_80161A54; func_play_800A6148(); gLevelStatusScreenTimer = 50; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = 0; player->pos.y = 350.0f; - player->camEye.x = player->pos.x; - player->camEye.y = 50.0f + player->pos.y * player->unk_148; - player->camEye.z = 30.0f; + player->cam.eye.x = player->pos.x; + player->cam.eye.y = 50.0f + player->pos.y * player->unk_148; + player->cam.eye.z = 30.0f; - player->camAt.x = player->pos.x; - player->camAt.y = 20.0f + player->pos.y * player->unk_148; - player->camAt.z = player->unk_138; + player->cam.at.x = player->pos.x; + player->cam.at.y = 20.0f + player->pos.y * player->unk_148; + player->cam.at.z = player->unk_138; D_ctx_80177950 = 1.0f; func_8001D1C8(255, 3); AUDIO_PLAY_SFX(0x4100C023, gDefaultSfxSource, 4); - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; gFillScreenAlphaTarget = 0; player->timer_1F8 = 15; gPlayer[0].shields = 255; @@ -1140,14 +1140,14 @@ void Solar_801A10F4(Player* player) { D_ctx_80177CE8 += 60.0f; break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); sp50.x = 0.f; sp50.y = 0.0f; sp50.z = player->unk_0D0; @@ -1366,8 +1366,8 @@ void Solar_801A23F4(Boss* bossSO) { bossSO->fwork[SO_FWK_3] = 2600.0f; Math_SmoothStepToAngle(&bossSO->obj.rot.y, 0.0f, 1.0f, 1.5f, 1.0f); if (bossSO->unk_04C == 65) { - Matrix_RotateX(gCalcMatrix, D_i3_801C2768[0] * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, D_i3_801C2768[1] * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, D_i3_801C2768[0] * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, D_i3_801C2768[1] * M_DTOR, MTXF_APPLY); sp40.x = 0.0f; sp40.y = -200.0f; sp40.z = 1100.0f; @@ -1815,8 +1815,8 @@ void Solar_801A3C4C(Boss* bossSO) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); Audio_KillSfxById(0x4100C023); AUDIO_PLAY_SFX(0x2940D09A, bossSO->sfxSource, 4); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].timer_1F8 = 0; gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8; gPlayer[0].unk_0E8 += gPlayer[0].unk_114; @@ -1848,8 +1848,8 @@ void Solar_801A4214(Boss* bossSO) { bossSO->unk_04C = 38; bossSO->fwork[SO_FWK_0] = 0.05f; } - Matrix_RotateX(gCalcMatrix, bossSO->fwork[SO_FWK_1] * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, -bossSO->fwork[SO_FWK_2] * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, bossSO->fwork[SO_FWK_1] * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -bossSO->fwork[SO_FWK_2] * M_DTOR, MTXF_APPLY); sp50.x = 0.0f; sp50.y = 200.0f; sp50.z = 1100.0f; @@ -2318,7 +2318,7 @@ void Solar_801A5B3C(Boss* bossSO) { bossSO->info.hitbox[13] = bossSO->fwork[SO_FWK_24] - bossSO->obj.pos.z; bossSO->info.hitbox[15] = bossSO->fwork[SO_FWK_23] - bossSO->obj.pos.y; bossSO->info.hitbox[17] = bossSO->fwork[SO_FWK_22] - bossSO->obj.pos.x; - Matrix_RotateY(gCalcMatrix, -bossSO->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -bossSO->obj.rot.y * M_DTOR, MTXF_NEW); sp44.x = bossSO->fwork[SO_FWK_28] - bossSO->obj.pos.x; sp44.y = bossSO->fwork[SO_FWK_29] - bossSO->obj.pos.y; sp44.z = bossSO->fwork[SO_FWK_30] - bossSO->obj.pos.z; @@ -2441,12 +2441,12 @@ void Solar_801A5B3C(Boss* bossSO) { sp1BC = Animation_GetFrameData(&D_SO_6009D30, bossSO->unk_04C, sp50); break; } - Matrix_RotateZ(gCalcMatrix, -bossSO->vwork[SO_VWK_29].z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -bossSO->vwork[SO_VWK_29].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -bossSO->vwork[SO_VWK_29].y * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -bossSO->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -bossSO->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -bossSO->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -bossSO->vwork[SO_VWK_29].z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -bossSO->vwork[SO_VWK_29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -bossSO->vwork[SO_VWK_29].y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -bossSO->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -bossSO->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -bossSO->obj.rot.y * M_DTOR, MTXF_APPLY); if ((bossSO->health > 0) && (bossSO->swork[SO_SWK_0] == 1)) { sp44.x = gPlayer[0].pos.x - bossSO->obj.pos.x; sp44.y = gPlayer[0].pos.y - bossSO->obj.pos.y; @@ -2704,7 +2704,7 @@ void Solar_801A71B8(Boss* bossSO) { -89.0f, -90.0f, -88.0f, -36.0f, -73.0f, -95.0f, -91.0f, -83.0f, -91.0f, }; - Matrix_Scale(gCalcMatrix, bossSO->unk_3F8, bossSO->unk_3F8, bossSO->unk_3F8, 1); + Matrix_Scale(gCalcMatrix, bossSO->unk_3F8, bossSO->unk_3F8, bossSO->unk_3F8, MTXF_APPLY); if (gBossActive != 0) { Animation_DrawSkeleton(2, D_SO_600E470, bossSO->vwork, Solar_801A68A8, Solar_801A6BDC, bossSO, gCalcMatrix); } @@ -2715,18 +2715,18 @@ void Solar_801A71B8(Boss* bossSO) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y, bossSO->obj.pos.z - 500.0f + D_ctx_80177D20, - 1); - Matrix_Scale(gGfxMatrix, D_i3_801C2768[3], D_i3_801C2768[2], 1.0f, 1); + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i3_801C2768[3], D_i3_801C2768[2], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); for (i = 0; i < 9; i++) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x + spE8[i].x, bossSO->obj.pos.y + spE8[i].y, - bossSO->obj.pos.z + D_ctx_80177D20 + spE8[i].z, 1); - Matrix_RotateY(gGfxMatrix, spC4[i] * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, spA0[i] * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, D_i3_801C2768[4 + i], 100.0f, 1.0f, 1); + bossSO->obj.pos.z + D_ctx_80177D20 + spE8[i].z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, spC4[i] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, spA0[i] * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i3_801C2768[4 + i], 100.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -2735,23 +2735,23 @@ void Solar_801A71B8(Boss* bossSO) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y + 230.0f, - bossSO->obj.pos.z - 300.0f + D_ctx_80177D20, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 5.0f, 1); - Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], 1); + bossSO->obj.pos.z - 300.0f + D_ctx_80177D20, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 5.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); - Matrix_Scale(gGfxMatrix, 0.6f, 1.0f, 0.6f, 1); + Matrix_Scale(gGfxMatrix, 0.6f, 1.0f, 0.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, bossSO->obj.pos.x, bossSO->obj.pos.y + 270.0f, - (bossSO->obj.pos.z - 300.0f) + D_ctx_80177D20, 1); - Matrix_RotateX(gGfxMatrix, -3.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], 1); + (bossSO->obj.pos.z - 300.0f) + D_ctx_80177D20, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -3.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i3_801C2768[13], 1.0f, D_i3_801C2768[13], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); - Matrix_Scale(gGfxMatrix, 0.6f, 1.0f, 0.6f, 1); + Matrix_Scale(gGfxMatrix, 0.6f, 1.0f, 0.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); } @@ -2813,18 +2813,18 @@ void Solar_801A7930(Player* player) { switch (player->unk_1D0) { case 0: gCsFrameCount = 0; - player->unk_034 = player->unk_4D8 = 0.0f; + player->camRoll = player->unk_4D8 = 0.0f; player->unk_0D0 = 40.0f; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = player->unk_130 = player->unk_12C = player->unk_110 = 0.0f; player->unk_234 = 1; - gCsCamEyeX = player->camEye.x; - gCsCamEyeY = player->camEye.y; - gCsCamEyeZ = player->camEye.z; - gCsCamAtX = player->camAt.x; - gCsCamAtY = player->camAt.y; - gCsCamAtZ = player->camAt.z; + gCsCamEyeX = player->cam.eye.x; + gCsCamEyeY = player->cam.eye.y; + gCsCamEyeZ = player->cam.eye.z; + gCsCamAtX = player->cam.at.x; + gCsCamAtY = player->cam.at.y; + gCsCamAtZ = player->cam.at.z; for (i = 10; i < 60; i++) { if (gActors[i].unk_0B6 == 0) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); @@ -2893,20 +2893,20 @@ void Solar_801A7930(Player* player) { player->pos.y = 200.0f; player->pos.z = -(D_ctx_80177D20 - 500.0f); player->unk_1D0++; - player->wings.unk_2C = 1; + player->wings.modelId = 1; func_8001C8B8(0); AUDIO_PLAY_BGM(SEQ_ID_GOOD_END); D_ctx_80177A98 = 1; func_play_800A6148(); D_ctx_80177A48[1] = 0.0f; D_ctx_80177A48[2] = 0.0f; - player->camEye.x = 0.0f; - player->camEye.y = player->pos.y + 80.0f; - player->camEye.z = player->pos.z + D_ctx_80177D20 - 4000.0f; + player->cam.eye.x = 0.0f; + player->cam.eye.y = player->pos.y + 80.0f; + player->cam.eye.z = player->pos.z + D_ctx_80177D20 - 4000.0f; gCsCamEyeZ = player->pos.z + D_ctx_80177D20 - 4900.0f; - player->camAt.x = gCsCamAtX = 0.0f; - player->camAt.y = gCsCamAtY = 200.0f; - player->camAt.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; + player->cam.at.x = gCsCamAtX = 0.0f; + player->cam.at.y = gCsCamAtY = 200.0f; + player->cam.at.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; D_ctx_80177A48[0] = 0.0f; Object_Kill(&gActors[4].obj, gActors[4].sfxSource); Object_Kill(&gActors[5].obj, gActors[5].sfxSource); @@ -2964,20 +2964,20 @@ void Solar_801A7930(Player* player) { } Math_SmoothStepToF(&player->pos.z, -(D_ctx_80177D20 + 4350.0f), 1.0f, 20.0f, 0.0001f); if (gCsFrameCount >= 620) { - Math_SmoothStepToF(&player->camEye.x, 0.0f, 1.0f, 10.0f, 0); - Math_SmoothStepToF(&player->camEye.y, player->pos.y + 52.0f, 1.0f, 16.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, (player->pos.z + D_ctx_80177D20) - 50.0f, 1.0f, 21.5f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, 0.0f, 1.0f, 10.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + 52.0f, 1.0f, 16.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, (player->pos.z + D_ctx_80177D20) - 50.0f, 1.0f, 21.5f, 0.0f); } - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; break; case 4: D_ctx_80177CE8 += 60.0f; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; D_ctx_80177A48[1] += D_ctx_80177A48[2] * 0.8f; - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); sp60.x = 0.0f; sp60.y = 0.0f; sp60.z = -700.0f; @@ -3018,7 +3018,7 @@ void Solar_801A7930(Player* player) { if (gFillScreenAlpha == 255) { func_8001CA24(0); Audio_FadeOutAll(10); - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; D_play_800D3180[LEVEL_SOLAR] = Play_CheckMedalStatus(100) + 1; @@ -3102,8 +3102,8 @@ void Solar_801A7930(Player* player) { } break; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); sp60.x = 0.0f; sp60.y = 0.0f; sp60.z = player->unk_0D0; @@ -3118,12 +3118,12 @@ void Solar_801A7930(Player* player) { player->unk_138 = player->pos.z; player->unk_0F8 = player->unk_0EC; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); player->unk_088 += 10.0f; player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->unk_0F4 += 8.0f; @@ -3153,8 +3153,8 @@ void Solar_801A8BE8(Actor* actor) { actor->unk_0F4.x += 0.2f; break; } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); sp3C.x = 0.0f; sp3C.y = 0.0f; sp3C.z = actor->fwork[0]; diff --git a/src/overlays/ovl_i3/fox_zo.c b/src/overlays/ovl_i3/fox_zo.c index 96c553fa..4049c3fd 100644 --- a/src/overlays/ovl_i3/fox_zo.c +++ b/src/overlays/ovl_i3/fox_zo.c @@ -538,11 +538,11 @@ void Zoness_8018FF50(Actor* actor) { f32 temp; (void) " Enm->hitNO %d\n"; // Unclear where this goes. hitNO can't be info.bonus. Damage related? - actor->obj.rot.y = RAD_TO_DEG( - Math_Atan2F(gPlayer[0].camEye.x - actor->obj.pos.x, gPlayer[0].camEye.z - (actor->obj.pos.z + D_ctx_80177D20))); - temp = sqrtf(SQ(gPlayer[0].camEye.z - (actor->obj.pos.z + D_ctx_80177D20)) + - SQ(gPlayer[0].camEye.x - actor->obj.pos.x)); - actor->obj.rot.x = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].camEye.y - actor->obj.pos.y, temp)); + actor->obj.rot.y = RAD_TO_DEG(Math_Atan2F(gPlayer[0].cam.eye.x - actor->obj.pos.x, + gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20))); + temp = sqrtf(SQ(gPlayer[0].cam.eye.z - (actor->obj.pos.z + D_ctx_80177D20)) + + SQ(gPlayer[0].cam.eye.x - actor->obj.pos.x)); + actor->obj.rot.x = RAD_TO_DEG(-Math_Atan2F(gPlayer[0].cam.eye.y - actor->obj.pos.y, temp)); } void Zoness_80190028(Actor* actor, Vec3f* pos, Vec3f* rot, f32 xVel, f32 yVel, f32 zVel, s32 arg6, f32 scale, s32 arg8, @@ -640,7 +640,7 @@ void Zoness_80190204(s32 limbIndex, Vec3f* rot, void* thisx) { void Zoness_80190430(Actor* actor) { Vec3f sp30[30]; - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Animation_GetFrameData(&D_ZO_600E5EC, actor->unk_0B6, sp30); Animation_DrawSkeleton(3, D_ZO_600E7D8, sp30, Zoness_8019019C, Zoness_80190204, actor, gCalcMatrix); } @@ -653,9 +653,9 @@ void Zoness_801904CC(Actor* actor) { switch (actor->state) { case 0: actor->health = 20; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); spA4.x = spA4.y = 0.0f; spA4.z = actor->fwork[10]; Matrix_MultVec3f(gCalcMatrix, &spA4, &sp98); @@ -726,7 +726,7 @@ void Zoness_80190790(Actor* actor) { break; } } - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, MTXF_NEW); sp44.x = 0.f; sp44.y = 0.f; sp44.z = 20.0f; @@ -773,11 +773,11 @@ Gfx* D_i3_801BF5A8[3] = { D_ZO_60012A0, D_ZO_60239E0, D_ZO_6023730 }; void Zoness_80190B4C(f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, u8 arg6, s32 arg7) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, xPos, yPos, zPos + D_ctx_80177D20, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Translate(gGfxMatrix, xPos, yPos, zPos + D_ctx_80177D20, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * yRot, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * xRot, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * zRot, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); if (arg7 != 0) { @@ -861,8 +861,8 @@ void Zoness_80191010(Actor* actor) { actor->state++; break; case 1: - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); sp8C.x = 0.0f; sp8C.y = 0.0f; sp8C.z = (actor->fwork[3] * 10.0f) + 30.0f; @@ -933,7 +933,7 @@ void Zoness_80191010(Actor* actor) { void Zoness_801914C4(Actor* actor) { Vec3f sp38[20]; - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Animation_GetFrameData(&D_ZO_601AA48, actor->unk_0B6, sp38); Animation_DrawSkeleton(3, D_ZO_601AB14, sp38, NULL, Zoness_80190F28, actor, gCalcMatrix); @@ -1026,8 +1026,8 @@ void Zoness_80191680(Actor* actor) { sp5C = 30.0f; } Math_SmoothStepToAngle(&actor->obj.rot.z, sp5C, 0.2f, 4.0f, 0.0f); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); sp48.x = sp48.y = 0.0f; sp48.z = 30.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp48, &sp3C); @@ -1087,8 +1087,8 @@ void Zoness_80191BC4(Actor* actor) { void Zoness_80191DB0(Actor* actor) { RCP_SetupDL_40(); gSPDisplayList(gMasterDisp++, D_ZO_6019EB0); - Matrix_RotateY(gGfxMatrix, actor->fwork[0] * 0.7f * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[0] * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, actor->fwork[0] * 0.7f * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[0] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6023D50); } @@ -1130,7 +1130,7 @@ void Zoness_80191E94(s32 limbIndex, Vec3f* rot, void* thisx) { void Zoness_80191FFC(Actor* actor) { Vec3f sp30[20]; - Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gCalcMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Animation_GetFrameData(&D_ZO_60195EC, actor->unk_0B6, sp30); Animation_DrawSkeleton(3, D_ZO_6019738, sp30, NULL, Zoness_80191E94, actor, gCalcMatrix); } @@ -1201,9 +1201,9 @@ void Zoness_80192094(Actor* actor) { } } else { Math_SmoothStepToF(&actor->vel.z, -40.0f, 0.1f, 1.0f, 0.00001f); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->fwork[2] * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->fwork[2] * M_DTOR, MTXF_APPLY); sp70.x = 0.0f; sp70.y = actor->fwork[3]; sp70.z = 0.0f; @@ -1295,8 +1295,8 @@ void Zoness_80192834(Actor* actor) { switch (actor->state) { case 0: - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, 5.497787f, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, 5.497787f, MTXF_APPLY); sp84.y = 0.0f; sp84.x = 0.0f; sp84.z = (actor->obj.rot.x * 10.0f) + 15.0f; @@ -1430,7 +1430,7 @@ void Zoness_80192E64(Actor* actor) { if (actor->timer_0BC == 0) { actor->unk_0B6++; if (actor->unk_0B6 == 5) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); sp80.x = 0.0f; sp80.y = 0.0f; sp80.z = 50.0f; @@ -1576,11 +1576,11 @@ void Zoness_80193628(Object* obj, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar Vec3f sp54 = { 0.0f, 0.0f, 40.0f }; Vec3f sp48; - Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, M_DTOR * arg5, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg4, 1); + Matrix_RotateY(gCalcMatrix, obj->rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, obj->rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, obj->rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg5, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg4, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp54, &sp48); func_effect_8007F04C(OBJ_EFFECT_353, arg1 + sp48.x + arg6, arg2 + sp48.y, arg3 + sp48.z, arg4, arg5, 0.0f, obj->rot.x, obj->rot.y, obj->rot.z, sp48.x + arg6, sp48.y, sp48.z, 1.0f); @@ -1591,7 +1591,7 @@ void Zoness_801937D8(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot) { Vec3f sp20; Effect_Initialize(effect); - Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, 0); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_NEW); sp2C.x = 0.0f; sp2C.y = 0.0f; sp2C.z = 10.0f; @@ -1629,7 +1629,7 @@ void Zoness_80193970(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 yRot, s32 Vec3f sp20; Effect_Initialize(effect); - Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, 0); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_NEW); sp2C.x = 0.0f; sp2C.y = 0.0f; sp2C.z = 20.0f; @@ -1985,8 +1985,8 @@ void Zoness_80194394(s32 limbIndex, Vec3f* rot, void* thisx) { } void Zoness_801949DC(Boss* bossZO) { - Matrix_Translate(gCalcMatrix, 0.0f, bossZO->fwork[ZO_FWK_3], 0.0f, 1); - Matrix_Scale(gCalcMatrix, 2.6f, 2.6f, 2.6f, 1); + Matrix_Translate(gCalcMatrix, 0.0f, bossZO->fwork[ZO_FWK_3], 0.0f, MTXF_APPLY); + Matrix_Scale(gCalcMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); Animation_DrawSkeleton(3, D_ZO_6019E18, bossZO->vwork, Zoness_80193D08, Zoness_80194394, bossZO, gCalcMatrix); } @@ -2035,7 +2035,7 @@ void Zoness_80194A84(Boss* bossZO) { } if (sZoSwork[ZO_BSS_24] == 0) { Math_SmoothStepToF(&sZoFwork[ZO_BSF_27], sZoFwork[ZO_BSF_26], 0.1f, 2.0f, 0.00001f); - Math_SmoothStepToF(&bossZO->obj.pos.z, gPlayer[0].camEye.z - D_ctx_80177D20 + sZoFwork[ZO_BSF_28], 0.1f, + Math_SmoothStepToF(&bossZO->obj.pos.z, gPlayer[0].cam.eye.z - D_ctx_80177D20 + sZoFwork[ZO_BSF_28], 0.1f, sZoFwork[ZO_BSF_27], 0.00001f); } if ((gGameFrameCount % 4U) == 0) { @@ -2272,11 +2272,11 @@ void Zoness_80194A84(Boss* bossZO) { bossZO->fwork[ZO_FWK_5] += 4.0f; bossZO->vel.x = COS_DEG(bossZO->fwork[ZO_FWK_5]) * 40.0f; padF4 = Math_Atan2F(bossZO->fwork[ZO_FWK_6] - bossZO->obj.pos.x, - gPlayer[0].camEye.z - D_ctx_80177D20 + D_i3_801BF6BC[bossZO->swork[ZO_SWK_1]] - + gPlayer[0].cam.eye.z - D_ctx_80177D20 + D_i3_801BF6BC[bossZO->swork[ZO_SWK_1]] - bossZO->obj.pos.z); padF4 = Math_RadToDeg(padF4); Math_SmoothStepToAngle(&bossZO->fwork[ZO_FWK_7], padF4, 0.1f, 100.0f, 0.001f); - Matrix_RotateY(gCalcMatrix, bossZO->fwork[ZO_FWK_7] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, bossZO->fwork[ZO_FWK_7] * M_DTOR, MTXF_NEW); spE4.x = spE4.y = 0.0f; spE4.z = 20.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spE4, &spCC); @@ -2294,8 +2294,8 @@ void Zoness_80194A84(Boss* bossZO) { 0.00001f); Math_SmoothStepToAngle(&bossZO->obj.rot.y, D_i3_801BF6D4[var_s0], 0.1f, bossZO->fwork[ZO_FWK_8], 0.00001f); - Matrix_RotateX(gCalcMatrix, -bossZO->obj.rot.x * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -bossZO->obj.rot.x * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); spE4.x = gPlayer[0].pos.x - sZoFwork[ZO_BSF_93_X]; spE4.y = gPlayer[0].pos.y - sZoFwork[ZO_BSF_93_Y]; spE4.z = gPlayer[0].unk_138 - sZoFwork[ZO_BSF_93_Z]; @@ -2492,9 +2492,10 @@ void Zoness_80194A84(Boss* bossZO) { sZoFwork[ZO_BSF_23] = 10.0f; gShowBossHealth = 0; func_effect_8007A568(bossZO->obj.pos.x, bossZO->obj.pos.y, bossZO->obj.pos.z, 80.0f); - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gCsFrameCount = 0; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8 = 0; gPlayer[0].unk_0E8 += gPlayer[0].unk_114; if (gPlayer[0].unk_0E8 > 360.0f) { @@ -2614,14 +2615,14 @@ void Zoness_80194A84(Boss* bossZO) { spE4.z = gPlayer[0].unk_138 - sZoFwork[ZO_BSF_65_Z]; Math_SmoothStepToAngle(&sZoFwork[ZO_BSF_19], Math_RadToDeg(Math_Atan2F(spE4.x, spE4.z)), 0.1f, 5.0f, 0.0f); if ((bossZO->state >= 3) && (bossZO->state < 6)) { - Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &spA8, &spD8); Matrix_MultVec3f(gCalcMatrix, &sp9C, &spCC); sp78 = spD8; sp6C = spCC; - Matrix_RotateX(gCalcMatrix, -bossZO->obj.rot.x * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -bossZO->obj.rot.x * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); spE4.x = gPlayer[0].pos.x - (bossZO->obj.pos.x + spD8.x); spE4.y = gPlayer[0].pos.y - (bossZO->obj.pos.y + spD8.y); spE4.z = gPlayer[0].unk_138 - (bossZO->obj.pos.z + spD8.z); @@ -3085,10 +3086,10 @@ void Zoness_801986FC(Boss* bossZO, s32 arg1, f32 xOff, f32 yOff, f32 zOff, f32 y newActor->obj.pos.z = bossZO->obj.pos.z + zOff; newActor->health = 10; - Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, sZoFwork[ZO_BSF_15 + arg1] * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * yRot, 1); + Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, sZoFwork[ZO_BSF_15 + arg1] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * yRot, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp60, &sp54); newActor->vel.x = sp54.x; newActor->vel.y = sp54.y; @@ -3130,8 +3131,8 @@ void Zoness_801989FC(Boss* bossZO) { newActor->timer_0BC = 300; newActor->health = 10; - Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp70, &sp64); newActor->vel.x = sp64.x; newActor->vel.z = bossZO->vel.z + sp64.z; @@ -3175,11 +3176,11 @@ void Zoness_80198BE8(Boss* bossZO, s32 arg1) { effect->obj.pos.x = sZoFwork[ZO_BSF_93_X + 3 * arg1]; effect->obj.pos.y = sZoFwork[ZO_BSF_93_Y + 3 * arg1]; effect->obj.pos.z = sZoFwork[ZO_BSF_93_Z + 3 * arg1]; - Matrix_RotateY(gCalcMatrix, sZoFwork[ZO_BSF_8 + 2 * arg1] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, sZoFwork[ZO_BSF_7 + 2 * arg1] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, bossZO->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, sZoFwork[ZO_BSF_8 + 2 * arg1] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, sZoFwork[ZO_BSF_7 + 2 * arg1] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, bossZO->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, bossZO->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, bossZO->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp3C, &sp30); effect->vel.x = sp30.x; effect->vel.y = sp30.y; @@ -3361,7 +3362,7 @@ void Zoness_8019969C(Actor* actor) { void Zoness_8019983C(Actor* actor) { RCP_SetupDL(&gMasterDisp, 70); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, 1); + Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6017950); } @@ -3472,7 +3473,7 @@ void Zoness_80199A28(Actor* actor) { } void Zoness_80199E24(Actor* actor) { - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6025E60); } @@ -3552,14 +3553,14 @@ void Zoness_8019A1FC(Actor* actor) { s32 var_s0; s32 var_s1; - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPDisplayList(gMasterDisp++, D_ZO_601C590); RCP_SetupDL_60(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); if (((actor->state == 1) && (gBosses[0].timer_052 != 0)) || (actor->state == 0)) { - Matrix_RotateY(gGfxMatrix, gGameFrameCount * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, gGameFrameCount * M_DTOR, MTXF_APPLY); } var_fv0 = sZoFwork[ZO_BSF_60_Y] + -1.0f * actor->fwork[0] - actor->obj.pos.y; @@ -3573,10 +3574,10 @@ void Zoness_8019A1FC(Actor* actor) { var_s1 = 1; } for (var_s0 = 0; var_s0 < var_s1; var_s0++) { - Matrix_Translate(gGfxMatrix, 0.0f, 30.0f, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, 1.5707964f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 30.0f, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, 1.5707964f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 0.75f, 0.75f, 0.75f, 1); + Matrix_Scale(gGfxMatrix, 0.75f, 0.75f, 0.75f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6018660); Matrix_Pop(&gGfxMatrix); @@ -3594,8 +3595,8 @@ void Zoness_8019A4E0(Actor* actor, f32 xPos, f32 yPos, f32 zPos, f32 arg4) { sp3C = Math_Atan2F(sp4C, sp44); sp40 = -Math_Atan2F(sp48, sqrtf(SQ(sp4C) + SQ(sp44))); - Matrix_RotateY(gCalcMatrix, sp3C, 0); - Matrix_RotateX(gCalcMatrix, sp40, 1); + Matrix_RotateY(gCalcMatrix, sp3C, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, sp40, MTXF_APPLY); sp30.x = 0.0f; sp30.y = 0.0f; sp30.z = arg4; @@ -3678,7 +3679,8 @@ void Zoness_8019A5D4(Actor* actor) { 30.0f); actor->vel.z -= D_ctx_80177D08; } - if (func_enmy_80062DBC(&actor->obj.pos, gBosses[0].info.hitbox, &gBosses[0].obj, 0.0f, 0.0f, 0.0f) != 0) { + if (Object_CheckHitboxCollision(&actor->obj.pos, gBosses[0].info.hitbox, &gBosses[0].obj, 0.0f, 0.0f, + 0.0f) != 0) { actor->fwork[6] = 50.0f; AUDIO_PLAY_SFX(0x19030003, actor->sfxSource, 4); } @@ -3753,22 +3755,22 @@ void Zoness_8019ACCC(Actor* actor) { if (var_s4 < 0) { var_s4 = 0; } - Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + D_ctx_80177D20, 1); - Matrix_RotateY(gGfxMatrix, temp_fs4, 1); - Matrix_RotateX(gGfxMatrix, temp_fs0_2, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, temp_fs4, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, temp_fs0_2, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, MTXF_APPLY); sp94 = (180.0f / var_s4) + 1.0f; for (i = 0; i < var_s4; i++) { temp_fs1_2 = SIN_DEG(i * sp94) * actor->fwork[5]; temp_fs0_4 = COS_DEG(i * sp94) * actor->fwork[5] * -0.25f; - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, actor->fwork[1], 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, actor->fwork[1], MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, temp_fs1_2, 0.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * temp_fs0_4, 1); + Matrix_Translate(gGfxMatrix, 0.0f, temp_fs1_2, 0.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * temp_fs0_4, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, M_DTOR * var_fs5, 1); - Matrix_RotateX(gGfxMatrix, 1.5707964f, 1); - Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * var_fs5, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, 1.5707964f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6018660); Matrix_Pop(&gGfxMatrix); @@ -3778,17 +3780,17 @@ void Zoness_8019ACCC(Actor* actor) { } Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + D_ctx_80177D20, 1); - Matrix_RotateY(gGfxMatrix, actor->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, 1); + Matrix_Translate(gGfxMatrix, actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z + D_ctx_80177D20, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.6f, 2.6f, 2.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 70); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gSPDisplayList(gMasterDisp++, D_ZO_6004380); - Matrix_RotateY(gGfxMatrix, sZoFwork[ZO_BSF_19] * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[2] * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, actor->fwork[3] * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, sZoFwork[ZO_BSF_19] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[2] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, actor->fwork[3] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_55(); gSPDisplayList(gMasterDisp++, D_ZO_601BCC0); @@ -3820,7 +3822,7 @@ void Zoness_8019B1F0(Actor* actor) { actor->obj.pos.y = 120.0f; actor->scale = -1.0f; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); sp78.x = sp78.y = 0.0f; sp78.z = actor->obj.rot.z; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp78, &sp6C); @@ -3884,7 +3886,7 @@ void Zoness_8019B548(Actor* actor) { Vec3f sp58; Actor* otherActor; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); switch (actor->state) { case 0: for (i = 1; i < 3; i++) { @@ -4146,11 +4148,11 @@ void Zoness_8019C200(Actor* actor) { } else { actor->fwork[0] = 30.0f; } - Matrix_RotateZ(gCalcMatrix, actor->fwork[0] * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, actor->fwork[0] * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8AC, &sp2C); actor->fwork[1] = sp2C.x; actor->fwork[2] = actor->fwork[3] + sp2C.y; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8B8, &sp2C); for (i = 0, newActor = gActors; i < 60; i++, newActor++) { if (newActor->obj.status == OBJ_FREE) { @@ -4185,14 +4187,14 @@ void Zoness_8019C454(Actor* actor) { } if (1) {} } - Matrix_RotateZ(gCalcMatrix, actor->fwork[0] * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, actor->fwork[0] * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8AC, &sp34); actor->fwork[1] = sp34.x; actor->fwork[2] = actor->fwork[3] + sp34.y; otherActor = &gActors[actor->iwork[3]]; switch (actor->state) { case 0: - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i3_801BF8B8, &sp34); if ((otherActor->obj.status != OBJ_FREE) && (otherActor->obj.id == OBJ_ACTOR_251)) { otherActor->obj.pos.x = actor->obj.pos.x + sp34.x; @@ -4247,29 +4249,29 @@ void Zoness_8019C83C(Actor* actor) { s32 var_s1; Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, actor->fwork[0] * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, actor->fwork[0] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_601A340); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -320.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.3, 1.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -320.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.3, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6013330); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, 1.5707964f, 1); - Matrix_Translate(gGfxMatrix, -110.0f, 0.0f, 0.0f, 1); + Matrix_RotateZ(gGfxMatrix, 1.5707964f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, -110.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_601D680); Matrix_Pop(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->fwork[1], actor->fwork[2], 0.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[4] * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 0.75f, 0.75f, 0.75f, 1); + Matrix_Translate(gGfxMatrix, actor->fwork[1], actor->fwork[2], 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[4] * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.75f, 0.75f, 0.75f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_601C590); RCP_SetupDL_57(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - Matrix_RotateY(gGfxMatrix, gGameFrameCount * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, gGameFrameCount * M_DTOR, MTXF_APPLY); var_fv1 = (fabsf(actor->fwork[3]) * 1.3f) + 50.0f; for (var_s1 = 0; var_fv1 > 0.0f; var_s1++) { @@ -4283,10 +4285,10 @@ void Zoness_8019C83C(Actor* actor) { var_s1 = 1; } for (i = 0; i < var_s1; i++) { - Matrix_Translate(gGfxMatrix, 0.0f, 9.3f, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, 1.5707964f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 9.3f, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, 1.5707964f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ZO_6018660); Matrix_Pop(&gGfxMatrix); @@ -4358,9 +4360,9 @@ void Zoness_8019CE58(Actor* actor) { RCP_SetupDL(&gMasterDisp, 72); if (actor->iwork[0] != 0) { - Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[0], 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, (actor->fwork[4] + actor->obj.rot.z) * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, actor->fwork[1], actor->fwork[2], actor->fwork[3], 1); + Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[0], 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (actor->fwork[4] + actor->obj.rot.z) * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, actor->fwork[1], actor->fwork[2], actor->fwork[3], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (gMissedZoSearchlight) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 191, 43, 255); @@ -4475,19 +4477,19 @@ void Zoness_8019D428(Player* player) { case 0: gCsFrameCount = 0; player->pos.z += 10000.0f; - player->camEye.x = gCsCamEyeX = player->pos.x; - player->camEye.y = gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f; - player->camEye.z = gCsCamEyeZ = 400.0f; - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f - 230.0f; - player->camAt.z = gCsCamAtZ = 0.0f; + player->cam.eye.x = gCsCamEyeX = player->pos.x; + player->cam.eye.y = gCsCamEyeY = (player->pos.y * player->unk_148) + 50.0f; + player->cam.eye.z = gCsCamEyeZ = 400.0f; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f - 230.0f; + player->cam.at.z = gCsCamAtZ = 0.0f; player->unk_1D0 = 1; /* fallthrough */ case 1: Math_SmoothStepToF(&player->pos.z, 0.0f, 0.1f, 48.0f, 0); - Math_SmoothStepToF(&player->camAt.y, (player->pos.y * player->unk_148) + 20.0f, 0.1f, 1.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, (player->pos.y * player->unk_148) + 20.0f, 0.1f, 1.0f, 0.0f); if (gCsFrameCount >= 230) { - Math_SmoothStepToF(&player->camAt.z, player->unk_138, 0.2f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, player->unk_138, 0.2f, 20000.0f, 0.0f); } sp2C = gControllerHold[gMainController].button; gControllerHold[gMainController].button = gBoostButton[gMainController]; @@ -4503,11 +4505,11 @@ void Zoness_8019D428(Player* player) { if (gCsFrameCount >= 270) { AUDIO_PLAY_BGM(SEQ_ID_ZONESS | SEQ_FLAG); gLevelStatusScreenTimer = 80; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = 0; player->timer_1F8 = 0; player->timer_1FC = 0; - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; } break; } @@ -4529,17 +4531,17 @@ void Zoness_8019D76C(Player* player) { case 10: gCsFrameCount = 0; player->unk_4D8 = 0.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; player->unk_0D0 = 40.0f; player->unk_234 = 1; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = player->unk_130 = player->unk_12C = player->unk_110 = 0.0f; - gCsCamEyeX = player->camEye.x; - gCsCamEyeY = player->camEye.y; - gCsCamEyeZ = player->camEye.z; - gCsCamAtX = player->camAt.x; - gCsCamAtY = player->camAt.y; - gCsCamAtZ = player->camAt.z; + gCsCamEyeX = player->cam.eye.x; + gCsCamEyeY = player->cam.eye.y; + gCsCamEyeZ = player->cam.eye.z; + gCsCamAtX = player->cam.at.x; + gCsCamAtY = player->cam.at.y; + gCsCamAtZ = player->cam.at.z; for (i = 10; i < 60; i++) { if (gActors[i].unk_0B6 == 0) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); @@ -4584,7 +4586,7 @@ void Zoness_8019D76C(Player* player) { Audio_KillSfxBySource(player->sfxSource); gFillScreenAlpha = 250; player->timer_1F8 = 20; - player->wings.unk_2C = 1; + player->wings.modelId = 1; player->unk_0D0 = 0.0f; player->unk_0E4 = 0.0f; player->unk_0E8 = 0.0f; @@ -4607,23 +4609,23 @@ void Zoness_8019D76C(Player* player) { D_ctx_80177A48[2] = 0.0f; if (!gMissedZoSearchlight) { D_ctx_80177A48[1] = 330.0f; - player->camEye.x = 1350.0f; - player->camAt.x = gCsCamAtX = 1450.0f; + player->cam.eye.x = 1350.0f; + player->cam.at.x = gCsCamAtX = 1450.0f; D_ctx_80177A48[3] = 800.0f; D_ctx_80177A48[4] = -0.15f; D_ctx_80177A48[5] = -250.0f; - player->camEye.z = player->pos.z + D_ctx_80177D20 - 1780.0f; + player->cam.eye.z = player->pos.z + D_ctx_80177D20 - 1780.0f; } else { - player->camEye.x = -1500.0f; - player->camAt.x = gCsCamAtX = -1500.0f; + player->cam.eye.x = -1500.0f; + player->cam.at.x = gCsCamAtX = -1500.0f; D_ctx_80177A48[3] = -800.0f; D_ctx_80177A48[4] = 0.2f; D_ctx_80177A48[5] = 250.0f; - player->camEye.z = player->pos.z + D_ctx_80177D20 - 2000.0f; + player->cam.eye.z = player->pos.z + D_ctx_80177D20 - 2000.0f; } - player->camEye.y = 200.0f; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; + player->cam.eye.y = 200.0f; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = player->pos.z + D_ctx_80177D20; D_ctx_80177A48[0] = 0.0f; } break; @@ -4632,7 +4634,7 @@ void Zoness_8019D76C(Player* player) { gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; D_ctx_80177A48[1] += D_ctx_80177A48[2]; - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); sp58.x = 0.0f; sp58.y = 0.0f; sp58.z = D_ctx_80177A48[3]; @@ -4672,7 +4674,7 @@ void Zoness_8019D76C(Player* player) { if (gFillScreenAlpha == 255) { func_8001CA24(0); Audio_FadeOutAll(10); - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; D_play_800D3180[LEVEL_ZONESS] = Play_CheckMedalStatus(250) + 1; @@ -4770,8 +4772,8 @@ void Zoness_8019D76C(Player* player) { player->unk_25C = 0.6f; } } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); sp58.x = 0.0f; sp58.y = 0.0f; sp58.z = player->unk_0D0; @@ -4783,12 +4785,12 @@ void Zoness_8019D76C(Player* player) { player->pos.y += player->vel.y; player->unk_138 = player->pos.z += player->vel.z; player->unk_0F8 = player->unk_0EC; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); player->unk_088 += 10.0f; player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->unk_0F4 += 8.0f; @@ -4828,8 +4830,8 @@ void Zoness_8019E5F0(Actor* actor) { } break; } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); sp34.x = 0.0f; sp34.y = 0.0f; sp34.z = actor->fwork[0]; diff --git a/src/overlays/ovl_i4/fox_bo.c b/src/overlays/ovl_i4/fox_bo.c index 74c03277..d22fc9cf 100644 --- a/src/overlays/ovl_i4/fox_bo.c +++ b/src/overlays/ovl_i4/fox_bo.c @@ -260,13 +260,14 @@ void Bolse_8018C158(Actor* actor) { if (gBosses[2].state == 10) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 1); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].timer_1F8 = 30; gPlayer[0].unk_1D0 = 0; gPlayer[0].unk_000 = 0.0f; } - func_360_8002EE34(); + AllRange_ClearRadio(); actor->state = 6; AUDIO_PLAY_SFX(0x31009063U, actor->sfxSource, 0U); AUDIO_PLAY_SFX(0x2940D09AU, actor->sfxSource, 4U); @@ -284,15 +285,15 @@ void Bolse_8018C158(Actor* actor) { actor->iwork[1] = gHitCount; actor->state = 10; actor->timer_0BC = 150; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; AUDIO_PLAY_BGM(SEQ_ID_BO_BOSS | SEQ_FLAG); - func_360_8002EE34(); - gPlayer[0].camEye.x = 400.0f; - gPlayer[0].camEye.y = 50.0f; - gPlayer[0].camEye.z = 3000.0f; - gPlayer[0].camAt.x = 0.0f; - gPlayer[0].camAt.y = 0.0f; - gPlayer[0].camAt.z = 0.0f; + AllRange_ClearRadio(); + gPlayer[0].cam.eye.x = 400.0f; + gPlayer[0].cam.eye.y = 50.0f; + gPlayer[0].cam.eye.z = 3000.0f; + gPlayer[0].cam.at.x = 0.0f; + gPlayer[0].cam.at.y = 0.0f; + gPlayer[0].cam.at.z = 0.0f; for (i = 10; i < 30; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } @@ -318,23 +319,23 @@ void Bolse_8018C158(Actor* actor) { } if (i == 3) { actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; return; } } - player->camEye.x += actorPtr->vel.x * 0.23f; - player->camEye.y += actorPtr->vel.y * 0.23f; - player->camEye.z += actorPtr->vel.z * 0.23f; + player->cam.eye.x += actorPtr->vel.x * 0.23f; + player->cam.eye.y += actorPtr->vel.y * 0.23f; + player->cam.eye.z += actorPtr->vel.z * 0.23f; - Math_SmoothStepToF(&player->camAt.x, actorPtr->obj.pos.x, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, actorPtr->obj.pos.y, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, actorPtr->obj.pos.z, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 0.2f, 0); + Math_SmoothStepToF(&player->cam.at.x, actorPtr->obj.pos.x, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, actorPtr->obj.pos.y, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, actorPtr->obj.pos.z, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 0.2f, 0); if ((gControllerPress->button & START_BUTTON) || ((D_360_800C9B4C + 300) == gAllRangeEventTimer)) { actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); player->unk_014 = 0.0f; D_hud_80161708 = 0; @@ -359,13 +360,13 @@ void Bolse_8018C158(Actor* actor) { gBosses[0].obj.rot.y = gBosses[0].fwork[1]; - player->camEye.x -= 6.0f; - player->camEye.z -= 12.0f; - player->camAt.y += 8.0f; + player->cam.eye.x -= 6.0f; + player->cam.eye.z -= 12.0f; + player->cam.at.y += 8.0f; - gPlayer[0].camEye.y += 2.0f; + gPlayer[0].cam.eye.y += 2.0f; - Math_SmoothStepToF(&player->unk_034, 0.0f, 1.0f, 1000.0f, 0); + Math_SmoothStepToF(&player->camRoll, 0.0f, 1.0f, 1000.0f, 0); if (actor->timer_0BC == 130) { Radio_PlayMessage(gMsg_ID_11060, RCID_FALCO); @@ -383,7 +384,7 @@ void Bolse_8018C158(Actor* actor) { if (!actor->timer_0BC) { gAllRangeEventTimer = 3000; actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); player->unk_014 = 0.0f; Audio_KillSfxBySource(gBosses[1].sfxSource); @@ -589,8 +590,8 @@ void Bolse_8018D124(Actor* actor) { Vec3f src; Vec3f dest; - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + actor->obj.rot.y) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + actor->obj.rot.y) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -actor->unk_0F4.x * M_DTOR, MTXF_APPLY); src.y = 0.0f; src.x = 0.0f; @@ -636,7 +637,7 @@ bool Bolse_8018D278(Actor* actor) { void Bolse_8018D394(Actor* actor) { Bolse_8018CC60(actor); - if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { + if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { Bolse_8018CCE8(actor); Bolse_8018CE5C(actor); if (Bolse_8018D008(actor)) { @@ -658,7 +659,7 @@ bool Bolse_8018D414(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* th } void Bolse_8018D454(Actor* actor) { - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Animation_GetFrameData(&D_BO_600F2E0, 0, actor->vwork); Animation_DrawSkeleton(1, D_BO_600F36C, actor->vwork, Bolse_8018D414, NULL, actor, &gIdentityMatrix); actor->iwork[0] = 1; @@ -839,14 +840,14 @@ s32 Bolse_8018E05C(Boss* boss, s32 index) { var_fs0 = D_i4_801A0488[index].unk_04; Matrix_Push(&gGfxMatrix); - Matrix_RotateX(gCalcMatrix, -temp_fs1 * M_DTOR, 0); + Matrix_RotateX(gCalcMatrix, -temp_fs1 * M_DTOR, MTXF_NEW); var_fs0 += boss->obj.rot.y; if (var_fs0 >= 360.0f) { var_fs0 -= 360.0f; } - Matrix_RotateY(gCalcMatrix, (-var_fs0) * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (-var_fs0) * M_DTOR, MTXF_APPLY); src.x = gPlayer[0].pos.x - (boss->obj.pos.x + temp_fs2); src.y = gPlayer[0].pos.y - (boss->obj.pos.y + 580.0f); @@ -978,14 +979,14 @@ void Bolse_8018E710(Boss* boss) { } boss->fwork[0] += 2.0f; - Matrix_RotateY(&D_BO_8019EE80, gBosses[0].obj.rot.y * M_DTOR, 0); + Matrix_RotateY(&D_BO_8019EE80, gBosses[0].obj.rot.y * M_DTOR, MTXF_NEW); } void Bolse_8018E870(Boss* boss) { s32 i; s32 alpha; - Matrix_Scale(gGfxMatrix, boss->unk_3F8, boss->unk_3F8, boss->unk_3F8, 1); + Matrix_Scale(gGfxMatrix, boss->unk_3F8, boss->unk_3F8, boss->unk_3F8, MTXF_APPLY); if (boss->vwork[30].y >= 0.0f) { gSPDisplayList(gMasterDisp++, D_BO_6002020); @@ -1005,12 +1006,13 @@ void Bolse_8018E870(Boss* boss) { RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, alpha); gDPSetEnvColor(gMasterDisp++, 255, 56, 56, alpha); - Matrix_Translate(gGfxMatrix, D_i4_801A0488[i].unk_0C, D_i4_801A0488[i].unk_10, D_i4_801A0488[i].unk_14, 1); - Matrix_RotateY(gGfxMatrix, D_i4_801A0488[i].unk_04 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_i4_801A0488[i].unk_00 * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, M_PI / 2, 1); - Matrix_Translate(gGfxMatrix, 1.0f, 1.0f, D_i4_801A0488[i].unk_08 * 200.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, D_i4_801A0488[i].unk_08, 1); + Matrix_Translate(gGfxMatrix, D_i4_801A0488[i].unk_0C, D_i4_801A0488[i].unk_10, D_i4_801A0488[i].unk_14, + MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_i4_801A0488[i].unk_04 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_i4_801A0488[i].unk_00 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 1.0f, 1.0f, D_i4_801A0488[i].unk_08 * 200.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, D_i4_801A0488[i].unk_08, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BO_600BF30); Matrix_Pop(&gGfxMatrix); @@ -1295,7 +1297,7 @@ void Bolse_8018EF6C(Player* player) { } if (gCsFrameCount == 270) { - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_0D0 = D_play_80161A54; player->unk_014 = 0.0001f; @@ -1312,8 +1314,8 @@ void Bolse_8018EF6C(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); sp54.x = 0.0f; sp54.y = 0; @@ -1332,12 +1334,12 @@ void Bolse_8018EF6C(Player* player) { player->unk_138 = player->pos.z; player->unk_0F8 = (player->unk_0EC + player->unk_12C) + player->unk_130; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); } void Bolse_8018F83C(Actor* actor, s32 arg1) { @@ -1451,7 +1453,7 @@ void Bolse_8018F94C(Player* player) { gCsFrameCount = 0; gGroundLevel = -10000.0f; player->unk_240 = 1; - player->wings.unk_2C = 1; + player->wings.modelId = 1; AUDIO_PLAY_SFX(0x31009063U, actor50->sfxSource, 0U); func_8001C8B8(0); } @@ -1570,8 +1572,8 @@ void Bolse_8018F94C(Player* player) { Math_SmoothStepToF(&player->unk_0D0, 0.0f, 0.1f, 1.5f, 0.0f); Math_SmoothStepToF(D_ctx_80177A48, 0.2f, 1.0f, 0.001f, 0.0f); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[5] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, 0, 1); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[5] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, 0, MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; @@ -1685,8 +1687,8 @@ void Bolse_8018F94C(Player* player) { gLight1G = D_i4_801A03D4; gLight1B = D_i4_801A03D8; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; @@ -1708,7 +1710,7 @@ void Bolse_8018F94C(Player* player) { if (player->unk_1D0 < 10) { Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); @@ -1718,16 +1720,16 @@ void Bolse_8018F94C(Player* player) { func_play_800B7184(player, 0); - player->camEye.x += player->vel.x * 0.1f; - player->camEye.y += player->vel.y * 0.1f; - player->camEye.z += player->vel.z * 0.1f; + player->cam.eye.x += player->vel.x * 0.1f; + player->cam.eye.y += player->vel.y * 0.1f; + player->cam.eye.z += player->vel.z * 0.1f; } else { - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000, 0); } player->unk_088 += 10.0f; player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; @@ -1748,8 +1750,8 @@ void Bolse_80190D98(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 effect->obj.rot.x = xRot; effect->obj.rot.y = yRot; effect->scale2 = 1.0f; - Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * xRot, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * yRot, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * xRot, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = 200.0f; @@ -1831,7 +1833,7 @@ void Bolse_80191180(Effect* effect) { switch (effect->state) { case 0: gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 192); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BO_6006910); break; @@ -1840,7 +1842,7 @@ void Bolse_80191180(Effect* effect) { RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, effect->unk_44); gDPSetEnvColor(gMasterDisp++, 0, 128, 255, effect->unk_44); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, 0x40); @@ -1933,7 +1935,7 @@ void Bolse_801912FC(Boss* boss) { } } - Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, MTXF_NEW); for (i = 0; i < 8; i++) { if (boss->swork[i + 24] != 0) { @@ -2086,7 +2088,7 @@ void Bolse_80191BAC(Boss* boss) { void Bolse_80191DB0(Boss* boss) { s32 alpha; - Matrix_Scale(gGfxMatrix, boss->unk_3F8, boss->unk_3F8, boss->unk_3F8, 1); + Matrix_Scale(gGfxMatrix, boss->unk_3F8, boss->unk_3F8, boss->unk_3F8, MTXF_APPLY); alpha = boss->fwork[0]; if (alpha != 0) { if (((gGameFrameCount % 2) == 0)) { @@ -2094,7 +2096,7 @@ void Bolse_80191DB0(Boss* boss) { } RCP_SetupDL(&gMasterDisp, 0x29); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, alpha); - Matrix_Scale(gGfxMatrix, 1.2f, 0.55f, 1.2f, 1); + Matrix_Scale(gGfxMatrix, 1.2f, 0.55f, 1.2f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BO_600C4E0); } @@ -2196,15 +2198,15 @@ void Bolse_80192264(void) { Matrix_Push(&gGfxMatrix); Rand_SetSeed(1, 29100, 9786); - Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, gBosses[0].obj.rot.y * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 5.0f, 1.0f, 5.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, gCameraShakeY, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, gBosses[0].obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 5.0f, 1.0f, 5.0f, MTXF_APPLY); for (z = -3200.0f; z <= 3200.0f; z += 800.0f) { for (x = -3200.0f; x <= 3200.0f; x += 800.0f) { rnd = Rand_ZeroOneSeeded(); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, 0.0f, z, 1); + Matrix_Translate(gGfxMatrix, x, 0.0f, z, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &spDC, &spD0); if ((spD0.z < 3000.0f) && (spD0.z > -13000.0f) && (fabsf(spD0.x) < (fabsf(spD0.z * 0.7f) + 3000.0f)) && (fabsf(spD0.y) < (fabsf(spD0.z * 0.5f) + 2000.0f))) { diff --git a/src/overlays/ovl_i4/fox_fo.c b/src/overlays/ovl_i4/fox_fo.c index bef5f0cb..dbcebf83 100644 --- a/src/overlays/ovl_i4/fox_fo.c +++ b/src/overlays/ovl_i4/fox_fo.c @@ -106,7 +106,7 @@ void Fortuna_80187960(Actor* actor) { Actor* actor19 = &gActors[19]; s32 pad[2]; - if ((player->state_1C8 == PLAYERSTATE_1C8_4) || (player->state_1C8 == PLAYERSTATE_1C8_6)) { + if ((player->state_1C8 == PLAYERSTATE_1C8_DOWN) || (player->state_1C8 == PLAYERSTATE_1C8_NEXT)) { gAllRangeEventTimer = 20000; return; } @@ -135,7 +135,7 @@ void Fortuna_80187960(Actor* actor) { if (gAllRangeEventTimer == 7000) { AUDIO_PLAY_SFX(0x11030016U, gBosses[0].sfxSource, 4U); - func_360_8002EE34(); + AllRange_ClearRadio(); Radio_PlayMessage(gMsg_ID_9390, RCID_ROB64); gAllRangeCountdownScale = 1.0f; gShowAllRangeCountdown = 1; @@ -172,10 +172,10 @@ void Fortuna_80187960(Actor* actor) { if (gAllRangeEventTimer == 9206) { gShowAllRangeCountdown = 0; actor->state = 5; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; actor->iwork[0] = 0; actor->fwork[0] = 0.0f; - func_360_8002EE34(); + AllRange_ClearRadio(); for (i = 4; i < 8; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } @@ -190,11 +190,11 @@ void Fortuna_80187960(Actor* actor) { gShowAllRangeCountdown = 0; actor->iwork[0] = 0; actor->state = 6; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; gPlayer[0].unk_000 = 0.0f; - func_360_8002EE34(); + AllRange_ClearRadio(); for (i = 4; i < 8; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); @@ -225,7 +225,7 @@ void Fortuna_80187960(Actor* actor) { } gAllRangeEventTimer = 0; gStarWolfMsgTimer = 0; - if (player->state_1C8 == PLAYERSTATE_1C8_3) { + if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { actor->state = 2; player->pos.x = 0.0f; player->pos.z = 8000.0f; @@ -261,7 +261,7 @@ void Fortuna_80187960(Actor* actor) { if (gCsFrameCount == 264) { actorPtr->state = 2; actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0001f; AUDIO_PLAY_BGM(gBgmSeqId); gLevelStatusScreenTimer = 80; @@ -274,13 +274,13 @@ void Fortuna_80187960(Actor* actor) { break; case 3: - player->camEye.x += actor4->vel.x * 0.23f; - player->camEye.y += actor4->vel.y * 0.23f; - player->camEye.z += actor4->vel.z * 0.23f; - Math_SmoothStepToF(&player->camAt.x, actor4->obj.pos.x, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, actor4->obj.pos.y, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, actor4->obj.pos.z, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 1.0f, 1000.0f, 0.0f); + player->cam.eye.x += actor4->vel.x * 0.23f; + player->cam.eye.y += actor4->vel.y * 0.23f; + player->cam.eye.z += actor4->vel.z * 0.23f; + Math_SmoothStepToF(&player->cam.at.x, actor4->obj.pos.x, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, actor4->obj.pos.y, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, actor4->obj.pos.z, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 1.0f, 1000.0f, 0.0f); if (gAllRangeEventTimer == (D_360_800C9B4C + 2)) { gStarWolfMsgTimer = 883; gAllRangeCheckpoint = 1; @@ -294,7 +294,7 @@ void Fortuna_80187960(Actor* actor) { if ((gControllerPress->button & START_BUTTON) || (gAllRangeEventTimer == (D_360_800C9B4C + 440))) { actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); player->unk_014 = 0.0f; D_hud_80161708 = 0; @@ -306,33 +306,33 @@ void Fortuna_80187960(Actor* actor) { gAllRangeEventTimer = 9207; actor->iwork[0] += 1; actor->fwork[0] += 10.0f; - player->camEye.x = 300.0f; - player->camEye.y = 300.0f; - player->camEye.z = -1000.0f; - player->camAt.x = actor->fwork[0] + 300.0f; - player->camAt.y = actor->fwork[0] + 500.0f; - player->camAt.z = -15000.0f; - player->unk_034 = 0.0f; + player->cam.eye.x = 300.0f; + player->cam.eye.y = 300.0f; + player->cam.eye.z = -1000.0f; + player->cam.at.x = actor->fwork[0] + 300.0f; + player->cam.at.y = actor->fwork[0] + 500.0f; + player->cam.at.z = -15000.0f; + player->camRoll = 0.0f; if ((actor->iwork[0] == 50) && (gStarWolfTeamAlive[0] != 0)) { if (gRadioState == 0) { Radio_PlayMessage(gMsg_ID_9431, RCID_WOLF); } - Fortuna_80187884(&gActors[4], player->camEye.x - 200.0f, player->camEye.y, player->camEye.z, 160.0f); + Fortuna_80187884(&gActors[4], player->cam.eye.x - 200.0f, player->cam.eye.y, player->cam.eye.z, 160.0f); } if ((actor->iwork[0] == 70) && (gStarWolfTeamAlive[1] != 0)) { if (gRadioState == 0) { Radio_PlayMessage(gMsg_ID_9432, RCID_LEON); } - Fortuna_80187884(&gActors[5], player->camEye.x, player->camEye.y + 50.0f, player->camEye.z, 160.0f); + Fortuna_80187884(&gActors[5], player->cam.eye.x, player->cam.eye.y + 50.0f, player->cam.eye.z, 160.0f); } if ((actor->iwork[0] == 90) && (gStarWolfTeamAlive[2] != 0)) { if (gRadioState == 0) { Radio_PlayMessage(gMsg_ID_9433, RCID_PIGMA); } - Fortuna_80187884(gActors + 6, player->camEye.x - 200.0f, player->camEye.y + 200.0f, player->camEye.z, + Fortuna_80187884(gActors + 6, player->cam.eye.x - 200.0f, player->cam.eye.y + 200.0f, player->cam.eye.z, 160.0f); } @@ -340,12 +340,12 @@ void Fortuna_80187960(Actor* actor) { if (gRadioState == 0) { Radio_PlayMessage(gMsg_ID_9434, RCID_ANDREW); } - Fortuna_80187884(gActors + 7, player->camEye.x - 300.0f, player->camEye.y, player->camEye.z, 160.0f); + Fortuna_80187884(gActors + 7, player->cam.eye.x - 300.0f, player->cam.eye.y, player->cam.eye.z, 160.0f); } if (actor->iwork[0] == 250) { actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); @@ -374,9 +374,9 @@ void Fortuna_80187960(Actor* actor) { Vec3f sp50 = { 0.0f, 0.0f, -10000 }; Actor_Initialize(actor19); - Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, player->pos.x, player->pos.y, player->unk_138, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp50, &actor19->obj.pos); actor19->obj.status = OBJ_ACTIVE; @@ -643,7 +643,7 @@ void Fortuna_8018927C(Player* player) { if ((player->unk_1D0 < 10) && (player->unk_1D0 >= 0)) { Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); if (gNextPlanetPath == 0) { if (player->pos.y < 700.0f) { @@ -653,9 +653,9 @@ void Fortuna_8018927C(Player* player) { Math_SmoothStepToF(&player->pos.y, 500.0f, 0.1f, 5.0f, 0.0f); } func_play_800B7184(player, 0); - player->camEye.x += player->vel.x * 0.1f; - player->camEye.y += player->vel.y * 0.1f; - player->camEye.z += player->vel.z * 0.1f; + player->cam.eye.x += player->vel.x * 0.1f; + player->cam.eye.y += player->vel.y * 0.1f; + player->cam.eye.z += player->vel.z * 0.1f; } player->wings.unk_04 = 0.0f; @@ -667,7 +667,7 @@ void Fortuna_8018927C(Player* player) { switch (player->unk_1D0) { case -1: - player->wings.unk_2C = 1; + player->wings.modelId = 1; player->unk_0E8 = 0.0f; player->unk_0D0 = 30.0f; player->unk_114 = 180.0f; @@ -676,12 +676,12 @@ void Fortuna_8018927C(Player* player) { player->unk_12C = 0.0f; player->unk_130 = 0.0f; player->unk_4D8 = 0.0f; - player->camEye.x = -200.0f; - player->camEye.y = 100.0f; - player->camEye.z = -1500.0f; - player->camAt.x = player->pos.x; - player->camAt.y = player->pos.y; - player->camAt.z = player->unk_138; + player->cam.eye.x = -200.0f; + player->cam.eye.y = 100.0f; + player->cam.eye.z = -1500.0f; + player->cam.at.x = player->pos.x; + player->cam.at.y = player->pos.y; + player->cam.at.z = player->unk_138; if (player->timer_1F8 < 80) { gFillScreenAlphaTarget = 255; @@ -701,7 +701,7 @@ void Fortuna_8018927C(Player* player) { Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 2.5f, 0.0f); } else { player->unk_190 = 2.0f; - player->camEye.y += 3.0f; + player->cam.eye.y += 3.0f; Math_SmoothStepToF(&player->unk_0EC, Math_SmoothStepToF(&player->unk_114, Math_RadToDeg(Math_Atan2F(player->pos.x, player->unk_138)), 0.1f, @@ -818,13 +818,13 @@ void Fortuna_8018927C(Player* player) { player->unk_0EC = 0.0f; player->unk_114 = 0.0f; player->unk_0D0 = 0.0f; - player->camAt.y = 16.0f; + player->cam.at.y = 16.0f; player->pos.y = -100.0f; player->unk_0E8 = 180.0f; } player->pos.z = -10000.0f; gCsFrameCount = 0; - player->wings.unk_2C = 1; + player->wings.modelId = 1; player->unk_204 = 1; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 100); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 100); @@ -839,12 +839,12 @@ void Fortuna_8018927C(Player* player) { player->unk_234 = 1; gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 4; - player->camEye.x = 400.0f; - player->camEye.y = 0; - player->camEye.z = 0.0f; - player->camAt.x = actor0->obj.pos.x; - player->camAt.y = actor0->obj.pos.y; - player->camAt.z = actor0->obj.pos.z; + player->cam.eye.x = 400.0f; + player->cam.eye.y = 0; + player->cam.eye.z = 0.0f; + player->cam.at.x = actor0->obj.pos.x; + player->cam.at.y = actor0->obj.pos.y; + player->cam.at.z = actor0->obj.pos.z; if (gCsFrameCount == 100) { player->unk_0D0 = 30.0f; @@ -885,8 +885,8 @@ void Fortuna_8018927C(Player* player) { case 11: D_ctx_80177A48[1] += D_ctx_80177A48[3]; - Matrix_RotateX(gCalcMatrix, -0.17453292f, 0); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -0.17453292f, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_APPLY); src.x = 0; src.y = 0.0f; src.z = D_ctx_80177A48[2]; @@ -900,13 +900,13 @@ void Fortuna_8018927C(Player* player) { Math_SmoothStepToF(D_ctx_80177A48, 0.05f, 1.0f, 0.001f, 0); - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); Math_SmoothStepToF(&player->unk_0D0, 0.0f, 0.05f, 2.0f, 0); @@ -1094,7 +1094,7 @@ void Fortuna_8018927C(Player* player) { } if (gCsFrameCount == 1382) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; Audio_FadeOutAll(10); @@ -1201,16 +1201,16 @@ void Fortuna_8018927C(Player* player) { src.x = 0.0f; src.y = D_ctx_80177A48[7]; src.z = D_ctx_80177A48[5]; - Matrix_Translate(gCalcMatrix, player->pos.x, 0.0f, player->pos.z + D_ctx_80177D20, 0); - Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), 1); + Matrix_Translate(gCalcMatrix, player->pos.x, 0.0f, player->pos.z + D_ctx_80177D20, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); - player->camEye.x = gCsCamEyeX = dest.x; - player->camEye.y = gCsCamEyeY = dest.y; - player->camEye.z = gCsCamEyeZ = dest.z; + player->cam.eye.x = gCsCamEyeX = dest.x; + player->cam.eye.y = gCsCamEyeY = dest.y; + player->cam.eye.z = gCsCamEyeZ = dest.z; Math_SmoothStepToF(&gCsCamAtY, 0.0f, 0.005f, 1000.0f, 0.0001f); - player->camAt.x = player->pos.x; - player->camAt.y = gCsCamAtY; - player->camAt.z = player->pos.z + D_ctx_80177D20; + player->cam.at.x = player->pos.x; + player->cam.at.y = gCsCamAtY; + player->cam.at.z = player->pos.z + D_ctx_80177D20; break; case 22: @@ -1317,7 +1317,7 @@ void Fortuna_8018927C(Player* player) { gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 16; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; Audio_FadeOutAll(10); @@ -1374,12 +1374,12 @@ void Fortuna_8018927C(Player* player) { src.x = 0.0f; src.y = D_ctx_80177A48[7]; src.z = D_ctx_80177A48[5]; - Matrix_Translate(gCalcMatrix, player->pos.x, 0.0f, player->pos.z + D_ctx_80177D20, 0); - Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), 1); + Matrix_Translate(gCalcMatrix, player->pos.x, 0.0f, player->pos.z + D_ctx_80177D20, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, -(D_ctx_80177A48[4] * M_DTOR), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); - player->camEye.x = gCsCamEyeX = dest.x; - player->camEye.y = gCsCamEyeY = dest.y; - player->camEye.z = gCsCamEyeZ = dest.z; + player->cam.eye.x = gCsCamEyeX = dest.x; + player->cam.eye.y = gCsCamEyeY = dest.y; + player->cam.eye.z = gCsCamEyeZ = dest.z; } if (gCsFrameCount >= 1240) { @@ -1397,9 +1397,9 @@ void Fortuna_8018927C(Player* player) { } Math_SmoothStepToF(&gCsCamAtY, player->pos.y, 0.005f, 1000.0f, 0.0001f); - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY; - player->camAt.z = gCsCamAtZ = player->pos.z - D_ctx_80177A48[6] + D_ctx_80177D20; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY; + player->cam.at.z = gCsCamAtZ = player->pos.z - D_ctx_80177A48[6] + D_ctx_80177D20; break; } @@ -1414,8 +1414,8 @@ void Fortuna_8018927C(Player* player) { } } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; diff --git a/src/overlays/ovl_i4/fox_i4.c b/src/overlays/ovl_i4/fox_i4.c index ea2a4991..cbcd6dd6 100644 --- a/src/overlays/ovl_i4/fox_i4.c +++ b/src/overlays/ovl_i4/fox_i4.c @@ -15,31 +15,31 @@ s32 D_i4_8019EDD0 = 0; void OvlI4_CallFunction(u32 arg0, void* arg1) { switch (arg0) { - case 90: + case OVLCALL_FO_CS_COMPLETE: Fortuna_8018927C(arg1); break; - case 91: + case OVLCALL_BOSS309_UPDATE: Bolse_8018E710(arg1); break; - case 92: + case OVLCALL_BOSS309_DRAW: Bolse_8018E870(arg1); break; - case 93: + case OVLCALL_BOSS310_UPDATE: Bolse_80191BAC(arg1); break; - case 94: + case OVLCALL_BOSS310_DRAW: Bolse_80191DB0(arg1); break; - case 95: + case OVLCALL_ACTOR271_UPDATE: Bolse_8018D7F0(arg1); break; - case 96: + case OVLCALL_ACTOR271_DRAW: Bolse_8018D960(arg1); break; - case 97: + case OVLCALL_ACTOR272_UPDATE: Bolse_8018D394(arg1); break; - case 98: + case OVLCALL_ACTOR272_DRAW: Bolse_8018D454(arg1); default: PRINTF("i4 指定外!\n"); // Not specified! diff --git a/src/overlays/ovl_i4/fox_ka.c b/src/overlays/ovl_i4/fox_ka.c index 40d196c0..02c74d23 100644 --- a/src/overlays/ovl_i4/fox_ka.c +++ b/src/overlays/ovl_i4/fox_ka.c @@ -73,8 +73,8 @@ void Katina_801927E0(Effect* effect, f32 x, f32 y, f32 z, f32 x2, f32 y2, f32 z2 xRot = Math_Atan2F(x2 - x, z2 - z); distXZ = sqrtf(SQ(x2 - x) + SQ(z2 - z)); yRot = -Math_Atan2F(y2 - y, distXZ); - Matrix_RotateY(gCalcMatrix, xRot, 0); - Matrix_RotateX(gCalcMatrix, yRot, 1); + Matrix_RotateY(gCalcMatrix, xRot, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, yRot, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = 30.0f; @@ -119,7 +119,7 @@ void Katina_80192A68(Effect* effect) { gDPSetPrimColor(gMasterDisp++, 0, 0, 48, 48, 255, effect->unk_44); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, effect->unk_44); - Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 0.4f, 1); + Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 0.4f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -165,7 +165,7 @@ void Katina_80192C8C(void) { s32 i; Vec3f dest; - Matrix_RotateY(gCalcMatrix, -0.7853982f, 0); + Matrix_RotateY(gCalcMatrix, -0.7853982f, MTXF_NEW); for (i = 0; i < 3; i++, actor++) { if (actor->obj.status == OBJ_FREE) { @@ -263,15 +263,15 @@ void Katina_80192E20(Player* player) { break; case 13: - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = player->pos.z; - player->camEye.x = gCsCamEyeX = 100.0f; - player->camEye.z = gCsCamEyeZ = 7000.0f; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = player->pos.z; + player->cam.eye.x = gCsCamEyeX = 100.0f; + player->cam.eye.z = gCsCamEyeZ = 7000.0f; if (gCsFrameCount == 240) { Object_Kill(&gActors[4].obj, gActors[4].sfxSource); Object_Kill(&gActors[6].obj, gActors[6].sfxSource); - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0001f; AUDIO_PLAY_BGM(gBgmSeqId); gLevelStatusScreenTimer = 80; @@ -295,8 +295,8 @@ void Katina_80192E20(Player* player) { case 25: case 40: actor = &gActors[5]; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); func_enmy2_8006EEFC(5, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->obj.rot.x, @@ -307,8 +307,8 @@ void Katina_80192E20(Player* player) { case 41: case 44: actor = &gActors[6]; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); func_enmy2_8006EEFC(6, actor->obj.pos.x + (dest.x * 1.5), actor->obj.pos.y + (dest.y * 1.5), actor->obj.pos.z + (dest.z * 1.5), dest.x, dest.y, dest.z, actor->obj.rot.x, @@ -328,8 +328,8 @@ void Katina_80192E20(Player* player) { Object_Kill(&gActors[5].obj, gActors[5].sfxSource); break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); src.x = 0; src.y = 0.0f; src.z = player->unk_0D0; @@ -342,12 +342,12 @@ void Katina_80192E20(Player* player) { player->pos.z += player->vel.z; player->unk_138 = player->pos.z; player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); } void Katina_80193718(Boss* boss) { @@ -376,7 +376,7 @@ void Katina_80193718(Boss* boss) { src.y = 0.0f; src.z = 500.0f; for (posX = 50.0f, i = 0; posX < 600.0f; i++) { - Matrix_RotateY(gCalcMatrix, i * 13.0f * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, i * 13.0f * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); if (dest.z > 0.0f) { func_effect_8007953C(dest.x, posX, dest.z, 1.3f); @@ -408,7 +408,7 @@ void Katina_80193718(Boss* boss) { void Katina_80193B1C(Boss* boss) { gSPFogPosition(gMasterDisp++, gFogNear, 1002); - Matrix_Translate(gGfxMatrix, 0.0f, 20.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 20.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (boss->state == 0) { gSPDisplayList(gMasterDisp++, D_KA_600BAF0); @@ -466,7 +466,7 @@ void Katina_80193EF0(Boss* boss) { if (boss->dmgType != DMG_NONE) { boss->dmgType = DMG_NONE; - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) { return; } @@ -512,7 +512,7 @@ void Katina_80193EF0(Boss* boss) { src.z = 50.0f; for (i = 0; i < 130; i++, y += 5.0f, src.z += 1.4f) { - Matrix_RotateY(gCalcMatrix, i * 35.0f * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, i * 35.0f * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); func_effect_800794CC(boss->obj.pos.x + dest.x, boss->obj.pos.y - 1200.0f + y, boss->obj.pos.z + dest.z, 1.6f); @@ -533,7 +533,7 @@ void Katina_80193EF0(Boss* boss) { } } - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if ((gGameFrameCount % 16) == 0) { for (i = 0; i < 4; i++) { if ((boss->swork[10 + i] <= 0) && (Rand_ZeroOne() < 0.2f)) { @@ -675,17 +675,17 @@ void Katina_801946C4(Boss* boss) { break; case 1: - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { if (boss->obj.pos.z < 4500.0f) { boss->state++; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; - gPlayer[0].camEye.x = -900.0f; - gPlayer[0].camEye.y = 100.0f; - gPlayer[0].camEye.z = 1400.0f; - gPlayer[0].camAt.x = -730.0f; - gPlayer[0].camAt.y = 130.0f; - gPlayer[0].camAt.z = 1160.0f; - gPlayer[0].unk_034 = 0.0f; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; + gPlayer[0].cam.eye.x = -900.0f; + gPlayer[0].cam.eye.y = 100.0f; + gPlayer[0].cam.eye.z = 1400.0f; + gPlayer[0].cam.at.x = -730.0f; + gPlayer[0].cam.at.y = 130.0f; + gPlayer[0].cam.at.z = 1160.0f; + gPlayer[0].camRoll = 0.0f; boss->obj.pos.x = -4500.0f; boss->obj.pos.z = 4500.0f; boss->timer_050 = 500; @@ -702,7 +702,7 @@ void Katina_801946C4(Boss* boss) { break; case 2: - gPlayer[0].camAt.y += 0.2f; + gPlayer[0].cam.at.y += 0.2f; Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 30.0f, 1.0f, 1.65f, 0.0f); if (boss->timer_050 == 460) { D_i4_801A0548 = 10.0f; @@ -717,12 +717,12 @@ void Katina_801946C4(Boss* boss) { gLight1B = D_i4_801A0554; if (boss->timer_050 == 170) { boss->state++; - gPlayer[0].camEye.x = -2500.0f; - gPlayer[0].camEye.y = 250.0f; - gPlayer[0].camEye.z = 2500.0f; - gPlayer[0].camAt.x = 0.0f; - gPlayer[0].camAt.y = 1000.0f; - gPlayer[0].camAt.z = 0.0f; + gPlayer[0].cam.eye.x = -2500.0f; + gPlayer[0].cam.eye.y = 250.0f; + gPlayer[0].cam.eye.z = 2500.0f; + gPlayer[0].cam.at.x = 0.0f; + gPlayer[0].cam.at.y = 1000.0f; + gPlayer[0].cam.at.z = 0.0f; boss->unk_05E = 0; boss->obj.pos.x = -500.0f; boss->obj.pos.z = 500.0f; @@ -775,8 +775,8 @@ void Katina_801946C4(Boss* boss) { if (boss->timer_052 == 0) { AUDIO_PLAY_SFX(0x19032040U, boss->sfxSource, 0); boss->state++; - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_3; + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(&gPlayer[0], 1); } gPlayer[0].unk_014 = 0.0f; @@ -876,7 +876,7 @@ void Katina_801946C4(Boss* boss) { boss->vwork[0].z = 0.0f; Math_SmoothStepToF(&boss->fwork[10], 5.0f, 0.1f, 0.5f, 0.0f); if (boss->timer_050 == 0 && - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3 || gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE || gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gShowAllRangeCountdown = 0; boss->timer_050 = 1000; boss->state = 15; @@ -890,14 +890,14 @@ void Katina_801946C4(Boss* boss) { boss->fwork[10] = 0.0f; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; - gPlayer[0].unk_034 = 0.0f; - gPlayer[0].camEye.x = boss->obj.pos.x; - gPlayer[0].camEye.y = 600.0f; - gPlayer[0].camEye.z = boss->obj.pos.z + 5000.0f; - gPlayer[0].camAt.x = boss->obj.pos.x; - gPlayer[0].camAt.y = boss->obj.pos.y - 500.0f; - gPlayer[0].camAt.z = boss->obj.pos.z; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; + gPlayer[0].camRoll = 0.0f; + gPlayer[0].cam.eye.x = boss->obj.pos.x; + gPlayer[0].cam.eye.y = 600.0f; + gPlayer[0].cam.eye.z = boss->obj.pos.z + 5000.0f; + gPlayer[0].cam.at.x = boss->obj.pos.x; + gPlayer[0].cam.at.y = boss->obj.pos.y - 500.0f; + gPlayer[0].cam.at.z = boss->obj.pos.z; } break; @@ -911,7 +911,7 @@ void Katina_801946C4(Boss* boss) { } if (boss->timer_050 == 500) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 100; gPlayer[0].unk_234 = 0; gCsFrameCount = 5000; @@ -919,22 +919,22 @@ void Katina_801946C4(Boss* boss) { Math_SmoothStepToF(&boss->obj.pos.y, 3000.0f, 0.02f, 0.5f, 0.0f); Math_SmoothStepToF(&boss->obj.rot.x, 180.0f, 0.02f, 0.3f, 0.0f); Math_SmoothStepToF(&boss->fwork[13], 180.0f, 0.02f, 0.2f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.z, boss->obj.pos.z + 8000.0f, 0.05f, 3.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.y, boss->obj.pos.y - 1000.0f, 0.05f, 2.0f, 0.0f); - gPlayer[0].camAt.y = boss->obj.pos.y - 500.0f; + Math_SmoothStepToF(&gPlayer[0].cam.eye.z, boss->obj.pos.z + 8000.0f, 0.05f, 3.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.y, boss->obj.pos.y - 1000.0f, 0.05f, 2.0f, 0.0f); + gPlayer[0].cam.at.y = boss->obj.pos.y - 500.0f; boss->unk_05E = 0; if (boss->timer_050 == 260) { boss->obj.pos.y = 3000.0f; boss->obj.rot.y = 0.0f; boss->obj.rot.x = 180.0f; boss->fwork[13] = 15.0f; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; - gPlayer[0].camEye.x = boss->obj.pos.x; - gPlayer[0].camEye.y = 600.0f; - gPlayer[0].camEye.z = boss->obj.pos.z - 1500.0f; - gPlayer[0].camAt.x = boss->obj.pos.x; - gPlayer[0].camAt.y = boss->obj.pos.y - 300.0f; - gPlayer[0].camAt.z = boss->obj.pos.z; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; + gPlayer[0].cam.eye.x = boss->obj.pos.x; + gPlayer[0].cam.eye.y = 600.0f; + gPlayer[0].cam.eye.z = boss->obj.pos.z - 1500.0f; + gPlayer[0].cam.at.x = boss->obj.pos.x; + gPlayer[0].cam.at.y = boss->obj.pos.y - 300.0f; + gPlayer[0].cam.at.z = boss->obj.pos.z; boss->state = 16; boss->timer_050 = 130; boss->timer_052 = 1000; @@ -951,7 +951,7 @@ void Katina_801946C4(Boss* boss) { case 16: Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 30.0f, 1.0f, 1.6f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.z, 0.0f, 0.05f, 5.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.z, 0.0f, 0.05f, 5.0f, 0.0f); boss->fwork[13] += 0.1f; Math_SmoothStepToF(&D_ctx_801784D4, 200.0f, 1.0f, 0.5f, 0.0f); scale = 0.5f; @@ -979,7 +979,7 @@ void Katina_801946C4(Boss* boss) { gLight1B = D_i4_801A0554; for (i = 0; i < rot_count; i++) { - Matrix_RotateY(gCalcMatrix, RAND_FLOAT(2.0f) * M_PI, 0); + Matrix_RotateY(gCalcMatrix, RAND_FLOAT(2.0f) * M_PI, MTXF_NEW); src.x = 0.0f; src.y = 0.0f; src.z = RAND_FLOAT(400.0f) + 300.0f; @@ -1002,12 +1002,12 @@ void Katina_801946C4(Boss* boss) { Object_Kill(&gEffects[i].obj, gEffects[i].sfxSource); } } - gPlayer[0].camEye.x = boss->obj.pos.x; - gPlayer[0].camEye.y = 300.0f; - gPlayer[0].camEye.z = boss->obj.pos.z + 2000.0f; - gPlayer[0].camAt.x = boss->obj.pos.x; - gPlayer[0].camAt.y = 1500.0f; - gPlayer[0].camAt.z = boss->obj.pos.z; + gPlayer[0].cam.eye.x = boss->obj.pos.x; + gPlayer[0].cam.eye.y = 300.0f; + gPlayer[0].cam.eye.z = boss->obj.pos.z + 2000.0f; + gPlayer[0].cam.at.x = boss->obj.pos.x; + gPlayer[0].cam.at.y = 1500.0f; + gPlayer[0].cam.at.z = boss->obj.pos.z; D_ctx_801784D4 = 60.0f; gLight1R = 100; gLight1G = 70; @@ -1019,7 +1019,7 @@ void Katina_801946C4(Boss* boss) { case 17: boss->fwork[13] += 0.1f; - Math_SmoothStepToF(&gPlayer[0].camAt.y, 525.0f, 0.3f, 50.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.y, 525.0f, 0.3f, 50.0f, 0.0f); Math_SmoothStepToF(&boss->fwork[15], 8.0f, 1.0f, 2.0f, 0.0f); if (boss->timer_050 == 1) { gBosses[0].state = 1; @@ -1031,14 +1031,14 @@ void Katina_801946C4(Boss* boss) { case 18: Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 100.0f, 1.0f, 100.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camAt.y, 525.0f, 0.3f, 50.0f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.y, 525.0f, 0.3f, 50.0f, 0.0f); if (boss->timer_050 == 0) { gFillScreenAlphaTarget = 255; gFillScreenRed = 255; gFillScreenGreen = 255; gFillScreenBlue = 255; if (gFillScreenAlpha == 255) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 2; gPlayer[0].unk_234 = 1; gCsFrameCount = 200; @@ -1062,9 +1062,9 @@ void Katina_801946C4(Boss* boss) { case 20: gShowAllRangeCountdown = 0; Math_SmoothStepToF(&boss->fwork[10], 0.0f, 0.1f, 3.0f, 0.0f); - if ((boss->timer_050 == 0) && - (((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5))) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((boss->timer_050 == 0) && (((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; gNextPlanetPath = 1; boss->obj.pos.z = 0.0f; @@ -1083,8 +1083,8 @@ void Katina_801946C4(Boss* boss) { break; case 21: - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); boss->obj.pos.z += boss->unk_078.z; if (boss->timer_050 == 820) { AUDIO_PLAY_SFX(0x19408047U, boss->sfxSource, 0); @@ -1125,7 +1125,7 @@ void Katina_801946C4(Boss* boss) { if (boss->state != 0) { angle = 360.0f; for (i = 0; i < 4; i++) { - Matrix_RotateY(gCalcMatrix, (boss->obj.rot.y + angle) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (boss->obj.rot.y + angle) * M_DTOR, MTXF_NEW); src.x = 0.0f; src.y = -550.0f; src.z = 850.0f; @@ -1142,8 +1142,8 @@ void Katina_801946C4(Boss* boss) { if (boss->obj.rot.y < 0.0f) { boss->obj.rot.y += 360.0f; } - gRadarMarks[64].unk_00 = 1; - gRadarMarks[64].unk_02 = 101; + gRadarMarks[64].status = 1; + gRadarMarks[64].type = 101; gRadarMarks[64].pos.x = boss->obj.pos.x; gRadarMarks[64].pos.y = boss->obj.pos.y; gRadarMarks[64].pos.z = boss->obj.pos.z; @@ -1285,7 +1285,7 @@ void Katina_801968F4(Boss* boss) { gSPFogPosition(gMasterDisp++, gFogNear, 1006); } - Matrix_RotateY(gGfxMatrix, boss->fwork[13] * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, boss->fwork[13] * M_DTOR, MTXF_APPLY); Animation_GetFrameData(&D_KA_60105D8, 0, jointTable); Animation_DrawSkeleton(1, D_KA_6010744, jointTable, Katina_801965A8, NULL, boss, &gIdentityMatrix); @@ -1295,18 +1295,19 @@ void Katina_801968F4(Boss* boss) { Matrix_Push(&gGfxMatrix); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 0, 255, 255, 255); - Matrix_Translate(gGfxMatrix, 0.0f, 500.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[14], boss->fwork[14], boss->fwork[14], 1); - Matrix_RotateX(gGfxMatrix, -90 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 500.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[14], boss->fwork[14], boss->fwork[14], MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -90 * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 64); gDPSetEnvColor(gMasterDisp++, 0, 255, 255, 64); - Matrix_Translate(gGfxMatrix, 0.0f, 500.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[14] * 3.0f, boss->fwork[14] * 3.0f, boss->fwork[14] * 3.0f, 1); - Matrix_RotateX(gGfxMatrix, -90 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 500.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[14] * 3.0f, boss->fwork[14] * 3.0f, boss->fwork[14] * 3.0f, + MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -90 * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -1315,8 +1316,8 @@ void Katina_801968F4(Boss* boss) { if (boss->fwork[15] > 0.0f) { RCP_SetupDL(&gMasterDisp, 41); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 128); - Matrix_RotateX(gGfxMatrix, M_PI, 1); - Matrix_Scale(gGfxMatrix, 0.3f, boss->fwork[15], 0.3f, 1); + Matrix_RotateX(gGfxMatrix, M_PI, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, boss->fwork[15], 0.3f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_KA_600BFB0); } @@ -1416,7 +1417,7 @@ void Katina_80197290(Player* player) { player->pos.x = boss->obj.pos.x; player->pos.y = 800.0f; player->pos.z = boss->obj.pos.z; - player->unk_114 = player->unk_120 = player->unk_0E4 = player->unk_034 = player->unk_4D8 = 0.0f; + player->unk_114 = player->unk_120 = player->unk_0E4 = player->camRoll = player->unk_4D8 = 0.0f; player->unk_0E8 = 120.0f; player->unk_0D0 = 40.0f; gCsCamEyeX = boss->obj.pos.x + 5000.0f; @@ -1516,7 +1517,7 @@ void Katina_80197290(Player* player) { gFillScreenAlphaTarget = 0; gFillScreenAlphaStep = 2; D_ctx_80177A48[1] -= D_ctx_80177A48[2]; - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); src.x = -1000.0f; src.y = 0.0f; src.z = 0.0f; @@ -1549,7 +1550,7 @@ void Katina_80197290(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; D_play_800D3180[LEVEL_KATINA] = Play_CheckMedalStatus(150) + 1; @@ -1638,8 +1639,8 @@ void Katina_80197290(Player* player) { gActors[4].unk_0F4.x += 0.08f; break; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = player->unk_0D0; @@ -1653,12 +1654,12 @@ void Katina_80197290(Player* player) { player->unk_0F8 = player->unk_0EC; player->unk_138 = player->pos.z; if (player->unk_1D0 < 100) { - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); } player->unk_088 += 10.0f; player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; @@ -1703,8 +1704,8 @@ void Katina_80197F10(Actor* actor) { actor->fwork[1] -= 0.5f; break; } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; src.z = actor->fwork[0]; @@ -1724,7 +1725,7 @@ void Katina_801981F8(Actor* actor) { Vec3f dest; s32 pad; - if (actor->timer_0C0 == 0 && (i = 0, (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_0))) { + if (actor->timer_0C0 == 0 && (i = 0, (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY))) { actor->timer_0C0 = 2; src.x = 0.0f; src.y = 0.0f; @@ -1741,7 +1742,7 @@ void Katina_801981F8(Actor* actor) { if ((actor_it->unk_0B6 != 0) || (gBosses[1].state == 0)) { actor_it->obj.status = OBJ_ACTIVE; actor_it->obj.id = OBJ_ACTOR_ALLRANGE; - Matrix_RotateY(gCalcMatrix, actor->unk_04E * 18.0f * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->unk_04E * 18.0f * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &src, &dest); actor_it->obj.pos.x = dest.x; actor_it->obj.pos.y = RAND_FLOAT(1000.0f) + 300.0f; @@ -1861,25 +1862,25 @@ void Katina_80198594(Actor* actor) { if (gBosses[1].state == 12) { if (((gAllRangeEventTimer % 256) == 0) && (Rand_ZeroOne() < 0.5f)) { - func_360_8002E4F8(gMsg_ID_18060, RCID_BILL); + AllRange_PlayMessage(gMsg_ID_18060, RCID_BILL); } - } else if ((gAllRangeEventTimer > 500) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && + } else if ((gAllRangeEventTimer > 500) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && ((gAllRangeEventTimer % 512) == 0)) { switch (RAND_INT(3.99f)) { case 0: - func_360_8002E4F8(gMsg_ID_18020, RCID_BILL); + AllRange_PlayMessage(gMsg_ID_18020, RCID_BILL); break; case 1: - func_360_8002E4F8(gMsg_ID_18021, RCID_BILL); + AllRange_PlayMessage(gMsg_ID_18021, RCID_BILL); break; case 2: - func_360_8002E4F8(gMsg_ID_18022, RCID_BILL); + AllRange_PlayMessage(gMsg_ID_18022, RCID_BILL); break; case 3: - func_360_8002E4F8(gMsg_ID_18025, RCID_FALCO); + AllRange_PlayMessage(gMsg_ID_18025, RCID_FALCO); break; } } @@ -1992,7 +1993,7 @@ void Katina_80198AA0(Actor* actor) { actor->iwork[5] = 1; if ((((actor->index + gGameFrameCount) & 0xB) == 0) && (Rand_ZeroOne() < 0.1f) && - (func_360_80031900(actor) != 0) && (gActors[0].state == 2)) { + func_360_80031900(actor) && (gActors[0].state == 2)) { actor->iwork[0] = 1; } } else { @@ -2000,7 +2001,7 @@ void Katina_80198AA0(Actor* actor) { } if ((actor->aiIndex >= AI360_FALCO) && - ((gActors[actor->aiIndex].obj.status == 3) || (gActors[actor->aiIndex].state == 6) || + ((gActors[actor->aiIndex].obj.status == OBJ_DYING) || (gActors[actor->aiIndex].state == 6) || gActors[actor->aiIndex].obj.status == OBJ_FREE)) { actor->state = 3; } @@ -2014,7 +2015,7 @@ void Katina_80198AA0(Actor* actor) { actor->fwork[3] = 1.2f; actor->fwork[1] = 40.0f; yRand = RAND_FLOAT(1000.0f); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_0) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY) { xRand = RAND_FLOAT_CENTERED(5000.0f); zRand = RAND_FLOAT_CENTERED(5000.0f); } else { @@ -2110,10 +2111,10 @@ void Katina_80198AA0(Actor* actor) { (-xSin * 200.0f * 0.5f), (yCos * (xCos * 200.0f * 0.5f)), actor->obj.rot.x, actor->obj.rot.y, actor->obj.rot.z); } - func_360_8003088C(actor); + ActorAllRange_ApplyDamage(actor); radarMark = &gRadarMarks[actor->index]; - radarMark->unk_00 = 1; - radarMark->unk_02 = actor->aiType; + radarMark->status = 1; + radarMark->type = actor->aiType; radarMark->pos.x = actor->obj.pos.x; radarMark->pos.y = actor->obj.pos.y; radarMark->pos.z = actor->obj.pos.z; @@ -2131,17 +2132,17 @@ void Katina_801995B4(Actor* actor) { if (((actor->index + gSysFrameCount) % 8) == 0) { actor->iwork[23] = 1; - if ((fabsf(actor->obj.pos.x - gPlayer[0].camEye.x) < 4500.0f) && - (fabsf(actor->obj.pos.z - gPlayer[0].camEye.z) < 4500.0f)) { + if ((fabsf(actor->obj.pos.x - gPlayer[0].cam.eye.x) < 4500.0f) && + (fabsf(actor->obj.pos.z - gPlayer[0].cam.eye.z) < 4500.0f)) { actor->iwork[23] = 0; } } if ((actor->iwork[8] != 0) && (actor->aiType < AI360_GREAT_FOX)) { angle = SIN_DEG(actor->iwork[8] * 400.0f) * actor->iwork[8]; - Matrix_RotateY(gGfxMatrix, M_DTOR * angle, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * angle, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * angle, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * angle, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * angle, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * angle, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } if (actor->iwork[23] != 0) { @@ -2164,7 +2165,7 @@ void Katina_801995B4(Actor* actor) { case 1: gSPDisplayList(gMasterDisp++, D_KA_600E050); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -60.0f, MTXF_APPLY); func_edisplay_8005B1E8(actor, 0); break; } diff --git a/src/overlays/ovl_i4/fox_sz.c b/src/overlays/ovl_i4/fox_sz.c index cb16de15..0b63075c 100644 --- a/src/overlays/ovl_i4/fox_sz.c +++ b/src/overlays/ovl_i4/fox_sz.c @@ -46,9 +46,9 @@ void SectorZ_80199900(Actor* actor, s32 arg1) { if (arg1 != 0) { D_i4_801A0560++; if ((D_i4_801A0560 >= 6) && - ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5))) { + ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gCsFrameCount = 0; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 1000; gActors[0].state = 6; gPlayer[0].timer_1F8 = 30; @@ -157,8 +157,8 @@ void SectorZ_Missile_Update(Actor* this) { SectorZ_80199900(this, 0); gCameraShake = 25; gBosses[0].dmgType = DMG_UNK_100; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; gActors[0].state = -31072; return; @@ -166,11 +166,11 @@ void SectorZ_Missile_Update(Actor* this) { } if (((fabsf(this->fwork[MISSILE_TARGET_Z] - this->obj.pos.z) < 2000.0f) && - (((gPlayer[0].camEye.z < 0.0f) || (D_edisplay_801615D0.y < 0.0f)) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_10))) && - (((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_10)) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5))) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + (((gPlayer[0].cam.eye.z < 0.0f) || (D_edisplay_801615D0.y < 0.0f)) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR))) && + (((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR)) || + (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 100; gActors[0].state = -31072; } @@ -256,18 +256,18 @@ void SectorZ_8019A2F4(Actor* actor) { gCsFrameCount = 0; actor->timer_0BC = 400; actor->state = 3; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; Audio_PlayFanfare(SEQ_ID_KATT, 20, 10, 10); - func_360_8002EE34(); + AllRange_ClearRadio(); - gPlayer[0].camEye.x = 250.0f; - gPlayer[0].camEye.y = 2500.0f; - gPlayer[0].camEye.z = 25000.0f; + gPlayer[0].cam.eye.x = 250.0f; + gPlayer[0].cam.eye.y = 2500.0f; + gPlayer[0].cam.eye.z = 25000.0f; - gPlayer[0].camAt.x = gActors[8].obj.pos.x; - gPlayer[0].camAt.y = gActors[8].obj.pos.y; - gPlayer[0].camAt.z = gActors[8].obj.pos.z; + gPlayer[0].cam.at.x = gActors[8].obj.pos.x; + gPlayer[0].cam.at.y = gActors[8].obj.pos.y; + gPlayer[0].cam.at.z = gActors[8].obj.pos.z; D_i4_801A0564 = 1; } } @@ -338,7 +338,7 @@ void SectorZ_8019A3E8(Actor* actor) { Radio_PlayMessage(gMsg_ID_16030, RCID_FALCO); } - if (((actor->timer_0C0 == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_0)) && + if (((actor->timer_0C0 == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY)) && ((gAllRangeEventTimer < 200) || ((gAllRangeEventTimer > 4000) && (gAllRangeEventTimer < 4200)))) { actor->timer_0C0 = 5; actorPtr = &gActors[13]; @@ -351,7 +351,7 @@ void SectorZ_8019A3E8(Actor* actor) { Actor_Initialize(actorPtr); actorPtr->obj.status = OBJ_ACTIVE; actorPtr->obj.id = OBJ_ACTOR_ALLRANGE; - Matrix_RotateY(gCalcMatrix, (actor->unk_04E * 18.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, (actor->unk_04E * 18.0f) * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp40, &sp34); actorPtr->obj.pos.x = sp34.x; @@ -427,18 +427,18 @@ void SectorZ_8019A3E8(Actor* actor) { SectorZ_8019A0F8(&gActors[15], 2); SectorZ_8019A0F8(&gActors[16], 3); - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; actor->state = 10; actor->fwork[10] = 0.0f; - gPlayer[0].unk_034 = 15.0f; + gPlayer[0].camRoll = 15.0f; - gPlayer[0].camEye.x = gActors[10].obj.pos.x - 25000.0f; - gPlayer[0].camEye.y = gActors[10].obj.pos.y; - gPlayer[0].camEye.z = gActors[10].obj.pos.z; + gPlayer[0].cam.eye.x = gActors[10].obj.pos.x - 25000.0f; + gPlayer[0].cam.eye.y = gActors[10].obj.pos.y; + gPlayer[0].cam.eye.z = gActors[10].obj.pos.z; - gPlayer[0].camAt.x = gActors[10].obj.pos.x; - gPlayer[0].camAt.y = gActors[10].obj.pos.y; - gPlayer[0].camAt.z = gActors[10].obj.pos.z; + gPlayer[0].cam.at.x = gActors[10].obj.pos.x; + gPlayer[0].cam.at.y = gActors[10].obj.pos.y; + gPlayer[0].cam.at.z = gActors[10].obj.pos.z; actor->timer_0BC = 10000; gFillScreenAlpha = gFillScreenAlphaTarget = 255; @@ -452,10 +452,10 @@ void SectorZ_8019A3E8(Actor* actor) { } bool SectorZ_8019AA9C(Player* player) { - if (player->state_1C8 == PLAYERSTATE_1C8_3) { + if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if ((player->unk_114 > 30.0f) && (player->unk_114 < 150.0f) && (fabsf(player->pos.x - 1270.0f) < 450.0f) && (fabsf(player->pos.y - 265.0f) < 100.0f) && (fabsf(player->unk_138) < 172.0f)) { - player->state_1C8 = PLAYERSTATE_1C8_10; + player->state_1C8 = PLAYERSTATE_1C8_GFOX_REPAIR; player->unk_1D0 = 0; gActors[0].state = 20; gAllRangeEventTimer--; @@ -520,14 +520,14 @@ void SectorZ_8019AB8C(Actor* actor) { if (gCsFrameCount == 3) { func_effect_80078E50(actor8->obj.pos.x, actor8->obj.pos.y, actor8->obj.pos.z, 30.0f); } - player->camEye.x += actor8->vel.x * 0.23f; - player->camEye.y += actor8->vel.y * 0.23f; - player->camEye.z += actor8->vel.z * 0.23f; + player->cam.eye.x += actor8->vel.x * 0.23f; + player->cam.eye.y += actor8->vel.y * 0.23f; + player->cam.eye.z += actor8->vel.z * 0.23f; - Math_SmoothStepToF(&player->camAt.x, actor8->obj.pos.x, 1.0f, 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, actor8->obj.pos.y, 1.0f, 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, actor8->obj.pos.z, 1.0f, 20000.0f, 0); - Math_SmoothStepToF(&player->unk_034, 0, 1.0f, 1000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, actor8->obj.pos.x, 1.0f, 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, actor8->obj.pos.y, 1.0f, 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, actor8->obj.pos.z, 1.0f, 20000.0f, 0); + Math_SmoothStepToF(&player->camRoll, 0, 1.0f, 1000.0f, 0); switch (actor->timer_0BC) { case 370: @@ -556,7 +556,7 @@ void SectorZ_8019AB8C(Actor* actor) { if (actor->timer_0BC == 70) { actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); player->unk_014 = 0.0f; } @@ -605,31 +605,31 @@ void SectorZ_8019AB8C(Actor* actor) { break; } - Math_SmoothStepToF(&player->camAt.x, gActors[10].obj.pos.x, 0.2, 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gActors[10].obj.pos.y, 0.2, 500.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gActors[10].obj.pos.z, 0.2, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gActors[10].obj.pos.x, 0.2, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gActors[10].obj.pos.y, 0.2, 500.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gActors[10].obj.pos.z, 0.2, 500.0f, 0.0f); if (actor->timer_0BC < 9800) { Math_SmoothStepToF(&gActors[10].fwork[1], 80.0f, 0.1, 10.0f, 0); Math_SmoothStepToF(&gActors[10].fwork[29], 3.0f, 0.1, 1.0f, 0); } else { Math_SmoothStepToF(&actor->fwork[10], 700.0f, 1, 5.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.x, gActors[10].obj.pos.x - 300.0f, 0.07f, actor->fwork[10], 0); - Math_SmoothStepToF(&player->camEye.y, gActors[10].obj.pos.y, 0.07f, actor->fwork[10], 0); - Math_SmoothStepToF(&player->camEye.z, gActors[10].obj.pos.z + 500.0f, 0.05f, 50.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gActors[10].obj.pos.x - 300.0f, 0.07f, actor->fwork[10], 0); + Math_SmoothStepToF(&player->cam.eye.y, gActors[10].obj.pos.y, 0.07f, actor->fwork[10], 0); + Math_SmoothStepToF(&player->cam.eye.z, gActors[10].obj.pos.z + 500.0f, 0.05f, 50.0f, 0); Math_SmoothStepToF(&gActors[10].fwork[29], 2.0f, 0.1f, 1.0f, 0); } if (actor->timer_0BC < 9680) { actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); player->unk_014 = 0.0f; gActors[10].fwork[1] = 25.0f; gActors[10].fwork[29] = 5.0f; gActors[10].obj.pos.z = 35000.0f; gActors[10].iwork[9] = 0; - gPlayer[0].unk_034 = 0.0f; + gPlayer[0].camRoll = 0.0f; actor->timer_0BE = 550; } break; @@ -701,9 +701,9 @@ void SectorZ_8019B630(Actor* actor, s32 index) { actor->obj.status = OBJ_ACTIVE; actor->obj.id = OBJ_ACTOR_195; - actor->obj.pos.x = gPlayer[0].camEye.x + D_i4_8019F57C[index].x; - actor->obj.pos.y = gPlayer[0].camEye.y + D_i4_8019F57C[index].y; - actor->obj.pos.z = gPlayer[0].camEye.z + D_i4_8019F57C[index].z; + actor->obj.pos.x = gPlayer[0].cam.eye.x + D_i4_8019F57C[index].x; + actor->obj.pos.y = gPlayer[0].cam.eye.y + D_i4_8019F57C[index].y; + actor->obj.pos.z = gPlayer[0].cam.eye.z + D_i4_8019F57C[index].z; actor->vel.z = -30.0f; actor->vel.y = -10.0f; @@ -805,7 +805,7 @@ void SectorZ_8019BA64(Player* player) { player->unk_234 = 0; player->unk_0D0 = 0.0f; - player->unk_034 = -20.0f; + player->camRoll = -20.0f; D_game_80161A44 = 30000.0f; @@ -834,7 +834,7 @@ void SectorZ_8019BA64(Player* player) { case 2: gFillScreenAlpha = 0; - player->unk_034 += 0.05f; + player->camRoll += 0.05f; for (i = 30; i < 34; i++) { Math_SmoothStepToF(&gActors[i].vel.x, -5.0f, 0.1f, 0.1, 0.0f); @@ -854,15 +854,15 @@ void SectorZ_8019BA64(Player* player) { actor->obj.pos.y = 0.0f; actor->obj.pos.x = 0.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; - player->camEye.x = gCsCamEyeX = actor->obj.pos.x - 2800.0f; - player->camEye.y = gCsCamEyeY = actor->obj.pos.y + 1400.0f; - player->camEye.z = gCsCamEyeZ = actor->obj.pos.z + 700.0f; + player->cam.eye.x = gCsCamEyeX = actor->obj.pos.x - 2800.0f; + player->cam.eye.y = gCsCamEyeY = actor->obj.pos.y + 1400.0f; + player->cam.eye.z = gCsCamEyeZ = actor->obj.pos.z + 700.0f; - player->camAt.x = gCsCamAtX = actor->obj.pos.x - 1000.0f; - player->camAt.y = gCsCamAtY = actor->obj.pos.y; - player->camAt.z = gCsCamAtZ = actor->obj.pos.z; + player->cam.at.x = gCsCamAtX = actor->obj.pos.x - 1000.0f; + player->cam.at.y = gCsCamAtY = actor->obj.pos.y; + player->cam.at.z = gCsCamAtZ = actor->obj.pos.z; D_ctx_80177A48[0] = 0.0f; gFillScreenAlpha = 255; @@ -930,7 +930,7 @@ void SectorZ_8019BA64(Player* player) { if (gCsFrameCount == 820) { Audio_KillSfxById(0x49000014U); - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_01C = player->unk_018 = player->unk_014 = 0.f; AUDIO_PLAY_BGM(gBgmSeqId); gLevelStatusScreenTimer = 50; @@ -998,8 +998,8 @@ void SectorZ_8019BA64(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + player->unk_114 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; @@ -1018,12 +1018,12 @@ void SectorZ_8019BA64(Player* player) { player->unk_138 = player->pos.z; player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); } f32 D_i4_8019F61C[] = { -300.0f, 350.0f, -50.0f, 800.0f }; @@ -1156,7 +1156,7 @@ void SectorZ_8019C85C(Player* player) { player->unk_234 = 0; player->unk_0D0 = 0.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; if (boss0->state != 0) { player->unk_1D0 = 0; @@ -1180,7 +1180,7 @@ void SectorZ_8019C85C(Player* player) { player->timer_1F8 = 550; player->unk_0D0 = 0.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; gFillScreenAlphaTarget = 255; gFillScreenAlpha = gFillScreenAlphaTarget; @@ -1297,7 +1297,7 @@ void SectorZ_8019C85C(Player* player) { break; case 11: - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); D_ctx_80177A48[1] += D_ctx_80177A48[2] * var_fv1; src.x = -800.0f * var_fv1; @@ -1350,7 +1350,7 @@ void SectorZ_8019C85C(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; D_play_800D3180[LEVEL_SECTOR_Z] = Play_CheckMedalStatus(100) + 1; @@ -1524,8 +1524,8 @@ void SectorZ_8019C85C(Player* player) { break; } - Matrix_RotateY(gCalcMatrix, ((player->unk_114 + player->unk_0E8) + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(((player->unk_120 + player->unk_0E4) + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, ((player->unk_114 + player->unk_0E8) + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(((player->unk_120 + player->unk_0E4) + player->unk_4D8) * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -1546,7 +1546,7 @@ void SectorZ_8019C85C(Player* player) { Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); if (player->unk_1D0 >= 1000) { @@ -1554,16 +1554,16 @@ void SectorZ_8019C85C(Player* player) { Math_SmoothStepToF(&player->pos.y, 700.0f, 0.1f, 10.0f, 0.0f); } func_play_800B7184(player, 0); - player->camEye.x += player->vel.x * 0.1f; - player->camEye.y += player->vel.y * 0.1f; - player->camEye.z += player->vel.z * 0.1f; + player->cam.eye.x += player->vel.x * 0.1f; + player->cam.eye.y += player->vel.y * 0.1f; + player->cam.eye.z += player->vel.z * 0.1f; } else { - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); } player->unk_088 += 10.0f; @@ -1640,9 +1640,9 @@ void SectorZ_8019DD20(Actor* actor) { Math_SmoothStepToF(&actor->fwork[0], 40.0f, 0.1f, 3.0f, 0.0f); if ((gCsFrameCount < 460) && ((gCsFrameCount & 3) == 0)) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = 70.0f; src.z = -70.0f; @@ -1653,8 +1653,8 @@ void SectorZ_8019DD20(Actor* actor) { } } - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -1752,8 +1752,8 @@ void SectorZ_8019E454(Boss* boss) { } } - Matrix_RotateY(gCalcMatrix, (boss->unk_078.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(boss->unk_078.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (boss->unk_078.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(boss->unk_078.x * M_DTOR), MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -1770,9 +1770,9 @@ void SectorZ_8019E454(Boss* boss) { boss->obj.rot.z = -boss->unk_078.z; if (!gGreatFoxIntact) { - Matrix_RotateY(gCalcMatrix, (boss->obj.rot.y - 270.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (boss->obj.rot.y - 270.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i4_8019F64C[RAND_INT(11.99f)], &dest); func_effect_8007C484(boss->obj.pos.x + dest.x, boss->obj.pos.y + dest.y, boss->obj.pos.z + dest.z, boss->vel.x, boss->vel.y, boss->vel.z, RAND_FLOAT(0.1f) + 0.15f, 0); diff --git a/src/overlays/ovl_i5/fox_ground.c b/src/overlays/ovl_i5/fox_ground.c index cc5b9007..5d3665dc 100644 --- a/src/overlays/ovl_i5/fox_ground.c +++ b/src/overlays/ovl_i5/fox_ground.c @@ -346,7 +346,7 @@ void Ground_801B5244(s32 arg0, s32 arg1) { gSP1Triangle(D_i5_801C5C00++, (iv1 << 1), (iv1 << 1) + 3, (iv1 << 1) + 2, 0); } } - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_i5_801C24B8[sp5C] * -220.0f, 0); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_i5_801C24B8[sp5C] * -220.0f, MTXF_NEW); Matrix_ToMtx(&D_i5_801C5C18[sp60]); gSPMatrix(D_i5_801C5C00++, &D_i5_801C5C18[sp60], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPEndDisplayList(D_i5_801C5C00++); @@ -373,7 +373,7 @@ void Ground_801B58AC(Gfx** dList, f32 arg1) { G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); gDPLoadTileTexture((*dList)++, D_TI_6001BA8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32); gSPMatrix((*dList)++, &gIdentityMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - Matrix_Translate(gGfxMatrix, D_i5_801C62D8.x, D_i5_801C62D8.y, D_i5_801C62D8.z + D_i5_801C5C10, 0); + Matrix_Translate(gGfxMatrix, D_i5_801C62D8.x, D_i5_801C62D8.y, D_i5_801C62D8.z + D_i5_801C5C10, MTXF_NEW); Matrix_ToMtx(gGfxMtx); gSPMatrix((*dList)++, gGfxMtx++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList((*dList)++, D_i5_801BA950); @@ -415,7 +415,7 @@ void Ground_801B58AC(Gfx** dList, f32 arg1) { D_i5_801C24B8[(D_i5_801C5C08 + 29) % 28] * -220.0f; D_i5_801BE748[(D_i5_801C5C04 + 27) % 27][i][1].v.ob[2] = 0; - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_i5_801C24B8[D_i5_801C5C08] * -220.0f, 0); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, D_i5_801C24B8[D_i5_801C5C08] * -220.0f, MTXF_NEW); Matrix_ToMtx(&D_i5_801C5C18[D_i5_801C5C04]); } Ground_801B5FE0(D_i5_801C5C08, D_i5_801C5C04, 1); @@ -563,7 +563,7 @@ void Ground_801B68A8(Gfx** dlist, s32 arg1, s32 arg2) { gDPSetupTile((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); gDPLoadTileTexture((*dlist)++, D_TI_6001BA8, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32); - Matrix_Translate(gGfxMatrix, D_i5_801C62D8.x, D_i5_801C62D8.y, D_i5_801C62D8.z + D_i5_801C5C10, 0); + Matrix_Translate(gGfxMatrix, D_i5_801C62D8.x, D_i5_801C62D8.y, D_i5_801C62D8.z + D_i5_801C5C10, MTXF_NEW); Matrix_ToMtx(gGfxMtx); gSPMatrix((*dlist)++, gGfxMtx++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/overlays/ovl_i5/fox_ma.c b/src/overlays/ovl_i5/fox_ma.c index 47623e64..ebd3da28 100644 --- a/src/overlays/ovl_i5/fox_ma.c +++ b/src/overlays/ovl_i5/fox_ma.c @@ -274,7 +274,7 @@ void Macbeth_80199A40(u8* arg0, u8* arg1, f32 arg2) { Matrix_Push(&gCalcMatrix); arg0 = SEGMENTED_TO_VIRTUAL(arg0); arg1 = SEGMENTED_TO_VIRTUAL(arg1); - Matrix_RotateZ(gCalcMatrix, M_DTOR * arg2, 0); + Matrix_RotateZ(gCalcMatrix, M_DTOR * arg2, MTXF_NEW); sp74.z = 0.0f; for (i = 0, var_fs4 = 0.0f; i < 32; i++, var_fs4++) { for (j = 0, var_fs0 = 0.0f; j < 32; j++, var_fs0++) { @@ -498,7 +498,7 @@ void Macbeth_8019A2F4(Actor* actor) { break; } } - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) { if (var_fa1 < (gPlayer[0].unk_138 - actor->obj.pos.z - (D_i5_801BA1E4 * 1416 - 1416))) { Math_SmoothStepToF(&D_i5_801BA1DC, -6.0f, 0.1f, 0.2f, 0.01f); } @@ -785,7 +785,7 @@ void Macbeth_8019C778(Actor* actor) { case 0: D_i5_801BE320[25] = 1; if ((D_i5_801BE320[9] <= 0) && (D_i5_801BE320[10] <= 0) && (D_i5_801BE320[17] != 0) && - (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { + (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { D_i5_801BE320[30] = 0; actor->timer_0BC = 150; actor->timer_0BE = 200; @@ -871,8 +871,8 @@ void Macbeth_8019C778(Actor* actor) { } if (actor->timer_0BC == 100) { Object_Kill(&actor->obj, actor->sfxSource); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; gNextPlanetPath = 0; } @@ -911,7 +911,7 @@ void Macbeth_8019C778(Actor* actor) { D_i5_801BE320[23] = 0; actor->state = 4; } - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) && (gCsFrameCount > 630)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (gCsFrameCount > 630)) { Object_Kill(&actor->obj, actor->sfxSource); } } @@ -1494,9 +1494,9 @@ void Macbeth_8019F164(Actor* actor) { } } if ((actor->iwork[4] == 0) || (sp44 != 0)) { - Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->obj.rot.x + actor->fwork[29]) * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -(actor->obj.rot.y + actor->fwork[26]) * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->obj.rot.x + actor->fwork[29]) * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -(actor->obj.rot.y + actor->fwork[26]) * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp6C, &sp84); sp78.x = sp84.x - D_i5_801BA708.x; sp78.y = sp84.y - D_i5_801BA708.y; @@ -1521,9 +1521,9 @@ void Macbeth_8019F164(Actor* actor) { } Math_SmoothStepToAngle(&actor->fwork[2], actor->fwork[4], 0.2f, 5.0f, 0.01f); Math_SmoothStepToAngle(&actor->fwork[1], actor->fwork[3], 0.2f, 5.0f, 0.01f); - Matrix_RotateY(gCalcMatrix, (actor->obj.rot.y + actor->fwork[26]) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, (actor->obj.rot.x + actor->fwork[29]) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (actor->obj.rot.y + actor->fwork[26]) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, (actor->obj.rot.x + actor->fwork[29]) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i5_801BA708, &sp84); sp60.x = sp84.x + actor->obj.pos.x + actor->fwork[25]; sp60.y = sp84.y + actor->obj.pos.y + actor->fwork[8] + 25.0f; @@ -2034,7 +2034,7 @@ void Macbeth_801A12C4(Actor* actor) { Vec3f spD0[50]; s32 id; - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if (((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f) || ((gPlayer[0].unk_138 - actor->obj.pos.z) < -1000.0f)) { return; @@ -2047,9 +2047,9 @@ void Macbeth_801A12C4(Actor* actor) { } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->fwork[25], actor->fwork[8] + 25.0f, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[26] * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[29] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, actor->fwork[25], actor->fwork[8] + 25.0f, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[26] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[29] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((actor->obj.id != OBJ_ACTOR_206) && (actor->obj.id != OBJ_ACTOR_205)) { @@ -2057,7 +2057,7 @@ void Macbeth_801A12C4(Actor* actor) { gSPDisplayList(gMasterDisp++, D_MA_6027BF0); gSPDisplayList(gMasterDisp++, D_MA_601BE90); } else { - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Animation_GetFrameData(&D_MA_602EA0C, 0, spD0); Animation_DrawSkeleton(1, D_MA_602EBB8, spD0, Macbeth_801A0A74, NULL, actor, &gIdentityMatrix); } @@ -2080,8 +2080,8 @@ void Macbeth_801A12C4(Actor* actor) { if (actor->iwork[13] == 0) { Animation_GetFrameData(&D_MA_6027A04, 0, spD0); Animation_DrawSkeleton(1, D_MA_6027AF0, spD0, Macbeth_801A0B00, NULL, actor, &gIdentityMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 205.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, actor->fwork[4] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 205.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, actor->fwork[4] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((actor->iwork[7] % 2) != 0) { RCP_SetupDL_27(); @@ -2099,7 +2099,7 @@ void Macbeth_801A12C4(Actor* actor) { break; case OBJ_ACTOR_209: if (actor->iwork[17] != 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 5.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 5.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((actor->iwork[8] % 2) != 0) { RCP_SetupDL_27(); @@ -2114,7 +2114,7 @@ void Macbeth_801A12C4(Actor* actor) { break; case OBJ_ACTOR_211: if (actor->iwork[17] != 2) { - Matrix_Translate(gGfxMatrix, 0.0f, -15.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -15.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((actor->iwork[8] % 2) != 0) { RCP_SetupDL_27(); @@ -2137,7 +2137,7 @@ void Macbeth_801A12C4(Actor* actor) { break; case OBJ_ACTOR_213: if (actor->iwork[13] < 2) { - Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x39); if ((actor->iwork[7] % 2) != 0) { @@ -2161,11 +2161,11 @@ void Macbeth_801A12C4(Actor* actor) { actor->iwork[7]--; } if (actor->iwork[13] == 0) { - Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MA_60269E0); } else { - Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MA_6017720); } @@ -2177,7 +2177,7 @@ void Macbeth_801A12C4(Actor* actor) { Animation_DrawSkeleton(1, D_MA_601EBBC, spD0, Macbeth_801AC5AC, NULL, actor, &gIdentityMatrix); break; case OBJ_ACTOR_205: - Matrix_Translate(gGfxMatrix, actor->fwork[3], 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, actor->fwork[3], 0.0f, 0.0f, MTXF_APPLY); if (D_i5_801BE320[21] == 0) { Animation_GetFrameData(&D_MA_6010220, 0, spD0); } else if (D_i5_801BE320[21] == 1) { @@ -2186,7 +2186,7 @@ void Macbeth_801A12C4(Actor* actor) { Animation_GetFrameData(&D_MA_6010144, D_i5_801BE320[22], spD0); } Animation_DrawSkeleton(1, D_MA_601042C, spD0, Macbeth_801A0EB8, Macbeth_801A1268, actor, &gIdentityMatrix); - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { RCP_SetupDL(&gMasterDisp, 0x1D); gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); gSPDisplayList(gMasterDisp++, D_MA_6003370); @@ -2195,11 +2195,11 @@ void Macbeth_801A12C4(Actor* actor) { } Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->fwork[21], actor->fwork[6] + 65.0f, -420.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[22] * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[27] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, actor->fwork[21], actor->fwork[6] + 65.0f, -420.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[22] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[27] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); if ((gPlayer[0].unk_138 - actor->obj.pos.z) > 3000.0f) { gSPDisplayList(gMasterDisp++, D_MA_6027D40); } else if (actor->vel.z > -2.0f) { @@ -2209,10 +2209,10 @@ void Macbeth_801A12C4(Actor* actor) { } Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->fwork[23], actor->fwork[7] + 65.0f, 420.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[24] * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[28] * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Translate(gGfxMatrix, actor->fwork[23], actor->fwork[7] + 65.0f, 420.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[24] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[28] * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x1D); if ((gPlayer[0].unk_138 - actor->obj.pos.z) > 3000.0f) { @@ -2227,9 +2227,9 @@ void Macbeth_801A12C4(Actor* actor) { if ((id == OBJ_ACTOR_209) || (id == OBJ_ACTOR_211)) { if (actor->iwork[13] != 2) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->fwork[21], actor->fwork[6] + 10.0f, -420.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[26] * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[29] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, actor->fwork[21], actor->fwork[6] + 10.0f, -420.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[26] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[29] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((actor->iwork[7] % 2) != 0) { RCP_SetupDL_27(); @@ -2252,9 +2252,9 @@ void Macbeth_801A12C4(Actor* actor) { } if (actor->iwork[21] != 2) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, actor->fwork[23], actor->fwork[7] + 10.0f, 420.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[26] * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[29] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, actor->fwork[23], actor->fwork[7] + 10.0f, 420.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[26] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[29] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((actor->iwork[9] % 2) != 0) { RCP_SetupDL_27(); @@ -2285,14 +2285,16 @@ void Macbeth_801A23AC(Object_80* obj80) { switch (obj80->obj.id) { case OBJ_80_94: case OBJ_80_97: - if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) && ((gPlayer[0].unk_138 - obj80->obj.pos.z) < -2500.0f)) { + if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) && + ((gPlayer[0].unk_138 - obj80->obj.pos.z) < -2500.0f)) { Object_Kill(&obj80->obj, obj80->sfxSource); } gSPDisplayList(gMasterDisp++, D_MA_6026860); break; case OBJ_80_95: case OBJ_80_98: - if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7) && ((gPlayer[0].unk_138 - obj80->obj.pos.z) < -2500.0f)) { + if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE) && + ((gPlayer[0].unk_138 - obj80->obj.pos.z) < -2500.0f)) { Object_Kill(&obj80->obj, obj80->sfxSource); } gSPDisplayList(gMasterDisp++, D_MA_602FBF0); @@ -2324,17 +2326,17 @@ void Macbeth_801A23AC(Object_80* obj80) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); Matrix_Translate(gGfxMatrix, D_i5_801BE688[0].x, D_i5_801BE688[0].y + 50.0f, - D_i5_801BE688[0].z + 100.0f, 1); - Matrix_RotateX(gCalcMatrix, (D_PI / 2), 1); - Matrix_Scale(gGfxMatrix, obj80->vel.z, obj80->vel.z / 2, obj80->vel.z, 1); + D_i5_801BE688[0].z + 100.0f, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, (D_PI / 2), MTXF_APPLY); + Matrix_Scale(gGfxMatrix, obj80->vel.z, obj80->vel.z / 2, obj80->vel.z, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_i5_801BE688[1].x, D_i5_801BE688[1].y + 50.0f, - D_i5_801BE688[1].z + 100.0f, 1); - Matrix_RotateX(gCalcMatrix, (D_PI / 2), 1); - Matrix_Scale(gGfxMatrix, obj80->vel.z, obj80->vel.z / 2, obj80->vel.z, 1); + D_i5_801BE688[1].z + 100.0f, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, (D_PI / 2), MTXF_APPLY); + Matrix_Scale(gGfxMatrix, obj80->vel.z, obj80->vel.z / 2, obj80->vel.z, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, 0x1D); @@ -2345,9 +2347,9 @@ void Macbeth_801A23AC(Object_80* obj80) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); Matrix_Translate(gGfxMatrix, D_i5_801BE688[1].x - 50.0f, D_i5_801BE688[1].y + 50.0f, - D_i5_801BE688[1].z + 50.0f, 1); - Matrix_RotateX(gCalcMatrix, (D_PI / 2), 1); - Matrix_Scale(gGfxMatrix, obj80->vel.z, obj80->vel.z / 2, obj80->vel.z, 1); + D_i5_801BE688[1].z + 50.0f, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, (D_PI / 2), MTXF_APPLY); + Matrix_Scale(gGfxMatrix, obj80->vel.z, obj80->vel.z / 2, obj80->vel.z, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, 0x1D); @@ -2355,14 +2357,14 @@ void Macbeth_801A23AC(Object_80* obj80) { } if (D_MA_801BE2F0[5] != 0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -1800.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -1800.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MA_601C170); Matrix_Pop(&gGfxMatrix); } else { Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gGfxMatrix, -(D_PI / 18), 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -1800.0f, 1); + Matrix_RotateY(gGfxMatrix, -(D_PI / 18), MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -1800.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MA_601C170); Matrix_Pop(&gGfxMatrix); @@ -2388,7 +2390,7 @@ void Macbeth_801A2A78(Object_80* obj80) { } void Macbeth_801A2B24(Object_80* obj80) { - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) { Object_Kill(&obj80->obj, obj80->sfxSource); } RCP_SetupDL(&gMasterDisp, 0x39); @@ -2834,8 +2836,8 @@ void Macbeth_801A43BC(Actor* actor) { Matrix_Pop(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x1D); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[2] + 204.0f, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[1] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[2] + 204.0f, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[1] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MA_602FFC0); Matrix_Pop(&gGfxMatrix); @@ -2843,8 +2845,8 @@ void Macbeth_801A43BC(Actor* actor) { gDPSetTextureFilter(gMasterDisp++, G_TF_POINT); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, actor->fwork[0], 0, 0, 255); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[2] + 204.0f, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[1] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, actor->fwork[2] + 204.0f, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[1] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MA_602F380); gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); @@ -2940,7 +2942,7 @@ void Macbeth_801A49B8(Actor* actor) { void Macbeth_801A4A64(Actor* actor) { if (actor->state < 2) { if (actor->scale != 1.0f) { - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } gSPDisplayList(gMasterDisp++, D_MA_601A2B0); @@ -3020,7 +3022,7 @@ void Macbeth_801A4B24(Actor* actor) { } D_ctx_80177DC8 = i; D_ctx_8017796C = -1; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; gNextPlanetPath = 1; actor->timer_0BC = 5; @@ -3121,7 +3123,7 @@ s32 Macbeth_801A55D4(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { for (i = 0; i < ARRAY_COUNT(gObjects80); i++, obj80++) { if ((obj80->obj.status == OBJ_ACTIVE) && (obj80->obj.id != OBJ_80_68) && (fabsf(arg1->x - obj80->obj.pos.x) < 2000.0f) && (fabsf(arg1->z - obj80->obj.pos.z) < 2000.0f) && - (func_enmy_80062DBC(arg1, obj80->info.hitbox, &obj80->obj, 0.0f, 0.0f, 0.0f) != 0)) { + (Object_CheckHitboxCollision(arg1, obj80->info.hitbox, &obj80->obj, 0.0f, 0.0f, 0.0f) != 0)) { return i + 10; } } @@ -3130,7 +3132,7 @@ s32 Macbeth_801A55D4(s32 arg0, Vec3f* arg1, Vec3f* arg2, s32 arg3) { for (i = 0; i < ARRAY_COUNT(gActors); i++, actor++) { if ((actor->obj.status >= OBJ_ACTIVE) && (fabsf(arg1->x - actor->obj.pos.x) < 1000.0f) && (fabsf(arg1->z - actor->obj.pos.z) < 1500.0f) && (arg0 != i) && (actor->info.unk_16 != 2) && - (actor->timer_0C2 == 0) && (func_enmy_800631A8(arg1, actor->info.hitbox, &actor->obj.pos) != 0)) { + (actor->timer_0C2 == 0) && (Object_CheckSingleHitbox(arg1, actor->info.hitbox, &actor->obj.pos) != 0)) { actor->unk_0D0 = 1; actor->unk_0D2 = -1; actor->unk_0D8.x = arg1->x; @@ -3861,7 +3863,7 @@ void Macbeth_801A7E7C(Actor* actor) { Macbeth_801A6C78(actor); Macbeth_801A6984(actor); Macbeth_801A7CAC(actor); - if ((D_i5_801BE320[16] != 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if ((D_i5_801BE320[16] != 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { var_v1 = 0xFF; if (D_i5_801BE320[18] == 2) { var_v1 = 3; @@ -4314,7 +4316,7 @@ void Macbeth_801A7E7C(Actor* actor) { if (actor->timer_0BC == 98) { AUDIO_PLAY_SFX(0x19022069, actor->sfxSource, 4); } - Matrix_RotateY(gCalcMatrix, RAND_FLOAT(2.0f) * (M_DTOR * 180.0f), 0); + Matrix_RotateY(gCalcMatrix, RAND_FLOAT(2.0f) * (M_DTOR * 180.0f), MTXF_NEW); sp360.x = 0.0f; sp360.y = RAND_FLOAT(100.0f); sp360.z = RAND_FLOAT(200.0f) + 100.0f; @@ -4379,16 +4381,16 @@ void Macbeth_801A7E7C(Actor* actor) { sp348.x = actor->vwork[6].x - actor->vwork[2].x; sp348.y = actor->vwork[6].y - actor->vwork[2].y + 25.0f; sp348.z = actor->vwork[6].z - actor->vwork[2].z; - Matrix_RotateZ(gCalcMatrix, -actor->vwork[3].z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->vwork[3].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->vwork[3].y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -actor->vwork[3].z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -actor->vwork[3].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->vwork[3].y * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp348, &sp354); D_i5_801BE368[14] = Math_RadToDeg(Math_Atan2F(sp354.x, sp354.z)); temp = sqrtf(SQ(sp354.x) + SQ(sp354.z)); D_i5_801BE368[13] = Math_RadToDeg(-Math_Atan2F(sp354.y, temp)); - Matrix_RotateY(gCalcMatrix, actor->vwork[3].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->vwork[3].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->vwork[3].z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->vwork[3].y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->vwork[3].x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->vwork[3].z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i5_801BA744, &sp354); sp348.x = actor->vwork[2].x + sp354.x; sp348.y = actor->vwork[2].y + sp354.y + 25.0f; @@ -4403,16 +4405,16 @@ void Macbeth_801A7E7C(Actor* actor) { sp348.x = actor->vwork[7].x - actor->vwork[4].x; sp348.y = actor->vwork[7].y - actor->vwork[4].y + 25.0f; sp348.z = actor->vwork[7].z - actor->vwork[4].z; - Matrix_RotateZ(gCalcMatrix, -actor->vwork[5].z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->vwork[5].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->vwork[5].y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -actor->vwork[5].z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -actor->vwork[5].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->vwork[5].y * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp348, &sp354); D_i5_801BE368[14] = Math_RadToDeg(Math_Atan2F(sp354.x, sp354.z)); temp = sqrtf(SQ(sp354.x) + SQ(sp354.z)); D_i5_801BE368[13] = Math_RadToDeg(-Math_Atan2F(sp354.y, temp)); - Matrix_RotateY(gCalcMatrix, actor->vwork[5].y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->vwork[5].x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->vwork[5].z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->vwork[5].y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->vwork[5].x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->vwork[5].z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i5_801BA744, &sp354); sp348.x = actor->vwork[4].x + sp354.x; sp348.y = actor->vwork[4].y + sp354.y + 25.0f; @@ -4584,7 +4586,7 @@ void Macbeth_801A7E7C(Actor* actor) { actor->state = 8; } } - if ((D_i5_801BE320[16] != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_7)) { + if ((D_i5_801BE320[16] != 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { if (gBossFrameCount == 0) { Radio_PlayMessage(gMsg_ID_2225, RCID_SLIPPY); } else if (gBossFrameCount > 155) { @@ -4633,7 +4635,7 @@ void Macbeth_801A7E7C(Actor* actor) { D_i5_801BE368[21] = 160.0f; D_i5_801BE368[22] = 16.0f; } - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_7) && (actor->state < 20)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_COMPLETE) && (actor->state < 20)) { D_i5_801BE320[3] = 0; D_i5_801BE320[2] = 1; D_i5_801BE320[31] = 30; @@ -4745,9 +4747,9 @@ bool Macbeth_801ABC14(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* gDPSetEnvColor(gMasterDisp++, 16, 32, 255, 255); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); Matrix_Push(&gCalcMatrix); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, D_i5_801BE368[31], D_i5_801BE368[30], D_i5_801BE368[31], 1); + Matrix_Scale(gGfxMatrix, D_i5_801BE368[31], D_i5_801BE368[30], D_i5_801BE368[31], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); Matrix_Pop(&gGfxMatrix); @@ -4816,7 +4818,7 @@ void Macbeth_801AC1C0(s32 limbIndex, Vec3f* rot, void* data) { } void Macbeth_801AC294(Actor* actor) { - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { if (((gPlayer[0].unk_138 - actor->obj.pos.z) > 7000.0f) || ((gPlayer[0].unk_138 - actor->obj.pos.z) < -1000.0f)) { return; @@ -4829,9 +4831,9 @@ void Macbeth_801AC294(Actor* actor) { } if (D_i5_801BE320[2] == 0) { - Matrix_Translate(gCalcMatrix, actor->fwork[25], 0.0f, 0.0f, 1); - Matrix_RotateY(gCalcMatrix, actor->fwork[26] * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, actor->fwork[29] * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, actor->fwork[25], 0.0f, 0.0f, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, actor->fwork[26] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, actor->fwork[29] * M_DTOR, MTXF_APPLY); Animation_GetFrameData(&D_MA_601EA28, D_i5_801BE320[3], D_i5_801BE430); } Animation_DrawSkeleton(3, D_MA_600D1E4, D_i5_801BE430, Macbeth_801ABC14, Macbeth_801AC1C0, actor, gCalcMatrix); @@ -4937,12 +4939,12 @@ void Macbeth_801AC754(Player* player) { player->pos.x = 0.0f; player->pos.y = -3.0f; player->vel.z = -15.0f; - player->camEye.x = gCsCamEyeX = -518.0f; - player->camEye.y = gCsCamEyeY = 3882.5f; - player->camEye.z = gCsCamEyeZ = 200.0f; - player->camAt.x = gCsCamAtX = -910.0f; - player->camAt.y = gCsCamAtY = 42.0f; - player->camAt.z = gCsCamAtZ = -800.0f; + player->cam.eye.x = gCsCamEyeX = -518.0f; + player->cam.eye.y = gCsCamEyeY = 3882.5f; + player->cam.eye.z = gCsCamEyeZ = 200.0f; + player->cam.at.x = gCsCamAtX = -910.0f; + player->cam.at.y = gCsCamAtY = 42.0f; + player->cam.at.z = gCsCamAtZ = -800.0f; player->unk_240 = 1; player->unk_1D0 = 2; gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 255; @@ -4990,7 +4992,7 @@ void Macbeth_801AC754(Player* player) { case 3: AUDIO_PLAY_BGM(SEQ_ID_MACBETH | SEQ_FLAG); gLevelStatusScreenTimer = 50; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = player->timer_1F8 = player->timer_1FC = player->unk_240 = 0; player->unk_0D4 = 3.0f; player->unk_014 = 0.0f; @@ -5005,12 +5007,12 @@ void Macbeth_801AC754(Player* player) { break; } player->unk_138 = player->pos.z += player->vel.z; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], sp4C, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[1], sp48, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[2], sp44, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], sp4C, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[1], sp48, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[2], sp44, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], sp4C, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[1], sp48, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[2], sp44, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], sp4C, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[1], sp48, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[2], sp44, 0); player->unk_0A0 = 0.0f; player->unk_0F4 += player->vel.z * 5.0f; player->unk_0F0 = SIN_DEG(player->unk_0F4) * 0.7f; @@ -5026,8 +5028,8 @@ void Macbeth_801AC754(Player* player) { void Macbeth_801ACE40(Effect* effect) { Effect_Initialize(effect); effect->obj.status = OBJ_INIT; - effect->obj.pos.x = gPlayer[0].camEye.x + RAND_FLOAT_CENTERED(600.0f); - effect->obj.pos.y = gPlayer[0].camEye.y - 1000.0f; + effect->obj.pos.x = gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(600.0f); + effect->obj.pos.y = gPlayer[0].cam.eye.y - 1000.0f; effect->obj.pos.z = gPlayer[0].unk_138 - 2000.0f; effect->obj.id = OBJ_EFFECT_352; effect->timer_50 = 80; @@ -5094,17 +5096,17 @@ void Macbeth_801AD144(PlayerShot* playerShot) { if (temp_ft3 != 0) { for (j = 0; j < temp_ft3; j++, var_s1 += 6) { if (var_s1[0] == 200000.0f) { - Matrix_RotateZ(gCalcMatrix, -var_s1[3] * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -var_s1[1] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -var_s1[2] * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -var_s1[3] * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -var_s1[1] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -var_s1[2] * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); var_s1 += 4; } else { - Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); } if ((j == temp_s6) && (var_s1[1] > -100.0f) && (var_s1[3] > -100.0f)) { sp8C.x = playerShot->obj.pos.x - actor->obj.pos.x; @@ -5184,7 +5186,7 @@ void Macbeth_801AD6F0(Actor* actor) { switch (actor->state) { case 0: if ((actor->timer_0BC == 0) && - ((actor->vel.y -= 0.5f, (func_enmy_8006351C(actor->index, &actor->obj.pos, &sp4C, 1) != 0)) || + ((actor->vel.y -= 0.5f, (Object_CheckCollision(actor->index, &actor->obj.pos, &sp4C, 1) != 0)) || (actor->obj.pos.y < (gGroundLevel + 10.0f)) || (actor->iwork[0] != 0))) { actor->vel.x = 0.0f; actor->vel.y = 0.0f; @@ -5239,7 +5241,7 @@ void Macbeth_801ADAC8(Actor* actor) { RCP_SetupDL(&gMasterDisp, 0x40); break; case 1: - Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->scale, 2.5f, 1); + Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->scale, 2.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_40(); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -5323,7 +5325,7 @@ void Macbeth_801ADD68(Actor* actor) { } } } - if ((func_enmy_8006351C(actor->index, &actor->obj.pos, &sp3C, 1) != 0) || + if ((Object_CheckCollision(actor->index, &actor->obj.pos, &sp3C, 1) != 0) || (actor->obj.pos.y < (gGroundLevel + 200.0f))) { AUDIO_PLAY_SFX(0x19032064, actor->sfxSource, 4); gControllerRumbleFlags[gMainController] = 1; @@ -5387,11 +5389,11 @@ void Macbeth_801AE2C0(Actor* actor) { RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, actor->iwork[0]); gDPSetEnvColor(gMasterDisp++, 255, 48, 0, actor->iwork[0]); - Matrix_Scale(gGfxMatrix, 1.0f, actor->fwork[2], 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, actor->fwork[2], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MA_6013060); RCP_SetupDL(&gMasterDisp, 0x43); - Matrix_Scale(gGfxMatrix, 1.0f, actor->fwork[2], 1.0f, 1); + Matrix_Scale(gGfxMatrix, 1.0f, actor->fwork[2], 1.0f, MTXF_APPLY); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 53, 53, 53, 255 - actor->iwork[0]); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, actor->iwork[0]); } else { @@ -5463,8 +5465,8 @@ void Macbeth_801AE694(Effect* effect, f32 xPos, f32 yPos, f32 zPos, f32 arg4, f3 sp48 = Math_Atan2F(arg4 - xPos, arg6 - zPos); sp44 = sqrtf(SQ(arg4 - xPos) + SQ(arg6 - zPos)); sp4C = -Math_Atan2F(arg5 - yPos, sp44); - Matrix_RotateY(gCalcMatrix, sp48, 0); - Matrix_RotateX(gCalcMatrix, sp4C, 1); + Matrix_RotateY(gCalcMatrix, sp48, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, sp4C, MTXF_APPLY); sp38.x = 0.0f; sp38.y = 0.0f; sp38.z = 30.0f; @@ -5540,7 +5542,7 @@ void Macbeth_801AEAA0(Effect* effect) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, effect->unk_44); gDPSetEnvColor(gMasterDisp++, 0, 128, 255, effect->unk_44); } - Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, 1); + Matrix_Scale(gGfxMatrix, 0.5f, 0.5f, 0.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); RCP_SetupDL(&gMasterDisp, 0x40); @@ -5606,9 +5608,9 @@ void Macbeth_801AEC04(Actor* actor) { void Macbeth_801AEEFC(Actor* actor) { gSPDisplayList(gMasterDisp++, D_MA_6015510); - Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[2], 1.0f, 1); + Matrix_Scale(gGfxMatrix, actor->fwork[0], actor->fwork[2], 1.0f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -10.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -10.0f, 0.0f, MTXF_APPLY); RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 111, 175, 64, actor->fwork[1]); gDPSetEnvColor(gMasterDisp++, 255, 255, 208, actor->fwork[1]); @@ -5797,7 +5799,7 @@ void Macbeth_801AF8F4(Player* player) { switch (player->unk_1D0) { case 0: gCsFrameCount = 0; - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; player->unk_234 = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 30); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 30); @@ -5810,17 +5812,17 @@ void Macbeth_801AF8F4(Player* player) { if (player->shields <= 0) { player->shields = 1; } - player->camEye.x = gCsCamEyeX = gActors[D_i5_801BE318].obj.pos.x - 250.0f; - player->camEye.y = gCsCamEyeY = gActors[D_i5_801BE318].obj.pos.y + 150.0f; - player->camEye.z = gCsCamEyeZ = gActors[D_i5_801BE318].obj.pos.z + D_ctx_80177D20 + 500.0f; - player->camAt.x = gCsCamAtX = gActors[D_i5_801BE318].obj.pos.x; - player->camAt.y = gCsCamAtY = gActors[D_i5_801BE318].obj.pos.y + 200.0f; - player->camAt.z = gCsCamAtZ = gActors[D_i5_801BE318].obj.pos.z + D_ctx_80177D20; + player->cam.eye.x = gCsCamEyeX = gActors[D_i5_801BE318].obj.pos.x - 250.0f; + player->cam.eye.y = gCsCamEyeY = gActors[D_i5_801BE318].obj.pos.y + 150.0f; + player->cam.eye.z = gCsCamEyeZ = gActors[D_i5_801BE318].obj.pos.z + D_ctx_80177D20 + 500.0f; + player->cam.at.x = gCsCamAtX = gActors[D_i5_801BE318].obj.pos.x; + player->cam.at.y = gCsCamAtY = gActors[D_i5_801BE318].obj.pos.y + 200.0f; + player->cam.at.z = gCsCamAtZ = gActors[D_i5_801BE318].obj.pos.z + D_ctx_80177D20; player->pos.x = 500.0f; player->pos.y = -3.0f; D_i5_801BA1DC = 0.0f; player->unk_4D8 = 0.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; player->unk_110 = 0.0f; player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = player->unk_130 = player->unk_12C = 0.0f; @@ -5849,12 +5851,12 @@ void Macbeth_801AF8F4(Player* player) { gCsCamAtX = -250.0f; gCsCamAtY = 10.0f; gCsCamAtZ = -3210.0f; - player->camEye.x = -250.0f; - player->camEye.y = 50.0f; - player->camEye.z = 1580.0f; - player->camAt.x = -250.0f; - player->camAt.y = 10.0f; - player->camAt.z = -3210.0f; + player->cam.eye.x = -250.0f; + player->cam.eye.y = 50.0f; + player->cam.eye.z = 1580.0f; + player->cam.at.x = -250.0f; + player->cam.at.y = 10.0f; + player->cam.at.z = -3210.0f; D_i5_801BE312 = 1; player->pos.x = 500.0f; player->pos.y = -3.0f; @@ -5925,12 +5927,12 @@ void Macbeth_801AF8F4(Player* player) { D_ctx_801779E4 = 0.0f; D_ctx_801779F4 = 0.0f; player->timer_210 = 0; - player->camEye.x = gCsCamEyeX = 2750.0f; - player->camEye.y = gCsCamEyeY = 50.0f; - player->camEye.z = gCsCamEyeZ = -620.0f; - player->camAt.x = gCsCamAtX = -650.0f; - player->camAt.y = gCsCamAtY = 30.0f; - player->camAt.z = gCsCamAtZ = 1900.0f; + player->cam.eye.x = gCsCamEyeX = 2750.0f; + player->cam.eye.y = gCsCamEyeY = 50.0f; + player->cam.eye.z = gCsCamEyeZ = -620.0f; + player->cam.at.x = gCsCamAtX = -650.0f; + player->cam.at.y = gCsCamAtY = 30.0f; + player->cam.at.z = gCsCamAtZ = 1900.0f; player->unk_114 = 0.0f; D_i5_801BA1DC = -100.0f; Audio_KillSfxById(0x31078085); @@ -5955,12 +5957,12 @@ void Macbeth_801AF8F4(Player* player) { D_ctx_80177A48[6] = 0.5f; D_ctx_80177A48[7] = 1560.0f; D_ctx_80177A48[8] = 2400.0f; - player->camAt.x = gCsCamAtX = gActors[D_i5_801BE314].obj.pos.x; - player->camAt.z = gCsCamAtZ = (gActors[D_i5_801BE314].obj.pos.z + D_ctx_80177D20) - 2000.0f; - player->camEye.y = gCsCamEyeY = 50.0f; - player->camAt.y = gCsCamAtY = 10.0f; - player->camEye.x = gCsCamEyeX = D_ctx_80177A48[7] + gCsCamAtX; - player->camEye.z = gCsCamEyeZ = D_ctx_80177A48[8] + gCsCamAtZ; + player->cam.at.x = gCsCamAtX = gActors[D_i5_801BE314].obj.pos.x; + player->cam.at.z = gCsCamAtZ = (gActors[D_i5_801BE314].obj.pos.z + D_ctx_80177D20) - 2000.0f; + player->cam.eye.y = gCsCamEyeY = 50.0f; + player->cam.at.y = gCsCamAtY = 10.0f; + player->cam.eye.x = gCsCamEyeX = D_ctx_80177A48[7] + gCsCamAtX; + player->cam.eye.z = gCsCamEyeZ = D_ctx_80177A48[8] + gCsCamAtZ; player->unk_118 = -30.0f; player->unk_0B8 = 10014.0f; player->timer_210 = 1000; @@ -6182,7 +6184,7 @@ void Macbeth_801AF8F4(Player* player) { gFillScreenAlphaTarget = 255; gFillScreenAlphaStep = 20; AUDIO_PLAY_SFX(0x2940F026, gActors[D_i5_801BE314].sfxSource, 4); - gBossActive = D_ctx_80178488 = 0; + gBossActive = gLoadLevelObjects = 0; } if (gCsFrameCount == 940) { player->unk_1D0++; @@ -6195,14 +6197,14 @@ void Macbeth_801AF8F4(Player* player) { gFillScreenAlphaStep = 8; D_ctx_80177A48[0] = 0.0f; player->unk_234 = 1; - player->camAt.x = gCsCamAtX = player->camEye.x = gCsCamEyeX = player->pos.x; - player->camAt.y = gCsCamAtY = player->pos.y + 70.0f; - player->camEye.y = gCsCamEyeY = player->pos.y + 30.0f; - player->camEye.z = gCsCamEyeZ = (player->unk_138 + D_ctx_80177D20) - 300.0f; - player->camAt.z = gCsCamAtZ = player->unk_138 + D_ctx_80177D20; + player->cam.at.x = gCsCamAtX = player->cam.eye.x = gCsCamEyeX = player->pos.x; + player->cam.at.y = gCsCamAtY = player->pos.y + 70.0f; + player->cam.eye.y = gCsCamEyeY = player->pos.y + 30.0f; + player->cam.eye.z = gCsCamEyeZ = (player->unk_138 + D_ctx_80177D20) - 300.0f; + player->cam.at.z = gCsCamAtZ = player->unk_138 + D_ctx_80177D20; player->savedCockpitView = player->timer_210 = 0; player->unk_190 = player->unk_194 = player->unk_188 = player->unk_18C = player->unk_118 = - player->unk_114 = player->unk_4D8 = player->unk_034 = player->unk_174 = player->unk_178 = + player->unk_114 = player->unk_4D8 = player->camRoll = player->unk_174 = player->unk_178 = player->unk_17C = player->unk_180 = player->unk_184 = player->wings.unk_04 = player->unk_170 = player->unk_16C = player->unk_0F0 = player->unk_080 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = player->unk_130 = player->unk_12C = @@ -6229,7 +6231,7 @@ void Macbeth_801AF8F4(Player* player) { if ((gCsFrameCount >= 1059) && (gCsFrameCount < 2120)) { Math_SmoothStepToF(&D_ctx_80177A48[0], 1.0f, 1.0f, 0.005f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[3], 1080.0f, 0.1f, D_ctx_80177A48[0] * 1.2f, 0.0f); - Matrix_RotateY(gCalcMatrix, -D_ctx_80177A48[3] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, -D_ctx_80177A48[3] * M_DTOR, MTXF_NEW); spE4.x = 0.0f; spE4.y = 0.0f; spE4.z = -300.0f; @@ -6270,7 +6272,7 @@ void Macbeth_801AF8F4(Player* player) { Math_SmoothStepToF(&gCsCamAtZ, gActors[3].obj.pos.z + D_ctx_80177D20 - 300.0f, 0.1f, 20.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, gActors[3].obj.pos.y + 100.0f, 0.1f, 10.0f, 0.0f); } else { - player->camAt.z = gCsCamAtZ = player->unk_138 + D_ctx_80177D20; + player->cam.at.z = gCsCamAtZ = player->unk_138 + D_ctx_80177D20; } Math_SmoothStepToF(&player->pos.y, 260.0f, 0.1f, D_ctx_80177A48[7], 0.0f); break; @@ -6422,21 +6424,21 @@ void Macbeth_801AF8F4(Player* player) { } else { Math_SmoothStepToF(&player->unk_114, 0.0f, 0.03f, 0.5f, 0.0001f); } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); - player->camAt.y += zeroVar; + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); + player->cam.at.y += zeroVar; if (player->unk_1D0 >= 6) { - player->camEye.y += gCameraShakeY * 10.0f; + player->cam.eye.y += gCameraShakeY * 10.0f; } if (gCsFrameCount > 2500) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaTarget = 255; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; D_ctx_8017837C = 4; func_play_800A6148(); Audio_FadeOutAll(10); @@ -6461,7 +6463,7 @@ void Macbeth_801B28BC(Actor* actor) { switch (actor->state) { case 10: actor->fwork[3] += D_i5_801BA864; - Matrix_RotateY(gCalcMatrix, actor->fwork[3] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->fwork[3] * M_DTOR, MTXF_NEW); sp5C.x = 0.0f; sp5C.y = D_i5_801BA884; sp5C.z = D_i5_801BA894[4]; @@ -6507,9 +6509,9 @@ void Macbeth_801B28BC(Actor* actor) { Math_SmoothStepToF(&actor->fwork[9], 22.0f, 0.05f, 0.2f, 0.0f); if (actor->obj.rot.x <= -115.0f) { Math_SmoothStepToF(&actor->obj.rot.z, 800.0f, 0.1f, 18.0f, 0.0f); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 70.0f; sp5C.z = -70.0f; @@ -6544,9 +6546,9 @@ void Macbeth_801B28BC(Actor* actor) { actor->fwork[29] = 3.0f; Math_SmoothStepToF(&actor->obj.rot.z, 405.0f, 0.1f, 10.0f, 0.0f); if (actor->timer_0BC == 0) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 70.0f; sp5C.z = -70.0f; @@ -6570,7 +6572,7 @@ void Macbeth_801B28BC(Actor* actor) { break; case 30: actor->fwork[3] += D_i5_801BA854[actor->index]; - Matrix_RotateY(gCalcMatrix, actor->fwork[3] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->fwork[3] * M_DTOR, MTXF_NEW); sp5C.x = 0.0f; sp5C.y = D_i5_801BA874[actor->index]; sp5C.z = D_i5_801BA894[actor->index]; @@ -6601,8 +6603,8 @@ void Macbeth_801B28BC(Actor* actor) { Math_SmoothStepToF(&actor->obj.rot.z, 0.0f, 0.1f, 0.5f, 0.0f); break; } - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); sp5C.x = 0.0f; sp5C.y = 0.0f; sp5C.z = actor->fwork[9]; @@ -6686,7 +6688,7 @@ void Macbeth_801B38E0(void) { s16 j; for (i = 0; i < 65; i++) { - gRadarMarks[i].unk_00 = 0; + gRadarMarks[i].status = 0; } for (i = 0; i < 100; i++) { @@ -6755,7 +6757,7 @@ void Macbeth_801B3D04(Player* player) { gCsCamEyeZ = player->pos.z + player->unk_144 + 50.0f; switch (player->unk_1D0) { case 0: - gCsFrameCount = gBossActive = D_ctx_80178488 = 1; + gCsFrameCount = gBossActive = gLoadLevelObjects = 1; D_i5_801BA894[4] = 80.0f; D_i5_801BA894[3] = D_i5_801BA894[4]; D_i5_801BA894[2] = D_i5_801BA894[4]; @@ -6795,12 +6797,12 @@ void Macbeth_801B3D04(Player* player) { gFillScreenAlpha = gFillScreenAlphaTarget = D_ctx_80177A10[9]; if (gCsFrameCount > 40) { D_ctx_80177A10[9] = 255; - player->camEye.x = gCsCamEyeX = 0.0f; - player->camEye.y = gCsCamEyeY = 21.182106f; - player->camEye.z = gCsCamEyeZ = -112.08748f; - player->camAt.x = gCsCamAtX = 0.0f; - player->camAt.y = gCsCamAtY = 22.873417f; - player->camAt.z = gCsCamAtZ = -283.55914f; + player->cam.eye.x = gCsCamEyeX = 0.0f; + player->cam.eye.y = gCsCamEyeY = 21.182106f; + player->cam.eye.z = gCsCamEyeZ = -112.08748f; + player->cam.at.x = gCsCamAtX = 0.0f; + player->cam.at.y = gCsCamAtY = 22.873417f; + player->cam.at.z = gCsCamAtZ = -283.55914f; player->unk_1D0++; player->pos.x = 0.0f; player->pos.y = -3.0f; @@ -6983,16 +6985,16 @@ void Macbeth_801B3D04(Player* player) { break; case 1200: Macbeth_801B3554(&gActors[3], 3); - D_ctx_80178488 = 0; + gLoadLevelObjects = 0; break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], D_i5_801BE240, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], D_i5_801BE244, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], D_i5_801BE248, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], D_i5_801BE240, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], D_i5_801BE244, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], D_i5_801BE248, 0.0f); - player->camAt.y += zeroVar; + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], D_i5_801BE240, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], D_i5_801BE244, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], D_i5_801BE248, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], D_i5_801BE240, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], D_i5_801BE244, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], D_i5_801BE248, 0.0f); + player->cam.at.y += zeroVar; if ((gCsFrameCount >= 850) && ((gGameFrameCount % 16) == 0)) { Macbeth_801ACF6C(); @@ -7005,7 +7007,7 @@ void Macbeth_801B3D04(Player* player) { gFillScreenRed = gFillScreenGreen = gFillScreenBlue = 0; gFillScreenAlphaTarget = 255; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; D_ctx_8017837C = 4; func_play_800A6148(); Audio_FadeOutAll(10); diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c index 61b9ef58..9f1786e4 100644 --- a/src/overlays/ovl_i5/fox_ti.c +++ b/src/overlays/ovl_i5/fox_ti.c @@ -93,8 +93,8 @@ void Titania_80188F60(Effect* effect) { } void Titania_80188FA8(Effect* effect) { - Matrix_Scale(gGfxMatrix, effect->scale2 * 0.5f, effect->scale2, effect->scale2, 1); - Matrix_RotateX(gGfxMatrix, -(M_DTOR * 90), 1); + Matrix_Scale(gGfxMatrix, effect->scale2 * 0.5f, effect->scale2, effect->scale2, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -(M_DTOR * 90), MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, effect->unk_44); @@ -185,15 +185,15 @@ void Titania_80189380(Actor* actor) { sp44.y = gPlayer[0].pos.y - actor->obj.pos.y; sp44.z = gPlayer[0].pos.z - actor->obj.pos.z; - Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp44, &sp8C); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp50, &sp8C); @@ -281,12 +281,12 @@ void Titania_801895B8(Actor* actor) { actor->obj.rot.z -= 2.0f; } - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_Push(&gCalcMatrix); if (((actor->iwork[2] % 2) == 0) && ((actor->obj.pos.z + D_ctx_80177D20) > -3800.0f)) { - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B752C, &sp48); Titania_80189120(actor->obj.pos.x + sp48.x, actor->obj.pos.y + sp48.y, actor->obj.pos.z + sp48.z, actor->obj.pos.y, 1.3f); @@ -338,9 +338,9 @@ void Titania_80189B80(Actor* actor) { Ground_801B6E20(actor->obj.pos.x, actor->obj.pos.z + D_ctx_80177D20, &sp2C, &actor->obj.pos.y, &sp2C); actor->health = 10; actor->info.hitbox = SEGMENTED_TO_VIRTUAL(D_TI_60068F0); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i5_801B7544, (Vec3f*) &actor->fwork[0]); actor->fwork[0] += actor->obj.pos.x; actor->fwork[1] += actor->obj.pos.y; @@ -377,9 +377,9 @@ void Titania_80189CC8(Actor* actor) { sp4C.x = gPlayer[0].pos.x - actor->obj.pos.x; sp4C.y = (gPlayer[0].pos.y + 30.0f) - actor->obj.pos.y; sp4C.z = gPlayer[0].pos.z - actor->obj.pos.z; - Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -actor->obj.rot.z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -actor->obj.rot.y * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp64); sp58.x = sp64.x - D_i5_801B7550.x; sp58.y = sp64.y - D_i5_801B7550.y; @@ -405,9 +405,9 @@ void Titania_80189CC8(Actor* actor) { } } - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &D_i5_801B7550, &sp64); @@ -431,9 +431,9 @@ void Titania_80189CC8(Actor* actor) { void Titania_8018A1C0(Actor* actor) { gSPDisplayList(gMasterDisp++, D_TI1_700C4B0); - Matrix_Translate(gGfxMatrix, 0.0f, -50.0f, 178.0f, 1); - Matrix_RotateY(gGfxMatrix, actor->fwork[4] * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, actor->fwork[3] * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -50.0f, 178.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, actor->fwork[4] * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, actor->fwork[3] * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (actor->health != 0) { gSPDisplayList(gMasterDisp++, D_TI1_700B9C0); @@ -598,7 +598,7 @@ void Titania_8018A544(Actor* actor) { void Titania_8018AABC(Actor* actor) { if (actor->scale != 1.0f) { - Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, 1); + Matrix_Scale(gGfxMatrix, actor->scale, actor->scale, actor->scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } gSPDisplayList(gMasterDisp++, D_TI1_700E3F0); @@ -680,7 +680,7 @@ void Titania_8018ADC4(Actor* actor) { actor->obj.pos.y = sp58; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B75AC, &sp68[0]); Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B75B8, &sp68[1]); @@ -723,11 +723,11 @@ bool Titania_8018AFD4(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* bool Titania_8018AFF0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* data) { if ((limbIndex == 2) || (limbIndex == 3) || (limbIndex == 4)) { - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x21); gSPDisplayList(gMasterDisp++, *dList); @@ -799,7 +799,7 @@ void Titania_8018B268(Actor* actor) { break; case 1: - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); if ((actor->unk_0B6 >= 26) && (actor->unk_0B6 <= 53) && (sp3C != NULL)) { if (actor->unk_0B6 == 26) { sp3C->unk_046 = 2; @@ -886,7 +886,7 @@ void Titania_8018B720(Actor* actor) { s32 i; Vec3f sp70; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); var_s1 = SEGMENTED_TO_VIRTUAL(D_i5_801BDA30); @@ -1054,7 +1054,7 @@ void Titania_8018BE84(Actor* actor) { RCP_SetupDL(&gMasterDisp, 0x1E); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); - Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, 1); + Matrix_Scale(gGfxMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TI1_7009D60); RCP_SetupDL(&gMasterDisp, 0x22); @@ -1116,12 +1116,12 @@ bool Titania_8018C134(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* for (i = 0; i < 9; i++) { if (limbIndex == D_i5_801B7630[i * 2]) { if (!(D_i5_801BD738[sp50][i].unk_18 & 1)) { - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); sp58 = true; - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if ((limbIndex == 13) && (actor->iwork[5] & 2) && (actor->iwork[6] == 0)) { RCP_SetupDL(&gMasterDisp, 0x1E); @@ -1383,9 +1383,9 @@ void Titania_8018C8A8(Actor* actor) { actor->state = 2; } actor->fwork[15] = 0.0f; - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &actor->fwork[12], &sp8C); actor->fwork[12] = sp8C.x; actor->fwork[13] = sp8C.y; @@ -1467,7 +1467,7 @@ void Titania_8018C8A8(Actor* actor) { actor->unk_0B6 = 0; } if ((actor->fwork[4] > 0.0f) || (actor->fwork[7] > 0.0f)) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i5_801B766C, &sp158); actor->obj.pos.x += sp158.x; actor->obj.pos.z += sp158.z; @@ -1539,9 +1539,9 @@ void Titania_8018C8A8(Actor* actor) { &gIdentityMatrix); actor->vwork[0].y = temp_fs0; if (actor->unk_0B6 == 21) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &actor->fwork[12], &sp158); func_effect_8007A900(actor->obj.pos.x + sp158.x, actor->obj.pos.y + sp158.y, actor->obj.pos.z + sp158.z, @@ -1559,9 +1559,9 @@ void Titania_8018C8A8(Actor* actor) { } if ((actor->timer_0BC % 8) == 0) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &actor->fwork[12], &sp158); func_effect_8007D2C8(actor->obj.pos.x + sp158.x, actor->obj.pos.y + sp158.y, actor->obj.pos.z + sp158.z, 1.5f); @@ -1597,9 +1597,9 @@ void Titania_8018C8A8(Actor* actor) { AUDIO_PLAY_SFX(0x2940C00A, actor->sfxSource, 4); gCameraShake = 20; gControllerRumbleTimers[0] = 16; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor->obj.rot.z * M_DTOR, MTXF_APPLY); func_effect_8007D2C8(actor->obj.pos.x, actor->fwork[27] + actor->obj.pos.y, actor->obj.pos.z, 15.0f); var_s1 = D_i5_801BD738[actor->iwork[0]]; @@ -1731,7 +1731,7 @@ void Titania_8018E3CC(Actor* actor) { actor->iwork[0] = (uintptr_t) actorPtr; actorPtr->fwork[6] = D_i5_801B7518[0]; actorPtr->obj.rot.x = (D_i5_801B7518[0] + D_i5_801B7518[1]) * 0.5f; - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i5_801B7678, &sp34); actorPtr->obj.pos.x = actor->fwork[0] = actor->obj.pos.x + sp34.x; actorPtr->obj.pos.y = actor->fwork[1] = actor->obj.pos.y + sp34.y; @@ -1862,8 +1862,8 @@ void Titania_8018E5F8(Actor* actor) { break; } if ((actor->state == 0) || (actor->state == 1)) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, MTXF_APPLY); sp90.x = 0.0f; sp90.y = 39.0f; sp90.z = 115.0f; @@ -1999,8 +1999,8 @@ void Titania_8018EFF0(Sprite* sprite) { } void Titania_Cactus_Update(Sprite* sprite) { - sprite->obj.rot.y = Math_Atan2F(gPlayer[0].camEye.x - sprite->obj.pos.x, - gPlayer[0].camEye.z - (sprite->obj.pos.z + D_ctx_80177D20)) * + sprite->obj.rot.y = Math_Atan2F(gPlayer[0].cam.eye.x - sprite->obj.pos.x, + gPlayer[0].cam.eye.z - (sprite->obj.pos.z + D_ctx_80177D20)) * M_RTOD; if (sprite->unk_46 != 0) { func_effect_8007D074(sprite->obj.pos.x, sprite->obj.pos.y + 96.0f, sprite->obj.pos.z, 4.0f); @@ -2040,8 +2040,8 @@ void Titania_8018F134(Object_80* obj80) { switch (obj80->unk_44) { case 0: - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, MTXF_APPLY); if ((obj80->obj.rot.y <= 30.0f) || (obj80->obj.rot.y >= 330.0f)) { for (*j = -80.0f; *j <= 80.0f; *j += 40.0f) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &D_i5_801B7690, &sp70); @@ -2056,8 +2056,8 @@ void Titania_8018F134(Object_80* obj80) { } for (i = 0.0f; i <= 450.0f; i += 50.0f) { - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, MTXF_APPLY); sp7C.y = i; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp7C, &sp70); func_effect_8007A900(obj80->obj.pos.x + sp70.x, obj80->obj.pos.y + sp70.y, @@ -2066,7 +2066,7 @@ void Titania_8018F134(Object_80* obj80) { } break; case 1: - Matrix_RotateZ(gCalcMatrix, obj80->obj.rot.z * M_DTOR, 0); + Matrix_RotateZ(gCalcMatrix, obj80->obj.rot.z * M_DTOR, MTXF_NEW); sp7C.z = 0.0f; sp7C.x = 0.0f; for (i = 0.0f; i <= 450.0f; i += 50.0f) { @@ -2164,10 +2164,10 @@ void Titania_8018F8B8(Object_80* obj80) { case 2: if (obj80->obj.rot.z != 0.0f) { if (obj80->obj.rot.z > 0.0f) { - Matrix_Translate(gGfxMatrix, 75.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 75.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } else { - Matrix_Translate(gGfxMatrix, -75.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, -75.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } } @@ -2246,8 +2246,8 @@ bool Titania_8018FC70(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* } switch (limbIndex) { case 0: - Matrix_Translate(gCalcMatrix, D_i5_801BBEF4[36], D_i5_801BBEF4[37], D_i5_801BBEF4[38], 1); - Matrix_RotateY(gCalcMatrix, D_i5_801BBEF4[64] * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, D_i5_801BBEF4[36], D_i5_801BBEF4[37], D_i5_801BBEF4[38], MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, D_i5_801BBEF4[64] * M_DTOR, MTXF_APPLY); break; case 1: case 2: @@ -2255,11 +2255,11 @@ bool Titania_8018FC70(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* rot->z += D_i5_801BBEF4[66]; break; } - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); switch (limbIndex) { case 1: @@ -2501,17 +2501,17 @@ void Titania_8019002C(s32 limbIndex, Vec3f* rot, void* data) { } if (limbIndex == 7) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 180.0f, 36.0f, 0.0f, 1); - Matrix_RotateX(gGfxMatrix, -(M_DTOR * 90.0f), 1); - Matrix_RotateZ(gGfxMatrix, -(M_DTOR * 90.0f), 1); + Matrix_Translate(gGfxMatrix, 180.0f, 36.0f, 0.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -(M_DTOR * 90.0f), MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -(M_DTOR * 90.0f), MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -47.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -47.0f, MTXF_APPLY); Matrix_GetYRPAngles(gGfxMatrix, &sp64); - Matrix_RotateZ(gGfxMatrix, -sp64.z * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -sp64.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -sp64.y * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, D_i5_801BBEF4[74], D_i5_801BBEF4[74], 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, -sp64.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -sp64.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -sp64.y * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i5_801BBEF4[74], D_i5_801BBEF4[74], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x48); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); @@ -2529,11 +2529,11 @@ bool Titania_801903A0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* if (limbIndex == 0) { if (D_i5_801BBEF0[25] == 1) { - Matrix_Translate(gCalcMatrix, D_i5_801BBEF4[39], D_i5_801BBEF4[40], D_i5_801BBEF4[41], 1); - Matrix_RotateY(gCalcMatrix, D_i5_801BBEF4[54] * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, D_i5_801BBEF4[39], D_i5_801BBEF4[40], D_i5_801BBEF4[41], MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, D_i5_801BBEF4[54] * M_DTOR, MTXF_APPLY); } else { - Matrix_Translate(gCalcMatrix, D_i5_801BBEF4[42], D_i5_801BBEF4[43], D_i5_801BBEF4[44], 1); - Matrix_RotateY(gCalcMatrix, D_i5_801BBEF4[56] * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, D_i5_801BBEF4[42], D_i5_801BBEF4[43], D_i5_801BBEF4[44], MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, D_i5_801BBEF4[56] * M_DTOR, MTXF_APPLY); } } if (D_i5_801BBEF0[25] == 1) { @@ -2549,11 +2549,11 @@ bool Titania_801903A0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* rot->z += SIN_DEG((D_i5_801BBEF0[34] / (f32) D_i5_801BBEF0[36]) * 360.0f) * sp24; } } - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); switch (limbIndex) { case 1: @@ -2733,8 +2733,8 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* break; case 2: if (sp88 == 0) { - Matrix_RotateZ(gCalcMatrix, sp9C * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, sp9C * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, sp9C * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, sp9C * M_DTOR, MTXF_APPLY); } break; case 3: @@ -2745,11 +2745,11 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* break; } } - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); if (sp88 != 0) { - Matrix_RotateZ(gCalcMatrix, D_i5_801BBF00[i].unk_20 * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, D_i5_801BBF00[i].unk_1C * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, D_i5_801BBF00[i].unk_18 * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, D_i5_801BBF00[i].unk_20 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, D_i5_801BBF00[i].unk_1C * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, D_i5_801BBF00[i].unk_18 * M_DTOR, MTXF_APPLY); } else { rot->z += D_i5_801BBF00[i].unk_20; rot->y += D_i5_801BBF00[i].unk_1C; @@ -2757,9 +2757,9 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* } if (sp88 != 0) { Matrix_Push(&gCalcMatrix); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); Matrix_GetYRPAngles(gCalcMatrix, &sp8C); Matrix_MultVec3f(gCalcMatrix, &D_tank_800C9F2C, &sp7C); @@ -2781,9 +2781,9 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* } Matrix_Pop(&gCalcMatrix); - Matrix_RotateZ(gCalcMatrix, -(spCC.z * M_DTOR), 1); - Matrix_RotateX(gCalcMatrix, -(spCC.x * M_DTOR), 1); - Matrix_RotateY(gCalcMatrix, -(spCC.y * M_DTOR), 1); + Matrix_RotateZ(gCalcMatrix, -(spCC.z * M_DTOR), MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -(spCC.x * M_DTOR), MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -(spCC.y * M_DTOR), MTXF_APPLY); switch (limbIndex) { case 55: if (D_i5_801BBEF0[15] == 1) { @@ -2843,13 +2843,13 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* Math_SmoothStepToAngle(&sp8C.z, D_i5_801BBEF4[16], boss->fwork[38], 360.0f, 0.01f); break; } - Matrix_RotateY(gCalcMatrix, (sp8C.y + sp9C) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (sp8C.z + sp9C) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, sp8C.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (sp8C.y + sp9C) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (sp8C.z + sp9C) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, sp8C.x * M_DTOR, MTXF_APPLY); } else { - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); } sp6C = 0; if ((limbIndex == 51) || (limbIndex == 66)) { @@ -2857,7 +2857,7 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* sp68 = 1.1f - (fabsf(__sinf(((f32) D_i5_801BBEF0[0] / D_i5_801BBEF0[1]) * 360.0f * M_DTOR))) * D_i5_801BBEF4[0]; Matrix_Push(&gCalcMatrix); - Matrix_Scale(gCalcMatrix, sp68, sp68, sp68, 1); + Matrix_Scale(gCalcMatrix, sp68, sp68, sp68, MTXF_APPLY); sp6C = 1; } } @@ -2865,17 +2865,17 @@ bool Titania_80190A08(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* switch (spA8) { case 1: Matrix_Push(&gCalcMatrix); - Matrix_Translate(gCalcMatrix, spC0.x, spC0.y, spC0.z, 1); + Matrix_Translate(gCalcMatrix, spC0.x, spC0.y, spC0.z, MTXF_APPLY); break; case 4: Matrix_Push(&gCalcMatrix); - Matrix_Translate(gCalcMatrix, 40.0f, 0.0f, 0.0f, 1); - Matrix_RotateZ(gCalcMatrix, padB4.z * M_DTOR, 1); - Matrix_Translate(gCalcMatrix, -40.0f, 0.0f, 0.0f, 1); + Matrix_Translate(gCalcMatrix, 40.0f, 0.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, padB4.z * M_DTOR, MTXF_APPLY); + Matrix_Translate(gCalcMatrix, -40.0f, 0.0f, 0.0f, MTXF_APPLY); break; } } - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); sp58 = 0; switch (D_i5_801B7770[i][1]) { @@ -3015,17 +3015,17 @@ void Titania_80191AE8(s32 limbIndex, Vec3f* rot, void* data) { case 55: if (D_i5_801BBEF0[8] == 0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 180.0f, 36.0f, 0.0f, 1); - Matrix_RotateX(gGfxMatrix, -(M_DTOR * 90.0f), 1); - Matrix_RotateZ(gGfxMatrix, -(M_DTOR * 90.0f), 1); + Matrix_Translate(gGfxMatrix, 180.0f, 36.0f, 0.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -(M_DTOR * 90.0f), MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -(M_DTOR * 90.0f), MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ENMY_PLANET_40018A0); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -47.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -47.0f, MTXF_APPLY); Matrix_GetYRPAngles(gGfxMatrix, &sp78); - Matrix_RotateZ(gGfxMatrix, -sp78.z * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -sp78.x * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -sp78.y * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, D_i5_801BBEF4[74], D_i5_801BBEF4[74], 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, -sp78.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -sp78.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -sp78.y * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i5_801BBEF4[74], D_i5_801BBEF4[74], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x48); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); @@ -3661,7 +3661,7 @@ void Titania_80193DF0(Boss* boss) { Vec3f sp90; Vec3f sp84; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); for (i = 0; i < ARRAY_COUNTU(D_i5_801BBF00); i++) { if (D_i5_801BBF00[i].unk_26 & 0x10) { @@ -3699,7 +3699,7 @@ void Titania_80193DF0(Boss* boss) { actor->obj.rot.y = boss->obj.rot.y + D_i5_801BBF00[i].unk_00.rot.y; actor->obj.rot.z = boss->obj.rot.z + D_i5_801BBF00[i].unk_00.rot.z; Matrix_Push(&gCalcMatrix); - Matrix_RotateY(gCalcMatrix, 0.0f, 0); + Matrix_RotateY(gCalcMatrix, 0.0f, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D18, &spC8); Matrix_Pop(&gCalcMatrix); actor->vel.x = spC8.x; @@ -3716,7 +3716,7 @@ void Titania_80193DF0(Boss* boss) { actor->obj.rot.y = boss->obj.rot.y + D_i5_801BBF00[i].unk_00.rot.y; actor->obj.rot.z = boss->obj.rot.z + D_i5_801BBF00[i].unk_00.rot.z; Matrix_Push(&gCalcMatrix); - Matrix_RotateY(gCalcMatrix, RAND_FLOAT(360.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, RAND_FLOAT(360.0f) * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8D0C, &spC8); Matrix_Pop(&gCalcMatrix); actor->vel.x = spC8.x; @@ -4059,7 +4059,7 @@ void Titania_80193DF0(Boss* boss) { boss->swork[28]++; break; case 10: - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); spA4 = 0; for (i = 0; i < 33; i++) { actor = D_i5_801B8198[i].actor; @@ -4662,7 +4662,7 @@ void Titania_80193DF0(Boss* boss) { if ((boss->fwork[15] <= 0.0f) && (boss->fwork[9] > 0.0f)) { effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &boss->fwork[8], &spC8); effect->obj.status = OBJ_ACTIVE; effect->unk_78 = effect->unk_7A = 0; @@ -4679,7 +4679,7 @@ void Titania_80193DF0(Boss* boss) { if ((boss->fwork[12] <= 0.0f) && (boss->fwork[6] > 0.0f)) { effect = func_effect_8007783C(OBJ_EFFECT_394); if (effect != NULL) { - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, (Vec3f*) &boss->fwork[5], &spC8); effect->obj.status = OBJ_ACTIVE; effect->unk_78 = effect->unk_7A = 0; @@ -5004,8 +5004,8 @@ void Titania_801982A8(Boss* boss) { RCP_SetupDL(&gMasterDisp, 0x45); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_RotateX(gGfxMatrix, -1.5707964f, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[47] * 10.0f, boss->fwork[47] * 10.0f, 1.0f, 1); + Matrix_RotateX(gGfxMatrix, -1.5707964f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[47] * 10.0f, boss->fwork[47] * 10.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -5021,8 +5021,8 @@ void Titania_801982A8(Boss* boss) { RCP_SetupDL(&gMasterDisp, 0x45); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255); gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); - Matrix_RotateX(gGfxMatrix, -1.5707964f, 1); - Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 1.0f, 1); + Matrix_RotateX(gGfxMatrix, -1.5707964f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); @@ -5031,7 +5031,7 @@ void Titania_801982A8(Boss* boss) { if (boss->state == 11) { if (boss->swork[24] != 0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[17], boss->fwork[18], boss->fwork[19] + 50.0f, 1); + Matrix_Translate(gGfxMatrix, boss->fwork[17], boss->fwork[18], boss->fwork[19] + 50.0f, MTXF_APPLY); RCP_SetupDL_14(); for (i = 0; i < 3; i++) { sp120 = (boss->fwork[43] + i) / 3.0f; @@ -5042,8 +5042,8 @@ void Titania_801982A8(Boss* boss) { (s32) ((temp_fv0 * 155.0f) + 100.0f)); for (j = 0; j < 360; j += 45) { Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, (j + boss->fwork[43] * 360.0f) * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, temp_fs2, 0.0f, 0.0f, 1); + Matrix_RotateZ(gGfxMatrix, (j + boss->fwork[43] * 360.0f) * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, temp_fs2, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_Gfx_800D94D0); Matrix_Pop(&gGfxMatrix); @@ -5051,22 +5051,22 @@ void Titania_801982A8(Boss* boss) { } Matrix_Pop(&gGfxMatrix); } - Matrix_Translate(gGfxMatrix, boss->fwork[17], boss->fwork[18], boss->fwork[19], 1); + Matrix_Translate(gGfxMatrix, boss->fwork[17], boss->fwork[18], boss->fwork[19], MTXF_APPLY); if (D_i5_801BBEF0[7] != 0) { Matrix_Push(&gGfxMatrix); sp120 = D_i5_801BBEF0[7] * 16.0f; RCP_SetupDL(&gMasterDisp, 0x40); - Matrix_RotateX(gGfxMatrix, 1.5707964f, 1); + Matrix_RotateX(gGfxMatrix, 1.5707964f, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, sp120, 1.0f, sp120, 1); + Matrix_Scale(gGfxMatrix, sp120, 1.0f, sp120, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 120, 255, 220, D_i5_801BBEF0[7] * 50); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); Matrix_Pop(&gGfxMatrix); if (D_i5_801BBEF0[7] > 0) { sp120 = (D_i5_801BBEF0[7] - 1) * 24.0f; - Matrix_Scale(gGfxMatrix, sp120, 1.0f, sp120, 1); + Matrix_Scale(gGfxMatrix, sp120, 1.0f, sp120, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 120, 255, 220, D_i5_801BBEF0[7] * 50); gSPDisplayList(gMasterDisp++, D_BG_PLANET_20112C0); @@ -5077,10 +5077,11 @@ void Titania_801982A8(Boss* boss) { if (D_i5_801BBEF0[16] > 0) { temp = D_i5_801BBEF0[16] - 1; Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gGfxMatrix, (boss->fwork[21] - 90.0f) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, (boss->fwork[22] - 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (boss->fwork[20] + ((boss->unk_04C - 15) * 15.6f)) * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, D_i5_801B8D5C[temp], D_i5_801B8D5C[temp], D_i5_801B8D5C[temp + 25], 1); + Matrix_RotateY(gGfxMatrix, (boss->fwork[21] - 90.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, (boss->fwork[22] - 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (boss->fwork[20] + ((boss->unk_04C - 15) * 15.6f)) * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_i5_801B8D5C[temp], D_i5_801B8D5C[temp], D_i5_801B8D5C[temp + 25], + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 178); @@ -5090,10 +5091,11 @@ void Titania_801982A8(Boss* boss) { } if (D_i5_801BBEF0[17] > 0) { Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gGfxMatrix, (boss->fwork[21] - 90.0f) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, (boss->fwork[22] - 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (boss->fwork[20] + ((boss->unk_04C - 15) * 15.6f)) * M_DTOR * 3.0f, 1); - Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, 1); + Matrix_RotateY(gGfxMatrix, (boss->fwork[21] - 90.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, (boss->fwork[22] - 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (boss->fwork[20] + ((boss->unk_04C - 15) * 15.6f)) * M_DTOR * 3.0f, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x31); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) ((D_i5_801BBEF0[17] * 89.0f) / 3.0f)); @@ -5105,26 +5107,27 @@ void Titania_801982A8(Boss* boss) { if (boss->swork[25] != 0) { sp120 = boss->fwork[41] / 40.0f; temp_fs2 = boss->fwork[42] / 700.0f; - Matrix_RotateY(gGfxMatrix, (boss->fwork[21] - 90.0f) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, (boss->fwork[22] - 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, (boss->fwork[20] - ((s32) (boss->swork[38] % 8U) * 43.0f)) * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, (boss->fwork[21] - 90.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, (boss->fwork[22] - 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, (boss->fwork[20] - ((s32) (boss->swork[38] % 8U) * 43.0f)) * M_DTOR, + MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, half * sp120, half * sp120, temp_fs2, 1); + Matrix_Scale(gGfxMatrix, half * sp120, half * sp120, temp_fs2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x48); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 178); gDPSetEnvColor(gMasterDisp++, 0, 128, 60, 0); gSPDisplayList(gMasterDisp++, D_TI_8000D90); Matrix_Pop(&gGfxMatrix); - Matrix_Scale(gGfxMatrix, sp120, sp120, temp_fs2, 1); + Matrix_Scale(gGfxMatrix, sp120, sp120, temp_fs2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPPipeSync(gMasterDisp++); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 64); gDPSetEnvColor(gMasterDisp++, 0, 128, 110, 0); gSPDisplayList(gMasterDisp++, D_TI_8000D90); - Matrix_RotateY(gCalcMatrix, (boss->fwork[21] - 90.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, (boss->fwork[22] - 180.0f) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, (boss->fwork[20] + boss->fwork[42]) * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (boss->fwork[21] - 90.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, (boss->fwork[22] - 180.0f) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, (boss->fwork[20] + boss->fwork[42]) * M_DTOR, MTXF_APPLY); temp_fs0 = boss->obj.pos.x + boss->fwork[17]; temp_fs1 = boss->obj.pos.y + boss->fwork[18]; temp_fs2 = boss->obj.pos.z + boss->fwork[19]; @@ -5187,7 +5190,7 @@ void Titania_801990DC(Boss* boss) { actor->state = 40; actor->unk_046 = D_i5_801B7770[i][5]; actor->unk_048 = D_i5_801B7770[i][1]; - Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, boss->obj.rot.y * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i5_801BBF00[i].unk_00.pos, &sp60); actor->obj.pos.x = boss->obj.pos.x + sp60.x; actor->obj.pos.y = boss->obj.pos.y + sp60.y; @@ -5204,7 +5207,7 @@ void Titania_801990DC(Boss* boss) { actor->fwork[0] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f); actor->fwork[1] = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * (RAND_FLOAT(5.0f) + 5.0f); Matrix_Push(&gCalcMatrix); - Matrix_RotateY(gCalcMatrix, RAND_FLOAT(360.0f) * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, RAND_FLOAT(360.0f) * M_DTOR, MTXF_NEW); Matrix_MultVec3f(gCalcMatrix, &D_i5_801B8E44, &sp60); Matrix_Pop(&gCalcMatrix); actor->vel.x = sp60.x; @@ -5285,9 +5288,9 @@ void Titania_801990DC(Boss* boss) { } break; } - if ((boss->timer_050 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if ((boss->timer_050 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Object_Kill(&boss->obj, boss->sfxSource); - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; } } diff --git a/src/overlays/ovl_i5/fox_ti_cs.c b/src/overlays/ovl_i5/fox_ti_cs.c index 203a9b20..56b74c9c 100644 --- a/src/overlays/ovl_i5/fox_ti_cs.c +++ b/src/overlays/ovl_i5/fox_ti_cs.c @@ -66,13 +66,13 @@ void Titania_8018769C(Player* player) { player->pos.y = actor->obj.pos.y - 530.0f; player->pos.z = actor->obj.pos.z; - player->camEye.x = gCsCamEyeX = 5000.0f; - player->camEye.y = gCsCamEyeY = 1000.0f; - player->camEye.z = gCsCamEyeZ = -5000.0f; + player->cam.eye.x = gCsCamEyeX = 5000.0f; + player->cam.eye.y = gCsCamEyeY = 1000.0f; + player->cam.eye.z = gCsCamEyeZ = -5000.0f; - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = player->pos.z; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = player->pos.z; player->unk_240 = 1; player->unk_1D0 = 1; @@ -141,9 +141,9 @@ void Titania_8018769C(Player* player) { player->pos.y = 2000.0f; player->vel.z = 0.0f; - player->camAt.x = gCsCamAtX = player->pos.x; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = player->pos.z; + player->cam.at.x = gCsCamAtX = player->pos.x; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = player->pos.z; gPlayer[0].unk_19C = 1; @@ -158,7 +158,7 @@ void Titania_8018769C(Player* player) { *D_ctx_80177A10 = 0; - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, MTXF_NEW); sp54.x = 0.0f; sp54.y = 30.0f; @@ -168,18 +168,18 @@ void Titania_8018769C(Player* player) { gCsCamEyeX = sp48.x; - player->camEye.x = sp48.x; + player->cam.eye.x = sp48.x; gCsCamEyeY = sp48.y; - player->camEye.y = sp48.y; - player->camEye.z = gCsCamEyeZ = player->pos.z + player->unk_144 + sp48.z; + player->cam.eye.y = sp48.y; + player->cam.eye.z = gCsCamEyeZ = player->pos.z + player->unk_144 + sp48.z; } break; case 3: Math_SmoothStepToF(&D_ctx_80177A48[2], 0.0f, 0.1f, 4.0f, 0.0f); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, MTXF_NEW); sp54.x = 0.0f; sp54.y = 30.0f; @@ -192,9 +192,9 @@ void Titania_8018769C(Player* player) { gCsCamEyeZ = player->pos.z + player->unk_144 + sp48.z; gCsCamAtX = player->pos.x; - player->camAt.x = gCsCamAtX; - player->camAt.y = gCsCamAtY = player->pos.y; - player->camAt.z = gCsCamAtZ = player->pos.z + player->unk_144; + player->cam.at.x = gCsCamAtX; + player->cam.at.y = gCsCamAtY = player->pos.y; + player->cam.at.z = gCsCamAtZ = player->pos.z + player->unk_144; Math_SmoothStepToF(&player->pos.y, D_ctx_80177A48[1], 0.1f, 50.0f, 0.0f); @@ -220,7 +220,7 @@ void Titania_8018769C(Player* player) { if (gCsFrameCount == 580) { gLevelStatusScreenTimer = 50; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = player->timer_1F8 = player->timer_1FC = player->unk_240 = 0; player->unk_0D4 = 3.0f; player->unk_014 = 0.0f; @@ -239,12 +239,12 @@ void Titania_8018769C(Player* player) { player->pos.z += player->vel.z; player->unk_138 = player->pos.z; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], sp64, 0.00f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], sp64, 0.00f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], sp64, 0.00f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], sp64, 0.00f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], sp64, 0.00f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], sp64, 0.00f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], sp64, 0.00f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], sp64, 0.00f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], sp64, 0.00f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], sp64, 0.00f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], sp64, 0.00f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], sp64, 0.00f); } void Titania_80188108(Actor* actor, s32 arg1) { @@ -291,7 +291,7 @@ void Titania_801882CC(Player* player) { switch (player->unk_1D0) { case 0: - gCsFrameCount = gBossActive = D_ctx_80178488 = 0; + gCsFrameCount = gBossActive = gLoadLevelObjects = 0; func_play_800A6148(); @@ -328,8 +328,8 @@ void Titania_801882CC(Player* player) { D_ctx_80177A48[2] = D_ctx_80177A48[1] + D_ctx_80177A48[2]; - Matrix_RotateX(gCalcMatrix, -10.0f * M_DTOR, 0); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -10.0f * M_DTOR, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[2] * M_DTOR, MTXF_APPLY); src.x = 0.0f; src.y = 0.0f; @@ -503,14 +503,14 @@ void Titania_801882CC(Player* player) { break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0.00f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0.00f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0.00f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0.00f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0.00f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0.00f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0.00f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0.00f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0.00f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0.00f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0.00f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0.00f); - player->camAt.y += camAtY; + player->cam.at.y += camAtY; if (gCsFrameCount == 1380) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 60); @@ -522,7 +522,7 @@ void Titania_801882CC(Player* player) { gFillScreenAlphaTarget = 255; if (gFillScreenAlpha == 255) { - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; D_ctx_8017837C = 4; func_play_800A6148(); Audio_FadeOutAll(10); diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c index 632260b3..f9e6e368 100644 --- a/src/overlays/ovl_i6/fox_andross.c +++ b/src/overlays/ovl_i6/fox_andross.c @@ -7,6 +7,7 @@ #include "assets/ast_bg_planet.h" #include "prevent_bss_reordering.h" #include "prevent_bss_reordering2.h" + f32 D_i6_801A7F5C; f32 D_i6_801A7F64; f32 D_i6_801A7F6C; @@ -289,8 +290,8 @@ void Andross_801880E4(Actor* actor) { actor->obj.rot.y = actor->unk_0F4.y; actor->obj.rot.x = -actor->unk_0F4.x; - Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -actor->unk_0F4.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor->unk_0F4.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -actor->unk_0F4.x * M_DTOR, MTXF_APPLY); sp48.x = 0; sp48.y = 0; sp48.z = actor->fwork[0]; @@ -330,19 +331,19 @@ void Andross_80188528(Actor* actor) { } else if (actor->timer_0BC == 0) { Object_Kill(&actor->obj, actor->sfxSource); } - actor->obj.rot.y = RAD_TO_DEG(-gPlayer[0].unk_058); - actor->obj.rot.x = RAD_TO_DEG(gPlayer[0].unk_05C); + actor->obj.rot.y = RAD_TO_DEG(-gPlayer[0].camYaw); + actor->obj.rot.x = RAD_TO_DEG(gPlayer[0].camPitch); actor->unk_0F4.z += actor->fwork[0]; } void Andross_80188660(Actor* actor) { RCP_SetupDL(&gMasterDisp, 0x3D); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); - Matrix_RotateZ(gGfxMatrix, actor->unk_0F4.z * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.1f, 0.9f, 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, -actor->unk_0F4.z * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.1f, 0.9f, 1.0f, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 1.0f, 1); + Matrix_RotateZ(gGfxMatrix, actor->unk_0F4.z * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.1f, 0.9f, 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -actor->unk_0F4.z * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.1f, 0.9f, 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_VE2_6009300); } @@ -425,7 +426,7 @@ void Andross_80188A4C(Boss* boss) { gScreenFlashTimer = 8; AUDIO_PLAY_SFX(0x2940D09AU, boss->sfxSource, 4); func_boss_80042EC0(boss); - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; boss->state = 20; boss->swork[1] = 1000; boss->swork[2] = 1000; @@ -503,7 +504,7 @@ void Andross_80188CB8(Boss* boss) { } } boss->fwork[14] += boss->fwork[15]; - Matrix_RotateY(gCalcMatrix, -gPlayer[0].unk_058, 0); + Matrix_RotateY(gCalcMatrix, -gPlayer[0].camYaw, MTXF_NEW); sp50.x = boss->vel.z * 0.25f; sp50.y = 0.0f; sp50.z = boss->vel.x * 0.25f; @@ -574,17 +575,17 @@ void Andross_80189214(void) { gLevelMode = LEVELMODE_ON_RAILS; player->unk_204 = 0; gPlayer[0].pos.x = 0.0f; - player->camEye.z = 400.0f; - player->camAt.z = player->camEye.z - 1000.0f; + player->cam.eye.z = 400.0f; + player->cam.at.z = player->cam.eye.z - 1000.0f; player->unk_148 = player->unk_14C = 0.74f; - player->camEye.y = player->pos.y * player->unk_14C + 10.0f; - player->camEye.x = player->pos.x * player->unk_148; + player->cam.eye.y = player->pos.y * player->unk_14C + 10.0f; + player->cam.eye.x = player->pos.x * player->unk_148; D_ctx_80177DC8 = 0; // FAKE if (1) {} PRINTF("FO_Game_Sw %d\n"); - player->camAt.x = 0.0f; - player->camAt.y = 0.0f; + player->cam.at.x = 0.0f; + player->cam.at.y = 0.0f; player->unk_114 = 0.0f; player->unk_144 = 0.0f; D_ctx_80177D20 = 0.0f; @@ -626,7 +627,7 @@ void Andross_80189470(Actor* actor) { s32 i; Player* player = &gPlayer[0]; - if ((D_ctx_80177AB0 != 7) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && + if ((D_ctx_80177AB0 != 7) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 9000.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 9000.0f)) { D_ctx_80177AB0 = 7; @@ -635,25 +636,25 @@ void Andross_80189470(Actor* actor) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 20); } - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 500.0f) && + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 500.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 500.0f)) { Audio_KillSfxById(0x11403076); Audio_SetBaseSfxReverb(0); gCurrentLevel = LEVEL_VENOM_2; gLevelStage = 1; D_play_800D2F68 = 1; - player->state_1C8 = PLAYERSTATE_1C8_7; + player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; player->unk_1D0 = 3; player->unk_144 = D_ctx_80177D20 = 0.0f; D_ctx_80177AB0 = D_ctx_80177A98 = 1; - player->camEye.x = 1200.0f; - player->camEye.z = 1200.0f; - player->camEye.y = 1800.0f; + player->cam.eye.x = 1200.0f; + player->cam.eye.z = 1200.0f; + player->cam.eye.y = 1800.0f; gCsCamAtX = 0.0f; gCsCamAtY = 620.0f; gCsCamAtZ = 0.0f; player->unk_234 = 0; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; D_ctx_80177A48[0] = 1.0f; func_play_800A6148(); @@ -680,12 +681,12 @@ void Andross_80189724(Actor* actor) { if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 2000.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 2000.0f)) { - Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, MTXF_NEW); vec.x = 0.0f; vec.y = 0.0f; vec.z = -30.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &vec, &vel); - Matrix_RotateZ(gCalcMatrix, 2.0f * RAND_FLOAT(M_PI), 1); + Matrix_RotateZ(gCalcMatrix, 2.0f * RAND_FLOAT(M_PI), MTXF_APPLY); vec.x = RAND_FLOAT(300.0f); vec.y = 0.0f; vec.z = 0.0f; @@ -701,7 +702,7 @@ void Andross_80189724(Actor* actor) { } if ((fabsf(actor->obj.pos.x - gPlayer[0].pos.x) < 500.0f) && (fabsf(actor->obj.pos.z - gPlayer[0].unk_138) < 500.0f)) { - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3 || gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE || gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gPlayer[0].shields = 0; gRightWingHealth[0] = gLeftWingHealth[0] = 0; Player_ApplyDamage(&gPlayer[0], 1, 60); @@ -711,7 +712,7 @@ void Andross_80189724(Actor* actor) { } } if (actor->timer_0BC == 1) { - func_demo_8004D440(&gPlayer[0]); + Cutscene_KillPlayer(&gPlayer[0]); } } @@ -805,14 +806,14 @@ void Andross_80189B70(Boss* boss) { boss->fwork[19] = -26.0f; boss->swork[5] = 100; if (boss->timer_050 == 0) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_9; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; gPlayer[0].unk_1D0 = 0; boss->state = 1; gPlayer[0].unk_240 = 1; } break; case 1: - if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_9) && (boss->timer_050 == 0)) { + if ((gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) && (boss->timer_050 == 0)) { boss->fwork[2] = 1.6f; boss->timer_050 = RAND_INT(1.0f) * 50.0f + 50; boss->fwork[3] = RAND_FLOAT_CENTERED(10000.0f); @@ -841,7 +842,7 @@ void Andross_80189B70(Boss* boss) { gPlayer[0].timer_224 = gGameFrameCount % 8U; gPlayer[0].timer_220 = 3; Math_SmoothStepToF(&D_ctx_801779A8[gMainController], 40.0f, 1.0f, 3.0f, 0.0f); - if (((gGameFrameCount % 32) == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3)) { + if (((gGameFrameCount % 32) == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE)) { Player_ApplyDamage(&gPlayer[0], 3, 10); } } @@ -889,7 +890,7 @@ void Andross_80189B70(Boss* boss) { if ((boss->fwork[22] < 1.0f) && (boss->timer_050 == 0)) { xDisplacement = boss->fwork[3] - boss->obj.pos.x; zDisplacement = boss->fwork[5] - boss->obj.pos.z; - Matrix_RotateY(gCalcMatrix, Math_Atan2F(xDisplacement, zDisplacement), 0); + Matrix_RotateY(gCalcMatrix, Math_Atan2F(xDisplacement, zDisplacement), MTXF_NEW); vec.x = 0.0f; vec.y = 0.0f; vec.z = 4000.0f; @@ -917,7 +918,7 @@ void Andross_80189B70(Boss* boss) { boss->obj.rot.z += 0.2f; boss->obj.rot.x += 0.1f; boss->obj.pos.y -= 3.0f; - Matrix_RotateY(gCalcMatrix, -gPlayer[0].unk_058, 0U); + Matrix_RotateY(gCalcMatrix, -gPlayer[0].camYaw, 0U); vec.x = RAND_FLOAT_CENTERED(700.0f); vec.y = RAND_FLOAT_CENTERED(300.0f); vec.z = 500.0f; @@ -935,13 +936,13 @@ void Andross_80189B70(Boss* boss) { Matrix_MultVec3f(gCalcMatrix, &vec, &sp64); Math_SmoothStepToF(&D_ctx_80177A48[0], 100.0f, 1.0f, 2.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[1], 100.0f, 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.x, boss->obj.pos.x + sp64.x, 0.02f, D_ctx_80177A48[0], 0.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.y, boss->obj.pos.y + sp64.y, 0.02f, D_ctx_80177A48[0], 0.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.z, boss->obj.pos.z + sp64.z, 0.02f, D_ctx_80177A48[0], 0.0f); - Math_SmoothStepToF(&gPlayer[0].camAt.x, boss->obj.pos.x, 0.05f, D_ctx_80177A48[1], 0.0f); - Math_SmoothStepToF(&gPlayer[0].camAt.y, boss->obj.pos.y, 0.05f, D_ctx_80177A48[1], 0.0f); - Math_SmoothStepToF(&gPlayer[0].camAt.z, boss->obj.pos.z, 0.05f, D_ctx_80177A48[1], 0.0f); - Math_SmoothStepToF(&gPlayer[0].unk_034, 0.0f, 0.5f, 0.5f, 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.x, boss->obj.pos.x + sp64.x, 0.02f, D_ctx_80177A48[0], 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.y, boss->obj.pos.y + sp64.y, 0.02f, D_ctx_80177A48[0], 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.z, boss->obj.pos.z + sp64.z, 0.02f, D_ctx_80177A48[0], 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.x, boss->obj.pos.x, 0.05f, D_ctx_80177A48[1], 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.y, boss->obj.pos.y, 0.05f, D_ctx_80177A48[1], 0.0f); + Math_SmoothStepToF(&gPlayer[0].cam.at.z, boss->obj.pos.z, 0.05f, D_ctx_80177A48[1], 0.0f); + Math_SmoothStepToF(&gPlayer[0].camRoll, 0.0f, 0.5f, 0.5f, 0.0f); if (gCsFrameCount == 50) { Radio_PlayMessage(gMsg_ID_19335, RCID_ANDROSS_RED); @@ -1007,8 +1008,8 @@ void Andross_80189B70(Boss* boss) { gPlayer[0].unk_110 = gPlayer[0].unk_4D8 = gPlayer[0].unk_0E8 = gPlayer[0].unk_0E4 = gPlayer[0].unk_0EC = 0.0f; gPlayer[0].unk_12C = 150.0f; - gPlayer[0].unk_034 = -90.0f; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].camRoll = -90.0f; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 100; gPlayer[0].timer_1F8 = 240; gPlayer[0].unk_234 = 1; @@ -1042,7 +1043,7 @@ void Andross_80189B70(Boss* boss) { } boss->obj.pos.y = 10000.0f; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && ((gGameFrameCount % 4) == 0)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && ((gGameFrameCount % 4) == 0)) { Matrix_RotateY(gCalcMatrix, (gPlayer[0].unk_114 + gPlayer[0].unk_0E8) * M_DTOR, 0U); vec.x = RAND_FLOAT_CENTERED(800.0f); vec.y = 600.0f; @@ -1050,13 +1051,13 @@ void Andross_80189B70(Boss* boss) { Matrix_MultVec3fNoTranslate(gCalcMatrix, &vec, &sp64); Andross_80189B00(gPlayer[0].pos.x + sp64.x, sp64.y, gPlayer[0].unk_138 + sp64.z, 1.2f); } - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_0) { - Matrix_RotateY(gCalcMatrix, -gPlayer[0].unk_058, 0); + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_STANDBY) { + Matrix_RotateY(gCalcMatrix, -gPlayer[0].camYaw, MTXF_NEW); vec.x = 0.0f; vec.y = 0.0f; vec.z = -50.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &vec, &sp58); - Matrix_RotateZ(gCalcMatrix, 2.0f * RAND_FLOAT(M_PI), 1); + Matrix_RotateZ(gCalcMatrix, 2.0f * RAND_FLOAT(M_PI), MTXF_APPLY); vec.x = RAND_FLOAT(50.0f) + 120.0f; vec.y = 0.0f; vec.z = 0.0f; @@ -1073,8 +1074,8 @@ void Andross_80189B70(Boss* boss) { sp98 = 1; if (!(gGameFrameCount & frameCountMask)) { for (i = 0; i < sp98; i++) { - func_effect_8007797C(gPlayer[0].camEye.x + sp64.x, gPlayer[0].camEye.y + sp64.y, - gPlayer[0].camEye.z + sp64.z, sp58.x, sp58.y, sp58.z, + func_effect_8007797C(gPlayer[0].cam.eye.x + sp64.x, gPlayer[0].cam.eye.y + sp64.y, + gPlayer[0].cam.eye.z + sp64.z, sp58.x, sp58.y, sp58.z, RAND_FLOAT(2.5f) + 2.5f); } } @@ -1090,9 +1091,9 @@ void Andross_80189B70(Boss* boss) { 0.1f, boss->fwork[2], 0.0f); Math_SmoothStepToAngle(&boss->unk_078.y, yaw, 0.1f, boss->fwork[2], 0.0f); if (boss->swork[4] != 0) { - Math_SmoothStepToAngle(&boss->obj.rot.y, Math_RadToDeg(-gPlayer[0].unk_058), 0.3f, 5.0f, 0.0f); + Math_SmoothStepToAngle(&boss->obj.rot.y, Math_RadToDeg(-gPlayer[0].camYaw), 0.3f, 5.0f, 0.0f); } else if (boss->timer_054 == 0) { - Math_SmoothStepToAngle(&boss->obj.rot.y, Math_RadToDeg(-gPlayer[0].unk_058), 0.3f, 1.5f, 0.0f); + Math_SmoothStepToAngle(&boss->obj.rot.y, Math_RadToDeg(-gPlayer[0].camYaw), 0.3f, 1.5f, 0.0f); } Math_SmoothStepToF(&boss->fwork[0], boss->fwork[1], 0.2f, 1.0f, 0.00001f); Matrix_RotateY(gCalcMatrix, boss->unk_078.y * M_DTOR, 0U); @@ -1105,8 +1106,8 @@ void Andross_80189B70(Boss* boss) { boss->vel.y = sp64.y; boss->vel.z = sp64.z - D_ctx_80177D08; if (boss->state < 20) { - gRadarMarks[59].unk_00 = 1; - gRadarMarks[59].unk_02 = 102; + gRadarMarks[59].status = 1; + gRadarMarks[59].type = 102; gRadarMarks[59].pos.x = boss->obj.pos.x; gRadarMarks[59].pos.y = boss->obj.pos.y; gRadarMarks[59].pos.z = boss->obj.pos.z; @@ -1158,22 +1159,23 @@ bool Andross_8018B47C(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* return false; } if ((limbIndex == 1) || (limbIndex == 2)) { - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); if (*dList != NULL) { Matrix_Push(&gGfxMatrix); Matrix_Push(&gCalcMatrix); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); if (limbIndex == 1) { - Matrix_RotateY(gGfxMatrix, -boss->fwork[14] * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[16] + 1.0f, 1.0f, 1.0f - boss->fwork[16], 1); - Matrix_RotateY(gGfxMatrix, boss->fwork[14] * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, -boss->fwork[14] * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[16] + 1.0f, 1.0f, 1.0f - boss->fwork[16], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, boss->fwork[14] * M_DTOR, MTXF_APPLY); } else { - Matrix_RotateY(gGfxMatrix, boss->fwork[14] * 1.5f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 2.0f * boss->fwork[16] + 1.0f, 1.0f, 1.0f - 2.0f * boss->fwork[16], 1); - Matrix_RotateY(gGfxMatrix, -boss->fwork[14] * 1.5f * M_DTOR, 1); + Matrix_RotateY(gGfxMatrix, boss->fwork[14] * 1.5f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f * boss->fwork[16] + 1.0f, 1.0f, 1.0f - 2.0f * boss->fwork[16], + MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -boss->fwork[14] * 1.5f * M_DTOR, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); if (((boss->swork[3] % 2) != 0) && (boss->fwork[21] >= 254.0f)) { @@ -1199,11 +1201,11 @@ void Andross_8018B8C0(Boss* boss) { Vec3f spA0; if (boss->state != 21) { - Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 20.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[23] + 1.0f, 1.0f - boss->fwork[23], 1.0f, 1); - Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[23] + 1.0f, 1.0f - boss->fwork[23], 1.0f, 1); - Matrix_Scale(gGfxMatrix, boss->unk_3F8, boss->unk_3F8, boss->unk_3F8, 1); + Matrix_RotateZ(gGfxMatrix, -(f32) gGameFrameCount * 20.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[23] + 1.0f, 1.0f - boss->fwork[23], 1.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[23] + 1.0f, 1.0f - boss->fwork[23], 1.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->unk_3F8, boss->unk_3F8, boss->unk_3F8, MTXF_APPLY); Animation_DrawSkeleton(0, D_VE2_600C0A4, boss->vwork, Andross_8018B47C, NULL, boss, &gIdentityMatrix); if (boss->fwork[21] >= 254) { RCP_SetupDL(&gMasterDisp, 0x36); @@ -1213,8 +1215,8 @@ void Andross_8018B8C0(Boss* boss) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 64, 64, (s32) boss->fwork[21]); } gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Translate(gGfxMatrix, 0.0f, -16.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 0.6f, 0.3f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -16.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 0.6f, 0.3f, MTXF_APPLY); for (i = 0; i < 30; i++) { Matrix_Push(&gGfxMatrix); @@ -1223,16 +1225,16 @@ void Andross_8018B8C0(Boss* boss) { spAC.y = 0.0f; spAC.z = i * 0.8f; Matrix_MultVec3f(gCalcMatrix, &spAC, &spA0); - Matrix_Translate(gGfxMatrix, spA0.x, 10.0f, spA0.z, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * -boss->obj.rot.y - gPlayer[0].unk_058, 1); + Matrix_Translate(gGfxMatrix, spA0.x, 10.0f, spA0.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * -boss->obj.rot.y - gPlayer[0].camYaw, MTXF_APPLY); for (j = 0; j < 10; j++) { - Matrix_Translate(gGfxMatrix, 0.0f, -10.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -10.0f, 0.0f, MTXF_APPLY); temp = SIN_DEG((s32) boss->fwork[19] * (i * 10 + j) + (gGameFrameCount * 5)) * boss->fwork[10]; - Matrix_RotateZ(gGfxMatrix, (boss->fwork[18] + temp) * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, boss->fwork[17] * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, (boss->fwork[18] + temp) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, boss->fwork[17] * M_DTOR, MTXF_APPLY); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (j == 9) { gSPDisplayList(gMasterDisp++, D_VE2_600C2D0); @@ -1299,12 +1301,12 @@ void Andross_8018C390(Player* player) { Math_SmoothStepToF(&player->pos.y, gBosses[0].obj.pos.y - 150.0f, 0.5f, 30.0f, 0); Math_SmoothStepToF(&player->pos.z, gBosses[0].obj.pos.z - 100.0f, 0.5f, 60.0f, 0); D_ctx_80177D20 = player->unk_144 = -player->pos.z; - Math_SmoothStepToF(&player->camEye.z, 2000.0f, 0.05f, 20.0f, 0); - Math_SmoothStepToF(&player->camEye.x, 0.0f, 0.05f, 10.0f, 0); - Math_SmoothStepToF(&player->camEye.y, 0.0f, 0.05f, 10.0f, 0); - Math_SmoothStepToF(&player->camAt.x, 0.0f, 0.05f, 10.0f, 0); - Math_SmoothStepToF(&player->camAt.y, 0.0f, 0.05f, 10.0f, 0); - Math_SmoothStepToF(&player->camAt.z, 100.0f, 0.05f, 10.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, 2000.0f, 0.05f, 20.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, 0.0f, 0.05f, 10.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, 0.0f, 0.05f, 10.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, 0.0f, 0.05f, 10.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, 0.0f, 0.05f, 10.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, 100.0f, 0.05f, 10.0f, 0.0f); break; case 1: player->unk_0E4 += 15.0f; @@ -1316,14 +1318,14 @@ void Andross_8018C390(Player* player) { if (player->unk_0E8 > 180.0f) { player->unk_0E8 -= 360.0f; } - Math_SmoothStepToF(&player->camEye.z, 400.0f, 0.05f, 20.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, 400.0f, 0.05f, 20.0f, 0.0f); if (player->timer_1F8 != 0) { if (gControllerPress[gMainController].button != 0) { player->timer_1F8--; } } if (player->timer_1F8 == 0) { - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0f; player->unk_018 = 0.0f; } @@ -1455,8 +1457,8 @@ void Andross_8018CAD4(Effect* effect) { yaw = Math_Atan2F(sp3C - effectXpos, sp34 - effectZpos); sp40 = sqrtf(SQ(sp3C - effectXpos) + SQ(sp34 - effectZpos)); pitch = -Math_Atan2F(sp38 - effectYpos, sp40); - Matrix_RotateY(gCalcMatrix, yaw, 0); - Matrix_RotateX(gCalcMatrix, pitch, 1); + Matrix_RotateY(gCalcMatrix, yaw, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, pitch, MTXF_APPLY); vec.x = 0.0f; vec.y = 0.0f; vec.z = 30.0f; @@ -1533,13 +1535,13 @@ void Andross_8018CF98(Effect* effect) { if (effect->state == 10) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, effect->unk_44); - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_BG_PLANET_2010A30); } else { RCP_SetupDL(&gMasterDisp, 0x1D); if (effect->unk_4C < 8) { - Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, 1); + Matrix_Scale(gGfxMatrix, effect->scale2, effect->scale2, effect->scale2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } gSPDisplayList(gMasterDisp++, D_i6_801A6790[effect->unk_4C]); @@ -1548,7 +1550,7 @@ void Andross_8018CF98(Effect* effect) { } void Andross_8018D0D8(Boss* boss) { - if ((gPlayer[0].timer_498 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) && + if ((gPlayer[0].timer_498 == 0) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && (fabsf(boss->vwork[10].x - gPlayer[0].pos.x) < 700.0f) && (fabsf(boss->vwork[10].y - gPlayer[0].pos.y) < 700.0f)) { Player_ApplyDamage(&gPlayer[0], 0, 40); @@ -1599,7 +1601,7 @@ void Andross_8018D2B0(Boss* boss) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 1); boss->state = 31; boss->timer_050 = 200; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].unk_1D0 = 0; } else if (boss->health < 50) { AUDIO_PLAY_SFX(0x2943500F, boss->sfxSource, 4); @@ -1911,7 +1913,7 @@ void Andross_8018DBF0(Boss* boss) { Math_SmoothStepToF(&D_i6_801A8430, gAmbientB, 1.0f, 2.0f, 0.0f); } Math_SmoothStepToF(&D_bg_800C9C30, 32.0f, 1.0f, 0.5f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.2f, 3.0f, 0); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.2f, 3.0f, 0); boss->fwork[8] = 0.1f; Math_SmoothStepToF(&boss->fwork[7], 200.0f, 1.0f, 10.0f, 0); if (boss->timer_052 == 0) { @@ -2269,11 +2271,11 @@ void Andross_8018DBF0(Boss* boss) { } if ((boss->unk_04C > 35) && (boss->unk_04C < 150) && ((boss->unk_04C % 32) == 0)) { AUDIO_PLAY_SFX(0x29022089, boss->sfxSource, 4); - if (player->state_1C8 == PLAYERSTATE_1C8_11) { + if (player->state_1C8 == PLAYERSTATE_1C8_ANDROSS_MOUTH) { gControllerRumbleTimers[0] = 10; } } - if ((boss->unk_04C == 20) && (player->state_1C8 == PLAYERSTATE_1C8_11)) { + if ((boss->unk_04C == 20) && (player->state_1C8 == PLAYERSTATE_1C8_ANDROSS_MOUTH)) { player->unk_234 = 0; for (i = 0; i < ARRAY_COUNT(gEffects); i++) { if (gEffects[i].obj.id == OBJ_EFFECT_396) { @@ -2328,7 +2330,7 @@ void Andross_8018DBF0(Boss* boss) { if (boss->unk_04C == 10) { AUDIO_PLAY_SFX(0x3140208A, boss->sfxSource, 4); } - if ((boss->unk_04C == 13) && (player->state_1C8 == PLAYERSTATE_1C8_11)) { + if ((boss->unk_04C == 13) && (player->state_1C8 == PLAYERSTATE_1C8_ANDROSS_MOUTH)) { player->unk_234 = 1; player->unk_1D0 = 1; player->timer_1F8 = 60; @@ -2367,9 +2369,9 @@ void Andross_8018DBF0(Boss* boss) { boss->timer_056 = 50; if ((boss->timer_050 > 70) && (boss->timer_050 < 1000) && ((gGameFrameCount % 4) == 0)) { - Andross_8018C734(gPlayer[0].camEye.x + RAND_FLOAT_CENTERED(3000.0f), - gPlayer[0].camEye.y + RAND_FLOAT_CENTERED(3000.0f), - gPlayer[0].camEye.z - D_ctx_80177D20, RAND_INT(7.9)); + Andross_8018C734(gPlayer[0].cam.eye.x + RAND_FLOAT_CENTERED(3000.0f), + gPlayer[0].cam.eye.y + RAND_FLOAT_CENTERED(3000.0f), + gPlayer[0].cam.eye.z - D_ctx_80177D20, RAND_INT(7.9)); } if (boss->timer_050 > 0) { playerShot = gPlayerShots; @@ -2415,8 +2417,8 @@ void Andross_8018DBF0(Boss* boss) { boss->swork[8] = 1; boss->fwork[9] = 0.2f; boss->unk_04C = 0; - if (player->state_1C8 == PLAYERSTATE_1C8_3) { - player->state_1C8 = PLAYERSTATE_1C8_11; + if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { + player->state_1C8 = PLAYERSTATE_1C8_ANDROSS_MOUTH; player->unk_1D0 = 0; } break; @@ -2944,14 +2946,14 @@ bool Andross_801917F0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* pos->x -= boss->fwork[11]; pos->y += boss->fwork[12]; pos->z += boss->fwork[13]; - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); if (*dList != NULL) { Matrix_Push(&gGfxMatrix); Matrix_Push(&gCalcMatrix); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); RCP_SetupDL(&gMasterDisp, 0x29); @@ -2969,10 +2971,10 @@ bool Andross_801917F0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); break; } - Matrix_Translate(gGfxMatrix, D_i6_801A67DC.x, D_i6_801A67DC.y, D_i6_801A67DC.z, 1); - Matrix_RotateZ(gGfxMatrix, D_i6_801A67F0 * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, D_i6_801A67EC * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_i6_801A67E8 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, D_i6_801A67DC.x, D_i6_801A67DC.y, D_i6_801A67DC.z, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_i6_801A67F0 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_i6_801A67EC * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_i6_801A67E8 * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C022520); Matrix_Pop(&gGfxMatrix); @@ -2983,14 +2985,14 @@ bool Andross_801917F0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* pos->x -= boss->fwork[11]; pos->y += boss->fwork[12]; pos->z -= boss->fwork[13]; - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); if (*dList != NULL) { Matrix_Push(&gGfxMatrix); Matrix_Push(&gCalcMatrix); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); RCP_SetupDL(&gMasterDisp, 0x29); @@ -3008,10 +3010,10 @@ bool Andross_801917F0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); break; } - Matrix_Translate(gGfxMatrix, D_i6_801A67C4.x, D_i6_801A67C4.y, D_i6_801A67C4.z, 1); - Matrix_RotateZ(gGfxMatrix, D_i6_801A67D8 * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, D_i6_801A67D4 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_i6_801A67D0 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, D_i6_801A67C4.x, D_i6_801A67C4.y, D_i6_801A67C4.z, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_i6_801A67D8 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_i6_801A67D4 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_i6_801A67D0 * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C022520); Matrix_Pop(&gGfxMatrix); @@ -3022,16 +3024,16 @@ bool Andross_801917F0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* break; } - Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, 1); - Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, 1); + Matrix_Translate(gCalcMatrix, pos->x, pos->y, pos->z, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, rot->z * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, rot->y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, rot->x * M_DTOR, MTXF_APPLY); Matrix_Push(&gCalcMatrix); - Matrix_Scale(gCalcMatrix, scale, scale, scale, 1); + Matrix_Scale(gCalcMatrix, scale, scale, scale, MTXF_APPLY); if (*dList != NULL) { Matrix_MultVec3f(gCalcMatrix, &sp94, &sp88); func_edisplay_8005F670(&sp88); - Matrix_Mult(gGfxMatrix, gCalcMatrix, 1); + Matrix_Mult(gGfxMatrix, gCalcMatrix, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, *dList); } @@ -3131,28 +3133,31 @@ void Andross_801928C8(Boss* boss) { Lights_SetOneLight(&gMasterDisp, gLight1x, gLight1y, gLight1z, D_i6_801A7F5C, D_i6_801A7F64, D_i6_801A7F6C, D_i6_801A7F74, D_i6_801A7F7C, D_i6_801A8430); } - Matrix_Scale(gCalcMatrix, 10.0f, 10.0f, 10.0f, 1); + Matrix_Scale(gCalcMatrix, 10.0f, 10.0f, 10.0f, MTXF_APPLY); Animation_DrawSkeleton(2, D_ANDROSS_C01CC3C, D_i6_801A7F80, Andross_801917F0, Andross_801924B4, boss, gCalcMatrix); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); if (boss->fwork[20] > 0.05f) { - Matrix_Translate(gGfxMatrix, boss->vwork[10].x, boss->vwork[10].y, boss->vwork[10].z + D_ctx_80177D20, 1); + Matrix_Translate(gGfxMatrix, boss->vwork[10].x, boss->vwork[10].y, boss->vwork[10].z + D_ctx_80177D20, + MTXF_APPLY); if (boss->fwork[21] > 0.05f) { Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 192); gDPSetEnvColor(gMasterDisp++, 255, 0, 128, 192); - Matrix_Scale(gGfxMatrix, boss->fwork[21] * 7.0f, boss->fwork[21] * 7.0f, boss->fwork[21] * 7.0f, 1); + Matrix_Scale(gGfxMatrix, boss->fwork[21] * 7.0f, boss->fwork[21] * 7.0f, boss->fwork[21] * 7.0f, + MTXF_APPLY); if ((gGameFrameCount % 2) != 0) { - Matrix_Scale(gGfxMatrix, 1.1f, 1.1f, 1.1f, 1); + Matrix_Scale(gGfxMatrix, 1.1f, 1.1f, 1.1f, MTXF_APPLY); } Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); Matrix_Pop(&gGfxMatrix); } - Matrix_Scale(gGfxMatrix, boss->fwork[20] * 10.0f, boss->fwork[20] * 10.0f, boss->fwork[20] * 10.0f, 1); - Matrix_RotateZ(gGfxMatrix, boss->fwork[19] * M_DTOR, 1); + Matrix_Scale(gGfxMatrix, boss->fwork[20] * 10.0f, boss->fwork[20] * 10.0f, boss->fwork[20] * 10.0f, + MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, boss->fwork[19] * M_DTOR, MTXF_APPLY); RCP_SetupDL(&gMasterDisp, 0x40); if ((gGameFrameCount % 2) != 0) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128); @@ -3160,26 +3165,26 @@ void Andross_801928C8(Boss* boss) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 30); } Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, 0.0f, 1); - Matrix_RotateX(gGfxMatrix, 15.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 200.0f, 1); + Matrix_RotateZ(gGfxMatrix, 0.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, 15.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 200.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C017440); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, 120.0f * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, 15.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 200.0f, 1); + Matrix_RotateZ(gGfxMatrix, 120.0f * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, 15.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 200.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C017440); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, 240.0f * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, 15.0f * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 200.0f, 1); + Matrix_RotateZ(gGfxMatrix, 240.0f * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, 15.0f * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 1.0f, 1.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 200.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_ANDROSS_C017440); Matrix_Pop(&gGfxMatrix); @@ -3230,7 +3235,7 @@ void Andross_80192E94(Actor* actor) { /* fallthrough */ case 2: actor->obj.rot.z = actor->unk_0F4.z + D_Andross_801A7F68; - Matrix_RotateZ(gCalcMatrix, M_DTOR * D_Andross_801A7F68, 0); + Matrix_RotateZ(gCalcMatrix, M_DTOR * D_Andross_801A7F68, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, actor->vwork, &actor->obj.pos); actor->obj.pos.y += 300.0f; break; @@ -3265,8 +3270,8 @@ void Andross_80193244(Actor* actor) { alpha = 64; scale *= 1.2f; } - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, alpha); @@ -3407,7 +3412,7 @@ void Andross_801939A0(s32 actorIndex) { actor->obj.status = OBJ_ACTIVE; actor->obj.id = OBJ_ACTOR_195; actor->obj.pos.x = 0.0f; - actor->obj.pos.y = gPlayer[0].camAt.y; + actor->obj.pos.y = gPlayer[0].cam.at.y; actor->obj.pos.z = 0.0f; actor->iwork[11] = 1; actor->unk_0F4.x = 90.0f; @@ -3484,7 +3489,7 @@ void Andross_80193C4C(Player* player) { switch (player->unk_1D0) { case 0: gCsFrameCount = 0; - player->wings.unk_2C = 1; + player->wings.modelId = 1; D_ctx_80177A48[0] = 0.0f; if (player->unk_4D8 > 180.0f) { player->unk_4D8 -= 360.0f; @@ -3499,8 +3504,8 @@ void Andross_80193C4C(Player* player) { Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.1f, 10.0f, 0.0f); Math_SmoothStepToF(&player->vel.x, 0.0f, 1.0f, 3.0f, 0.0f); Math_SmoothStepToF(&player->vel.y, 0.0f, 1.0f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.x, player->pos.x, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, player->pos.y + 30.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, player->pos.x, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + 30.0f, 0.1f, 15.0f, 0.0f); if (player->timer_1F8 == 0) { player->pos.y += SIN_DEG(player->unk_0E4) * 15.0f; Math_SmoothStepToF(&player->unk_0E4, 180.0f, 0.1f, 5.0f, 0.0f); @@ -3509,7 +3514,7 @@ void Andross_80193C4C(Player* player) { Math_SmoothStepToF(&player->unk_08C, 0.0f, 1.0f, 5.0f, 0.0f); Math_SmoothStepToF(&player->unk_0E4, 0.0f, 0.1f, 10.0f, 0.0f); } - player->camEye.z += player->vel.z * 0.5f; + player->cam.eye.z += player->vel.z * 0.5f; switch (gCsFrameCount) { case 80: func_effect_8007A568(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, 40.0f); @@ -3539,7 +3544,7 @@ void Andross_80193C4C(Player* player) { gCsCamAtX = gBosses[0].obj.pos.x; gCsCamAtY = gBosses[0].obj.pos.y; gCsCamAtZ = gBosses[0].obj.pos.z + D_ctx_80177D20; - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); break; case 2: player->unk_190 = D_ctx_80177A48[8]; @@ -3569,20 +3574,20 @@ void Andross_80193C4C(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[3], 200.0f, 0.1f, 5.0f, 0.0f); D_ctx_80177A48[4] += 4.5f; D_ctx_80177AB0 = 2; - Matrix_RotateZ(gCalcMatrix, 2.0f * RAND_FLOAT(M_PI), 0); + Matrix_RotateZ(gCalcMatrix, 2.0f * RAND_FLOAT(M_PI), MTXF_NEW); sp74.x = RAND_FLOAT(50.0f) + 120.0f; sp74.y = 0.0f; sp74.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp74, &sp68); } Math_SmoothStepToF(&D_ctx_80177A48[5], 3.0f, 1.0f, 0.05f, 0.0f); - player->camEye.z += player->vel.z * D_ctx_80177A48[2]; + player->cam.eye.z += player->vel.z * D_ctx_80177A48[2]; if (gCsFrameCount > 230) { player->unk_08C -= 7.0f; } if (gCsFrameCount > 230) { Math_SmoothStepToF(&D_ctx_80177A48[7], 3.0f, 1.0f, 0.1f, 0.0f); - player->unk_034 -= D_ctx_80177A48[7]; + player->camRoll -= D_ctx_80177A48[7]; } for (i = 0; i < sp90; i++) { @@ -3591,8 +3596,8 @@ void Andross_80193C4C(Player* player) { RAND_FLOAT(2.5f) + 2.5f); } - Math_SmoothStepToF(&player->camEye.x, D_ctx_80177A48[1] + player->pos.x, 0.1f, 15.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, player->pos.y + 30.0f, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, D_ctx_80177A48[1] + player->pos.x, 0.1f, 15.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, player->pos.y + 30.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToF(&player->unk_0EC, -180.0f, 0.02f, D_ctx_80177A48[6], 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[6], 3.0f, 1.0f, 0.05f, 0.0f); gCsCamAtX = player->pos.x; @@ -3603,7 +3608,7 @@ void Andross_80193C4C(Player* player) { if (player->unk_25C > 0.6f) { player->unk_25C = 0.6f; } - Math_SmoothStepToF(&player->unk_034, 3.0f, 0.5f, 0.1f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 3.0f, 0.5f, 0.1f, 0.0f); Math_SmoothStepToF(D_ctx_801779A8, 70.0f, 1.0f, 2.0f, 0.0f); } @@ -3619,7 +3624,7 @@ void Andross_80193C4C(Player* player) { case 25: for (i = 0; i < 12; i++) { Andross_80193668(&gObjects80[i], player->pos.x, player->pos.y, - (player->camEye.z - D_ctx_80177D20) + (2195.0f * i), i); + (player->cam.eye.z - D_ctx_80177D20) + (2195.0f * i), i); } break; case 150: @@ -3636,13 +3641,13 @@ void Andross_80193C4C(Player* player) { player->unk_1D0 = 3; player->unk_144 = D_ctx_80177D20 = 0.0f; D_ctx_80177AB0 = D_ctx_80177A98 = 1; - player->camEye.x = 1200.0f; - player->camEye.z = 1200.0f; - player->camEye.y = 1800.0f; + player->cam.eye.x = 1200.0f; + player->cam.eye.z = 1200.0f; + player->cam.eye.y = 1800.0f; gCsCamAtX = 0.0f; gCsCamAtY = 620.0f; gCsCamAtZ = 0.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; player->unk_234 = 0; D_ctx_80177A48[0] = 1.0f; func_play_800A6148(); @@ -3689,9 +3694,9 @@ void Andross_80193C4C(Player* player) { Math_SmoothStepToF(&gCsCamAtY, gActors[10].obj.pos.y, 1.0f, D_ctx_80177A48[1], 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[1], 1000.0f, 1.0f, 5.0f, 0.0f); } else { - Math_SmoothStepToF(&player->camEye.z, 1640.0f, 0.05f, 50.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, 110.0f, 0.05f, 50.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.x, 0.0f, 0.05f, 50.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, 1640.0f, 0.05f, 50.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, 110.0f, 0.05f, 50.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, 0.0f, 0.05f, 50.0f, 0.0f); Math_SmoothStepToF(&gCsCamAtY, 630.0f, 0.05f, 50.0f, 0.0f); } @@ -3722,7 +3727,7 @@ void Andross_80193C4C(Player* player) { } break; case 4: - player->unk_034 += D_ctx_80177A48[3]; + player->camRoll += D_ctx_80177A48[3]; if (gCsFrameCount > 190) { Math_SmoothStepToF(&D_ctx_80177A48[3], 0.3f, 0.05f, 0.02f, 0.0f); } @@ -3741,9 +3746,9 @@ void Andross_80193C4C(Player* player) { gAmbientG = D_i6_801A7F50; gAmbientB = D_i6_801A7F54; Math_SmoothStepToF(&D_ctx_80177A48[1], -5000.0f, 0.05f, 15.0f, 0.0f); - player->camEye.x = gActors[10].obj.pos.x + 50.0f; - player->camEye.y = gActors[10].obj.pos.y + D_ctx_80177A48[1]; - player->camEye.z = gActors[10].obj.pos.z; + player->cam.eye.x = gActors[10].obj.pos.x + 50.0f; + player->cam.eye.y = gActors[10].obj.pos.y + D_ctx_80177A48[1]; + player->cam.eye.z = gActors[10].obj.pos.z; gCsCamAtX = gActors[10].obj.pos.x; gCsCamAtY = gActors[10].obj.pos.y + 50.0f; gCsCamAtZ = gActors[10].obj.pos.z; @@ -3785,13 +3790,13 @@ void Andross_80193C4C(Player* player) { D_ctx_80177A48[2] = 0.0f; D_ctx_80177A48[3] = 0.0f; D_ctx_80177A48[4] = 0.0f; - player->camEye.x = gCsCamEyeX = 100.0f; - player->camEye.y = gCsCamEyeY = 14800.0f; - player->camEye.z = gCsCamEyeZ = -1500.0f; + player->cam.eye.x = gCsCamEyeX = 100.0f; + player->cam.eye.y = gCsCamEyeY = 14800.0f; + player->cam.eye.z = gCsCamEyeZ = -1500.0f; gCsCamAtX = 0.0f; gCsCamAtY = 15000.0f; gCsCamAtZ = 0; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; gActors[10].state = 101; gActors[10].fwork[0] = 0.0f; gActors[10].obj.pos.y = 14500.0f; @@ -3864,20 +3869,20 @@ void Andross_80193C4C(Player* player) { } D_ctx_80177A48[0] = 0.01f; Math_SmoothStepToF(&D_ctx_80177A48[1], 10.0f, 1.0f, 0.1f, 0.0f); - Math_SmoothStepToF(&player->camEye.x, gActors[10].obj.pos.x - 50.0f, D_ctx_80177A48[0], + Math_SmoothStepToF(&player->cam.eye.x, gActors[10].obj.pos.x - 50.0f, D_ctx_80177A48[0], D_ctx_80177A48[1], 0); - Math_SmoothStepToF(&player->camEye.y, gActors[10].obj.pos.y + 10.0f, D_ctx_80177A48[0], + Math_SmoothStepToF(&player->cam.eye.y, gActors[10].obj.pos.y + 10.0f, D_ctx_80177A48[0], D_ctx_80177A48[1], 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], D_ctx_80177A48[1], 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], D_ctx_80177A48[1], 0); gCsCamAtY = SIN_DEG(gGameFrameCount * 5.5f) + 15000.0f; } else { gCsCamEyeX -= 1.0f; gCsCamEyeY += 0.3f; gCsCamEyeZ += 4.0f; gCsCamAtY = (SIN_DEG(gGameFrameCount * 1.5f) * 10.0f) + 15000.0f; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); } if (D_play_800D2F68 != 0) { switch (gCsFrameCount) { @@ -3951,8 +3956,8 @@ void Andross_80193C4C(Player* player) { if (gPlayerFillScreenAlphas[0] > 255) { gPlayerFillScreenAlphas[0] = 0; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp74.x = 0.0f; sp74.y = 0.0f; sp74.z = player->unk_0D0; @@ -3961,7 +3966,7 @@ void Andross_80193C4C(Player* player) { player->vel.z = sp68.z; player->vel.y = sp68.y; if (player->timer_1F8 == 0) { - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.2f; player->unk_018 = 0.0f; player->unk_01C = 0.05f; @@ -3980,11 +3985,11 @@ void Andross_80193C4C(Player* player) { gCsCamEyeX = player->pos.x + sp68.x; gCsCamEyeY = player->pos.y + sp68.y; gCsCamEyeZ = player->pos.z + sp68.z; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0); Math_SmoothStepToF(&player->unk_12C, 0.0f, 0.1f, 0.7f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 0.4f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 0.4f, 0.0f); break; } player->pos.x += player->vel.x; @@ -3994,9 +3999,9 @@ void Andross_80193C4C(Player* player) { player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 20.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0); } void Andross_80195E44(Actor* actor) { diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index 1e851173..bc8a8b05 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -66,7 +66,7 @@ void SectorY_Boss314_Init(Boss314* this) { this->fwork[43] = 3.5f; this->fwork[45] = 40.0f; - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_9) { + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_START_360) { this->obj.pos.z = -28900.0f; gObjects58[0].obj.pos.z = -30000.0f; } @@ -94,8 +94,8 @@ void SectorY_Boss314_Init(Boss314* this) { } if (gLevelMode == LEVELMODE_ON_RAILS) { - if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_9; + if (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) { + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_START_360; gPlayer[0].unk_1D0 = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM, 50); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 50); @@ -265,7 +265,7 @@ void SectorY_801983E4(Boss* boss) { } else { SectorY_80199D64(boss); } - } else if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_5) { + } else if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_U_TURN) { Math_SmoothStepToAngle(&boss->unk_078.x, 181.0f, 0.1f, 6.0f, 0.1f); boss->swork[21] = 3; boss->fwork[11] = SIN_DEG(boss->unk_078.y) * (boss->fwork[45] + 10.0f); @@ -326,20 +326,20 @@ void SectorY_80198ABC(Boss* boss) { switch (D_ctx_80177A10[8]) { case 0: if (gTeamShields[TEAM_ID_FALCO] > 0) { - func_360_8002E4F8(gMsg_ID_14200, RCID_FALCO); + AllRange_PlayMessage(gMsg_ID_14200, RCID_FALCO); } break; case 1: if ((gBosses[1].obj.status == OBJ_FREE) && (gBosses[2].obj.status == OBJ_FREE)) { - func_360_8002E4F8(gMsg_ID_14320, RCID_BOSS_SECTORY); + AllRange_PlayMessage(gMsg_ID_14320, RCID_BOSS_SECTORY); } break; case 2: if ((gTeamShields[TEAM_ID_SLIPPY] > 0) && (gBosses[1].obj.status != OBJ_FREE) && (gBosses[2].obj.status != OBJ_FREE)) { - func_360_8002E4F8(gMsg_ID_14220, RCID_SLIPPY); + AllRange_PlayMessage(gMsg_ID_14220, RCID_SLIPPY); } break; } @@ -420,9 +420,9 @@ void SectorY_80198F5C(Boss* boss) { if (boss->index == 0) { boss->timer_058 = 20000; boss->vel.x = boss->vel.y = boss->vel.z = 0.0f; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { gCsFrameCount = 0; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_7; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].timer_1F8 = 0; gPlayer[0].unk_1D0 = gPlayer[0].timer_1F8; gPlayer[0].unk_0E8 += gPlayer[0].unk_114; @@ -457,14 +457,14 @@ void SectorY_80198F5C(Boss* boss) { boss->vel.y = 0.0f; boss->vel.x = 0.0f; - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_3) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_5)) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN)) { boss->timer_058 = 100; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_0; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; gCsFrameCount = 0; - xDisplacement = gPlayer[0].camEye.x - boss->obj.pos.x; - zDisplacement = gPlayer[0].camEye.z - boss->obj.pos.z; + xDisplacement = gPlayer[0].cam.eye.x - boss->obj.pos.x; + zDisplacement = gPlayer[0].cam.eye.z - boss->obj.pos.z; D_ctx_80177A48[8] = Math_RadToDeg(Math_Atan2F(xDisplacement, zDisplacement)); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, MTXF_NEW); vec.x = 0.0f; vec.y = 0.0f; vec.z = 900.0f; @@ -491,7 +491,7 @@ void SectorY_80198F5C(Boss* boss) { AUDIO_PLAY_SFX(0x2943500F, boss->sfxSource, 4); } if ((gBosses[1].obj.status == OBJ_FREE) && (gBosses[2].obj.status == OBJ_FREE)) { - func_360_8002E4F8(gMsg_ID_14350, RCID_BOSS_SECTORY); + AllRange_PlayMessage(gMsg_ID_14350, RCID_BOSS_SECTORY); } } } @@ -517,7 +517,7 @@ void SectorY_80199438(Boss* boss) { } } else { D_ctx_80177A48[8] += D_ctx_80177A48[9]; - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, MTXF_NEW); vec.x = 0.0f; vec.y = 0.0f; vec.z = 900.0f; @@ -553,12 +553,12 @@ void SectorY_80199438(Boss* boss) { } } } - Math_SmoothStepToF(&gPlayer[0].camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&gPlayer[0].camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&gPlayer[0].camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&gPlayer[0].camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&gPlayer[0].camAt.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&gPlayer[0].camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&gPlayer[0].cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&gPlayer[0].cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&gPlayer[0].cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&gPlayer[0].cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&gPlayer[0].cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&gPlayer[0].cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); } if (((gGameFrameCount % 4) == 0) && (boss->swork[36] == 0)) { func_effect_8007C120(boss->obj.pos.x, boss->obj.pos.y, boss->obj.pos.z, boss->vel.x, boss->vel.y, @@ -599,11 +599,11 @@ void SectorY_80199438(Boss* boss) { gObjects58[0].info.dList = D_SY_601F3D0; gObjects58[0].info.drawType = 0; } else { - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_3; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B63BC(&gPlayer[0], 1); gPlayer[0].unk_014 = 0.0f; if (gTeamShields[TEAM_ID_PEPPY] > 0) { - func_360_8002E4F8(gMsg_ID_14230, RCID_PEPPY); + AllRange_PlayMessage(gMsg_ID_14230, RCID_PEPPY); } } } @@ -796,9 +796,9 @@ void SectorY_8019A66C(Boss* boss) { AUDIO_PLAY_SFX(0x2902306C, boss->sfxSource, 4); boss->fwork[34] = 4.5f; if (Rand_ZeroOne() > 0.5f) { - func_360_8002E4F8(gMsg_ID_14330, 160); + AllRange_PlayMessage(gMsg_ID_14330, RCID_BOSS_SECTORY); } else { - func_360_8002E4F8(gMsg_ID_14320, 160); + AllRange_PlayMessage(gMsg_ID_14320, RCID_BOSS_SECTORY); } } if (boss->timer_056 <= 60) { @@ -816,12 +816,11 @@ void SectorY_8019A66C(Boss* boss) { } void SectorY_8019A82C(Boss* boss) { - boss->swork[20] = 9; boss->fwork[9] = 0.0f; boss->timer_050 = RAND_INT(150.0f) + 340; boss->timer_056 = 0; - func_360_8002E4F8(gMsg_ID_14340, 160); + AllRange_PlayMessage(gMsg_ID_14340, RCID_BOSS_SECTORY); } void SectorY_8019A898(Boss* boss) { @@ -860,7 +859,7 @@ void SectorY_8019AA08(Boss* boss) { return; } if ((gBosses[1].obj.status == OBJ_FREE) && (gBosses[2].obj.status == OBJ_FREE)) { - func_360_8002E4F8(gMsg_ID_14330, RCID_BOSS_SECTORY); + AllRange_PlayMessage(gMsg_ID_14330, RCID_BOSS_SECTORY); } if (Rand_ZeroOne() >= 0.5f) { @@ -918,8 +917,8 @@ void SectorY_8019AAF0(Boss* boss) { var_ft5 = ABS(boss->fwork[18] - boss->obj.pos.x) + ABS(boss->fwork[20] - boss->obj.pos.z); xAngle = -Math_Atan2F(boss->fwork[19] - boss->obj.pos.y, var_ft5); - Matrix_RotateY(gCalcMatrix, yAngle, 0); - Matrix_RotateX(gCalcMatrix, xAngle, 1); + Matrix_RotateY(gCalcMatrix, yAngle, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, xAngle, MTXF_APPLY); vec.x = 0.0f; vec.y = 0.0f; vec.z = boss->fwork[9]; @@ -967,13 +966,13 @@ void SectorY_8019AEEC(Boss* boss) { if (boss->unk_04A == 1) { Audio_PlaySequence(SEQ_PLAYER_BGM, SEQ_ID_BOSS_RESUME | SEQ_FLAG, 0, 0); boss->unk_04A++; - gPlayer[0].camEye.x = 0.0f; - gPlayer[0].camEye.y = 200.0f; - gPlayer[0].camEye.z = -20000.0f; - gPlayer[0].camAt.x = 0.0f; - gPlayer[0].camAt.y = 300.0f; - gPlayer[0].camAt.z = boss->obj.pos.z; - gPlayer[0].unk_034 = 0.0f; + gPlayer[0].cam.eye.x = 0.0f; + gPlayer[0].cam.eye.y = 200.0f; + gPlayer[0].cam.eye.z = -20000.0f; + gPlayer[0].cam.at.x = 0.0f; + gPlayer[0].cam.at.y = 300.0f; + gPlayer[0].cam.at.z = boss->obj.pos.z; + gPlayer[0].camRoll = 0.0f; Radio_PlayMessage(gMsg_ID_14300, RCID_BOSS_SECTORY); SectorY_801A0510(&gActors[59], 7); gActors[59].obj.pos.y = boss->obj.pos.y - 202.0f; @@ -986,8 +985,8 @@ void SectorY_8019AEEC(Boss* boss) { } Math_SmoothStepToF(&boss->obj.pos.y, 365.0f, 0.1f, 5.0f, 0.1f); Math_SmoothStepToF(&gActors[59].obj.pos.y, 153.0f, 0.1f, 5.0f, 0.1f); - Math_SmoothStepToF(&gPlayer[0].camEye.z, -28300.0f, 1.0f, 100.0f, 1.0f); - if (gPlayer[0].camEye.z == -28300.0f) { + Math_SmoothStepToF(&gPlayer[0].cam.eye.z, -28300.0f, 1.0f, 100.0f, 1.0f); + if (gPlayer[0].cam.eye.z == -28300.0f) { Math_SmoothStepToF(&boss->fwork[46], 128.0f, 1.0f, 16.0f, 1.0f); gBossHealthBar = boss->health * 1.7f; } @@ -998,9 +997,9 @@ void SectorY_8019AEEC(Boss* boss) { } } } else { - gPlayer[0].camAt.z = boss->obj.pos.z; - Math_SmoothStepToF(&gPlayer[0].camEye.z, -29000.0f, 1.0f, 5.0f, 1.0f); - Math_SmoothStepToF(&gPlayer[0].camEye.x, 2000.0f, 1.0f, 8.0f, 1.0f); + gPlayer[0].cam.at.z = boss->obj.pos.z; + Math_SmoothStepToF(&gPlayer[0].cam.eye.z, -29000.0f, 1.0f, 5.0f, 1.0f); + Math_SmoothStepToF(&gPlayer[0].cam.eye.x, 2000.0f, 1.0f, 8.0f, 1.0f); Math_SmoothStepToF(&boss->fwork[46], 0.0f, 1.0f, 16.0f, 1.0f); if (boss->timer_050 == 0) { boss->swork[21] = 0; @@ -1043,7 +1042,7 @@ void SectorY_8019AEEC(Boss* boss) { gObjects58[0].obj.pos.z = -20000.0f; boss->fwork[43] = 0.0f; boss->vel.y = 0.0f; - gPlayer[0].state_1C8 = PLAYERSTATE_1C8_3; + gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B63BC(&gPlayer[0], 1); gPlayer[0].unk_014 = 0.0f; boss->swork[34]++; @@ -1235,18 +1234,18 @@ void SectorY_8019C194(Boss* boss, f32 zSpeed, f32 xSpeed) { switch (D_ctx_80177A10[8]) { case 0: if (gTeamShields[TEAM_ID_FALCO] > 0) { - func_360_8002E4F8(gMsg_ID_14200, RCID_FALCO); + AllRange_PlayMessage(gMsg_ID_14200, RCID_FALCO); } break; case 1: if (gTeamShields[TEAM_ID_PEPPY] > 0) { - func_360_8002E4F8(gMsg_ID_14210, RCID_PEPPY); + AllRange_PlayMessage(gMsg_ID_14210, RCID_PEPPY); } break; case 2: if ((gTeamShields[TEAM_ID_SLIPPY] > 0) && (gBosses[1].obj.status != OBJ_FREE) && (gBosses[2].obj.status != OBJ_FREE)) { - func_360_8002E4F8(gMsg_ID_14220, RCID_SLIPPY); + AllRange_PlayMessage(gMsg_ID_14220, RCID_SLIPPY); } break; } @@ -1343,7 +1342,7 @@ void SectorY_8019C888(Boss* boss) { Vec3f sp4C; s32 pad; - if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_9) { + if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) { if (boss->swork[34] == 1) { if (boss->health > 0) { gObjects58[0].obj.pos.z += 20.0f; @@ -1440,12 +1439,12 @@ void SectorY_8019C888(Boss* boss) { boss->obj.rot.x = boss->unk_078.x; boss->obj.rot.y = boss->unk_078.y; boss->obj.rot.z = boss->unk_078.z; - Matrix_RotateZ(gCalcMatrix, -boss->vwork[29].z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -boss->vwork[29].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -boss->vwork[29].y * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -boss->vwork[29].z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -boss->vwork[29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -boss->vwork[29].y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -boss->obj.rot.y * M_DTOR, MTXF_APPLY); if ((boss->health > 0) && (boss->swork[20] < 10)) { sp58.x = boss->fwork[18] - boss->obj.pos.x; sp58.y = boss->fwork[19] - boss->obj.pos.y; @@ -1469,8 +1468,8 @@ void SectorY_8019C888(Boss* boss) { Math_SmoothStepToAngle(&boss->fwork[6], sp1E4, 0.2f, 4.0f, 0.1f); Math_SmoothStepToAngle(&boss->fwork[5], sp1E8, 0.2f, 4.0f, 0.1f); - Matrix_RotateX(gCalcMatrix, -boss->fwork[5] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -boss->fwork[6] * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -boss->fwork[5] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -boss->fwork[6] * M_DTOR, MTXF_APPLY); sp58.x = boss->fwork[18] - boss->obj.pos.x; sp58.y = (boss->fwork[19] - boss->obj.pos.y) + 20.0f; sp58.z = boss->fwork[20] - boss->obj.pos.z; @@ -1515,8 +1514,8 @@ void SectorY_8019C888(Boss* boss) { Math_SmoothStepToAngle(&boss->fwork[15], sp1D8, 0.2f, 4.0f, 0.1f); Math_SmoothStepToAngle(&boss->fwork[14], sp1D4, 0.2f, 4.0f, 0.1f); - Matrix_RotateX(gCalcMatrix, -boss->fwork[14] * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -boss->fwork[15] * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -boss->fwork[14] * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -boss->fwork[15] * M_DTOR, MTXF_APPLY); sp58.x = boss->fwork[18] - boss->obj.pos.x; sp58.y = (boss->fwork[19] - boss->obj.pos.y) + (COS_DEG(boss->obj.rot.z) * 40.0f); sp58.z = (boss->fwork[20] - boss->obj.pos.z) - (COS_DEG(boss->obj.rot.y) * 60.0f); @@ -1568,16 +1567,16 @@ void SectorY_8019C888(Boss* boss) { if (boss->index == 0) { radarMark = &gRadarMarks[boss->index + 1]; - radarMark->unk_00 = 1; - radarMark->unk_02 = 102; + radarMark->status = 1; + radarMark->type = 102; radarMark->pos.x = boss->obj.pos.x; radarMark->pos.y = boss->obj.pos.y; radarMark->pos.z = boss->obj.pos.z; radarMark->unk_10 = boss->unk_078.y + 180.0f; } else { radarMark = &gRadarMarks[boss->index + 4]; - radarMark->unk_00 = 1; - radarMark->unk_02 = 10; + radarMark->status = 1; + radarMark->type = 10; radarMark->pos.x = boss->obj.pos.x; radarMark->pos.y = boss->obj.pos.y; radarMark->pos.z = boss->obj.pos.z; @@ -1807,8 +1806,8 @@ void SectorY_8019E2C4(Boss* boss) { gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[1], boss->fwork[2], boss->fwork[3], 1); - Matrix_Scale(gGfxMatrix, sp9C, sp9C, sp9C, 1); + Matrix_Translate(gGfxMatrix, boss->fwork[1], boss->fwork[2], boss->fwork[3], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, sp9C, sp9C, sp9C, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -1818,18 +1817,18 @@ void SectorY_8019E2C4(Boss* boss) { gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[31], boss->fwork[32], boss->fwork[33], 1); - Matrix_Scale(gGfxMatrix, boss->fwork[34], boss->fwork[34], boss->fwork[34], 1); - Matrix_RotateX(gGfxMatrix, -boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, -boss->obj.rot.z * M_DTOR, 1); - sp98 = gPlayer[0].camEye.x - boss->obj.pos.x; - sp94 = gPlayer[0].camEye.y - boss->obj.pos.y; - sp90 = gPlayer[0].camEye.z - (boss->obj.pos.z + D_ctx_80177D20); + Matrix_Translate(gGfxMatrix, boss->fwork[31], boss->fwork[32], boss->fwork[33], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[34], boss->fwork[34], boss->fwork[34], MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, -boss->obj.rot.z * M_DTOR, MTXF_APPLY); + sp98 = gPlayer[0].cam.eye.x - boss->obj.pos.x; + sp94 = gPlayer[0].cam.eye.y - boss->obj.pos.y; + sp90 = gPlayer[0].cam.eye.z - (boss->obj.pos.z + D_ctx_80177D20); sp8C = -Math_Atan2F(sp98, sp90); sp9C = sqrtf(SQ(sp90) + SQ(sp98)); sp88 = Math_Atan2F(sp94, sp9C); - Matrix_RotateY(gGfxMatrix, -sp8C, 1); - Matrix_RotateX(gGfxMatrix, -sp88, 1); + Matrix_RotateY(gGfxMatrix, -sp8C, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -sp88, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -1840,11 +1839,11 @@ void SectorY_8019E2C4(Boss* boss) { gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[35], boss->fwork[36], boss->fwork[37], 1); - Matrix_RotateY(gGfxMatrix, boss->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, boss->obj.rot.z * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[41] * 2.0f, boss->fwork[41], boss->fwork[41] * 2.0f, 1); + Matrix_Translate(gGfxMatrix, boss->fwork[35], boss->fwork[36], boss->fwork[37], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, boss->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[41] * 2.0f, boss->fwork[41], boss->fwork[41] * 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -1854,11 +1853,11 @@ void SectorY_8019E2C4(Boss* boss) { gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->fwork[38], boss->fwork[39], boss->fwork[40], 1); - Matrix_RotateY(gGfxMatrix, boss->obj.rot.y * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, boss->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, boss->obj.rot.z * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[42] * 2.0f, boss->fwork[42], boss->fwork[42] * 2.0f, 1); + Matrix_Translate(gGfxMatrix, boss->fwork[38], boss->fwork[39], boss->fwork[40], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, boss->obj.rot.y * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, boss->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, boss->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[42] * 2.0f, boss->fwork[42], boss->fwork[42] * 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -1869,9 +1868,9 @@ void SectorY_8019E2C4(Boss* boss) { gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->obj.pos.x, 157.0f, boss->obj.pos.z, 1); - Matrix_RotateX(gGfxMatrix, M_PI / 2, 1); - Matrix_Scale(gGfxMatrix, boss->fwork[43], boss->fwork[43], boss->fwork[43], 1); + Matrix_Translate(gGfxMatrix, boss->obj.pos.x, 157.0f, boss->obj.pos.z, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, boss->fwork[43], boss->fwork[43], boss->fwork[43], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -1882,11 +1881,12 @@ void SectorY_8019E2C4(Boss* boss) { gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, boss->obj.pos.x + 10.0f, boss->obj.pos.y + 70.0f, boss->obj.pos.z + 60.0f, 1); - Matrix_Scale(gGfxMatrix, 0.4f, 0.2f, 0.2f, 1); + Matrix_Translate(gGfxMatrix, boss->obj.pos.x + 10.0f, boss->obj.pos.y + 70.0f, boss->obj.pos.z + 60.0f, + MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.4f, 0.2f, 0.2f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); - Matrix_Translate(gGfxMatrix, -46.0f, 0, 0, 1); + Matrix_Translate(gGfxMatrix, -46.0f, 0, 0, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); } @@ -1958,15 +1958,15 @@ void SectorY_8019EE60(Player* player) { case 0: gCsFrameCount = 0; player->unk_4D8 = 0.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; player->unk_0D0 = 40.0f; player->unk_110 = 0.0f; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = player->unk_130 = player->unk_12C = 0.0f; player->unk_234 = 1; D_ctx_80177A48[8] = Math_RadToDeg( - Math_Atan2F(gPlayer[0].camEye.x - boss->obj.pos.x, gPlayer[0].camEye.z - boss->obj.pos.z)); - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, 0); + Math_Atan2F(gPlayer[0].cam.eye.x - boss->obj.pos.x, gPlayer[0].cam.eye.z - boss->obj.pos.z)); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, MTXF_NEW); sp60.x = 0.0f; sp60.y = 0.0f; sp60.z = 1400.0f; @@ -2004,7 +2004,7 @@ void SectorY_8019EE60(Player* player) { Math_SmoothStepToAngle(&player->unk_0EC, -temp_ft1, 0.1f, 5.0f, 0.0001f); if (gCsFrameCount < 180) { D_ctx_80177A48[8] += D_ctx_80177A48[9]; - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[8] * M_DTOR, MTXF_NEW); sp60.x = 0.0f; sp60.y = 0.0f; sp60.z = 1400.0f; @@ -2061,7 +2061,7 @@ void SectorY_8019EE60(Player* player) { D_ctx_80177A48[7] = 25.0f; D_ctx_80177A48[8] = 500.0f; D_ctx_80177A48[9] = 3600.0f; - player->wings.unk_2C = 1; + player->wings.modelId = 1; } break; case 3: @@ -2081,7 +2081,7 @@ void SectorY_8019EE60(Player* player) { AUDIO_PLAY_SFX(0x09000013, player->sfxSource, 0); } D_ctx_80177A48[1] += D_ctx_80177A48[2]; - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); sp60.y = 0.0f; sp60.z = 0.0f; sp60.x = D_ctx_80177A48[8]; @@ -2122,7 +2122,7 @@ void SectorY_8019EE60(Player* player) { gFillScreenAlphaStep = 8; if (gFillScreenAlpha == 255) { Audio_FadeOutAll(10); - player->state_1C8 = PLAYERSTATE_1C8_6; + player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; D_ctx_8017837C = 4; D_play_800D3180[LEVEL_SECTOR_Y] = Play_CheckMedalStatus(150) + 1; @@ -2225,8 +2225,8 @@ void SectorY_8019EE60(Player* player) { } break; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4) * M_DTOR), MTXF_APPLY); sp60.x = 0.0f; sp60.y = 0.0f; sp60.z = player->unk_0D0; @@ -2239,12 +2239,12 @@ void SectorY_8019EE60(Player* player) { player->pos.z += player->vel.z; player->unk_138 = player->pos.z; player->unk_0F8 = player->unk_0EC; - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 50000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 50000.0f, 0.0f); player->unk_088 += 10.0f; player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->unk_0F4 += 8.0f; @@ -2333,8 +2333,8 @@ void SectorY_8019FF00(Actor* actor) { break; } if (actor->state != 6) { - Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (actor->unk_0F4.y + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(actor->unk_0F4.x * M_DTOR), MTXF_APPLY); sp4C.x = 0.0f; sp4C.y = 0.0f; sp4C.z = actor->fwork[0]; @@ -2440,16 +2440,16 @@ void SectorY_801A07FC(Actor* actor0, Actor* actor1) { sp3C.x = -40.0f; sp3C.y = 0.0f; sp3C.z = 80.0f; - Matrix_RotateY(gCalcMatrix, actor0->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor0->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, actor0->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor0->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor0->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, actor0->obj.rot.z * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); actor1->obj.pos.x = actor0->obj.pos.x + sp30.x; actor1->obj.pos.y = actor0->obj.pos.y + sp30.y; actor1->obj.pos.z = actor0->obj.pos.z + sp30.z; Object_SetInfo(&actor1->info, actor1->obj.id); - Matrix_RotateY(gCalcMatrix, actor0->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, actor0->obj.rot.x * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, actor0->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, actor0->obj.rot.x * M_DTOR, MTXF_APPLY); sp3C.x = 0.0f; sp3C.y = 0.0f; sp3C.z = 160.0f; @@ -2498,15 +2498,15 @@ void SectorY_801A0AC0(Player* player) { SectorY_801A0510(&gActors[i + 5], i); } player->unk_1D0 = 1; - player->camEye.x = gCsCamEyeX = -2000.0f; - player->camEye.y = gCsCamEyeY = 0.0f; - player->camEye.z = gCsCamEyeZ = -1700.0f; - player->camAt.x = gCsCamAtX = gActors[8].obj.pos.x; - player->camAt.y = gCsCamAtY = gActors[8].obj.pos.y; - player->camAt.z = gCsCamAtZ = gActors[8].obj.pos.z; + player->cam.eye.x = gCsCamEyeX = -2000.0f; + player->cam.eye.y = gCsCamEyeY = 0.0f; + player->cam.eye.z = gCsCamEyeZ = -1700.0f; + player->cam.at.x = gCsCamAtX = gActors[8].obj.pos.x; + player->cam.at.y = gCsCamAtY = gActors[8].obj.pos.y; + player->cam.at.z = gCsCamAtZ = gActors[8].obj.pos.z; D_ctx_80177A48[0] = 0.0f; player->pos.y = 5000.0f; - player->unk_034 = 0.0f; + player->camRoll = 0.0f; player->unk_0D0 = 0.0f; gActors[5].fwork[2] = gActors[6].fwork[2] = gActors[7].fwork[2] = 0.2f; gActors[5].obj.rot.z = 30.0f; @@ -2545,8 +2545,8 @@ void SectorY_801A0AC0(Player* player) { sp8C = gActors[spB0].obj.pos.z - sp80; sp84 = Math_RadToDeg(Math_Atan2F(sp94, sp8C)); sp88 = Math_RadToDeg(-Math_Atan2F(sp90, sqrtf(SQ(sp94) + SQ(sp8C)))); - Matrix_RotateY(gCalcMatrix, M_DTOR * sp84, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * sp88, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * sp84, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * sp88, MTXF_APPLY); spA4.x = 0.0f; spA4.y = 0.0f; spA4.z = 100.0f; @@ -2612,9 +2612,9 @@ void SectorY_801A0AC0(Player* player) { } if (((gGameFrameCount % 2) == 0) && (gCsFrameCount >= 110)) { - Matrix_RotateY(gCalcMatrix, gActors[8].obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, gActors[8].obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, gActors[8].obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, gActors[8].obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, gActors[8].obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, gActors[8].obj.rot.z * M_DTOR, MTXF_APPLY); spA4.x = RAND_FLOAT_CENTERED(100.0f) + 1500.0f; spA4.y = RAND_FLOAT_CENTERED(500.0f) + -500.0f; spA4.z = RAND_FLOAT_CENTERED(5000.0f) + 170.0f; @@ -2660,8 +2660,8 @@ void SectorY_801A0AC0(Player* player) { sp8C = -1000.0f - gActors[8].obj.pos.z; sp84 = Math_RadToDeg(Math_Atan2F(sp94, sp8C)); sp88 = Math_RadToDeg(-Math_Atan2F(sp90, sqrtf(SQ(sp94) + SQ(sp8C)))); - Matrix_RotateY(gCalcMatrix, M_DTOR * sp84, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * sp88, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * sp84, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * sp88, MTXF_APPLY); spA4.x = 0.0f; spA4.y = 0.0f; spA4.z = 100.0f; @@ -2734,12 +2734,12 @@ void SectorY_801A0AC0(Player* player) { gFillScreenAlphaTarget = 0; Object_Kill(&gActors[8].obj, gActors[8].sfxSource); player->unk_1D0++; - player->camEye.x = gCsCamEyeX = 0.0f; - player->camEye.y = gCsCamEyeY = 0.0f; - player->camEye.z = gCsCamEyeZ = 0.0f; - player->camAt.x = gCsCamAtX = -5600.0f; - player->camAt.y = gCsCamAtY = 0.0f; - player->camAt.z = gCsCamAtZ = 0.0f; + player->cam.eye.x = gCsCamEyeX = 0.0f; + player->cam.eye.y = gCsCamEyeY = 0.0f; + player->cam.eye.z = gCsCamEyeZ = 0.0f; + player->cam.at.x = gCsCamAtX = -5600.0f; + player->cam.at.y = gCsCamAtY = 0.0f; + player->cam.at.z = gCsCamAtZ = 0.0f; gActors[5].obj.pos.x = -4800.0f; gActors[5].obj.pos.y = 0.0f; gActors[5].obj.pos.z = 0.0f; @@ -2774,15 +2774,15 @@ void SectorY_801A0AC0(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[2], 2.0f, 0.1f, 0.05f, 0); Math_SmoothStepToF(&D_ctx_80177A48[3], 100.0f, 1.0f, 1.0f, 0); Math_SmoothStepToF(&D_ctx_80177A48[4], 400.0f, 1.0f, 10.0f, 0); - gCsCamAtX = player->camAt.x = gActors[5].obj.pos.x; - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); + gCsCamAtX = player->cam.at.x = gActors[5].obj.pos.x; + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); spA4.x = D_ctx_80177A48[4] + 400.0f; spA4.y = 0.0f; spA4.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA4, &sp98); - player->camEye.x = gCsCamEyeX = sp98.x; - player->camEye.y = gCsCamEyeY = D_ctx_80177A48[3] + sp98.y; - player->camEye.z = gCsCamEyeZ = sp98.z; + player->cam.eye.x = gCsCamEyeX = sp98.x; + player->cam.eye.y = gCsCamEyeY = D_ctx_80177A48[3] + sp98.y; + player->cam.eye.z = gCsCamEyeZ = sp98.z; } if (gCsFrameCount == 280) { gActors[5].iwork[4] = gActors[6].iwork[4] = gActors[7].iwork[4] = 1; @@ -2921,16 +2921,16 @@ void SectorY_801A0AC0(Player* player) { Math_SmoothStepToF(&D_ctx_80177A48[3], 100.0f, 1.0f, 1.0f, 0); Math_SmoothStepToF(&D_ctx_80177A48[4], 400.0f, 1.0f, 10.0f, 0); if (gCsFrameCount <= 410) { - gCsCamAtX = player->camAt.x = gActors[5].obj.pos.x; + gCsCamAtX = player->cam.at.x = gActors[5].obj.pos.x; } - Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, 0); + Matrix_RotateY(gCalcMatrix, D_ctx_80177A48[1] * M_DTOR, MTXF_NEW); spA4.x = D_ctx_80177A48[4] + 400.0f; spA4.y = 0.0f; spA4.z = 0.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA4, &sp98); - player->camEye.x = gCsCamEyeX = sp98.x; - player->camEye.y = gCsCamEyeY = D_ctx_80177A48[3] + sp98.y; - player->camEye.z = gCsCamEyeZ = sp98.z; + player->cam.eye.x = gCsCamEyeX = sp98.x; + player->cam.eye.y = gCsCamEyeY = D_ctx_80177A48[3] + sp98.y; + player->cam.eye.z = gCsCamEyeZ = sp98.z; } if (gCsFrameCount >= 390) { if (gActors[6].iwork[4] != 0) { @@ -3031,7 +3031,7 @@ void SectorY_801A0AC0(Player* player) { if ((gActors[5].iwork[4] == 6) && (gCsFrameCount == 550)) { Object_Kill(&gActors[10].obj, gActors[10].sfxSource); - D_ctx_80178488 = 1; + gLoadLevelObjects = 1; } if (gCsFrameCount >= 530) { Math_SmoothStepToF(&gActors[5].vel.z, -40.0f, 1.0f, 1.0f, 1.0f); @@ -3181,7 +3181,7 @@ void SectorY_801A0AC0(Player* player) { player->unk_0D0 = D_play_80161A54; AUDIO_PLAY_BGM(SEQ_ID_SECTOR_Y | SEQ_FLAG); gLevelStatusScreenTimer = 100; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_1D0 = 0; player->timer_1F8 = 0; player->timer_1FC = 0; @@ -3191,28 +3191,28 @@ void SectorY_801A0AC0(Player* player) { gCsCamAtX = player->pos.x; gCsCamAtY = (player->pos.y * player->unk_148) + 20.0f; gCsCamAtZ = player->unk_138; - player->camEye.x = player->pos.x; - player->camEye.y = player->pos.y * player->unk_148; - player->camEye.y += 50.0f; - player->camEye.z = 400.0f; - player->camAt.x = player->pos.x; - player->camAt.y = player->pos.y * player->unk_148; - player->camAt.y += 20.0f; - player->camAt.z = player->unk_138 - 41.0f; + player->cam.eye.x = player->pos.x; + player->cam.eye.y = player->pos.y * player->unk_148; + player->cam.eye.y += 50.0f; + player->cam.eye.z = 400.0f; + player->cam.at.x = player->pos.x; + player->cam.at.y = player->pos.y * player->unk_148; + player->cam.at.y += 20.0f; + player->cam.at.z = player->unk_138 - 41.0f; for (i = 0; i < 11; i++) { Object_Kill(&gActors[i].obj, gActors[i].sfxSource); } } break; } - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); - Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), 1); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[0], 20000.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[0], 20000.0f, 0); + Matrix_RotateY(gCalcMatrix, (player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -(player->unk_0E4 * M_DTOR), MTXF_APPLY); spA4.x = 0.0f; spA4.y = 0.0f; spA4.z = player->unk_0D0; @@ -3441,13 +3441,13 @@ void SectorY_Actor204_Update(Actor204* this) { break; } if ((this->unk_046 == 1) || (this->unk_046 == 2)) { - Matrix_RotateZ(gCalcMatrix, -this->vwork[29].z * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, -this->obj.rot.z * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, -this->obj.rot.x * M_DTOR, 1); + Matrix_RotateZ(gCalcMatrix, -this->vwork[29].z * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -this->vwork[29].x * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, -this->vwork[29].y * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, -this->obj.rot.z * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, -this->obj.rot.x * M_DTOR, MTXF_APPLY); if (this->iwork[17] == 0) { - Matrix_RotateY(gCalcMatrix, -this->obj.rot.y * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, -this->obj.rot.y * M_DTOR, MTXF_APPLY); } sp5C.x = gPlayer[0].pos.x - this->obj.pos.x; sp5C.y = gPlayer[0].pos.y - this->obj.pos.y; @@ -3615,8 +3615,8 @@ void SectorY_Actor204_Draw(Actor204* this) { gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, this->fwork[16], this->fwork[17], this->fwork[18] + D_ctx_80177D20, 1); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Translate(gGfxMatrix, this->fwork[16], this->fwork[17], this->fwork[18] + D_ctx_80177D20, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024AC0); @@ -3632,9 +3632,9 @@ void SectorY_801A4E44(Object_80* obj80) { obj80->state++; } if (((gGameFrameCount % 4) == 0)) { - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, obj80->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, obj80->obj.rot.z * M_DTOR, MTXF_APPLY); sp3C.x = RAND_FLOAT_CENTERED(100.0f) + 500.0f; sp3C.y = RAND_FLOAT_CENTERED(900.0f) + -150.0f; sp3C.z = 90.0f - RAND_FLOAT(50.0f); @@ -3671,9 +3671,9 @@ void SectorY_801A52B8(Object_80* obj80) { obj80->state++; } if (((gGameFrameCount % 4) == 0)) { - Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, obj80->obj.rot.z * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, obj80->obj.rot.y * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, obj80->obj.rot.x * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, obj80->obj.rot.z * M_DTOR, MTXF_APPLY); sp44.x = RAND_FLOAT_CENTERED(100.0f) + -800.0f; sp44.y = RAND_FLOAT_CENTERED(300.0f) + -100.0f; sp44.z = RAND_FLOAT_CENTERED(5000.0f) + 500.0f; diff --git a/src/overlays/ovl_i6/fox_turret.c b/src/overlays/ovl_i6/fox_turret.c index 232915b2..9842cf8d 100644 --- a/src/overlays/ovl_i6/fox_turret.c +++ b/src/overlays/ovl_i6/fox_turret.c @@ -6,22 +6,22 @@ void Turret_801A5560(Player* player, PlayerShot* shot, f32 xOffset, f32 yOffset, Vec3f sp34; PlayerShot_Initialize(shot); - Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_004 * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_004 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); sp4C.x = xOffset; sp4C.y = yOffset; sp4C.z = zOffset; Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp34); - Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, player->unk_004 * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, player->unk_000 * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, player->unk_004 * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_0E4 * M_DTOR, MTXF_APPLY); sp4C.x = sp4C.y = 0.0f; sp4C.z = speed; Matrix_MultVec3f(gCalcMatrix, &sp4C, &sp40); @@ -215,21 +215,21 @@ void Turret_801A5FC0(Player* player) { sp3C.x = 0.0f; sp3C.y = 0.0f; sp3C.z = 100.0f; - Matrix_RotateY(gCalcMatrix, (player->unk_000 + (player->unk_134 * 0.3f)) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, (player->unk_004 + (player->unk_134 * 0.3f)) * M_DTOR, 1); - Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, 1); - Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (player->unk_000 + (player->unk_134 * 0.3f)) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, (player->unk_004 + (player->unk_134 * 0.3f)) * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gCalcMatrix, player->unk_0EC * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, player->unk_180 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, player->unk_17C * M_DTOR, MTXF_APPLY); // unclear what values are being multiplied by 0.0f - Matrix_RotateY(gCalcMatrix, (0.0f * player->unk_000) * M_DTOR, 1); - Matrix_RotateX(gCalcMatrix, (0.0f * player->unk_004) * M_DTOR, 1); + Matrix_RotateY(gCalcMatrix, (0.0f * player->unk_000) * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, (0.0f * player->unk_004) * M_DTOR, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp3C, &sp30); - player->camAt.x = player->pos.x + sp30.x; - player->camAt.y = player->pos.y + sp30.y; - player->camAt.z = player->pos.z + D_ctx_80177D20 + sp30.z; - player->camEye.x = player->pos.x; - player->camEye.y = player->pos.y; - player->camEye.z = player->pos.z + D_ctx_80177D20; + player->cam.at.x = player->pos.x + sp30.x; + player->cam.at.y = player->pos.y + sp30.y; + player->cam.at.z = player->pos.z + D_ctx_80177D20 + sp30.z; + player->cam.eye.x = player->pos.x; + player->cam.eye.y = player->pos.y; + player->cam.eye.z = player->pos.z + D_ctx_80177D20; } void Turret_801A6164(Player* player) { @@ -244,15 +244,15 @@ void Turret_801A6164(Player* player) { Matrix_Push(&gGfxMatrix); RCP_SetupDL_36(); - Matrix_Translate(gGfxMatrix, 0.0f, -100.0f, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -100.0f, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); if (player->unk_1B0 < 2) { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -5000.0f + (player->unk_1BC * 25), 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -5000.0f + (player->unk_1BC * 25), MTXF_APPLY); } else { - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -5000.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -5000.0f, MTXF_APPLY); } - Matrix_Scale(gGfxMatrix, 12.0f, 12.0f, 1.0f, 1); + Matrix_Scale(gGfxMatrix, 12.0f, 12.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Pop(&gGfxMatrix); RCP_SetupDL_27(); @@ -262,36 +262,36 @@ void Turret_801A6164(Player* player) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255); } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -100.0f, -100.0f, -200.0f + player->unk_1BC, 1); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, -100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 100.0f, -100.0f, -200.0f + player->unk_1BC, 1); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, 100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Pop(&gGfxMatrix); if ((player->unk_1BC > 20) && (player->unk_1B0 >= 2)) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 128); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -100.0f, -100.0f, -200.0f + player->unk_1BC, 1); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -188.0f, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Translate(gGfxMatrix, -100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -188.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 100.0f, -100.0f, -200.0f + player->unk_1BC, 1); - Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -188.0f, 1); - Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, 1); + Matrix_Translate(gGfxMatrix, 100.0f, -100.0f, -200.0f + player->unk_1BC, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, player->unk_0E8 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -player->unk_0E4 * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -188.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.0f, 2.0f, 2.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Pop(&gGfxMatrix); } diff --git a/src/overlays/ovl_i6/fox_ve2.c b/src/overlays/ovl_i6/fox_ve2.c index 0f4349eb..06822e6d 100644 --- a/src/overlays/ovl_i6/fox_ve2.c +++ b/src/overlays/ovl_i6/fox_ve2.c @@ -47,7 +47,7 @@ void Venom2_80196314(Actor* actor) { gStarWolfTeamAlive[i] = 1; } - if (player->state_1C8 == PLAYERSTATE_1C8_3) { + if (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE) { actor->state = 2; player->pos.x = 0.0f; player->pos.z = 8000.0f; @@ -84,7 +84,7 @@ void Venom2_80196314(Actor* actor) { if (actor->timer_0BC == 0) { otherActor->state = 2; actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; player->unk_014 = 0.0001f; gLevelStatusScreenTimer = 80; } @@ -100,7 +100,7 @@ void Venom2_80196314(Actor* actor) { (gActors[7].obj.status == OBJ_FREE) && (actor->timer_0BE == 0)) { actor->timer_0BE = 80; } - if ((actor->timer_0BE == 1) && (player->state_1C8 != PLAYERSTATE_1C8_7)) { + if ((actor->timer_0BE == 1) && (player->state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { for (i = 1; i < ARRAY_COUNT(gTeamShields); i++) { gPrevPlanetTeamShields[i] = gSavedTeamShields[i]; @@ -108,7 +108,7 @@ void Venom2_80196314(Actor* actor) { gSavedTeamShields[i] = gTeamShields[i]; } - player->state_1C8 = PLAYERSTATE_1C8_7; + player->state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; player->unk_1D0 = 0; D_play_800D3180[gCurrentLevel] = 2; D_ctx_80177C94 = gGoldRingCount[0]; @@ -123,17 +123,17 @@ void Venom2_80196314(Actor* actor) { case 3: gPauseEnabled = 0; if (gStarWolfMsgTimer < 600) { - player->camEye.x += actor4->vel.x * 0.23f; - player->camEye.y += actor4->vel.y * 0.23f; - player->camEye.z += actor4->vel.z * 0.23f; + player->cam.eye.x += actor4->vel.x * 0.23f; + player->cam.eye.y += actor4->vel.y * 0.23f; + player->cam.eye.z += actor4->vel.z * 0.23f; } - Math_SmoothStepToF(&player->camAt.x, actor4->obj.pos.x, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.y, actor4->obj.pos.y, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->camAt.z, actor4->obj.pos.z, 1.0f, 20000.0f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0, 0.1f, 0.2f, 0.0f); + Math_SmoothStepToF(&player->cam.at.x, actor4->obj.pos.x, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.y, actor4->obj.pos.y, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->cam.at.z, actor4->obj.pos.z, 1.0f, 20000.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0, 0.1f, 0.2f, 0.0f); if ((gControllerPress->button & START_BUTTON) || (gAllRangeEventTimer == (D_360_800C9B4C + 300))) { actor->state = 2; - player->state_1C8 = PLAYERSTATE_1C8_3; + player->state_1C8 = PLAYERSTATE_1C8_ACTIVE; func_play_800B7184(player, 1); player->unk_014 = 0.0f; D_hud_80161708 = 0; @@ -227,8 +227,8 @@ void Venom2_80196BF8(Player* player) { gFillScreenAlphaStep = 3; gFillScreenAlphaTarget = 0; } - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); vec.x = 0.0f; vec.y = 0.0f; vec.z = player->unk_0D0 + player->unk_110; @@ -242,12 +242,12 @@ void Venom2_80196BF8(Player* player) { player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; player->unk_138 = player->pos.z; - player->camEye.x = 50.0f; - player->camEye.y = 1800.0f; - player->camEye.z = 9000.0f; - player->camAt.x = player->pos.x; - player->camAt.y = player->pos.y; - player->camAt.z = player->pos.z; + player->cam.eye.x = 50.0f; + player->cam.eye.y = 1800.0f; + player->cam.eye.z = 9000.0f; + player->cam.at.x = player->pos.x; + player->cam.at.y = player->pos.y; + player->cam.at.z = player->pos.z; } void Venom2_80196D88(Player* player) { @@ -300,7 +300,7 @@ void Venom2_80196D88(Player* player) { case 0: player->unk_1D0++; player->wings.unk_04 = player->wings.unk_0C = player->wings.unk_08 = player->wings.unk_10 = 0.0f; - player->wings.unk_2C = 1; + player->wings.modelId = 1; D_ctx_80177A48[0] = 0.0f; D_ctx_80177A48[1] = 0.1f; D_ctx_80177A48[3] = 0.0f; @@ -311,7 +311,7 @@ void Venom2_80196D88(Player* player) { sp64.x = 0.0f; sp64.y = 0.0f; sp64.z = 5000.0f; - Matrix_RotateY(gCalcMatrix, player->unk_114, 0); + Matrix_RotateY(gCalcMatrix, player->unk_114, MTXF_NEW); Matrix_MultVec3fNoTranslate(gCalcMatrix, &sp64, &sp58); D_ctx_80177A48[5] = sp58.x; D_ctx_80177A48[6] = sp58.z; @@ -347,8 +347,8 @@ void Venom2_80196D88(Player* player) { pad80 = Math_SmoothStepToAngle(&player->unk_114, sp84, 0.1f, D_ctx_80177A48[4], 0.0f) * 20.0f; Math_SmoothStepToF(&player->unk_0EC, pad80, 0.1f, 3.0f, 0.0f); Math_SmoothStepToF(&D_ctx_80177A48[4], 3.0f, 1.0f, 0.1f, 0.0f); - Matrix_RotateX(gCalcMatrix, -(D_PI / 9), 0); - Matrix_RotateY(gCalcMatrix, (D_ctx_80177A48[3] + player->unk_114) * M_DTOR, 1); + Matrix_RotateX(gCalcMatrix, -(D_PI / 9), MTXF_NEW); + Matrix_RotateY(gCalcMatrix, (D_ctx_80177A48[3] + player->unk_114) * M_DTOR, MTXF_APPLY); D_ctx_80177A48[3] += 1.0f; sp64.x = 0.0f; sp64.y = 0.0f; @@ -358,7 +358,7 @@ void Venom2_80196D88(Player* player) { gCsCamEyeY = player->pos.y + sp58.y; gCsCamEyeZ = player->pos.z + sp58.z; Math_SmoothStepToF(D_ctx_80177A48, 0.5f, 1.0f, 0.01f, 0.0f); - Math_SmoothStepToF(&player->unk_034, 0.0f, 0.1f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 3.0f, 0.0f); if ((player->timer_1F8 == 0) && (fabsf(sp94) < 50.0f) && (fabsf(sp8C) < 50.0f)) { player->unk_1D0++; D_ctx_80177A48[2] = 0.75f; @@ -448,8 +448,8 @@ void Venom2_80196D88(Player* player) { gCsCamAtX = player->pos.x; gCsCamAtY = player->pos.y; gCsCamAtZ = player->unk_138; - Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, 0); - Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), 1); + Matrix_RotateY(gCalcMatrix, (player->unk_114 + player->unk_0E8 + 180.0f) * M_DTOR, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, -((player->unk_120 + player->unk_0E4 + player->unk_4D8) * M_DTOR), MTXF_APPLY); sp64.x = 0.0f; sp64.y = 0.0f; sp64.z = player->unk_0D0 + player->unk_110; @@ -464,12 +464,12 @@ void Venom2_80196D88(Player* player) { player->unk_0F8 = player->unk_0EC + player->unk_12C + player->unk_130; Math_SmoothStepToF(&player->unk_130, 0.0f, 0.1f, 15.0f, 0.0f); Math_SmoothStepToAngle(&player->unk_4D8, 0.0f, 0.1f, 5.0f, 0.0f); - Math_SmoothStepToF(&player->camEye.x, gCsCamEyeX, D_ctx_80177A48[0], 100.0f, 0); - Math_SmoothStepToF(&player->camEye.y, gCsCamEyeY, D_ctx_80177A48[0], 100.0f, 0); - Math_SmoothStepToF(&player->camEye.z, gCsCamEyeZ, D_ctx_80177A48[0], 100.0f, 0); - Math_SmoothStepToF(&player->camAt.x, gCsCamAtX, D_ctx_80177A48[1], 100.0f, 0); - Math_SmoothStepToF(&player->camAt.y, gCsCamAtY, D_ctx_80177A48[1], 100.0f, 0); - Math_SmoothStepToF(&player->camAt.z, gCsCamAtZ, D_ctx_80177A48[1], 100.0f, 0); + Math_SmoothStepToF(&player->cam.eye.x, gCsCamEyeX, D_ctx_80177A48[0], 100.0f, 0); + Math_SmoothStepToF(&player->cam.eye.y, gCsCamEyeY, D_ctx_80177A48[0], 100.0f, 0); + Math_SmoothStepToF(&player->cam.eye.z, gCsCamEyeZ, D_ctx_80177A48[0], 100.0f, 0); + Math_SmoothStepToF(&player->cam.at.x, gCsCamAtX, D_ctx_80177A48[1], 100.0f, 0); + Math_SmoothStepToF(&player->cam.at.y, gCsCamAtY, D_ctx_80177A48[1], 100.0f, 0); + Math_SmoothStepToF(&player->cam.at.z, gCsCamAtZ, D_ctx_80177A48[1], 100.0f, 0); player->unk_088 += 10.0f; player->unk_080 = -SIN_DEG(player->unk_088) * 0.3f; player->unk_0F4 += 8.0f; diff --git a/src/overlays/ovl_menu/fox_i_menu.c b/src/overlays/ovl_menu/fox_i_menu.c index 4f1b3ba3..3525f6e4 100644 --- a/src/overlays/ovl_menu/fox_i_menu.c +++ b/src/overlays/ovl_menu/fox_i_menu.c @@ -14,35 +14,35 @@ s32 D_menu_801AD9F0 = 0; void OvlMenu_CallFunction(u32 mode, void* ptr) { switch (mode) { - case 103: + case OVLCALL_TITLE_UPDATE: Title_80187754(); break; - case 104: + case OVLCALL_TITLE_DRAW: Title_801878D8(); break; - case 105: + case OVLCALL_MAP_UPDATE: Map_8019E8D0(); break; - case 106: + case OVLCALL_MAP_DRAW: Map_801A01A8(); break; - case 107: + case OVLCALL_OPTION_UPDATE: Option_Init(); break; - case 108: + case OVLCALL_OPTION_DRAW: Option_DrawEntry(); break; - case 109: + case OVLCALL_GAME_OVER_UPDATE: Map_8019E85C(); break; - case 110: + case OVLCALL_UNKMAP_DRAW: Map_8019E8C8(); default: diff --git a/src/overlays/ovl_menu/fox_map.c b/src/overlays/ovl_menu/fox_map.c index 0c57aaff..f94c7875 100644 --- a/src/overlays/ovl_menu/fox_map.c +++ b/src/overlays/ovl_menu/fox_map.c @@ -1883,8 +1883,8 @@ void Map_801A01A8(void) { Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, D_menu_801CD9F4, D_menu_801CD9F8, D_menu_801CD9FC, D_menu_801CDA00, D_menu_801CDA04, - D_menu_801CDA08, D_menu_801CDA20, D_menu_801CDA24, D_menu_801CDA28, 1); - Matrix_Translate(gGfxMatrix, D_menu_801CEA58, D_menu_801CEA5C, D_menu_801CEA60, 1); + D_menu_801CDA08, D_menu_801CDA20, D_menu_801CDA24, D_menu_801CDA28, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_menu_801CEA58, D_menu_801CEA5C, D_menu_801CEA60, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (D_menu_801CD974 && D_menu_801CD944 != 0) { @@ -2218,8 +2218,8 @@ void Map_801A116C(void) { src.y = 0.0f; src.z = 100.0f; - Matrix_RotateY(gCalcMatrix, M_DTOR * 22.0f, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * -70.0f, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * 22.0f, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * -70.0f, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); if (D_menu_801CD948 >= 2) { @@ -2246,19 +2246,19 @@ void Map_801A116C(void) { if ((D_menu_801CD948 < 2) || (D_menu_801CD9E8 != 0)) { Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 430.0f, 0.0f, 180.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 430.0f, 0.0f, 180.0f, 0.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Lights_SetOneLight(&gMasterDisp, dest.x, dest.y, dest.z, colR, colG, colB, 0, 0, 0); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, -60.0f, 293.0f, -360.0f, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); + Matrix_Translate(gGfxMatrix, -60.0f, 293.0f, -360.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, M_DTOR * -15.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801B6970, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * -90.0f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * -15.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801B6970, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * -90.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2269,7 +2269,7 @@ void Map_801A116C(void) { // clang-format on wings.unk_14 = 0.0f; - wings.unk_2C = 1; + wings.modelId = 1; wings.unk_30 = 0.0f; wings.unk_34 = 0.0f; wings.unk_38 = 0.0f; @@ -3416,17 +3416,17 @@ void Map_801A4650(void) { Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 500.0f, 0.0f, 0.0f, -500.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 500.0f, 0.0f, 0.0f, -500.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); for (i = 0; i < 8; i++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801CF020[i], D_menu_801CF040[i], D_menu_801CF060[i], 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801CF0A8[i], 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801CF088[i], 1); - Matrix_Scale(gGfxMatrix, D_menu_801CF080, D_menu_801CF080, D_menu_801CF080, 1); + Matrix_Translate(gGfxMatrix, D_menu_801CF020[i], D_menu_801CF040[i], D_menu_801CF060[i], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801CF0A8[i], MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801CF088[i], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801CF080, D_menu_801CF080, D_menu_801CF080, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3911,7 +3911,7 @@ void Map_801A5C90(void) { Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3919,8 +3919,8 @@ void Map_801A5C90(void) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 45.0f, 32.0f, 0.01f, 1); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Translate(gGfxMatrix, 45.0f, 32.0f, 0.01f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4296,10 +4296,10 @@ void Map_801A6694(void) { for (planetId = 0; planetId < PLANET_MAX; planetId++) { Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gGfxMatrix, M_DTOR * sPlanets[planetId].longitude, 1); - Matrix_Translate(gGfxMatrix, sPlanets[planetId].orbit.radius, sPlanets[planetId].orbit.incl, 0.0f, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * sPlanets[planetId].longitude, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, sPlanets[planetId].orbit.radius, sPlanets[planetId].orbit.incl, 0.0f, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, M_DTOR * -sPlanets[planetId].longitude, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * -sPlanets[planetId].longitude, MTXF_APPLY); Map_801AD048(); @@ -4318,9 +4318,9 @@ void Map_801A6694(void) { Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, D_menu_801CD9F4, D_menu_801CD9F8, D_menu_801CD9FC, D_menu_801CDA00, D_menu_801CDA04, - D_menu_801CDA08, D_menu_801CDA20, D_menu_801CDA24, D_menu_801CDA28, 1); - Matrix_Translate(gGfxMatrix, D_menu_801CEA58, D_menu_801CEA5C, D_menu_801CEA60, 1); - Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[planetId], 1); + D_menu_801CDA08, D_menu_801CDA20, D_menu_801CDA24, D_menu_801CDA28, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_menu_801CEA58, D_menu_801CEA5C, D_menu_801CEA60, MTXF_APPLY); + Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[planetId], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4513,21 +4513,21 @@ void Map_801A6EC0(PlanetId planetId) { Matrix_Push(&gGfxMatrix); - Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[planetId], 1); + Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[planetId], MTXF_APPLY); if (sPlanets[planetId].anim == PL_ANIM_ROTATE_Y) { if (planetId == PLANET_BOLSE) { - Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801AFFF8, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFFF4, 1); + Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801AFFF8, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFFF4, MTXF_APPLY); } else { - Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801B0000, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFFFC, 1); + Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801B0000, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFFFC, MTXF_APPLY); } } - Matrix_RotateZ(gGfxMatrix, M_DTOR * (sPlanets[planetId].orbit.tilt), 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * (sPlanets[planetId].orbit.tilt), MTXF_APPLY); - Matrix_Scale(gGfxMatrix, sPlanets[planetId].scale, sPlanets[planetId].scale, sPlanets[planetId].scale, 1); + Matrix_Scale(gGfxMatrix, sPlanets[planetId].scale, sPlanets[planetId].scale, sPlanets[planetId].scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4543,8 +4543,8 @@ void Map_801A6EC0(PlanetId planetId) { src.y = 0.0f; src.z = 100.0f; - Matrix_RotateY(gCalcMatrix, M_DTOR * (-D_menu_801CDA10 - y1), 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * (-D_menu_801CDA0C - x1), 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * (-D_menu_801CDA10 - y1), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * (-D_menu_801CDA0C - x1), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dst); @@ -4627,8 +4627,8 @@ void Map_801A74F4(PlanetId planetId) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_menu_801CDE20[planetId]); - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801B6A74, 1); - Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801B6A74, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4673,11 +4673,11 @@ void Map_801A77B0(PlanetId planetId) { Matrix_Copy(gGfxMatrix, &D_menu_801CDE20[planetId]); if ((planetId == 10) || (planetId == 7) || (planetId == 8)) { - Matrix_RotateY(gGfxMatrix, M_DTOR * 180.0f, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * 180.0f, MTXF_APPLY); } - Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, 1); - Matrix_Scale(gGfxMatrix, 1.6f, 1.6f, 1.6f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.6f, 1.6f, 1.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4696,10 +4696,10 @@ void Map_801A791C(PlanetId planetId) { Matrix_Copy(gGfxMatrix, &D_menu_801CDE20[planetId]); - Matrix_RotateZ(gGfxMatrix, M_DTOR * -sPlanets[planetId].orbit.tilt, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * -sPlanets[planetId].orbit.tilt, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4717,9 +4717,9 @@ void Map_801A7A84(PlanetId planetId) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_menu_801CDE20[planetId]); - Matrix_RotateZ(gGfxMatrix, M_DTOR * -sPlanets[planetId].orbit.tilt, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * -sPlanets[planetId].orbit.tilt, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4743,8 +4743,8 @@ void Map_801A7BEC(f32* zAngle, f32 next, f32 scale) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_menu_801CDE20[PLANET_VENOM]); - Matrix_RotateZ(gGfxMatrix, M_DTOR * (*zAngle), 1); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * (*zAngle), MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4768,16 +4768,16 @@ void Map_801A7D3C(PlanetId planetId) { Matrix_Push(&gGfxMatrix); - Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[planetId], 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801CEAF8[planetId], 1); - Matrix_Translate(gGfxMatrix, D_menu_801AFFB8[planetId], 0.0f, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * -D_menu_801CEAF8[planetId], 1); + Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[planetId], MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801CEAF8[planetId], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_menu_801AFFB8[planetId], 0.0f, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * -D_menu_801CEAF8[planetId], MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Matrix_Copy(&D_menu_801CE5A0[planetId], gGfxMatrix); - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801CEAB8[planetId], 1); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801CEAB8[planetId], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_MultVec3f(gGfxMatrix, &src, &dest); D_menu_801CEA18[planetId] = dest.z; @@ -4849,7 +4849,7 @@ void Map_801A809C(PlanetId planetId) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_menu_801CE1E0[planetId]); - Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4881,11 +4881,11 @@ void Map_801A809C(PlanetId planetId) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_menu_801CE5A0[planetId]); - Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * (i * -45.0f), 1); - Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801CD99C, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_menu_801B6A78), 1); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * (i * -45.0f), MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801CD99C, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * (D_menu_801B6A78), MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4909,8 +4909,8 @@ void Map_801A809C(PlanetId planetId) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_menu_801CE5A0[planetId]); - Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4947,8 +4947,8 @@ void Map_801A809C(PlanetId planetId) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_menu_801CE5A0[planetId]); - Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, -30.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5003,9 +5003,9 @@ void Map_801A8738(void) { Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_menu_801CDE20[PLANET_CORNERIA]); - Matrix_RotateZ(gGfxMatrix, M_DTOR * -50.0f, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 25.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, D_menu_801CEB3C, D_menu_801CEB3C, D_menu_801CEB3C, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * -50.0f, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 25.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801CEB3C, D_menu_801CEB3C, D_menu_801CEB3C, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5087,10 +5087,11 @@ void Map_801A89BC(PlanetId planetId, s32 arg1) { Matrix_Push(&gGfxMatrix); - Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[planetId], 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801CEDB0[arg1][i], 1); - Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801CED38[arg1][i], 0.0f, 1); - Matrix_Scale(gGfxMatrix, D_menu_801CEC48[arg1][i], D_menu_801CEC48[arg1][i], D_menu_801CEC48[arg1][i], 1); + Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[planetId], MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801CEDB0[arg1][i], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801CED38[arg1][i], 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801CEC48[arg1][i], D_menu_801CEC48[arg1][i], D_menu_801CEC48[arg1][i], + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5119,10 +5120,10 @@ void Map_801A8F40(void) { Matrix_Push(&gGfxMatrix); - Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[sCurrentPlanetId], 1); - Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801CEAA8, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801B6A7C, 1); - Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, 1); + Matrix_Mult(gGfxMatrix, &D_menu_801CDA60[sCurrentPlanetId], MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801CEAA8, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801B6A7C, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 3.0f, 3.0f, 3.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5191,14 +5192,14 @@ void Map_801A9224(void) { for (i = 0; i < 42; i++) { Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFA38[i].angle, 1); - Matrix_Translate(gGfxMatrix, D_menu_801AFA38[i].x, D_menu_801AFA38[i].y, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * -D_menu_801AFA38[i].angle, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFA38[i].angle, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_menu_801AFA38[i].x, D_menu_801AFA38[i].y, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * -D_menu_801AFA38[i].angle, MTXF_APPLY); Map_801AD048(); Matrix_Scale(gGfxMatrix, D_menu_801AFA38[i].scale, D_menu_801AFA38[i].scale, D_menu_801AFA38[i].scale, - 1); + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5247,14 +5248,15 @@ void Map_801A9448(void) { for (i = 0; i < 4; i++) { Matrix_Push(&gGfxMatrix); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFCD8[i].angle, 1); - Matrix_Translate(gGfxMatrix, D_menu_801AFCD8[i].x, D_menu_801AFCD8[i].y, 0.0f, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * -(D_menu_801AFCD8[i].angle), 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFCD8[i].angle, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_menu_801AFCD8[i].x, D_menu_801AFCD8[i].y, 0.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * -(D_menu_801AFCD8[i].angle), MTXF_APPLY); Map_801AD048(); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801B6A80, 1); - Matrix_Scale(gGfxMatrix, D_menu_801AFCD8[i].scale, D_menu_801AFCD8[i].scale, D_menu_801AFCD8[i].scale, 1); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801B6A80, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801AFCD8[i].scale, D_menu_801AFCD8[i].scale, D_menu_801AFCD8[i].scale, + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5271,8 +5273,8 @@ void Map_801A9448(void) { dest.y = 0.0f; dest.z = 100.0f; - Matrix_RotateY(gCalcMatrix, M_DTOR * (-D_menu_801CDA10 - y1), 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * (-D_menu_801CDA0C - x1), 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * (-D_menu_801CDA10 - y1), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * (-D_menu_801CDA0C - x1), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &dest, &src); Lights_SetOneLight(&gMasterDisp, src.x, src.y, src.z, 80, 80, 60, 0, 0, 0); @@ -5288,8 +5290,8 @@ void Map_801A9814(void) { if (D_menu_801B8280 != 0) { Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, D_menu_801CD9F4, D_menu_801CD9F8, D_menu_801CD9FC, D_menu_801CDA00, D_menu_801CDA04, - D_menu_801CDA08, D_menu_801CDA20, D_menu_801CDA24, D_menu_801CDA28, 1); - Matrix_Translate(gGfxMatrix, D_menu_801CEA58, D_menu_801CEA5C, D_menu_801CEA60, 1); + D_menu_801CDA08, D_menu_801CDA20, D_menu_801CDA24, D_menu_801CDA28, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, D_menu_801CEA58, D_menu_801CEA5C, D_menu_801CEA60, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); func_fade_80084688(2, D_menu_801B8284); Matrix_Pop(&gGfxMatrix); @@ -5486,7 +5488,7 @@ void Map_801A9FD4(s32 arg0) { Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5606,9 +5608,9 @@ void Map_801AA778(s32 arg0, f32 x, f32 y, PlanetId planetId) { gDPSetEnvColor(gMasterDisp++, 31, 0, 0, 0); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * (sPlanets[planetId].orbit.tilt), 1); - Matrix_Scale(gGfxMatrix, 0.11f, 0.11f, 0.11f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * (sPlanets[planetId].orbit.tilt), MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.11f, 0.11f, 0.11f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801B68F8[sPlanets[planetId].id]); @@ -5616,7 +5618,7 @@ void Map_801AA778(s32 arg0, f32 x, f32 y, PlanetId planetId) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 128); gDPSetEnvColor(gMasterDisp++, 31, 0, 0, 0); - Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, 1); + Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801B68F8[sPlanets[planetId].id]); @@ -5633,15 +5635,15 @@ void Map_801AA778(s32 arg0, f32 x, f32 y, PlanetId planetId) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x - 0.4f, y + 0.9f, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, 1); - Matrix_Scale(gGfxMatrix, 0.1f, 0.1f, 0.1f, 1); + Matrix_Translate(gGfxMatrix, x - 0.4f, y + 0.9f, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.1f, 0.1f, 0.1f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801B68F8[sPlanets[planetId].id]); - Matrix_Translate(gGfxMatrix, 18.0f, -20.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 18.0f, -20.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5660,9 +5662,9 @@ void Map_801AA778(s32 arg0, f32 x, f32 y, PlanetId planetId) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, 1); - Matrix_Scale(gGfxMatrix, 0.09f, 0.09f, 0.09f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.09f, 0.09f, 0.09f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5680,11 +5682,11 @@ void Map_801AA778(s32 arg0, f32 x, f32 y, PlanetId planetId) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFFF4, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, 1); - Matrix_Scale(gGfxMatrix, 0.004f, 0.004f, 0.004f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFFF4, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.004f, 0.004f, 0.004f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5702,11 +5704,11 @@ void Map_801AA778(s32 arg0, f32 x, f32 y, PlanetId planetId) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFFFC, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, 1); - Matrix_Scale(gGfxMatrix, 0.003f, 0.003f, 0.003f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801AFFFC, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.003f, 0.003f, 0.003f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5724,9 +5726,9 @@ void Map_801AA778(s32 arg0, f32 x, f32 y, PlanetId planetId) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, 1); - Matrix_Scale(gGfxMatrix, 0.1f, 0.1f, 0.1f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * sPlanets[planetId].orbit.tilt, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.1f, 0.1f, 0.1f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -5742,7 +5744,7 @@ void Map_801AA778(s32 arg0, f32 x, f32 y, PlanetId planetId) { } gSPDisplayList(gMasterDisp++, D_menu_801B4A40); } - Matrix_Scale(gGfxMatrix, 1.6f, 1.6f, 1.6f, 1); + Matrix_Scale(gGfxMatrix, 1.6f, 1.6f, 1.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MAP_605C230); } @@ -5766,8 +5768,8 @@ void Map_801AB17C(f32 x, f32 y, f32 z) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x - xPos, y + yPos, z, 1); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Translate(gGfxMatrix, x - xPos, y + yPos, z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MAP_601D1F0); @@ -6016,7 +6018,7 @@ void Map_801ABCDC(s32 arg0, s32 alpha) { Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -400.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -400.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -6027,9 +6029,9 @@ void Map_801ABCDC(s32 arg0, s32 alpha) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801B6B24[arg0], -35.0f, -400.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * -40.0f, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, D_menu_801B6B24[arg0], -35.0f, -400.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * -40.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -6038,9 +6040,9 @@ void Map_801ABCDC(s32 arg0, s32 alpha) { Matrix_Pop(&gGfxMatrix); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801B6B24[arg0], -35.0f, -400.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * 40.0f, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, D_menu_801B6B24[arg0], -35.0f, -400.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * 40.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -6053,7 +6055,7 @@ void Map_801ABCDC(s32 arg0, s32 alpha) { void Map_801ABF1C(void) { Matrix_Push(&gGfxMatrix); { - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -400.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -400.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -6061,12 +6063,12 @@ void Map_801ABF1C(void) { Matrix_Push(&gGfxMatrix); { - Matrix_Translate(gGfxMatrix, D_menu_801CEA88, D_menu_801CEA8C, D_menu_801CEA90, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801CEA94, 1); + Matrix_Translate(gGfxMatrix, D_menu_801CEA88, D_menu_801CEA8C, D_menu_801CEA90, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801CEA94, MTXF_APPLY); Map_801AD048(); - Matrix_Scale(gGfxMatrix, D_menu_801CEA78, D_menu_801CEA7C, 1.0f, 1); + Matrix_Scale(gGfxMatrix, D_menu_801CEA78, D_menu_801CEA7C, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -6085,12 +6087,12 @@ void Map_801ABF1C(void) { Matrix_Push(&gGfxMatrix); { - Matrix_Translate(gGfxMatrix, D_menu_801CEA88, D_menu_801CEA8C - 1.5f, D_menu_801CEA90, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801CEA94, 1); + Matrix_Translate(gGfxMatrix, D_menu_801CEA88, D_menu_801CEA8C - 1.5f, D_menu_801CEA90, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801CEA94, MTXF_APPLY); Map_801AD048(); - Matrix_Scale(gGfxMatrix, D_menu_801CEA80, D_menu_801CEA84, 3.3f, 1); + Matrix_Scale(gGfxMatrix, D_menu_801CEA80, D_menu_801CEA84, 3.3f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -6219,13 +6221,13 @@ void Map_801AC530(s32 index) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801CEEB0.x, D_menu_801CEEB0.y, D_menu_801CEEB0.z, 1); + Matrix_Translate(gGfxMatrix, D_menu_801CEEB0.x, D_menu_801CEEB0.y, D_menu_801CEEB0.z, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, gTexturedLines[index].unk_20, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * -90.0f, 1); - Matrix_RotateX(gGfxMatrix, gTexturedLines[index].unk_1C, 1); + Matrix_RotateY(gGfxMatrix, gTexturedLines[index].unk_20, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * -90.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, gTexturedLines[index].unk_1C, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, 1); + Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -6242,8 +6244,8 @@ void Map_801AC530(s32 index) { src.y = 0.0f; src.z = 10.0f; - Matrix_RotateY(gCalcMatrix, M_DTOR * (-D_menu_801CDA10 - y1), 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * (-D_menu_801CDA0C - x1), 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * (-D_menu_801CDA10 - y1), MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * (-D_menu_801CDA0C - x1), MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &src, &dest); dirX = dest.x; @@ -6280,12 +6282,12 @@ void Map_801AC80C(PathType pathType) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801CEEB0.x, D_menu_801CEEB0.y, D_menu_801CEEB0.z, 1); + Matrix_Translate(gGfxMatrix, D_menu_801CEEB0.x, D_menu_801CEEB0.y, D_menu_801CEEB0.z, MTXF_APPLY); Map_801AD048(); - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801B6B30, 1); - Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801B6B30, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 10.0f, 10.0f, 10.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -6543,8 +6545,8 @@ void Map_801AD048(void) { sqrtf(SQ(D_menu_801CD9F4 - D_menu_801CDA00) + SQ(D_menu_801CD9FC - D_menu_801CDA08))); f32 temp = -Math_Atan2F(D_menu_801CD9F4 - D_menu_801CDA00, D_menu_801CD9FC - D_menu_801CDA08); - Matrix_RotateY(gGfxMatrix, -temp, 1); - Matrix_RotateX(gGfxMatrix, -sp1C, 1); + Matrix_RotateY(gGfxMatrix, -temp, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -sp1C, MTXF_APPLY); } void Map_801AD11C(void) { @@ -6700,9 +6702,9 @@ void Map_801AD718(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg5, sp20.y = 0.0f; sp20.z = arg6; - Matrix_Translate(gCalcMatrix, arg0, arg1, arg2, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * arg8, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg7, 1); + Matrix_Translate(gCalcMatrix, arg0, arg1, arg2, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg8, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg7, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp20, &sp2C); *arg3 = sp2C.x; diff --git a/src/overlays/ovl_menu/fox_option.c b/src/overlays/ovl_menu/fox_option.c index 3536c47f..44989908 100644 --- a/src/overlays/ovl_menu/fox_option.c +++ b/src/overlays/ovl_menu/fox_option.c @@ -1775,7 +1775,7 @@ void Option_ExpertSoundDraw(void) { RCP_SetupDL(&gMasterDisp, 5); Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); for (var_fs0 = D_menu_801AF004, i = 0; i < 32; i++, var_fs0 += D_menu_801AF010) { @@ -1786,8 +1786,8 @@ void Option_ExpertSoundDraw(void) { gDPSetPrimColor(gMasterDisp++, 0, 0, (s32) r, (s32) g, (s32) b, 255); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, var_fs0, D_menu_801AF078[spectrumAnalizerMode], D_menu_801AF008, 1); - Matrix_Scale(gGfxMatrix, D_menu_801AF00C, D_menu_801B9298[i], 1.0f, 1); + Matrix_Translate(gGfxMatrix, var_fs0, D_menu_801AF078[spectrumAnalizerMode], D_menu_801AF008, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801AF00C, D_menu_801B9298[i], 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AF06C[spectrumAnalizerMode]); @@ -2230,8 +2230,8 @@ void Option_80197914(void) { for (i = 0, vec1 = D_menu_801AF100, vec2 = D_menu_801AF118; i < 2; i++, vec1++, vec2++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, vec1->x, vec1->y, -500.0f, 1); - Matrix_Scale(gGfxMatrix, vec2->x, vec2->y, 1.0f, 1); + Matrix_Translate(gGfxMatrix, vec1->x, vec1->y, -500.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, vec2->x, vec2->y, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEF30); Matrix_Pop(&gGfxMatrix); @@ -2449,7 +2449,7 @@ void Option_8019896C(s32 arg0, f32 y, s32 arg2) { s32 pad[2]; Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); Lib_InitOrtho(&gMasterDisp); @@ -2466,15 +2466,15 @@ void Option_8019896C(s32 arg0, f32 y, s32 arg2) { gDPSetEnvColor(gMasterDisp++, 31, 0, 0, 0); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801AF130, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801AF130, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 128); gDPSetEnvColor(gMasterDisp++, 31, 0, 0, 0); - Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, 1); + Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); Matrix_Pop(&gGfxMatrix); @@ -2486,13 +2486,13 @@ void Option_8019896C(s32 arg0, f32 y, s32 arg2) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x - 1.0f, y + 4.0f, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); + Matrix_Translate(gGfxMatrix, x - 1.0f, y + 4.0f, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); - Matrix_Translate(gGfxMatrix, 18.0f, -20.0f, 0.0f, 1); + Matrix_Translate(gGfxMatrix, 18.0f, -20.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); @@ -2508,8 +2508,8 @@ void Option_8019896C(s32 arg0, f32 y, s32 arg2) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 144); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); @@ -2522,9 +2522,9 @@ void Option_8019896C(s32 arg0, f32 y, s32 arg2) { Lights_SetOneLight(&gMasterDisp, 0, 0, 100, 100, 100, 70, 100, 100, 100); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, 1); - Matrix_Scale(gGfxMatrix, 0.01f, 0.01f, 0.01f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.01f, 0.01f, 0.01f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); @@ -2537,9 +2537,9 @@ void Option_8019896C(s32 arg0, f32 y, s32 arg2) { Lights_SetOneLight(&gMasterDisp, 0, 0, 100, 100, 100, 70, 100, 100, 100); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, 1); - Matrix_Scale(gGfxMatrix, 0.01f, 0.01f, 0.01f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 20.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.01f, 0.01f, 0.01f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); @@ -2553,8 +2553,8 @@ void Option_8019896C(s32 arg0, f32 y, s32 arg2) { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, 0.0f, 1); - Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); + Matrix_Translate(gGfxMatrix, x, y, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); @@ -2568,7 +2568,7 @@ void Option_8019896C(s32 arg0, f32 y, s32 arg2) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_menu_801B4A40); } - Matrix_Scale(gGfxMatrix, 1.6f, 1.6f, 1.6f, 1); + Matrix_Scale(gGfxMatrix, 1.6f, 1.6f, 1.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MAP_605C230); @@ -2599,8 +2599,8 @@ static f32 D_menu_801AF144 = 2.7f; void Option_80199198(f32 arg0, f32 arg1, f32 arg2) { RCP_SetupDL(&gMasterDisp, 0x35); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, arg0 - D_menu_801AF140, arg1 + D_menu_801AF144, arg2, 1); - Matrix_Scale(gGfxMatrix, D_menu_801AF13C, D_menu_801AF13C, D_menu_801AF13C, 1); + Matrix_Translate(gGfxMatrix, arg0 - D_menu_801AF140, arg1 + D_menu_801AF144, arg2, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801AF13C, D_menu_801AF13C, D_menu_801AF13C, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_MAP_601D1F0); Matrix_Pop(&gGfxMatrix); @@ -3483,9 +3483,9 @@ void Option_DrawMenuCard(MenuContext_38 arg0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, arg0.unk_00, arg0.unk_04, arg0.unk_08, 1); - Matrix_Scale(gGfxMatrix, arg0.unk_0C, arg0.unk_10, 1.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 90.0f, 1); + Matrix_Translate(gGfxMatrix, arg0.unk_00, arg0.unk_04, arg0.unk_08, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, arg0.unk_0C, arg0.unk_10, 1.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 90.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3515,11 +3515,11 @@ void Option_8019BC44(f32 x, f32 y, f32 arg2, f32 arg3, f32 arg4, f32 arg5) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, arg2, 1); + Matrix_Translate(gGfxMatrix, x, y, arg2, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, arg5, arg5, arg5, 1); - Matrix_RotateZ(gGfxMatrix, M_DTOR * arg4, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * arg3, 1); + Matrix_Scale(gGfxMatrix, arg5, arg5, arg5, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_DTOR * arg4, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * arg3, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3532,7 +3532,8 @@ void Option_8019BC44(f32 x, f32 y, f32 arg2, f32 arg3, f32 arg4, f32 arg5) { void Option_8019BDF0(void) { Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, gCsCamEyeX, gCsCamEyeY, gCsCamEyeZ, gCsCamAtX, gCsCamAtY, gCsCamAtZ, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, gCsCamEyeX, gCsCamEyeY, gCsCamEyeZ, gCsCamAtX, gCsCamAtY, gCsCamAtZ, 0.0f, 1.0f, 0.0f, + MTXF_APPLY); } void Option_8019BE7C(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg5) { @@ -3543,8 +3544,8 @@ void Option_8019BE7C(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* ar sp18.y = 0.0f; sp18.z = arg2; - Matrix_RotateY(gCalcMatrix, M_DTOR * arg1, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg0, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg1, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg0, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp18, &sp24); *arg3 = sp24.x; @@ -3586,8 +3587,8 @@ void Option_8019C04C(void) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801B9204, D_menu_801B9208, 0.0f, 1); - Matrix_Scale(gGfxMatrix, D_menu_801B920C, D_menu_801B9210, 1.0f, 1); + Matrix_Translate(gGfxMatrix, D_menu_801B9204, D_menu_801B9208, 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801B920C, D_menu_801B9210, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4116,7 +4117,7 @@ void Option_8019D118(void) { Matrix_Push(&gGfxMatrix); - Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 0.0f, 1.0f, 0.0f, 1); + Matrix_LookAt(gGfxMatrix, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 0.0f, 1.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -4269,13 +4270,13 @@ void Option_8019DB20(s32 character, f32 x, f32 y, f32 z, f32 scale, f32 xAngle, Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, z, 1); + Matrix_Translate(gGfxMatrix, x, y, z, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, M_DTOR * zAngle, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * xAngle, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * yAngle, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * zAngle, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * xAngle, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * yAngle, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); diff --git a/src/overlays/ovl_menu/fox_title.c b/src/overlays/ovl_menu/fox_title.c index 9b4fc259..f40bb2f3 100644 --- a/src/overlays/ovl_menu/fox_title.c +++ b/src/overlays/ovl_menu/fox_title.c @@ -2243,14 +2243,14 @@ void Title_8018D2B8(s32 arg0) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_menu_801B84E8[arg0].unk_00.x, D_menu_801B84E8[arg0].unk_00.y, - D_menu_801B84E8[arg0].unk_00.z, 1); + D_menu_801B84E8[arg0].unk_00.z, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_menu_801B84E8[arg0].unk_0C, D_menu_801B84E8[arg0].unk_0C, D_menu_801B84E8[arg0].unk_0C, - 1); + MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, D_menu_801B84E8[arg0].unk_20 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, D_menu_801B84E8[arg0].unk_18 * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, D_menu_801B84E8[arg0].unk_1C * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, D_menu_801B84E8[arg0].unk_20 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, D_menu_801B84E8[arg0].unk_18 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_menu_801B84E8[arg0].unk_1C * M_DTOR, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2259,7 +2259,7 @@ void Title_8018D2B8(s32 arg0) { wings.unk_10 = wings.unk_28 = 0.0f; wings.unk_14 = D_menu_801B84E8[arg0].unk_28; - wings.unk_2C = D_menu_801B84E8[arg0].unk_34; + wings.modelId = D_menu_801B84E8[arg0].unk_34; wings.unk_30 = D_menu_801B84E8[arg0].unk_2C; wings.unk_34 = D_menu_801B84E8[arg0].unk_30; wings.unk_38 = D_menu_801B84E8[arg0].unk_24; @@ -2311,19 +2311,19 @@ void Title_8018D510(s32 arg0) { } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, var_fa0, 1); - Matrix_Scale(gGfxMatrix, var_fv0, var_fv0 * 0.7f, var_fv0, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, var_fa0, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, var_fv0, var_fv0 * 0.7f, var_fv0, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, -D_menu_801B84E8[arg0].unk_20 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -D_menu_801B84E8[arg0].unk_18 * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -D_menu_801B84E8[arg0].unk_1C * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, -D_menu_801B84E8[arg0].unk_20 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -D_menu_801B84E8[arg0].unk_18 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -D_menu_801B84E8[arg0].unk_1C * M_DTOR, MTXF_APPLY); sp3C = -Math_Atan2F(gCsCamEyeX - D_menu_801B84E8[arg0].unk_00.x, gCsCamEyeZ - D_menu_801B84E8[arg0].unk_00.z); temp = sqrtf(SQ(gCsCamEyeZ - D_menu_801B84E8[arg0].unk_00.z) + SQ(gCsCamEyeX - D_menu_801B84E8[arg0].unk_00.x)); sp40 = Math_Atan2F(gCsCamEyeY - D_menu_801B84E8[arg0].unk_00.y, temp); - Matrix_RotateY(gGfxMatrix, -sp3C, 1); - Matrix_RotateX(gGfxMatrix, -sp40, 1); + Matrix_RotateY(gGfxMatrix, -sp3C, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -sp40, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPClearGeometryMode(gMasterDisp++, G_CULL_BACK); @@ -2390,15 +2390,15 @@ void Title_8018D80C(s32 arg0) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801B7D40[i], D_menu_801B7DE0[i], D_menu_801B7E80[i], 1); - Matrix_Scale(gGfxMatrix, D_menu_801B7FC0[i], D_menu_801B7FC0[i], D_menu_801B7FC0[i], 1); + Matrix_Translate(gGfxMatrix, D_menu_801B7D40[i], D_menu_801B7DE0[i], D_menu_801B7E80[i], MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801B7FC0[i], D_menu_801B7FC0[i], D_menu_801B7FC0[i], MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, -D_menu_801B84E8[arg0].unk_20 * M_DTOR, 1); - Matrix_RotateX(gGfxMatrix, -D_menu_801B84E8[arg0].unk_18 * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, -D_menu_801B84E8[arg0].unk_1C * M_DTOR, 1); + Matrix_RotateZ(gGfxMatrix, -D_menu_801B84E8[arg0].unk_20 * M_DTOR, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -D_menu_801B84E8[arg0].unk_18 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, -D_menu_801B84E8[arg0].unk_1C * M_DTOR, MTXF_APPLY); - Matrix_RotateY(gGfxMatrix, -sp6C, 1); - Matrix_RotateX(gGfxMatrix, -sp70, 1); + Matrix_RotateY(gGfxMatrix, -sp6C, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, -sp70, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2412,9 +2412,9 @@ void Title_8018DDB8(s32 arg0) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, 0.0f, (D_menu_801B9050 - D_menu_801B84E8[arg0].unk_00.y * 2.05f) + (D_menu_801B9048 - 84.0f) * 1.99f, - 0.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); - Matrix_RotateY(gGfxMatrix, M_PI, 1); + 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_PI, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL_64(); @@ -2437,10 +2437,10 @@ void Title_8018DF0C(f32 arg0) { } Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801B8688.pos.x, D_menu_801B8688.pos.y, D_menu_801B8688.pos.z, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * sp30, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * sp34, 1); - Matrix_Scale(gGfxMatrix, D_menu_801B8688.scale, D_menu_801B8688.scale, D_menu_801B8688.scale, 1); + Matrix_Translate(gGfxMatrix, D_menu_801B8688.pos.x, D_menu_801B8688.pos.y, D_menu_801B8688.pos.z, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * sp30, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * sp34, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801B8688.scale, D_menu_801B8688.scale, D_menu_801B8688.scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_6037CF0); @@ -2454,13 +2454,13 @@ void Title_8018E058(void) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801B8658.pos.x, D_menu_801B8658.pos.y, D_menu_801B8658.pos.z, 1); + Matrix_Translate(gGfxMatrix, D_menu_801B8658.pos.x, D_menu_801B8658.pos.y, D_menu_801B8658.pos.z, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801B8658.angleZ, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801B8658.angleX, 1); - Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801B8658.angleY, 1); + Matrix_RotateZ(gGfxMatrix, M_DTOR * D_menu_801B8658.angleZ, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * D_menu_801B8658.angleX, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, M_DTOR * D_menu_801B8658.angleY, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, D_menu_801B8658.scale, D_menu_801B8658.scale, D_menu_801B8658.scale, 1); + Matrix_Scale(gGfxMatrix, D_menu_801B8658.scale, D_menu_801B8658.scale, D_menu_801B8658.scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); RCP_SetupDL(&gMasterDisp, 0x17); @@ -2531,10 +2531,10 @@ void Title_8018E200(void) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 5.0f, 1); - Matrix_RotateZ(gGfxMatrix, D_menu_801B7C20[i] * M_DTOR, 1); - Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801B7BF8[i], 0.0f, 1); - Matrix_Scale(gGfxMatrix, scale, scale, scale, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 5.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_menu_801B7C20[i] * M_DTOR, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801B7BF8[i], 0.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, scale, scale, scale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2559,8 +2559,8 @@ void Title_8018E67C(s32 arg0) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_menu_801B8350[arg0].unk_00.x, D_menu_801B8350[arg0].unk_00.y, - D_menu_801B8350[arg0].unk_00.z + D_menu_801B84D0, 1); - Matrix_Scale(gGfxMatrix, D_menu_801B84D4, D_menu_801B84D4, D_menu_801B84D4, 1); + D_menu_801B8350[arg0].unk_00.z + D_menu_801B84D0, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801B84D4, D_menu_801B84D4, D_menu_801B84D4, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); if (arg0 == 2) { @@ -2582,10 +2582,10 @@ void Title_8018E67C(s32 arg0) { Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, D_menu_801B8350[arg0].unk_00.x - 5.0f, 5.0f, - D_menu_801B8350[arg0].unk_00.z + 10.0f + D_menu_801B84D0, 1); + D_menu_801B8350[arg0].unk_00.z + 10.0f + D_menu_801B84D0, MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_menu_801B8350[arg0].unk_10, D_menu_801B8350[arg0].unk_10, D_menu_801B8350[arg0].unk_10, - 1); + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2621,13 +2621,13 @@ void Title_8018EA78(s32 arg0) { Matrix_Push(&gGfxMatrix); - Matrix_RotateX(gGfxMatrix, D_menu_801B8350[arg0].unk_48 * M_DTOR, 1); - Matrix_RotateY(gGfxMatrix, D_menu_801B8350[arg0].unk_4C * M_DTOR, 1); - Matrix_RotateZ(gGfxMatrix, D_menu_801B8350[arg0].unk_50 * M_DTOR, 1); + Matrix_RotateX(gGfxMatrix, D_menu_801B8350[arg0].unk_48 * M_DTOR, MTXF_APPLY); + Matrix_RotateY(gGfxMatrix, D_menu_801B8350[arg0].unk_4C * M_DTOR, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, D_menu_801B8350[arg0].unk_50 * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, D_menu_801B8350[arg0].unk_00.x, D_menu_801B8350[arg0].unk_00.y, - D_menu_801B8350[arg0].unk_00.z, 1); - Matrix_Scale(gGfxMatrix, D_menu_801B84D4, D_menu_801B84D4, D_menu_801B84D4, 1); + D_menu_801B8350[arg0].unk_00.z, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801B84D4, D_menu_801B84D4, D_menu_801B84D4, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -2793,18 +2793,18 @@ void Title_8018F438(void) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, (3079.2002f * sp54) - D_menu_801B82C8, 1); - Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, (3079.2002f * sp54) - D_menu_801B82C8, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.6f, 0.6f, 0.6f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_602E380); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -6836.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -6836.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_602E380); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -6836.0f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -6836.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_602E380); @@ -2827,9 +2827,9 @@ void Title_8018F680(void) { void Title_8018F77C(void) { RCP_SetupDL(&gMasterDisp, 0x35); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801B905C, D_menu_801B9060, D_menu_801B9064, 1); - Matrix_Scale(gGfxMatrix, D_menu_801B9068, D_menu_801B906C, 1.0f, 1); - Matrix_RotateX(gGfxMatrix, M_DTOR * 90, 1); + Matrix_Translate(gGfxMatrix, D_menu_801B905C, D_menu_801B9060, D_menu_801B9064, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, D_menu_801B9068, D_menu_801B906C, 1.0f, MTXF_APPLY); + Matrix_RotateX(gGfxMatrix, M_DTOR * 90, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_60148D0); Matrix_Pop(&gGfxMatrix); @@ -3024,12 +3024,12 @@ void Title_80190144(void) { gDPSetColorDither(gMasterDisp++, G_CD_NOISE); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, 1); + Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, MTXF_APPLY); for (i = 0; i < 4; i++) { Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, D_menu_801AE4EC[i] * 0.5f, D_menu_801AE4EC[i] * 0.5f, D_menu_801AE4EC[i] * 0.5f, - 1); + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, D_menu_801AE51C[i], D_menu_801AE528[i]); @@ -3066,13 +3066,14 @@ void Title_801903B8(void) { var_fs1 *= 0.5f; Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, 1); + Matrix_Translate(gGfxMatrix, D_ctx_801783D0, D_ctx_801783D4, -200.0f, MTXF_APPLY); for (i = 4; i < 12; i++) { Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801AE4BC[i] * temp_fs3, -D_menu_801AE4BC[i] * temp_fs4, 0.0f, 1); + Matrix_Translate(gGfxMatrix, D_menu_801AE4BC[i] * temp_fs3, -D_menu_801AE4BC[i] * temp_fs4, 0.0f, + MTXF_APPLY); Matrix_Scale(gGfxMatrix, D_menu_801AE4EC[i] * 0.5f, D_menu_801AE4EC[i] * 0.5f, D_menu_801AE4EC[i] * 0.5f, - 1); + MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); @@ -3125,8 +3126,8 @@ void Title_80190950(void) { RCP_SetupDL(&gMasterDisp, 0x17); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801B9048, D_menu_801B904C, 1); - Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 0.4f, 1); + Matrix_Translate(gGfxMatrix, 0.0f, D_menu_801B9048, D_menu_801B904C, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.4f, 0.4f, 0.4f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_6018D40); @@ -3139,8 +3140,8 @@ void Title_80190950(void) { } void Title_80190A98(void) { - Matrix_Translate(gGfxMatrix, 401.0f, -249.0f, -22.0f, 1); - Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, 1); + Matrix_Translate(gGfxMatrix, 401.0f, -249.0f, -22.0f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_602A720); } @@ -3151,8 +3152,8 @@ void Title_80190B30(s32 arg0) { RCP_SetupDL(&gMasterDisp, 0x17); Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, D_menu_801B84E8[arg0].unk_00.x, -12.8f, D_menu_801B9044, 1); - Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, 1); + Matrix_Translate(gGfxMatrix, D_menu_801B84E8[arg0].unk_00.x, -12.8f, D_menu_801B9044, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_TITLE_601C7C0); @@ -3344,9 +3345,9 @@ void Title_80191320(s32 arg0, f32* arg1, f32* arg2, f32* arg3, f32* arg4, f32* a sp48.y = 0.0f; sp48.z = arg9; - Matrix_Translate(gCalcMatrix, *var_v0, *var_v1, *var_t0, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * arg8, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg7, 1); + Matrix_Translate(gCalcMatrix, *var_v0, *var_v1, *var_t0, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg8, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg7, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp48, &sp54); *sp44 = sp54.x; @@ -3357,8 +3358,8 @@ void Title_80191320(s32 arg0, f32* arg1, f32* arg2, f32* arg3, f32* arg4, f32* a sp48.y = 1.0f; sp48.z = 0.0f; - Matrix_RotateY(gCalcMatrix, M_DTOR * arg8, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg7, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg8, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg7, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp48, &sp54); D_menu_801B829C = sp54.x; @@ -3375,10 +3376,10 @@ void Title_801914AC(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg sp38.y = 0.0f; sp38.z = argA; - Matrix_Translate(gCalcMatrix, arg0, arg1, arg2, 0); + Matrix_Translate(gCalcMatrix, arg0, arg1, arg2, MTXF_NEW); - Matrix_RotateY(gCalcMatrix, M_DTOR * argC, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * argB, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * argC, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * argB, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp38, &sp44); @@ -3390,9 +3391,9 @@ void Title_801914AC(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg sp38.y = 0.0f; sp38.z = arg6; - Matrix_Translate(gCalcMatrix, arg0, arg1, arg2, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * argC, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * argB, 1); + Matrix_Translate(gCalcMatrix, arg0, arg1, arg2, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * argC, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * argB, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp38, &sp44); *arg3 = sp44.x; @@ -3403,8 +3404,8 @@ void Title_801914AC(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg sp38.y = 1.0f; sp38.z = 0.0f; - Matrix_RotateY(gCalcMatrix, M_DTOR * argC, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * argB, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * argC, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * argB, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp38, &sp44); D_menu_801B829C = sp44.x; @@ -3424,10 +3425,10 @@ void Title_80191674(f32 arg0, f32 arg1, f32 arg2, f32* arg3, f32* arg4, f32* arg Title_80191798(&sp34, &sp30); - Matrix_RotateX(gCalcMatrix, M_DTOR * -sp34, 0); - Matrix_RotateY(gCalcMatrix, M_DTOR * -sp30, 1); - Matrix_RotateY(gCalcMatrix, M_DTOR * arg1, 1); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg0, 1); + Matrix_RotateX(gCalcMatrix, M_DTOR * -sp34, MTXF_NEW); + Matrix_RotateY(gCalcMatrix, M_DTOR * -sp30, MTXF_APPLY); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg1, MTXF_APPLY); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg0, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp18, &sp24); @@ -3453,8 +3454,8 @@ void Title_80191844(f32 arg0, f32 arg1) { sp18.y = 1.0f; sp18.z = 0.0f; - Matrix_RotateY(gCalcMatrix, M_DTOR * arg1, 0); - Matrix_RotateX(gCalcMatrix, M_DTOR * arg0, 1); + Matrix_RotateY(gCalcMatrix, M_DTOR * arg1, MTXF_NEW); + Matrix_RotateX(gCalcMatrix, M_DTOR * arg0, MTXF_APPLY); Matrix_MultVec3f(gCalcMatrix, &sp18, &sp24); @@ -3466,8 +3467,8 @@ void Title_80191844(f32 arg0, f32 arg1) { void Title_801918FC(void) { Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, gCsCamEyeX, gCsCamEyeY, gCsCamEyeZ, gCsCamAtX, gCsCamAtY, gCsCamAtZ, D_menu_801B829C, - D_menu_801B82A0, D_menu_801B82A4, 1); - Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, 1); + D_menu_801B82A0, D_menu_801B82A4, MTXF_APPLY); + Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); } diff --git a/src/sys/sys_matrix.c b/src/sys/sys_matrix.c index f50cfb64..6de74e22 100644 --- a/src/sys/sys_matrix.c +++ b/src/sys/sys_matrix.c @@ -50,7 +50,7 @@ void Matrix_Pop(Matrix** mtxStack) { *mtxStack -= 1; } -// Copies tf into mtx (MTXMODE_NEW) or applies it to mtx (MTXMODE_APPLY) +// Copies tf into mtx (MTXF_NEW) or applies it to mtx (MTXF_APPLY) void Matrix_Mult(Matrix* mtx, Matrix* tf, u8 mode) { f32 rx; f32 ry; @@ -102,7 +102,7 @@ void Matrix_Mult(Matrix* mtx, Matrix* tf, u8 mode) { } } -// Creates a translation matrix in mtx (MTXMODE_NEW) or applies one to mtx (MTXMODE_APPLY) +// Creates a translation matrix in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) void Matrix_Translate(Matrix* mtx, f32 x, f32 y, f32 z, u8 mode) { f32 rx; f32 ry; @@ -125,7 +125,7 @@ void Matrix_Translate(Matrix* mtx, f32 x, f32 y, f32 z, u8 mode) { } } -// Creates a scale matrix in mtx (MTXMODE_NEW) or applies one to mtx (MTXMODE_APPLY) +// Creates a scale matrix in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) void Matrix_Scale(Matrix* mtx, f32 xScale, f32 yScale, f32 zScale, u8 mode) { f32 rx; f32 ry; @@ -150,7 +150,7 @@ void Matrix_Scale(Matrix* mtx, f32 xScale, f32 yScale, f32 zScale, u8 mode) { } } -// Creates rotation matrix about the X axis in mtx (MTXMODE_NEW) or applies one to mtx (MTXMODE_APPLY) +// Creates rotation matrix about the X axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) void Matrix_RotateX(Matrix* mtx, f32 angle, u8 mode) { f32 cs; f32 sn; @@ -178,7 +178,7 @@ void Matrix_RotateX(Matrix* mtx, f32 angle, u8 mode) { } } -// Creates rotation matrix about the Y axis in mtx (MTXMODE_NEW) or applies one to mtx (MTXMODE_APPLY) +// Creates rotation matrix about the Y axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) void Matrix_RotateY(Matrix* mtx, f32 angle, u8 mode) { f32 cs; f32 sn; @@ -206,7 +206,7 @@ void Matrix_RotateY(Matrix* mtx, f32 angle, u8 mode) { } } -// Creates rotation matrix about the Z axis in mtx (MTXMODE_NEW) or applies one to mtx (MTXMODE_APPLY) +// Creates rotation matrix about the Z axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY) void Matrix_RotateZ(Matrix* mtx, f32 angle, u8 mode) { f32 cs; f32 sn; @@ -234,7 +234,7 @@ void Matrix_RotateZ(Matrix* mtx, f32 angle, u8 mode) { } } -// Creates rotation matrix about a given vector axis in mtx (MTXMODE_NEW) or applies one to mtx (MTXMODE_APPLY). +// Creates rotation matrix about a given vector axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY). // The vector specifying the axis does not need to be a unit vector. void Matrix_RotateAxis(Matrix* mtx, f32 angle, f32 axisX, f32 axisY, f32 axisZ, u8 mode) { f32 rx; @@ -458,8 +458,8 @@ void Matrix_GetYRPAngles(Matrix* mtx, Vec3f* rot) { xHatP.z -= originP.z; rot->y = Math_Atan2F(zHatP.x, zHatP.z); rot->x = -Math_Atan2F(zHatP.y, sqrtf(SQ(zHatP.x) + SQ(zHatP.z))); - Matrix_RotateX(&invYP, -rot->x, 0); - Matrix_RotateY(&invYP, -rot->y, 1); + Matrix_RotateX(&invYP, -rot->x, MTXF_NEW); + Matrix_RotateY(&invYP, -rot->y, MTXF_APPLY); Matrix_MultVec3fNoTranslate(&invYP, &xHatP, &xHat); rot->x *= M_RTOD; rot->y *= M_RTOD; @@ -488,15 +488,15 @@ void Matrix_GetXYZAngles(Matrix* mtx, Vec3f* rot) { yHatP.z -= originP.z; rot->z = Math_Atan2F(xHatP.y, xHatP.x); rot->y = -Math_Atan2F(xHatP.z, sqrtf(SQ(xHatP.x) + SQ(xHatP.y))); - Matrix_RotateY(&invYZ, -rot->y, 0); - Matrix_RotateZ(&invYZ, -rot->z, 1); + Matrix_RotateY(&invYZ, -rot->y, MTXF_NEW); + Matrix_RotateZ(&invYZ, -rot->z, MTXF_APPLY); Matrix_MultVec3fNoTranslate(&invYZ, &yHatP, &yHat); rot->x = Math_Atan2F(yHat.z, yHat.y) * M_RTOD; rot->y *= M_RTOD; rot->z *= M_RTOD; } -// Creates a look-at matrix from Eye, At, and Up in mtx (MTXMODE_NEW) or applies one to mtx (MTXMODE_APPLY). +// Creates a look-at matrix from Eye, At, and Up in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY). // A look-at matrix is a rotation-translation matrix that maps y to Up, z to (At - Eye), and translates to Eye void Matrix_LookAt(Matrix* mtx, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, u8 mode) {