From a33f296e0f0b55106d5f4744798e00b2fffd7620 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 21:50:52 -0300 Subject: [PATCH 01/11] better object interpolation --- src/math_util_2.c | 53 +++++++++++++++++++++++++++++++++----------- src/math_util_2.h | 2 +- src/render_objects.c | 24 +++++++++++--------- 3 files changed, 54 insertions(+), 25 deletions(-) diff --git a/src/math_util_2.c b/src/math_util_2.c index e4fc571d5..b113c6a5d 100644 --- a/src/math_util_2.c +++ b/src/math_util_2.c @@ -690,13 +690,13 @@ UNUSED void func_800421FC(s32 x, s32 y, f32 scale) { void func_80042330(s32 x, s32 y, u16 angle, f32 scale) { Mat4 matrix; - //printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0)); + // printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0)); if (gHUDModes != 2) { if (x < (SCREEN_WIDTH / 2)) { - x = (s32)OTRGetDimensionFromLeftEdge(x); + x = (s32) OTRGetDimensionFromLeftEdge(x); } else { - x = (s32)OTRGetDimensionFromRightEdge(x); + x = (s32) OTRGetDimensionFromRightEdge(x); } } @@ -710,7 +710,7 @@ void func_80042330(s32 x, s32 y, u16 angle, f32 scale) { void func_80042330_unchanged(s32 x, s32 y, u16 angle, f32 scale) { Mat4 matrix; - //printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0)); + // printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0)); mtxf_translation_x_y_rotate_z_scale_x_y(matrix, x, y, angle, scale); // convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], matrix); @@ -723,13 +723,13 @@ void func_80042330_unchanged(s32 x, s32 y, u16 angle, f32 scale) { // Allows a different way of lining up the portraits at the end of race sequence void func_80042330_portrait(s32 x, s32 y, u16 angle, f32 scale, s16 lapCount) { Mat4 matrix; - //printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0)); + // printf("panel %d %d %d\n", x, (s32)OTRGetDimensionFromLeftEdge(x), (s32)OTRGetDimensionFromLeftEdge(0)); if ((gHUDModes != 2) && (D_801657E2 == 0) || (CVarGetInteger("gImprovements", 0) == true)) { if (x < (SCREEN_WIDTH / 2)) { - x = (s32)OTRGetDimensionFromLeftEdge(x); + x = (s32) OTRGetDimensionFromLeftEdge(x); } else { - x = (s32)OTRGetDimensionFromRightEdge(x); + x = (s32) OTRGetDimensionFromRightEdge(x); } } @@ -745,9 +745,9 @@ void func_80042330_wide(s32 x, s32 y, u16 angle, f32 scale) { Mat4 matrix; if (x < (SCREEN_WIDTH / 2)) { - x = (s32)OTRGetDimensionFromLeftEdge(x); + x = (s32) OTRGetDimensionFromLeftEdge(x); } else { - x = (s32)OTRGetDimensionFromRightEdge(x); + x = (s32) OTRGetDimensionFromRightEdge(x); } mtxf_translation_x_y_rotate_z_scale_x_y(matrix, x, y, angle, scale); @@ -808,8 +808,7 @@ UNUSED void func_8004252C(Mat4 arg0, u16 arg1, u16 arg2) { arg0[2][2] = sp28 * cos_theta_y; } -void mtxf_set_matrix_transformation(Mat4 transformMatrix, Vec3f location, Vec3su rotation, - f32 scale) { +void mtxf_set_matrix_transformation(Mat4 transformMatrix, Vec3f location, Vec3su rotation, f32 scale) { FrameInterpolation_RecordSetMatrixTransformation(transformMatrix, location, rotation, scale); f32 sinX = sins(rotation[0]); @@ -864,7 +863,13 @@ void mtxf_set_matrix_scale_transl(Mat4 transformMatrix, Vec3f vec1, Vec3f vec2, * @param arg1 **/ -void mtxf_set_matrix_gObjectList(s32 objectIndex, Mat4 transformMatrix) { +struct ObjectInterpData2 { + s32 objectIndex; + f32 x, y; +}; +struct ObjectInterpData2 prevObject2[OBJECT_LIST_SIZE] = { 0 }; + +s32 mtxf_set_matrix_gObjectList(s32 objectIndex, Mat4 transformMatrix) { f32 sinX; Object* object = &gObjectList[objectIndex]; f32 sinY; @@ -896,6 +901,26 @@ void mtxf_set_matrix_gObjectList(s32 objectIndex, Mat4 transformMatrix) { transformMatrix[1][3] = 0.0f; transformMatrix[2][3] = 0.0f; transformMatrix[3][3] = 1.0f; + + // Search all recorded objects for the one we're drawing + for (int i = 0; i < OBJECT_LIST_SIZE; i++) { + if (objectIndex == prevObject2[i].objectIndex) { + // Coincidence! + // Skip drawing the object this frame if it warped to the other side of the screen + if ((fabsf(object->pos[0] - prevObject2[i].x) > 20) || (fabsf(object->pos[1] - prevObject2[i].y) > 20)) { + prevObject2[objectIndex].x = object->pos[0]; + prevObject2[objectIndex].y = object->pos[1]; + prevObject2[objectIndex].objectIndex = objectIndex; + // printf("IDX: %d X: %f Y: %f Z: %f\n", objectIndex, object->pos[0], object->pos[1], object->pos[2]); + return 1; + } + } + } + prevObject2[objectIndex].x = object->pos[0]; + prevObject2[objectIndex].y = object->pos[1]; + prevObject2[objectIndex].objectIndex = objectIndex; + + return 0; } UNUSED void mtxf_mult_first_column(Mat4 arg0, f32 arg1) { @@ -1065,7 +1090,9 @@ void rsp_set_matrix_transl_rot_scale(Vec3f arg0, Vec3f arg1, f32 arg2) { void rsp_set_matrix_gObjectList(s32 transformIndex) { Mat4 matrix; - mtxf_set_matrix_gObjectList(transformIndex, matrix); + if (mtxf_set_matrix_gObjectList(transformIndex, matrix)) { + return; + } // convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], matrix); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), diff --git a/src/math_util_2.h b/src/math_util_2.h index 5d0837dd9..52b436301 100644 --- a/src/math_util_2.h +++ b/src/math_util_2.h @@ -76,7 +76,7 @@ void func_80042330_portrait(s32, s32, u16, f32, s16); void func_80042330_wide(s32, s32, u16, f32); void mtxf_set_matrix_transformation(Mat4, Vec3f, Vec3su, f32); void mtxf_set_matrix_scale_transl(Mat4, Vec3f, Vec3f, f32); -void mtxf_set_matrix_gObjectList(s32, Mat4); +s32 mtxf_set_matrix_gObjectList(s32, Mat4); void set_transform_matrix(Mat4 dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle, f32 scaleFactor); void vec3f_rotate_x_y(Vec3f, Vec3f, Vec3s); diff --git a/src/render_objects.c b/src/render_objects.c index e3a5d869d..0bfef1437 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -3449,23 +3449,24 @@ void render_object_snowflakes_particles(void) { gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); } -struct CloudInterpData { +struct ObjectInterpData { s32 objectIndex; - s16 x; + s16 x, y; }; -struct CloudInterpData prevClouds[OBJECT_LIST_SIZE] = { 0 }; +struct ObjectInterpData prevObject[OBJECT_LIST_SIZE] = { 0 }; void func_800518F8(s32 objectIndex, s16 x, s16 y) { - // Search all recorded clouds for the one we're drawing + // Search all recorded objects for the one we're drawing for (int i = 0; i < OBJECT_LIST_SIZE; i++) { - if (objectIndex == prevClouds[i].objectIndex) { + if (objectIndex == prevObject[i].objectIndex) { // Coincidence! - // Skip drawing the cloud this frame if it warped to the other side of the screen - if (fabs(x - prevClouds[i].x) > SCREEN_WIDTH / 2) { - prevClouds[objectIndex].x = x; - prevClouds[objectIndex].objectIndex = objectIndex; + // Skip drawing the object this frame if it warped to the other side of the screen + if ((fabs(x - prevObject[i].x) > SCREEN_WIDTH / 2) || (fabs(y - prevObject[i].y) > SCREEN_HEIGHT / 2)) { + prevObject[objectIndex].x = x; + prevObject[objectIndex].y = y; + prevObject[objectIndex].objectIndex = objectIndex; return; } } @@ -3490,8 +3491,9 @@ void func_800518F8(s32 objectIndex, s16 x, s16 y) { } // Save current cloud index and x position - prevClouds[objectIndex].x = x; - prevClouds[objectIndex].objectIndex = objectIndex; + prevObject[objectIndex].x = x; + prevObject[objectIndex].y = y; + prevObject[objectIndex].objectIndex = objectIndex; } void func_800519D4(s32 objectIndex, s16 arg1, s16 arg2) { From 11e4d2a6a9f727c7dc7262e69a28763e0c818fe5 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 21:53:41 -0300 Subject: [PATCH 02/11] shift is not needed here --- src/render_objects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render_objects.c b/src/render_objects.c index e97e9ea1c..3211d0f9b 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -2630,7 +2630,7 @@ void draw_simplified_lap_count(s32 playerId) { void func_8004E800(s32 playerId) { // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Player place HUD", playerId << 8); + FrameInterpolation_RecordOpenChild("Player place HUD", playerId); if (playerHUD[playerId].unk_81 != 0) { if (playerHUD[playerId].lapCount != 3) { func_8004A384(playerHUD[playerId].rankX + playerHUD[playerId].slideRankX, From f4f06585c758f2e1ce584496eeec4c65f8461a92 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 21:55:57 -0300 Subject: [PATCH 03/11] fix tag --- src/engine/objects/TrashBin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/objects/TrashBin.cpp b/src/engine/objects/TrashBin.cpp index e721f299c..361b93631 100644 --- a/src/engine/objects/TrashBin.cpp +++ b/src/engine/objects/TrashBin.cpp @@ -65,7 +65,7 @@ void OTrashBin::Draw(s32 cameraId) { Vec3s Rot = { 0, 0x4000, 0 }; // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Bin", mtx); + FrameInterpolation_RecordOpenChild("Bin", (uintptr_t) object); mtxf_pos_rotation_xyz(mtx, Pos, Rot); //mtxf_scale(mtx, 1.0f); From 1024abdd4afcde0d71866e1b6344436a257ce29b Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 22:06:18 -0300 Subject: [PATCH 04/11] fix tags --- src/engine/objects/Bat.cpp | 55 ++++++++++++++++++--------------- src/engine/objects/Boos.cpp | 11 ++++--- src/engine/objects/TrashBin.cpp | 2 +- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/engine/objects/Bat.cpp b/src/engine/objects/Bat.cpp index 2056a17f7..e4f3a2086 100644 --- a/src/engine/objects/Bat.cpp +++ b/src/engine/objects/Bat.cpp @@ -23,7 +23,7 @@ OBat::OBat(const FVector& pos, const IRotator& rot) { Name = "Bat"; find_unused_obj_index(&_objectIndex); - init_texture_object(_objectIndex, (uint8_t*)d_course_banshee_boardwalk_bat_tlut, sBoardwalkTexList, 0x20U, + init_texture_object(_objectIndex, (uint8_t*) d_course_banshee_boardwalk_bat_tlut, sBoardwalkTexList, 0x20U, (u16) 0x00000040); gObjectList[_objectIndex].orientation[0] = rot.pitch; gObjectList[_objectIndex].orientation[1] = rot.roll; @@ -102,59 +102,64 @@ void OBat::Tick() { } void OBat::Draw(s32 cameraId) { - s32 var_s2; - s32 objectIndex; - Camera* temp_s7; + s32 i; + s32 objectIndex = _objectIndex; + Camera* cam = &camera1[cameraId]; - objectIndex = _objectIndex; - temp_s7 = &camera1[cameraId]; - OBat::func_80046F60((u8*)gObjectList[objectIndex].activeTLUT, (u8*)gObjectList[objectIndex].activeTexture, 0x00000020, 0x00000040, - 5); + OBat::func_80046F60((u8*) gObjectList[objectIndex].activeTLUT, (u8*) gObjectList[objectIndex].activeTexture, + 0x00000020, 0x00000040, 5); D_80183E80[0] = gObjectList[objectIndex].orientation[0]; 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]; + for (i = 0; i < 40; i++) { + objectIndex = gObjectParticle2[i]; if (objectIndex == -1) { continue; } if ((gObjectList[objectIndex].state >= 2) && (gMatrixHudCount < 0x2EF)) { + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Bat set 1", (uintptr_t) &gObjectList[objectIndex]); + D_80183E80[1] = - func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], temp_s7->pos); + func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], cam->pos); func_800431B0(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling, - (Vtx*)D_0D0062B0); + (Vtx*) D_0D0062B0); + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } - // @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]; + for (i = 0; i < 30; i++) { + + objectIndex = gObjectParticle3[i]; if (objectIndex == -1) { continue; } if ((gObjectList[objectIndex].state >= 2) && (gMatrixHudCount < 0x2EF)) { + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Bat set 2", (uintptr_t) &gObjectList[objectIndex]); + D_80183E80[1] = - func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], temp_s7->pos); + func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], cam->pos); func_800431B0(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling, - (Vtx*)D_0D0062B0); + (Vtx*) D_0D0062B0); + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } - // @port Pop the transform id. - FrameInterpolation_RecordCloseChild(); } } gSPTexture(gDisplayListHead++, 0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF); } void OBat::func_80046F60(u8* tlut, u8* arg1, s32 arg2, s32 arg3, s32 arg4) { - gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007D78); + gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007D78); gDPLoadTLUT_pal256(gDisplayListHead++, tlut); rsp_load_texture_mask(arg1, arg2, arg3, arg4); } diff --git a/src/engine/objects/Boos.cpp b/src/engine/objects/Boos.cpp index 69bb95072..5f02d7876 100644 --- a/src/engine/objects/Boos.cpp +++ b/src/engine/objects/Boos.cpp @@ -83,20 +83,23 @@ 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); if (CVarGetInteger("gNoCulling", 0) == 1) { temp_s2 = MIN(temp_s2, 0x15F91U); } + + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Boo", (uintptr_t)&gObjectList[objectIndex]); + if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { func_800523B8(objectIndex, cameraId, temp_s2); } + + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } - // @port Pop the transform id. - FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/objects/TrashBin.cpp b/src/engine/objects/TrashBin.cpp index 361b93631..89ac5dae5 100644 --- a/src/engine/objects/TrashBin.cpp +++ b/src/engine/objects/TrashBin.cpp @@ -65,7 +65,7 @@ void OTrashBin::Draw(s32 cameraId) { Vec3s Rot = { 0, 0x4000, 0 }; // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Bin", (uintptr_t) object); + FrameInterpolation_RecordOpenChild("OTrashBin", (uintptr_t) object); mtxf_pos_rotation_xyz(mtx, Pos, Rot); //mtxf_scale(mtx, 1.0f); From fd711e7c695144c473d4f2abb821cddb619544ff Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 22:24:10 -0300 Subject: [PATCH 05/11] mole comments --- src/engine/objects/Mole.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/Mole.cpp b/src/engine/objects/Mole.cpp index 91eeabebf..f623b1f52 100644 --- a/src/engine/objects/Mole.cpp +++ b/src/engine/objects/Mole.cpp @@ -323,6 +323,7 @@ void OMole::func_800821AC(s32 objectIndex, s32 arg1) { } } +// Holes void OMole::func_80054E10(s32 objectIndex) { if (gObjectList[objectIndex].state > 0) { if (is_obj_flag_status_active(objectIndex, 0x00800000) != 0) { @@ -362,7 +363,7 @@ void OMole::func_80054D00(s32 objectIndex, s32 cameraId) { if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("func_80054D00", TAG_OBJECT(&gObjectList[objectIndex])); + FrameInterpolation_RecordOpenChild("func_80054D00", (uintptr_t)&gObjectList[objectIndex]); D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0]; D_80183E80[1] = @@ -378,6 +379,7 @@ void OMole::func_80054D00(s32 objectIndex, s32 cameraId) { } } +// Mole rocks void OMole::func_80054F04(s32 cameraId) { Camera* camera = &camera1[cameraId]; From 0d6db3ad1ec2235d173142b94a2d8e7f264de3ab Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Tue, 20 May 2025 22:44:06 -0300 Subject: [PATCH 06/11] comment --- src/render_objects.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/render_objects.c b/src/render_objects.c index 3211d0f9b..515a319f9 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -3514,6 +3514,7 @@ void func_800519D4(s32 objectIndex, s16 arg1, s16 arg2) { } } +// Render clouds void func_80051ABC(s16 arg0, s32 arg1) { s32 var_s0; s32 objectIndex; From 6f61776b910cea30f99edf6d087263fd4ca9a991 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 20 May 2025 22:21:38 -0500 Subject: [PATCH 07/11] Changed how shell flames are interpolated. --- src/render_objects.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/render_objects.c b/src/render_objects.c index 3211d0f9b..9492916f7 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -3930,19 +3930,21 @@ void func_8005477C(s32 objectIndex, u8 arg1, Vec3f arg2) { void render_object_smoke_particles(s32 cameraId) { UNUSED s32 stackPadding[2]; Camera* sp54; - s32 var_s0; + s32 i; s32 objectIndex; Object* object; sp54 = &camera1[cameraId]; - FrameInterpolation_RecordOpenChild("SmokeParticles", TAG_OBJECT(sp54)); + gSPDisplayList(gDisplayListHead++, D_0D007AE0); load_texture_block_i8_nomirror(common_texture_particle_smoke[D_80165598], 32, 32); func_8004B72C(255, 255, 255, 255, 255, 255, 255); D_80183E80[0] = 0; D_80183E80[2] = 0x8000; - for (var_s0 = 0; var_s0 < gObjectParticle4_SIZE; var_s0++) { - objectIndex = gObjectParticle4[var_s0]; + for (i = 0; i < gObjectParticle4_SIZE; i++) { + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("SmokeParticles", (uintptr_t) i); + objectIndex = gObjectParticle4[i]; if (objectIndex != NULL_OBJECT_ID) { object = &gObjectList[objectIndex]; if (object->state >= 2) { @@ -3956,8 +3958,10 @@ void render_object_smoke_particles(s32 cameraId) { } } } + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } - FrameInterpolation_RecordCloseChild(); + } UNUSED void func_800557AC() { From ee9ca1a52e35b8480065bdde201f85be022e4677 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 20 May 2025 22:21:51 -0500 Subject: [PATCH 08/11] interpolated ended scene fireworks. --- src/ending/podium_ceremony_actors.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ending/podium_ceremony_actors.c b/src/ending/podium_ceremony_actors.c index 1e3911287..04edd018f 100644 --- a/src/ending/podium_ceremony_actors.c +++ b/src/ending/podium_ceremony_actors.c @@ -18,6 +18,7 @@ #include "code_80281C40.h" #include "math_util.h" #include +#include "port/interpolation/FrameInterpolation.h" #include "src/port/Game.h" #include "engine/Matrix.h" @@ -262,6 +263,9 @@ void render_fireworks(Vec3f arg0, f32 arg1, s32 rgb, s16 alpha) { void firework_update(Firework* actor) { s32 i; Vec3f pos; + + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("render_fireworks", (uintptr_t) actor); if (actor->unk44 < 30) { for (i = 0; i < 10; i++) { pos[0] = actor->pos[0]; @@ -290,6 +294,8 @@ void firework_update(Firework* actor) { } } actor->unk44 += 1; + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } void unused_80280FA0(UNUSED CeremonyActor* actor) { From c97a211a91bff70905e5525fefc5dfa669fca984 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 20 May 2025 22:35:45 -0500 Subject: [PATCH 09/11] Tagged star particles in the ending scene --- src/engine/particles/StarEmitter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/engine/particles/StarEmitter.cpp b/src/engine/particles/StarEmitter.cpp index 242e1a75a..7cb9d9979 100644 --- a/src/engine/particles/StarEmitter.cpp +++ b/src/engine/particles/StarEmitter.cpp @@ -1,6 +1,7 @@ #include "StarEmitter.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "render_objects.h" @@ -107,9 +108,13 @@ void StarEmitter::Draw(s32 cameraId) { // func_80054BE8 D_80183E80[0] = 0; for (var_s0 = 0; var_s0 < gObjectParticle3_SIZE; var_s0++) { temp_a0 = ObjectIndex[var_s0]; + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("Ceremony Stars", (uintptr_t) &ObjectIndex[var_s0]); if ((temp_a0 != -1) && (gObjectList[temp_a0].state >= 2)) { StarEmitter::func_80054AFC(temp_a0, camera->pos); } + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } } From 622795584c1161b4a167575c78f0ff932318ca5f Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 20 May 2025 22:44:51 -0500 Subject: [PATCH 10/11] Shell flames handled better. --- src/render_objects.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/render_objects.c b/src/render_objects.c index f2fd0a67c..3b6aa44c6 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -3943,11 +3943,11 @@ void render_object_smoke_particles(s32 cameraId) { D_80183E80[0] = 0; D_80183E80[2] = 0x8000; for (i = 0; i < gObjectParticle4_SIZE; i++) { - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("SmokeParticles", (uintptr_t) i); objectIndex = gObjectParticle4[i]; if (objectIndex != NULL_OBJECT_ID) { object = &gObjectList[objectIndex]; + // @port: Tag the transform. + FrameInterpolation_RecordOpenChild("SmokeParticles", (uintptr_t) object); if (object->state >= 2) { if (object->unk_0D8 == 3) { func_8008A364(objectIndex, cameraId, 0x4000U, 0x00000514); @@ -3958,11 +3958,10 @@ void render_object_smoke_particles(s32 cameraId) { func_8005477C(objectIndex, object->unk_0D8, sp54->pos); } } + // @port Pop the transform id. + FrameInterpolation_RecordCloseChild(); } - // @port Pop the transform id. - FrameInterpolation_RecordCloseChild(); } - } UNUSED void func_800557AC() { From 1c5c8ceeeef3295c6ea46493ea0e445a71fee7c6 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Wed, 21 May 2025 01:19:49 -0300 Subject: [PATCH 11/11] this isn't needed --- src/camera.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/camera.c b/src/camera.c index 6591dc32e..01ece4a2b 100644 --- a/src/camera.c +++ b/src/camera.c @@ -1125,7 +1125,6 @@ void func_8001EE98(Player* player, Camera* camera, s8 index) { break; } if (gIsGamePaused == 0) { - FrameInterpolation_ShouldInterpolateFrame(false); switch (D_80152300[cameraIndex]) { case 3: func_8001A588(&D_80152300[cameraIndex], camera, player, index, cameraIndex); @@ -1150,7 +1149,6 @@ void func_8001EE98(Player* player, Camera* camera, s8 index) { func_8001EA0C(camera, player, index); break; } - FrameInterpolation_ShouldInterpolateFrame(true); } }