diff options
| author | SonicDcer <alejandro.asenjo88@gmail.com> | 2026-06-15 03:13:19 -0300 |
|---|---|---|
| committer | SonicDcer <alejandro.asenjo88@gmail.com> | 2026-06-15 03:13:19 -0300 |
| commit | cee62dd2c39ecf9c032c573fabed1fbb08f9517a (patch) | |
| tree | 34594092ae41c0d92b2b05c0f52be1d8bd18a253 /src/engine | |
| parent | ed6604310a74c2207716a5bee32ae05d5fd00f7a (diff) | |
| parent | b96d7e4c530a11975b0f7a618253b9a0ea225880 (diff) | |
Merge branch 'main' of github.com:HarbourMasters/Starship
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/cutscene_record.c | 192 | ||||
| -rw-r--r-- | src/engine/fox_beam.c | 10 | ||||
| -rw-r--r-- | src/engine/fox_bg.c | 25 | ||||
| -rw-r--r-- | src/engine/fox_demo.c | 57 | ||||
| -rw-r--r-- | src/engine/fox_display.c | 109 | ||||
| -rw-r--r-- | src/engine/fox_edisplay.c | 34 | ||||
| -rw-r--r-- | src/engine/fox_effect.c | 3 | ||||
| -rw-r--r-- | src/engine/fox_enmy.c | 7 | ||||
| -rw-r--r-- | src/engine/fox_hud.c | 91 | ||||
| -rw-r--r-- | src/engine/fox_play.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_radio.c | 111 |
11 files changed, 444 insertions, 197 deletions
diff --git a/src/engine/cutscene_record.c b/src/engine/cutscene_record.c new file mode 100644 index 00000000..3bf8a512 --- /dev/null +++ b/src/engine/cutscene_record.c @@ -0,0 +1,192 @@ +#include "global.h" +#include "fox_record.h" + +void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames, int* frameCounter) { + int i; + + if (*frameCounter > record[maxFrames - 1].frame) { + return; + } + + for (i = 0; i < maxFrames; i++) { + if (*frameCounter == record[i].frame) { + gVIsPerFrame = record[i].vis; + } + } +} + +int gWarpzoneCsFrameCount = 0; +int gA6GorgonCsFrameCount = 0; + +// clang-format off + +Record gWarpzoneCsRecord[19] = { + { 2, 1 }, { 3, 3 }, { 4, 4 }, { 3, 8 }, { 2, 9 }, { 3, 52 }, { 2, 54 }, { 3, 69 }, { 2, 70 }, { 3, 75 }, + { 2, 76 }, { 3, 79 }, { 2, 117 }, { 3, 118 }, { 2, 120 }, { 3, 145 }, { 2, 215 }, { 3, 216 }, { 2, 230 }, +}; + +Record gA6GorgonCsRecord[12] = { + { 3, 0 }, { 4, 3 }, { 5, 6 }, { 4, 37 }, { 5, 38 }, { 4, 44 }, + { 3, 53 }, { 4, 54 }, { 3, 57 }, { 4, 58 }, { 3, 59 }, { 2, 170 }, +}; + +Record gEndingCsRecord[37] = { + { 2, 0 }, { 5, 1 }, { 2, 2 }, { 3, 277 }, { 2, 278 }, { 3, 340 }, { 2, 397 }, { 3, 537 }, + { 2, 538 }, { 3, 548 }, { 2, 549 }, { 3, 568 }, { 2, 569 }, { 3, 620 }, { 2, 623 }, { 3, 803 }, + { 2, 806 }, { 3, 814 }, { 2, 823 }, { 3, 1282 }, { 2, 1284 }, { 5, 3703 }, { 2, 3704 }, { 4, 3904 }, + { 2, 3905 }, { 3, 4782 }, { 2, 4783 }, { 3, 4785 }, { 2, 4820 }, { 3, 4986 }, { 2, 6779 }, { 5, 6780 }, + { 2, 6781 }, { 3, 6785 }, { 4, 6786 }, { 3, 6793 }, { 2, 6799 }, +}; + +// MeCrusher destroy cutscene timings recorded from a real N64 +Record gMeCrusherCutsceneRecord[3] = { + { 2, 0 }, + { 3, 200 }, + { 2, 224 }, +}; + +// Carrier destroy cutscene timings recorded from a real N64 +Record gCarrierCutsceneRecord[13] = { + { 2, 0 }, + { 3, 2 }, + { 4, 16 }, + { 3, 50 }, + { 4, 58 }, + { 5, 67 }, + { 4, 68 }, + { 5, 71 }, + { 4, 73 }, + { 5, 74 }, + { 4, 106 }, + { 3, 146 }, + { 2, 194 }, +}; + +// Granga destroy cutscene timings recorded from a real N64 +Record gGrangaCutsceneRecord[13] = { + { 2, 0 }, + { 3, 1 }, + { 2, 5 }, + { 3, 7 }, + { 2, 52 }, + { 3, 78 }, + { 4, 103 }, + { 3, 125 }, + { 2, 153 }, + { 3, 155 }, + { 2, 157 }, + { 3, 158 }, + { 2, 160 }, +}; + +// Train cutscene timings recorded from a real N64 +Record gMacbethCutsceneRecord[14] = { + // Train breaking barriers + { 2, 0 }, + { 3, 2 }, + { 2, 31 }, + { 3, 400 }, + { 2, 418 }, + { 3, 433 }, + { 4, 435 }, + { 3, 444 }, + { 2, 509 }, + // { 3, 559 }, + // { 2, 581 }, + // { 3, 587 }, + // Explosions + { 2, 589 }, + { 3, 714 }, + { 4, 821 }, + { 5, 849 }, + { 2, 942 }, +}; + +// After defeating Andross +Record gAndrossRobotKillCutscene1[25] = { + { 3, 0 }, + { 2, 8 }, + { 3, 19 }, + { 2, 35 }, + { 3, 156 }, + { 2, 166 }, + { 3, 193 }, + { 4, 198 }, + { 3, 199 }, + { 4, 201 }, + { 3, 205 }, + { 4, 207 }, + { 3, 215 }, + { 4, 234 }, + // { 3, 236 }, + { 4, 237 }, + { 3, 239 }, + { 4, 244 }, + // { 3, 245 }, + { 4, 246 }, + // { 3, 272 }, + { 4, 274 }, + // { 3, 290 }, + { 4, 292 }, + // { 3, 295 }, // too much? + { 4, 301 }, + // { 3, 302 }, + { 4, 304 }, + // { 3, 305 }, + { 4, 307 }, + // { 3, 332 }, + { 4, 334 }, + // { 3, 335 }, + { 2, 339 }, +}; + +Record gAndrossRobotKillCutscene2[20] = { + { 4, 0 }, + { 2, 1 }, + { 5, 2 }, + { 2, 3 }, + { 3, 42 }, + { 2, 43 }, + { 3, 57 }, + { 2, 58 }, + { 3, 63 }, + { 2, 69 }, + { 3, 158 }, + { 4, 161 }, + { 5, 163 }, + { 4, 182 }, + { 3, 185 }, + { 4, 189 }, + { 5, 193 }, + { 4, 205 }, + { 3, 207 }, + { 2, 211 }, +}; + +// SyRobot destroy cutscene timings recorded from a real N64 +Record gSyRobotCutsceneRecord[3] = { + { 2, 0 }, + { 3, 129 }, + { 2, 230 }, +}; + +Record gSolarIntroCsRecord[16] = { + { 2, 0 }, + { 3, 94 }, + { 2, 105 }, + { 3, 362 }, + { 4, 377 }, + { 3, 379 }, + { 4, 381 }, + { 2, 382 }, + { 3, 443 }, + { 2, 444 }, + { 3, 456 }, + { 2, 492 }, + { 3, 494 }, + { 2, 499 }, + { 3, 552 }, + { 2, 629 }, +}; + +// clang-format on diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index ae19d6f7..4006d4dc 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -1067,6 +1067,8 @@ void PlayerShot_DrawHitmark(PlayerShot* shot) { return; } } else { + FrameInterpolation_RecordOpenChild(shot, 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); @@ -1088,6 +1090,8 @@ void PlayerShot_DrawHitmark(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_1025800); break; } + + FrameInterpolation_RecordCloseChild(); } } @@ -1249,6 +1253,8 @@ void PlayerShot_DrawShot(PlayerShot* shot) { Object_Kill(&shot->obj, shot->sfxSource); } } else { + FrameInterpolation_RecordOpenChild(shot, 0); + if ((shot->obj.id == PLAYERSHOT_TANK) || (shot->obj.id == PLAYERSHOT_ON_FOOT) || (shot->obj.id == PLAYERSHOT_7)) { shot->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); @@ -1512,12 +1518,11 @@ void PlayerShot_DrawShot(PlayerShot* shot) { gSPDisplayList(gMasterDisp++, D_GREAT_FOX_E00DFB0); break; } + FrameInterpolation_RecordCloseChild(); } } void PlayerShot_Draw(PlayerShot* shot) { - FrameInterpolation_RecordOpenChild(shot, 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); switch (shot->obj.status) { case SHOT_ACTIVE: PlayerShot_DrawShot(shot); @@ -1526,7 +1531,6 @@ void PlayerShot_Draw(PlayerShot* shot) { PlayerShot_DrawHitmark(shot); break; } - FrameInterpolation_RecordCloseChild(); } void PlayerShot_UpdateHitmark(PlayerShot* shot) { diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 9cdb5f07..06f83608 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -308,7 +308,6 @@ void Background_DrawStarfield(void) { FrameInterpolation_ShouldInterpolateFrame(false); } else { FrameInterpolation_RecordOpenChild("Starfield", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } // Translate to (vx, vy) in ortho coordinates @@ -442,9 +441,8 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in // Check if the star is within the visible screen area if ((vx >= 0) && (vx < currentScreenWidth) && (yMin < vy) && (vy < yMax)) { - // Tag the transform. Assuming TAG_STARFIELD is a defined base tag value - FrameInterpolation_RecordOpenChild("SmallStarfield", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + + FrameInterpolation_RecordOpenChild("PartialStarfield", i); // Translate to (vx, vy) in ortho coordinates Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, vx - (currentScreenWidth / 2.0f), -(vy - (currentScreenHeight / 2.0f)), 0.0f, @@ -551,7 +549,6 @@ void Background_DrawBackdrop(void) { } else { // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Backdrop", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } switch (gCurrentLevel) { @@ -627,7 +624,6 @@ void Background_DrawBackdrop(void) { } else { // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Backdrop", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } switch ((s32) gCurrentLevel) { @@ -669,7 +665,6 @@ void Background_DrawBackdrop(void) { } else { // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Backdrop", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } if ((gDrawBackdrop == 2) || (gDrawBackdrop == 7)) { @@ -771,7 +766,6 @@ void Background_DrawBackdrop(void) { // Render the textures across the screen (left to right) for (int i = 0; i < 5; i++) { FrameInterpolation_RecordOpenChild("Backdrop", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); if (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) { gSPDisplayList(gMasterDisp++, D_AQ_601AFF0); } else { @@ -839,7 +833,6 @@ void Background_DrawBackdrop(void) { } else { // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Backdrop", i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); } if (gCurrentLevel == LEVEL_TITANIA) { @@ -1139,12 +1132,16 @@ void Background_DrawSun(void) { sunScale = sKaSunScales; } for (i = 0; i < 5; i++, sunColor++, sunAlpha++, sunDL++, sunScale++) { + FrameInterpolation_RecordOpenChild("Sun", i); + Matrix_Push(&gGfxMatrix); Matrix_Scale(gGfxMatrix, *sunScale, *sunScale, *sunScale, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, sunColor->r, sunColor->g, sunColor->b, *sunAlpha); gSPDisplayList(gMasterDisp++, *sunDL); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } Matrix_Pop(&gGfxMatrix); } @@ -1265,7 +1262,7 @@ void AllRangeGround_Draw(void) { // LOWER RIGHT QUADRANT if (gPlayer[0].pos.x > maxDistX && gPlayer[0].pos.z > maxDistZ) { // lower right corner piece : 4 - // // lower middle left piece : 5 + // lower middle left piece : 5 // lower middle right piece : 6 // side upper right piece: 14 // side lower right piece : 15 @@ -1274,11 +1271,11 @@ void AllRangeGround_Draw(void) { } } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("360Ground", i); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, sGroundPositions360x_FIX[i], 0.0f, sGroundPositions360z_FIX[i], MTXF_APPLY); if (gCurrentLevel == LEVEL_TRAINING) { @@ -1394,6 +1391,8 @@ void Background_DrawGround(void) { #endif } + FrameInterpolation_RecordOpenChild("Ground", 0); + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, gPlayer[gPlayerNum].xPath, -3.0f + gCameraShakeY, sp1D4, MTXF_APPLY); @@ -2255,6 +2254,8 @@ void Background_DrawGround(void) { break; } Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } // Unused. Early water implementation in Aquas? diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index 8b243ca6..dfdacc77 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -22,55 +22,6 @@ #include "fox_co.h" #include "fox_record.h" -int gWarpzoneCsFrameCount = 0; - -Record gWarpzoneCsRecord[] = { - { 2, 1 }, { 3, 3 }, { 4, 4 }, { 3, 8 }, { 2, 9 }, { 3, 52 }, { 2, 54 }, { 3, 69 }, { 2, 70 }, { 3, 75 }, - { 2, 76 }, { 3, 79 }, { 2, 117 }, { 3, 118 }, { 2, 120 }, { 3, 145 }, { 2, 215 }, { 3, 216 }, { 2, 230 }, -}; - -void UpdateVisPerFrameFromRecording(Record* record, s32 maxFrames) { - int i; - - if (gCsFrameCount > record[maxFrames - 1].frame) { - return; - } - - for (i = 0; i < maxFrames; i++) { - if (gCsFrameCount == record[i].frame) { - gVIsPerFrame = record[i].vis; - } - } -} - -void UpdateVisPerFrameFromRecording_Warpzone(Record* record, s32 maxFrames) { - int i; - - if (gWarpzoneCsFrameCount > record[maxFrames - 1].frame) { - return; - } - - for (i = 0; i < maxFrames; i++) { - if (gWarpzoneCsFrameCount == record[i].frame) { - gVIsPerFrame = record[i].vis; - } - } -} - -void UpdateVisPerFrameFromRecording_Ending(Record* record, s32 maxFrames) { - int i; - - if (gGameFrameCount > record[maxFrames - 1].frame) { - return; - } - - for (i = 0; i < maxFrames; i++) { - if (gGameFrameCount == record[i].frame) { - gVIsPerFrame = record[i].vis; - } - } -} - void func_demo_80048AC0(TeamId teamId) { s32 teamShield; @@ -448,8 +399,9 @@ void Cutscene_EnterWarpZone(Player* player) { s32 var_v0; s32 pad[4]; + // @Port: Vi recording gWarpzoneCsFrameCount++; - UpdateVisPerFrameFromRecording_Warpzone(gWarpzoneCsRecord, ARRAY_COUNT(gWarpzoneCsRecord)); + UpdateVisPerFrameFromRecording(gWarpzoneCsRecord, ARRAY_COUNT(gWarpzoneCsRecord), &gWarpzoneCsFrameCount); player->pos.x += player->vel.x; player->flags_228 = 0; @@ -678,6 +630,8 @@ void Cutscene_LevelStart(Player* player) { break; case LEVEL_SOLAR: + // @Port: Vi recording + UpdateVisPerFrameFromRecording(gSolarIntroCsRecord, ARRAY_COUNT(gSolarIntroCsRecord), &gCsFrameCount); Solar_LevelStart(player); break; @@ -982,7 +936,8 @@ void Cutscene_CoComplete2(Player* player) { Math_SmoothStepToF(&player->camRoll, 0.0f, 0.1f, 5.0f, 0.01f); - UpdateVisPerFrameFromRecording(gCarrierCutsceneRecord, ARRAY_COUNT(gCarrierCutsceneRecord)); + // @Port: Vi recording + UpdateVisPerFrameFromRecording(gCarrierCutsceneRecord, ARRAY_COUNT(gCarrierCutsceneRecord), &gCsFrameCount); switch (player->csState) { case 10: diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index 8351cd54..1434d68a 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -271,11 +271,11 @@ void Display_OnFootFalco_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* data) { } void Display_OnFootMuzzleFlash(Player* player) { - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_OnFootMuzzleFlash", player->num); + Matrix_Push(&gGfxMatrix); + Matrix_Copy(gGfxMatrix, &gIdentityMatrix); if ((player->state == PLAYERSTATE_ACTIVE) && (player->csTimer != 0)) { Matrix_Translate(gGfxMatrix, D_display_801613B0[player->num].x, D_display_801613B0[player->num].y, @@ -325,6 +325,8 @@ void Display_Landmaster(Player* player) { Vec3f sp4C = { 0.0f, 0.0f, 90.0f }; Vec3f sp40 = { 0.0f, 40.0f, -70.0f }; + FrameInterpolation_RecordOpenChild("Landmaster", player->num); + Matrix_Push(&gGfxMatrix); if (!gVersusMode) { @@ -364,6 +366,8 @@ void Display_Landmaster(Player* player) { Matrix_MultVec3f(gGfxMatrix, &sp4C, &D_display_80161548[player->num]); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } Gfx* sFaceDL[] = { aAwFoxHeadDL, aAwFalcoHeadDL, aAwSlippyHeadDL, aAwPeppyHeadDL }; @@ -375,11 +379,11 @@ f32 sReticleScales[] = { 0.0f, 0.0f, 0.0f, 0.0f }; f32 sPlayerShadowing = 0.0f; void Display_LandmasterMuzzleFlash(Player* player) { - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_LandmasterMuzzleFlash", player->num); + Matrix_Push(&gGfxMatrix); + if ((player->state == PLAYERSTATE_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, MTXF_APPLY); @@ -431,11 +435,11 @@ void Display_LandmasterThrusters(Player* player) { sp2C *= 1.1f; } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_LandmasterThrusters_1", player->num); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, 20.0f, 30.0f, -10.0f, MTXF_APPLY); if (!gVersusMode) { @@ -468,11 +472,11 @@ void Display_LandmasterThrusters(Player* player) { sp2C *= 1.1f; } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_LandmasterThrusters_2", player->num); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, -20.0f, 30.0f, -10.0f, MTXF_APPLY); if (!gVersusMode) { @@ -697,10 +701,11 @@ void Display_ArwingWings(ArwingInfo* arwing) { } gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); - Matrix_Pop(&gGfxMatrix); // @port Pop the transform id. FrameInterpolation_RecordCloseChild(); + + Matrix_Pop(&gGfxMatrix); } void Display_Unused(f32 arg0, f32 arg1, UNK_TYPE arg2, UNK_TYPE arg3) { @@ -708,11 +713,11 @@ void Display_Unused(f32 arg0, f32 arg1, UNK_TYPE arg2, UNK_TYPE arg3) { } void Display_CockpitGlass(void) { - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. FrameInterpolation_RecordOpenChild("Display_CockpitGlass", 0); + Matrix_Push(&gGfxMatrix); + Matrix_Copy(gGfxMatrix, &D_display_80161418[0]); 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); @@ -793,10 +798,10 @@ void Display_Reticle(Player* player) { (((gGameState == GSTATE_PLAY) && (player->state == PLAYERSTATE_ACTIVE)) || (gGameState == GSTATE_MENU))) { for (i = 0; i < 2; i++) { FrameInterpolation_RecordOpenChild("Reticle", (player->num << 16) + i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); translate = &D_display_801613E0[i]; Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, translate->x, translate->y, translate->z, MTXF_APPLY); + if (gChargeTimers[player->num] >= 20) { RCP_SetupDL(&gMasterDisp, SETUPDL_63_OPTIONAL); if (i == 1) { @@ -815,6 +820,7 @@ void Display_Reticle(Player* player) { Matrix_Scale(gGfxMatrix, sReticleScales[player->num], sReticleScales[player->num], 1.0f, MTXF_APPLY); Math_SmoothStepToF(&sReticleScales[player->num], 1.0f, 1.0f, 0.2f, 0.0f); } + Matrix_Scale(gGfxMatrix, 4.0f, 4.0f, 4.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024F60); @@ -856,6 +862,8 @@ void Display_PlayerShadow_Draw(Player* player) { player->shadowing = 180; } + FrameInterpolation_RecordOpenChild("PlayerShadow", player->num); + switch (player->form) { case FORM_ARWING: fake_label: @@ -895,6 +903,8 @@ void Display_PlayerShadow_Draw(Player* player) { Matrix_Pop(&gGfxMatrix); break; } + + FrameInterpolation_RecordCloseChild(); } void Display_DrawEngineGlow(EngineGlowColor color) { @@ -921,6 +931,9 @@ void Display_DrawEngineGlow(EngineGlowColor color) { void Display_LandmasterEngineGlow_Draw(Player* player) { RCP_SetupDL_64(); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); + + FrameInterpolation_RecordOpenChild("LandmasterEngineGlow", player->num); + Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, player->bankAngle * M_DTOR, MTXF_APPLY); if (player->form == FORM_LANDMASTER) { @@ -941,6 +954,8 @@ void Display_LandmasterEngineGlow_Draw(Player* player) { Matrix_SetGfxMtx(&gMasterDisp); Display_DrawEngineGlow(gLevelType); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } void Display_BarrelRollShield(Player* player) { @@ -970,10 +985,10 @@ void Display_BarrelRollShield(Player* player) { zRotDirection = -1.0f; } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("BarrelRollShield", 0); + FrameInterpolation_RecordOpenChild("BarrelRollShield", player->num); + + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, player->pos.x + dest.x, player->pos.y + dest.y, player->trueZpos + player->zPath + dest.z, MTXF_APPLY); @@ -1005,10 +1020,10 @@ void Display_BarrelRollShield(Player* player) { void Display_UnusedShield(Player* player) { if (gShieldAlpha[player->num] > 1.0f) { - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Display_UnusedShield", 0); + FrameInterpolation_RecordOpenChild("Display_UnusedShield", player->num); + + Matrix_Push(&gGfxMatrix); Matrix_Copy(gGfxMatrix, &D_display_80161418[player->num]); Matrix_Translate(gGfxMatrix, 0.0f, -5.0f, 10.0f, MTXF_APPLY); @@ -1046,12 +1061,16 @@ void Display_ArwingLaserCharge(Player* player) { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); } + Matrix_Push(&gGfxMatrix); - + sp80 = gChargeTimers[player->num] / 20.0f; - + Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, sp80, sp80, 1.0f, MTXF_APPLY); + + FrameInterpolation_RecordOpenChild("ArwingLaserCharge", player->num); + Matrix_Push(&gGfxMatrix); if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { @@ -1089,6 +1108,10 @@ void Display_ArwingLaserCharge(Player* player) { gSPDisplayList(gMasterDisp++, aStarDL); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); + + FrameInterpolation_RecordOpenChild("ArwingLaserCharge2", player->num); + if (player->alternateView && (gLevelMode == LEVELMODE_ON_RAILS)) { Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, MTXF_APPLY); } @@ -1103,6 +1126,8 @@ void Display_ArwingLaserCharge(Player* player) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, aOrbDL); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } if (gMuzzleFlashScale[player->num] > 0.1f) { Matrix_Push(&gGfxMatrix); @@ -1124,10 +1149,10 @@ void Display_ArwingLaserCharge(Player* player) { Matrix_MultVec3f(gCalcMatrix, &spC4, &sp94); } - Matrix_Push(&gGfxMatrix); - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash", 0); + FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash1", player->num); + + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, @@ -1152,10 +1177,11 @@ void Display_ArwingLaserCharge(Player* player) { } Matrix_MultVec3f(gCalcMatrix, &spAC, &sp94); Matrix_MultVec3f(gCalcMatrix, &spA0, &sp88); - Matrix_Push(&gGfxMatrix); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash", 0); + FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash2", player->num); + + Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, sp94.x, sp94.y, sp94.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, @@ -1170,7 +1196,7 @@ void Display_ArwingLaserCharge(Player* player) { Matrix_Push(&gGfxMatrix); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash", 1); + FrameInterpolation_RecordOpenChild("ArwingMuzzleFlash3", player->num); Matrix_Translate(gGfxMatrix, sp88.x, sp88.y, sp88.z, MTXF_NEW); Matrix_Scale(gGfxMatrix, gMuzzleFlashScale[player->num], gMuzzleFlashScale[player->num], 1.0f, @@ -1343,7 +1369,7 @@ void Display_ArwingWingTrail_Draw(Player* player) { gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 100); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("WingTrail", 0); + FrameInterpolation_RecordOpenChild("WingTrail", player->num); if (player->arwing.leftWingState == WINGSTATE_INTACT) { Matrix_Push(&gGfxMatrix); @@ -1363,7 +1389,7 @@ void Display_ArwingWingTrail_Draw(Player* player) { FrameInterpolation_RecordCloseChild(); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("WingTrail", 1); + FrameInterpolation_RecordOpenChild("WingTrail2", player->num); if (player->arwing.rightWingState == WINGSTATE_INTACT) { Matrix_Push(&gGfxMatrix); @@ -1637,8 +1663,8 @@ void Display_ActorMarks(void) { for (i = 0; i < ARRAY_COUNT(gTeamArrowsViewPos); i++) { if (gTeamArrowsViewPos[i].z < 0.0f) { - FrameInterpolation_RecordOpenChild(&gTeamArrowsViewPos[i], i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + FrameInterpolation_RecordOpenChild("ActorMarks", i); + var_fs0 = (VEC3F_MAG(&gTeamArrowsViewPos[i])) * 0.0015f; if (var_fs0 > 100.0f) { var_fs0 = 100.0f; @@ -1683,8 +1709,7 @@ void Display_LockOnIndicator(void) { if (gLockOnTargetViewPos[i].z < 0.0f) { var_fs0 = VEC3F_MAG(&gLockOnTargetViewPos[i]); if (var_fs0 < 20000.0f) { - FrameInterpolation_RecordOpenChild("LcckOnIndicator", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + FrameInterpolation_RecordOpenChild("LockOnIndicator", i); var_fs0 *= 0.0015f; if (var_fs0 > 100.0f) { var_fs0 = 100.0f; @@ -1797,9 +1822,7 @@ void Display_CsLevelCompleteHandleCamera(Player* player) { break; } } -#if 1 -f32 gTestVarF = 0.0f; -#endif + void Display_Update(void) { s32 i; Vec3f tempVec; @@ -1895,8 +1918,7 @@ void Display_Update(void) { printf("CAMERA 1 SKIPED: %d\n", camSkipTimes++); gCamera1Skipped = true; } else { - FrameInterpolation_RecordOpenChild("GamePlayCam", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + FrameInterpolation_RecordOpenChild("GamePlayCam", camPlayer->num); gCamera1Skipped = false; } @@ -1919,10 +1941,8 @@ void Display_Update(void) { } Background_DrawBackdrop(); - FrameInterpolation_RecordOpenChild("Sun", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); Background_DrawSun(); - FrameInterpolation_RecordCloseChild(); + Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, gPlayCamEye.x, gPlayCamEye.y, gPlayCamEye.z, gPlayCamAt.x, gPlayCamAt.y, gPlayCamAt.z, playerCamUp.x, playerCamUp.y, playerCamUp.z, MTXF_APPLY); @@ -1938,10 +1958,7 @@ void Display_Update(void) { Matrix_Pop(&gGfxMatrix); } else if (gGroundSurface != SURFACE_WATER) { D_bg_8015F964 = false; - FrameInterpolation_RecordOpenChild("Ground", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); Background_DrawGround(); - FrameInterpolation_RecordCloseChild(); } } @@ -2010,10 +2027,7 @@ void Display_Update(void) { if ((gGroundSurface == SURFACE_WATER) || (gAqDrawMode != 0)) { D_bg_8015F964 = true; Effect_Draw(1); - FrameInterpolation_RecordOpenChild("Ground", 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); Background_DrawGround(); - FrameInterpolation_RecordCloseChild(); } if ((gCurrentLevel != LEVEL_AQUAS) && @@ -2026,12 +2040,9 @@ void Display_Update(void) { for (i = 0, player = &gPlayer[0]; i < gCamCount; i++, player++) { if (sPlayersVisible[i]) { - FrameInterpolation_RecordOpenChild(player, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); Display_PlayerShadow_Update(player); Display_PlayerFeatures(player); Display_ArwingWingTrail_Update(player); - FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index 8ac59c45..969cd8ad 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -833,8 +833,7 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { s32 i; if (((gGameFrameCount & 0x18) != 0) && (this->state == 0)) { - FrameInterpolation_RecordOpenChild(this, 0); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + FrameInterpolation_RecordOpenChild("ItemCheckpoint", 0); Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, SETUPDL_64); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); @@ -846,14 +845,14 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { Matrix_Pop(&gGfxMatrix); FrameInterpolation_RecordCloseChild(); } - FrameInterpolation_RecordOpenChild(this, 1); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); RCP_SetupDL(&gMasterDisp, SETUPDL_29); gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON); gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN); Matrix_RotateZ(gGfxMatrix, this->unk_58 * M_DTOR, MTXF_APPLY); for (i = 0; i < 8; i++) { + FrameInterpolation_RecordOpenChild("ItemCheckpoint", i + 1); + Matrix_Push(&gGfxMatrix); Matrix_RotateZ(gGfxMatrix, i * 45.0f * M_DTOR, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 2.0f * this->width, 0.0f, 0.0f, MTXF_APPLY); @@ -861,9 +860,10 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) { Graphics_SetScaleMtx(2.0f * this->unk_50); gSPDisplayList(gMasterDisp++, D_101CAE0); Matrix_Pop(&gGfxMatrix); + + FrameInterpolation_RecordCloseChild(); } gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN); - FrameInterpolation_RecordCloseChild(); } void ItemSilverRing_Draw(ItemSilverRing* this) { @@ -1797,7 +1797,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { FrameInterpolation_RecordOpenChild(scenery360, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if ((scenery360->obj.status == OBJ_ACTIVE) && (scenery360->obj.id != OBJ_SCENERY_LEVEL_OBJECTS)) { if (gCurrentLevel == LEVEL_BOLSE) { spAC.x = scenery360->sfxSource[0]; @@ -1810,6 +1810,7 @@ void Object_DrawAll(s32 cullDirection) { Scenery360_Draw(scenery360); Matrix_Pop(&gGfxMatrix); } + FrameInterpolation_RecordCloseChild(); } } else { @@ -1817,7 +1818,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, scenery = gScenery; i < ARRAY_COUNT(gScenery); i++, scenery++) { if (scenery->obj.status >= OBJ_ACTIVE) { FrameInterpolation_RecordOpenChild(scenery, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if (cullDirection > 0) { Display_SetSecondLight(&scenery->obj.pos); } @@ -1825,6 +1826,7 @@ void Object_DrawAll(s32 cullDirection) { Scenery_Draw(scenery, cullDirection); Matrix_Pop(&gGfxMatrix); Object_UpdateSfxSource(scenery->sfxSource); + FrameInterpolation_RecordCloseChild(); } } @@ -1833,7 +1835,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, boss = &gBosses[0]; i < ARRAY_COUNT(gBosses); i++, boss++) { if ((boss->obj.status >= OBJ_ACTIVE) && (boss->obj.id != OBJ_BOSS_BO_BASE_SHIELD)) { FrameInterpolation_RecordOpenChild(boss, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if ((boss->timer_05C % 2) == 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { @@ -1850,6 +1852,7 @@ void Object_DrawAll(s32 cullDirection) { Object_DrawShadow(i, &boss->obj); Matrix_Pop(&gGfxMatrix); } + FrameInterpolation_RecordCloseChild(); } } @@ -1860,7 +1863,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, sprite = &gSprites[0]; i < ARRAY_COUNT(gSprites); i++, sprite++) { if ((sprite->obj.status >= OBJ_ACTIVE) && func_enmy_80060FE4(&sprite->obj.pos, -12000.0f)) { FrameInterpolation_RecordOpenChild(sprite, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + Matrix_Push(&gGfxMatrix); if ((sprite->obj.id == OBJ_SPRITE_CO_RUIN1) || (sprite->obj.id == OBJ_SPRITE_CO_RUIN2)) { @@ -1871,6 +1874,7 @@ void Object_DrawAll(s32 cullDirection) { Sprite_Draw(sprite, cullDirection); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } @@ -1878,7 +1882,7 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, actor = &gActors[0]; i < ARRAY_COUNT(gActors); i++, actor++) { if (actor->obj.status >= OBJ_ACTIVE) { FrameInterpolation_RecordOpenChild(actor, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if ((actor->timer_0C6 % 2) == 0) { if (gCurrentLevel == LEVEL_UNK_15) { RCP_SetupDL_23(); @@ -1940,12 +1944,13 @@ void Object_DrawAll(s32 cullDirection) { for (i = 0, item = &gItems[0]; i < ARRAY_COUNT(gItems); i++, item++) { if (item->obj.status >= OBJ_ACTIVE) { FrameInterpolation_RecordOpenChild(item, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, SETUPDL_29); Object_SetCullDirection(cullDirection); Item_Draw(item, cullDirection); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } @@ -1964,7 +1969,7 @@ void Effect_DrawAll(s32 arg0) { for (i = 0, effect = &gEffects[0]; i < ARRAY_COUNT(gEffects); i++, effect++) { if (effect->obj.status >= OBJ_ACTIVE) { FrameInterpolation_RecordOpenChild(effect, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if (effect->info.unk_14 == 1) { effect->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); effect->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].camPitch); @@ -1985,6 +1990,7 @@ void Effect_DrawAll(s32 arg0) { Matrix_Pop(&gGfxMatrix); } } + FrameInterpolation_RecordCloseChild(); } } @@ -1992,7 +1998,7 @@ void Effect_DrawAll(s32 arg0) { for (i = 0, boss = &gBosses[0]; i < ARRAY_COUNT(gBosses); i++, boss++) { if ((boss->obj.status >= OBJ_ACTIVE) && (boss->obj.id == OBJ_BOSS_BO_BASE_SHIELD)) { FrameInterpolation_RecordOpenChild(boss, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + if ((boss->timer_05C % 2) == 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { @@ -2002,6 +2008,7 @@ void Effect_DrawAll(s32 arg0) { Matrix_Push(&gGfxMatrix); Boss_Draw(boss, arg0); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } @@ -2065,7 +2072,6 @@ void TexturedLine_Draw(void) { for (i = 0; i < ARRAY_COUNT(gTexturedLines); i++) { TexturedLine* texLine = &gTexturedLines[i]; FrameInterpolation_RecordOpenChild(texLine, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); if (gTexturedLines[i].mode != 0) { Matrix_Push(&gGfxMatrix); diff --git a/src/engine/fox_effect.c b/src/engine/fox_effect.c index 3a7665a5..ada1e7ca 100644 --- a/src/engine/fox_effect.c +++ b/src/engine/fox_effect.c @@ -148,10 +148,11 @@ void BonusText_DrawAll(void) { for (i = 0, bonus = gBonusText; i < ARRAY_COUNT(gBonusText); i++, bonus++) { if (bonus->hits != 0) { FrameInterpolation_RecordOpenChild(bonus, i); - FrameInterpolation_RecordMarker(__FILE__, __LINE__); + Matrix_Push(&gGfxMatrix); BonusText_Draw(bonus); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index 5c7663b2..18e99218 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -2005,6 +2005,13 @@ void Sprite167_Update(Sprite167* this) { // World-aligned billboarding void SceneryRotateTowardsCamera(Scenery* this) { + bool isBuilding = (this->obj.id >= OBJ_SCENERY_CO_BUILDING_5 && this->obj.id <= OBJ_SCENERY_CO_BUILDING_8 || + this->obj.id == OBJ_SCENERY_CO_BUILDING_10); + + if (isBuilding) { + return; + } + this->obj.rot.y = 0.0f; if (gPlayer[0].cam.eye.x < this->obj.pos.x) { this->obj.rot.y = 271.0f; diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index bbf8de24..363f7555 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -210,22 +210,35 @@ void HUD_TeamDownWrench_Draw(s32 arg0) { } } } else { - f32 x = 48.0f; - f32 y = 0.0f; - HUD_MatrixTranslateCoordLeft(&x, &y); - y = -81.0f; - Lib_InitOrtho(&gMasterDisp); - Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, -600.0f, MTXF_APPLY); - Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 0.31f, 0.31f, 1.0f, MTXF_APPLY); - Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, aDownWrenchDL); - Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY); - Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, aDownWrenchDL); - Matrix_Pop(&gGfxMatrix); - Lib_InitPerspective(&gMasterDisp); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + f32 x = 48.0f; + f32 y = 0.0f; + HUD_MatrixTranslateCoordLeft(&x, &y); + y = -81.0f; + Lib_InitOrtho(&gMasterDisp); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, x, y, -600.0f, MTXF_APPLY); + Matrix_RotateZ(gGfxMatrix, M_PI / 4, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 0.31f, 0.31f, 1.0f, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, aDownWrenchDL); + Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, aDownWrenchDL); + Matrix_Pop(&gGfxMatrix); + Lib_InitPerspective(&gMasterDisp); + } else { + Matrix_Push(&gGfxMatrix); + 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++, aDownWrenchDL); + Matrix_RotateZ(gGfxMatrix, 3 * M_PI / 2, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, aDownWrenchDL); + Matrix_Pop(&gGfxMatrix); + } } } @@ -2262,7 +2275,12 @@ void HUD_RadioCharacterName_Draw(void) { RCP_SetupDL(&gMasterDisp, SETUPDL_76_OPTIONAL); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); - f32 xPos = OTRGetRectDimensionFromLeftEdgeOverride(73.0f); + f32 xPos; + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + xPos = OTRGetRectDimensionFromLeftEdgeOverride(73.0f); + } else { + xPos = 73.0f; + } switch ((s32) gRadioMsgRadioId) { case RCID_FOX: @@ -2635,20 +2653,31 @@ void HUD_RadioDamage_Draw(void) { } if ((D_80161788 != 0) || (D_8016178C != 0)) { - RCP_SetupDL(&gMasterDisp, SETUPDL_12); - gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, alpha); - f32 x = 48.0f; - f32 y = 0.0f; - HUD_MatrixTranslateCoordLeft(&x, &y); - y = -81.0f; - Lib_InitOrtho(&gMasterDisp); - Matrix_Push(&gGfxMatrix); - Matrix_Translate(gGfxMatrix, x, y, -139.4f, MTXF_APPLY); - Matrix_Scale(gGfxMatrix, 2.25f, 2.25f, 2.25f, MTXF_APPLY); - Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, sRadioDamageDL); - Matrix_Pop(&gGfxMatrix); - Lib_InitPerspective(&gMasterDisp); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + RCP_SetupDL(&gMasterDisp, SETUPDL_12); + gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, alpha); + f32 x = 48.0f; + f32 y = 0.0f; + HUD_MatrixTranslateCoordLeft(&x, &y); + y = -81.0f; + Lib_InitOrtho(&gMasterDisp); + Matrix_Push(&gGfxMatrix); + Matrix_Translate(gGfxMatrix, x, y, -139.4f, MTXF_APPLY); + Matrix_Scale(gGfxMatrix, 2.25f, 2.25f, 2.25f, MTXF_APPLY); + Matrix_SetGfxMtx(&gMasterDisp); + gSPDisplayList(gMasterDisp++, sRadioDamageDL); + Matrix_Pop(&gGfxMatrix); + Lib_InitPerspective(&gMasterDisp); + } else { + RCP_SetupDL(&gMasterDisp, SETUPDL_12); + gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, alpha); + Matrix_Push(&gGfxMatrix); + 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++, sRadioDamageDL); + Matrix_Pop(&gGfxMatrix); + } } } diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index cb8cc26c..c11c9dd6 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -2919,7 +2919,7 @@ void Play_Init(void) { D_ctx_801782C8 = 0; if (gCurrentLevel == LEVEL_TITANIA) { - Ground_801B5110(0.0f, 0.0f, 200.0f); + Ground_Init(0.0f, 0.0f, 200.0f); } if (gCurrentLevel == LEVEL_AQUAS) { gWaterLevel = 1000.0f; diff --git a/src/engine/fox_radio.c b/src/engine/fox_radio.c index 365b98b3..e60f80c1 100644 --- a/src/engine/fox_radio.c +++ b/src/engine/fox_radio.c @@ -130,36 +130,61 @@ void Radio_PlayMessage(u16* msg, RadioCharacterId character) { } void Radio_CalculatePositions() { - switch (gGameState) { - case GSTATE_TITLE: - gRadioPrintPosY = 176; - gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(85.0f); - gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdgeOverride(80.0f); - gRadioTextBoxPosY = 174.0f; - gRadioTextBoxScaleX = 4.63f; - gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdgeOverride(32.0f); - gRadioPortraitPosY = 174.0f; - break; - - case GSTATE_ENDING: - gRadioPrintPosY = 176; - gRadioPrintPosX = 85.0f; - gRadioTextBoxPosX = 80.0f; - gRadioTextBoxPosY = 174.0f; - gRadioTextBoxScaleX = 4.63f; - gRadioPortraitPosX = 32.0f; - gRadioPortraitPosY = 174.0f; - break; - - case GSTATE_PLAY: - gRadioPrintPosY = 180; - gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(79.0f); - gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdgeOverride(74.0f); - gRadioTextBoxPosY = 178.0f; - gRadioTextBoxScaleX = 4.53f; - gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdgeOverride(26.0f); - gRadioPortraitPosY = 178.0f; - break; + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + switch (gGameState) { + case GSTATE_TITLE: + gRadioPrintPosY = 176; + gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(85.0f); + gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdgeOverride(80.0f); + gRadioTextBoxPosY = 174.0f; + gRadioTextBoxScaleX = 4.63f; + gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdgeOverride(32.0f); + gRadioPortraitPosY = 174.0f; + break; + + case GSTATE_ENDING: + gRadioPrintPosY = 176; + gRadioPrintPosX = 85.0f; + gRadioTextBoxPosX = 80.0f; + gRadioTextBoxPosY = 174.0f; + gRadioTextBoxScaleX = 4.63f; + gRadioPortraitPosX = 32.0f; + gRadioPortraitPosY = 174.0f; + break; + + case GSTATE_PLAY: + gRadioPrintPosY = 180; + gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(79.0f); + gRadioTextBoxPosX = OTRGetRectDimensionFromLeftEdgeOverride(74.0f); + gRadioTextBoxPosY = 178.0f; + gRadioTextBoxScaleX = 4.53f; + gRadioPortraitPosX = OTRGetRectDimensionFromLeftEdgeOverride(26.0f); + gRadioPortraitPosY = 178.0f; + break; + } + } else { + switch (gGameState) { + case GSTATE_TITLE: + case GSTATE_ENDING: + gRadioPrintPosY = 176; + gRadioPrintPosX = 85; + gRadioTextBoxPosX = 80.0f; + gRadioTextBoxPosY = 174.0f; + gRadioTextBoxScaleX = 4.63f; + gRadioPortraitPosX = 32.0f; + gRadioPortraitPosY = 174.0f; + break; + + case GSTATE_PLAY: + gRadioPrintPosY = 180; + gRadioPrintPosX = 79; + gRadioTextBoxPosX = 74.0f; + gRadioTextBoxPosY = 178.0f; + gRadioTextBoxScaleX = 4.53f; + gRadioPortraitPosX = 26.0f; + gRadioPortraitPosY = 178.0f; + break; + } } } @@ -718,12 +743,20 @@ void Radio_Draw(void) { (gCurrentRadioPortrait != RCID_1000)) { RCP_SetupDL(&gMasterDisp, SETUPDL_76_OPTIONAL); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); - Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdgeOverride(31.0f), 167, 1.0f, 1.0f, "DOWN"); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdgeOverride(31.0f), 167, 1.0f, 1.0f, "DOWN"); + } else { + Graphics_DisplaySmallText(31, 167, 1.0f, 1.0f, "DOWN"); + } HUD_TeamDownWrench_Draw(1); } if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) && (gCurrentRadioPortrait != RCID_1000)) { - HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, gTeamShields[idx]); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, gTeamShields[idx]); + } else { + HUD_TeamShields_Draw(22.0f, 165.0f, gTeamShields[idx]); + } } } @@ -767,12 +800,20 @@ void Radio_Draw(void) { (gCurrentRadioPortrait != RCID_STATIC + 1) && (gCurrentRadioPortrait != RCID_1000)) { RCP_SetupDL(&gMasterDisp, SETUPDL_76_OPTIONAL); gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255); - Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdgeOverride(31.0f), 167, 1.0f, 1.0f, "DOWN"); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + Graphics_DisplaySmallText(OTRGetRectDimensionFromLeftEdgeOverride(31.0f), 167, 1.0f, 1.0f, "DOWN"); + } else { + Graphics_DisplaySmallText(31.0f, 167, 1.0f, 1.0f, "DOWN"); + } } if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) && (gCurrentRadioPortrait != RCID_1000)) { - HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, - gActors[idx].health * 2.55f); + if (CVarGetInteger("gRadioCommBox.expand", 0) == 1) { + HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, + gActors[idx].health * 2.55f); + } else { + HUD_TeamShields_Draw(22.0f, 165.0f, gActors[idx].health * 2.55f); + } } } if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) && |
