From a3319495706d9be84294d8f8a21a0ea6a83c02a4 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 16:32:26 -0300 Subject: [PATCH 01/11] better tag --- src/render_player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render_player.c b/src/render_player.c index aaed5fe29..017b0fd18 100644 --- a/src/render_player.c +++ b/src/render_player.c @@ -1892,7 +1892,7 @@ void render_player_ice_reflection(Player* player, s8 playerId, s8 screenId, s8 a } // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("PlayerReflection", playerId); + FrameInterpolation_RecordOpenChild("PlayerReflection", playerId | screenId << 8); mtxf_translate_rotate(mtx, sp9C, sp94); mtxf_scale(mtx, gCharacterSize[player->characterId] * player->size); From 4a6ebfdc78452faced41470413e01fe21d54cbb1 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 16:48:25 -0300 Subject: [PATCH 02/11] tag leaves --- src/render_objects.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/render_objects.c b/src/render_objects.c index b6b849d31..edc8d69d6 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -3387,15 +3387,19 @@ void func_800514BC(void) { } void render_object_leaf_particle(UNUSED s32 cameraId) { - s32 someIndex; + size_t i; s32 leafIndex; Object* object; gSPDisplayList(gDisplayListHead++, D_0D0079C8); gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH); load_texture_block_rgba16_mirror((u8*) common_texture_particle_leaf, 0x00000020, 0x00000010); - for (someIndex = 0; someIndex < gLeafParticle_SIZE; someIndex++) { - leafIndex = gLeafParticle[someIndex]; + for (i = 0; i < gLeafParticle_SIZE; i++) { + leafIndex = gLeafParticle[i]; + + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Leaves", leafIndex); + if (leafIndex != -1) { object = &gObjectList[leafIndex]; if ((object->state >= 2) && (object->unk_0D5 == 7) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { @@ -3403,23 +3407,27 @@ void render_object_leaf_particle(UNUSED s32 cameraId) { gSPDisplayList(gDisplayListHead++, D_0D0069C8); } } + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); } void render_object_snowflakes_particles(void) { - s32 someIndex; + size_t i; s32 snowflakeIndex; gSPDisplayList(gDisplayListHead++, D_0D007AE0); gDPSetCombineLERP(gDisplayListHead++, 1, 0, SHADE, 0, 0, 0, 0, TEXEL0, 1, 0, SHADE, 0, 0, 0, 0, TEXEL0); func_80044F34(D_0D0293D8, 0x10, 0x10); - for (someIndex = 0; someIndex < NUM_SNOWFLAKES; someIndex++) { - snowflakeIndex = gObjectParticle1[someIndex]; + for (i = 0; i < NUM_SNOWFLAKES; i++) { + snowflakeIndex = gObjectParticle1[i]; // @port: Tag the transform. FrameInterpolation_RecordOpenChild("SnowFlakes", snowflakeIndex); + if (gObjectList[snowflakeIndex].state >= 2) { rsp_set_matrix_gObjectList(snowflakeIndex); gSPDisplayList(gDisplayListHead++, D_0D006980); @@ -3454,7 +3462,7 @@ void func_800518F8(s32 objectIndex, s16 x, s16 y) { } if (gObjectList[objectIndex].status & 0x10) { - + // @port: Tag the transform. FrameInterpolation_RecordOpenChild("func_800518F8", (uintptr_t) &gObjectList[objectIndex]); From 1fee189805ea668b0b294bc70d8593bb87e044ae Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 20 May 2025 14:50:12 -0500 Subject: [PATCH 03/11] Set the default FPS to 30 --- src/port/Engine.cpp | 6 +++--- src/port/interpolation/FrameInterpolation.cpp | 2 +- src/port/ui/PortMenu.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index cc7d0755d..c8734fab4 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -233,10 +233,10 @@ uint32_t GameEngine::GetInterpolationFPS() { } else if (CVarGetInteger("gVsyncEnabled", 1) || !Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) { return std::min(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), - CVarGetInteger("gInterpolationFPS", 60)); + CVarGetInteger("gInterpolationFPS", 30)); } - return CVarGetInteger("gInterpolationFPS", 60); + return CVarGetInteger("gInterpolationFPS", 30); } uint32_t GameEngine::GetInterpolationFrameCount() @@ -360,7 +360,7 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) { int fps = target_fps; int original_fps = 60 / 2 /*gVIsPerFrame*/; - if (target_fps == 20 || original_fps > target_fps) { + if (target_fps == 30 || original_fps > target_fps) { fps = original_fps; } diff --git a/src/port/interpolation/FrameInterpolation.cpp b/src/port/interpolation/FrameInterpolation.cpp index 3d1512f55..d0e0fe0f0 100644 --- a/src/port/interpolation/FrameInterpolation.cpp +++ b/src/port/interpolation/FrameInterpolation.cpp @@ -565,7 +565,7 @@ void FrameInterpolation_StartRecord(void) { is_recording = false; return; } - if (GameEngine::GetInterpolationFPS() != 20) { + if (GameEngine::GetInterpolationFPS() != 30) { is_recording = true; } } diff --git a/src/port/ui/PortMenu.cpp b/src/port/ui/PortMenu.cpp index 6f2a4ec48..cb709e16b 100644 --- a/src/port/ui/PortMenu.cpp +++ b/src/port/ui/PortMenu.cpp @@ -258,11 +258,11 @@ void PortMenu::AddSettings() { if (mPortMenu->disabledMap.at(DISABLE_FOR_MATCH_REFRESH_RATE_ON).active) info.activeDisables.push_back(DISABLE_FOR_MATCH_REFRESH_RATE_ON); }) - .Options(IntSliderOptions().Tooltip(tooltip).Min(20).Max(maxFps).DefaultValue(20)); + .Options(IntSliderOptions().Tooltip(tooltip).Min(30).Max(maxFps).DefaultValue(30)); AddWidget(path, "Match Refresh Rate", WIDGET_BUTTON) .Callback([](WidgetInfo& info) { int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); - if (hz >= 20 && hz <= 360) { + if (hz >= 30 && hz <= 360) { CVarSetInteger("gInterpolationFPS", hz); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } From 2764ac65954104b368d0c386a78fbb9f82c91757 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 17:10:37 -0300 Subject: [PATCH 04/11] tag hud --- src/code_80057C60.c | 7 +++++++ src/render_objects.c | 46 +++++++++++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 7e609859d..0a8e22749 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -939,6 +939,10 @@ void func_80058F48(void) { void func_80058F78(void) { if (gHUDDisable == 0) { + + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("HudMatrix", 0); + set_matrix_hud_screen(); if ((!gDemoMode) && (gIsHUDVisible != 0) && (D_801657D8 == 0)) { draw_item_window(PLAYER_ONE); @@ -951,6 +955,9 @@ void func_80058F78(void) { } } } + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } } diff --git a/src/render_objects.c b/src/render_objects.c index edc8d69d6..e3a5d869d 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -3051,47 +3051,57 @@ void func_8004FDB4(f32 arg0, f32 arg1, s16 arg2, s16 arg3, s16 characterId, s32 void func_80050320(void) { s16 temp_v0; s16 characterId; - s32 var_s0; + s32 i; s32 lapCount; s32 var_a0; if (D_801657E2 == 0) { - for (var_s0 = 0; var_s0 < 4; var_s0++) { + for (i = 0; i < 4; i++) { var_a0 = 0; - if (D_8018D050[var_s0] >= 0.0f) { - if (D_8018D078[var_s0] < 0.0) { + if (D_8018D050[i] >= 0.0f) { + if (D_8018D078[i] < 0.0) { var_a0 = 1; } - temp_v0 = gGPCurrentRacePlayerIdByRank[var_s0]; - characterId = gGPCurrentRaceCharacterIdByRank[var_s0]; + + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("ranking portraits", i | var_a0 << 16); + + temp_v0 = gGPCurrentRacePlayerIdByRank[i]; + characterId = gGPCurrentRaceCharacterIdByRank[i]; lapCount = gLapCountByPlayerId[temp_v0]; if (characterId == gPlayerOne->characterId) { - func_8004FDB4(D_8018D028[var_s0], D_8018D050[var_s0], var_s0, lapCount, characterId, 0x000000FF, 1, - var_a0, 0); + func_8004FDB4(D_8018D028[i], D_8018D050[i], i, lapCount, characterId, 0x000000FF, 1, var_a0, 0); } else { - func_8004FDB4(D_8018D028[var_s0], D_8018D050[var_s0], var_s0, lapCount, characterId, D_8018D3E0, 0, - var_a0, 0); + func_8004FDB4(D_8018D028[i], D_8018D050[i], i, lapCount, characterId, D_8018D3E0, 0, var_a0, 0); } + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } } } else { - for (var_s0 = 0; var_s0 < 8; var_s0++) { + for (i = 0; i < 8; i++) { var_a0 = 0; - if (D_8018D050[var_s0] >= 0.0f) { - if (D_8018D078[var_s0] <= 0.0) { + if (D_8018D050[i] >= 0.0f) { + if (D_8018D078[i] <= 0.0) { var_a0 = 1; } - temp_v0 = gGPCurrentRacePlayerIdByRank[var_s0]; + + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("ranking portraits 2", i | var_a0 << 16); + + temp_v0 = gGPCurrentRacePlayerIdByRank[i]; // ???? characterId = (gPlayerOne + temp_v0)->characterId; lapCount = gLapCountByPlayerId[temp_v0]; if (temp_v0 == 0) { - func_8004FDB4(D_8018D028[var_s0], D_8018D050[var_s0], var_s0, lapCount, characterId, 0x000000FF, 1, - var_a0, 1); + func_8004FDB4(D_8018D028[i], D_8018D050[i], i, lapCount, characterId, 0x000000FF, 1, var_a0, 1); } else { - func_8004FDB4(D_8018D028[var_s0], D_8018D050[var_s0], var_s0, lapCount, characterId, 0x000000FF, 0, - var_a0, 1); + func_8004FDB4(D_8018D028[i], D_8018D050[i], i, lapCount, characterId, 0x000000FF, 0, var_a0, 1); } + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } } } From 939064476c3bb774afd12d108081296cb4dc07dd Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 20 May 2025 16:09:51 -0500 Subject: [PATCH 05/11] Fixed "Match Refresh Rate" option --- src/port/Engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index c8734fab4..15acab0ac 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -385,7 +385,7 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) { auto wnd = std::dynamic_pointer_cast(Ship::Context::GetInstance()->GetWindow()); if (wnd != nullptr) { - wnd->SetTargetFps(CVarGetInteger("gInterpolationFPS", 30)); + wnd->SetTargetFps(GetInterpolationFPS()); wnd->SetMaximumFrameLatency(1); } RunCommands(commands, mtx_replacements); From 8fb85b9e724af1a798522c1f60e86b845144875f Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 18:27:41 -0300 Subject: [PATCH 06/11] adjust draw distance --- src/racing/math_util.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/racing/math_util.c b/src/racing/math_util.c index a67bc7f65..43143fa7d 100644 --- a/src/racing/math_util.c +++ b/src/racing/math_util.c @@ -8,12 +8,14 @@ #include "math.h" #include "memory.h" #include "engine/Matrix.h" +#include "course.h" #include "port/Game.h" #include #include - #pragma intrinsic(sqrtf, fabs) +extern s16 gCurrentCourseId; + s32 D_802B91C0[2] = { 13, 13 }; Vec3f D_802B91C8 = { 0.0f, 0.0f, 0.0f }; @@ -55,7 +57,7 @@ s32 render_set_position(Mat4 mtx, s32 arg1) { if (gMatrixObjectCount >= MTX_OBJECT_POOL_SIZE) { return 0; } - //mtxf_to_mtx(&gGfxPool->mtxObject[gMatrixObjectCount], arg0); + // mtxf_to_mtx(&gGfxPool->mtxObject[gMatrixObjectCount], arg0); switch (arg1) { /* irregular */ case 0: AddObjectMatrix(mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -1103,16 +1105,22 @@ s32 is_visible_between_angle(u16 arg0, u16 arg1, u16 arg2) { f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance) { u16 angleObject; - UNUSED u16 pad; u16 temp_v0; f32 distanceX; f32 distance; f32 distanceY; + f32 scaleFov; + f32 maxDistance2; s32 plus_fov_angle; s32 minus_fov_angle; u16 temp; - UNUSED s32 pad2[3]; - u16 extended_fov = ((u16) fov * 0xB6); + s32 count = 0; + + maxDistance *= 6.5f; + maxDistance2 = 1.0f; + scaleFov = 1.25; + + f32 extended_fov = ((f32) fov * 0xB6 * scaleFov); // Sets the Culling for objects on the left and right distanceX = objectPos[0] - cameraPos[0]; distanceX = distanceX * distanceX; @@ -1141,19 +1149,28 @@ f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY if (minDistance == 0.0f) { if (is_visible_between_angle((orientationY + extended_fov), (orientationY - extended_fov), angleObject) == 1) { - return distance; + if (gCurrentCourseId == 0xB /* COURSE_KALAMARI_DESERT */) { + return distance / 6.5f; // set for better DD settings in Desert + } else { + return distance / 10.0f; // Items + } } return -1.0f; } if (is_visible_between_angle((u16) plus_fov_angle, (u16) minus_fov_angle, angleObject) == 1) { - return distance; + if (gCurrentCourseId == 0xB /* COURSE_KALAMARI_DESERT */) { + return distance / 2.0f; + } else { + return distance / 10.0f; // DD Vhicles + } } + temp_v0 = func_802B7CA8(minDistance / distance); temp = angleObject + temp_v0; if (is_visible_between_angle(plus_fov_angle, minus_fov_angle, temp) == 1) { - return distance; + return 0; } temp = angleObject - temp_v0; From 86dc0b0a998519ca33efaaafc2945c6b095de979 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 18:56:57 -0300 Subject: [PATCH 07/11] remove innecessary rock tag --- src/actors/falling_rock/render.inc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/actors/falling_rock/render.inc.c b/src/actors/falling_rock/render.inc.c index 9d50fd41c..e5ea29188 100644 --- a/src/actors/falling_rock/render.inc.c +++ b/src/actors/falling_rock/render.inc.c @@ -17,9 +17,6 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) { f32 height; UNUSED s32 pad[4]; - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("rock", TAG_ITEM_ADDR(rock)); //Not working properly just yet - if (rock->respawnTimer != 0) { return; } @@ -55,11 +52,10 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) { } mtxf_pos_rotation_xyz(mtx, rock->pos, rock->rot); + if (render_set_position(mtx, 0) == 0) { return; } - gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_falling_rock); - // @port Pop the transform id. - FrameInterpolation_RecordCloseChild(); + gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_falling_rock); } From f11728b31da9b35c8fcbe69eca123d6887b764d8 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 19:00:55 -0300 Subject: [PATCH 08/11] rag rocks --- src/actors/falling_rock/render.inc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/actors/falling_rock/render.inc.c b/src/actors/falling_rock/render.inc.c index e5ea29188..35876e3a0 100644 --- a/src/actors/falling_rock/render.inc.c +++ b/src/actors/falling_rock/render.inc.c @@ -51,11 +51,17 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) { } } - mtxf_pos_rotation_xyz(mtx, rock->pos, rock->rot); + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("rock", TAG_ITEM_ADDR(rock)); // Not working properly just yet + mtxf_pos_rotation_xyz(mtx, rock->pos, rock->rot); if (render_set_position(mtx, 0) == 0) { + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); return; } - gSPDisplayList(gDisplayListHead++, d_course_choco_mountain_dl_falling_rock); + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } From 64e2a39b446cd358181c0350660e98423d0914f1 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 19:01:56 -0300 Subject: [PATCH 09/11] better tag --- src/actors/falling_rock/render.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actors/falling_rock/render.inc.c b/src/actors/falling_rock/render.inc.c index 35876e3a0..d0d5aa0dc 100644 --- a/src/actors/falling_rock/render.inc.c +++ b/src/actors/falling_rock/render.inc.c @@ -52,7 +52,7 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) { } // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("rock", TAG_ITEM_ADDR(rock)); // Not working properly just yet + FrameInterpolation_RecordOpenChild("rock", (uintptr_t) rock); mtxf_pos_rotation_xyz(mtx, rock->pos, rock->rot); if (render_set_position(mtx, 0) == 0) { From 46abc4f6fccfe8fd4c6c9c9b67e8ddcf0385f988 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 20 May 2025 17:03:04 -0500 Subject: [PATCH 10/11] Tagged player rank placement in HUD --- src/render_objects.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/render_objects.c b/src/render_objects.c index e3a5d869d..ec452f1e0 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -2629,6 +2629,8 @@ void draw_simplified_lap_count(s32 playerId) { } void func_8004E800(s32 playerId) { + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Player place HUD", playerId << 8); if (playerHUD[playerId].unk_81 != 0) { if (playerHUD[playerId].lapCount != 3) { func_8004A384(playerHUD[playerId].rankX + playerHUD[playerId].slideRankX, @@ -2644,6 +2646,8 @@ void func_8004E800(s32 playerId) { 0x00000040, 0x00000080, 0x00000040); } } + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } void func_8004E998(s32 playerId) { From 02d6c6fc99301ec282189285c44101a78804a063 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 20 May 2025 17:03:38 -0500 Subject: [PATCH 11/11] Tagged Bat, Boos, and TrashBin(Banshee Boardwalk objects) --- src/engine/objects/Bat.cpp | 9 +++++++++ src/engine/objects/Boos.cpp | 5 +++++ src/engine/objects/TrashBin.cpp | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/src/engine/objects/Bat.cpp b/src/engine/objects/Bat.cpp index 764476064..2056a17f7 100644 --- a/src/engine/objects/Bat.cpp +++ b/src/engine/objects/Bat.cpp @@ -1,6 +1,7 @@ #include "Bat.h" #include "World.h" #include "CoreMath.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "render_objects.h" @@ -113,6 +114,8 @@ void OBat::Draw(s32 cameraId) { D_80183E80[2] = gObjectList[objectIndex].orientation[2]; if ((D_8018CFB0 != 0) || (D_8018CFC8 != 0)) { for (var_s2 = 0; var_s2 < 40; var_s2++) { + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Bat set 1", var_s2); objectIndex = gObjectParticle2[var_s2]; if (objectIndex == -1) { continue; @@ -124,10 +127,14 @@ void OBat::Draw(s32 cameraId) { func_800431B0(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling, (Vtx*)D_0D0062B0); } + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } } if ((D_8018CFE8 != 0) || (D_8018D000 != 0)) { for (var_s2 = 0; var_s2 < 30; var_s2++) { + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Bat set 2", var_s2); objectIndex = gObjectParticle3[var_s2]; if (objectIndex == -1) { continue; @@ -139,6 +146,8 @@ void OBat::Draw(s32 cameraId) { func_800431B0(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling, (Vtx*)D_0D0062B0); } + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } } gSPTexture(gDisplayListHead++, 0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF); diff --git a/src/engine/objects/Boos.cpp b/src/engine/objects/Boos.cpp index 5bdbd41cf..69bb95072 100644 --- a/src/engine/objects/Boos.cpp +++ b/src/engine/objects/Boos.cpp @@ -1,6 +1,7 @@ #include "Boos.h" #include "World.h" #include "CoreMath.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "render_objects.h" @@ -82,6 +83,8 @@ void OBoos::Draw(s32 cameraId) { s32 objectIndex; for (size_t i = 0; i < _numBoos; i++) { + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Boo", i); objectIndex = _indices[i]; //indexObjectList3[i]; if (gObjectList[objectIndex].state >= 2) { temp_s2 = func_8008A364(objectIndex, cameraId, 0x4000U, 0x00000320); @@ -92,6 +95,8 @@ void OBoos::Draw(s32 cameraId) { func_800523B8(objectIndex, cameraId, temp_s2); } } + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/objects/TrashBin.cpp b/src/engine/objects/TrashBin.cpp index c94d0352f..e721f299c 100644 --- a/src/engine/objects/TrashBin.cpp +++ b/src/engine/objects/TrashBin.cpp @@ -3,6 +3,7 @@ #include "TrashBin.h" #include "World.h" #include "port/Game.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "main.h" @@ -62,11 +63,18 @@ void OTrashBin::Draw(s32 cameraId) { Mat4 mtx; Vec3f Pos = { _pos.x + 63, _pos.y + 12, _pos.z + 25 }; Vec3s Rot = { 0, 0x4000, 0 }; + + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Bin", mtx); + mtxf_pos_rotation_xyz(mtx, Pos, Rot); //mtxf_scale(mtx, 1.0f); if (render_set_position(mtx, 0) != 0) { gSPDisplayList(gDisplayListHead++, BinMod); } + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } } }