diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2026-03-06 20:10:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 20:10:07 -0700 |
| commit | 132357d9fb50d7962518e10b22db358c85d87ba5 (patch) | |
| tree | 428671c5f9d888bb6905fe20c07d26a70430b392 /src/engine/objects | |
| parent | 25d49df90fe1ab2c95c962d45ef146cb5cf0c794 (diff) | |
Big Interpolation Overhaul (#674)
* Fix FI
* FI statue
* Intepr fixes
* Improve
* More interp
* Fix compile
* More interp
* Fix text
Diffstat (limited to 'src/engine/objects')
| -rw-r--r-- | src/engine/objects/Bat.cpp | 4 | ||||
| -rw-r--r-- | src/engine/objects/Boos.cpp | 10 | ||||
| -rw-r--r-- | src/engine/objects/Boos.h | 2 | ||||
| -rw-r--r-- | src/engine/objects/CheepCheep.cpp | 3 | ||||
| -rw-r--r-- | src/engine/objects/GrandPrixBalloons.cpp | 4 | ||||
| -rw-r--r-- | src/engine/objects/GrandPrixBalloons.h | 2 | ||||
| -rw-r--r-- | src/engine/objects/Lakitu.cpp | 9 | ||||
| -rw-r--r-- | src/engine/objects/Penguin.cpp | 2 | ||||
| -rw-r--r-- | src/engine/objects/Thwomp.cpp | 9 | ||||
| -rw-r--r-- | src/engine/objects/TrashBin.cpp | 4 |
10 files changed, 25 insertions, 24 deletions
diff --git a/src/engine/objects/Bat.cpp b/src/engine/objects/Bat.cpp index 2b6f01230..148725bca 100644 --- a/src/engine/objects/Bat.cpp +++ b/src/engine/objects/Bat.cpp @@ -126,7 +126,7 @@ void OBat::Draw(s32 cameraId) { if ((gObjectList[objectIndex].state >= 2) && (gMatrixHudCount < 0x2EF)) { // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Bat set 1", (uintptr_t) &gObjectList[objectIndex]); + FrameInterpolation_RecordOpenChild("bat_1", (objectIndex << 4) | cameraId); D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], cam->pos); @@ -149,7 +149,7 @@ void OBat::Draw(s32 cameraId) { if ((gObjectList[objectIndex].state >= 2) && (gMatrixHudCount < 0x2EF)) { // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Bat set 2", (uintptr_t) &gObjectList[objectIndex]); + FrameInterpolation_RecordOpenChild("bat_2", (objectIndex << 4) | cameraId); D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], cam->pos); diff --git a/src/engine/objects/Boos.cpp b/src/engine/objects/Boos.cpp index f05d62be1..f41197f46 100644 --- a/src/engine/objects/Boos.cpp +++ b/src/engine/objects/Boos.cpp @@ -104,30 +104,30 @@ void OBoos::Draw(s32 cameraId) { temp_s2 = MIN(temp_s2, 0x15F91U); } - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Boo", (uintptr_t)&gObjectList[objectIndex]); + FrameInterpolation_RecordOpenChild("boo", (objectIndex << 4) | cameraId); if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { func_800523B8(objectIndex, cameraId, temp_s2); } - // @port Pop the transform id. FrameInterpolation_RecordCloseChild(); } } } -void OBoos::func_800523B8(s32 objectIndex, s32 arg1, u32 arg2) { +void OBoos::func_800523B8(s32 objectIndex, s32 cameraId, u32 arg2) { UNUSED s32 pad[2]; Object* object; - Camera* camera = &camera1[arg1]; + Camera* camera = &camera1[cameraId]; object = &gObjectList[objectIndex]; object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos); func_800484BC(object->pos, object->orientation, object->sizeScaling, object->primAlpha, (u8*) object->activeTLUT, (u8*) object->activeTexture, object->vertex, 0x00000030, 0x00000028, 0x00000030, 0x00000028); if ((is_obj_flag_status_active(objectIndex, 0x00000020) != 0) && (arg2 < 0x15F91U)) { + FrameInterpolation_RecordOpenChild("boo_hoo", (objectIndex << 4) | cameraId); func_8004A630(&D_8018C830, object->pos, 0.4f); + FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/objects/Boos.h b/src/engine/objects/Boos.h index b29757fa7..faaf35ee7 100644 --- a/src/engine/objects/Boos.h +++ b/src/engine/objects/Boos.h @@ -63,7 +63,7 @@ public: virtual void Tick() override; virtual void Draw(s32 cameraId) override; virtual void DrawEditorProperties() override; - void func_800523B8(s32 objectIndex, s32 arg1, u32 arg2); + void func_800523B8(s32 objectIndex, s32 cameraId, u32 arg2); void func_8007CA70(void); void func_8007C5B4(s32 objectIndex); diff --git a/src/engine/objects/CheepCheep.cpp b/src/engine/objects/CheepCheep.cpp index f52af62a1..f81aeb795 100644 --- a/src/engine/objects/CheepCheep.cpp +++ b/src/engine/objects/CheepCheep.cpp @@ -1,5 +1,6 @@ #include "CheepCheep.h" #include "port/Game.h" +#include "port/interpolation/FrameInterpolation.h" #include "assets/models/tracks/banshee_boardwalk/banshee_boardwalk_data.h" #include "assets/models/common_data.h" @@ -64,6 +65,7 @@ void OCheepCheep::Draw(s32 cameraId) { // func_8005217C object = &gObjectList[temp_a3]; if (object->state >= 2) { if (is_obj_flag_status_active(temp_a3, 0x10) != 0) { + FrameInterpolation_RecordOpenChild("cheep_cheep", (temp_a3 << 4) | cameraId); rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling); func_800520C0(temp_a3); @@ -80,6 +82,7 @@ void OCheepCheep::Draw(s32 cameraId) { // func_8005217C gSPLight(gDisplayListHead++, &D_800E45C0l[3].l[0], LIGHT_1); gSPLight(gDisplayListHead++, &D_800E45C0l[3].a, LIGHT_2); gSPDisplayList(gDisplayListHead++, (Gfx*) d_course_banshee_boardwalk_dl_7650); + FrameInterpolation_RecordCloseChild(); } } } diff --git a/src/engine/objects/GrandPrixBalloons.cpp b/src/engine/objects/GrandPrixBalloons.cpp index 91b41bc5f..ba1c6f003 100644 --- a/src/engine/objects/GrandPrixBalloons.cpp +++ b/src/engine/objects/GrandPrixBalloons.cpp @@ -104,7 +104,7 @@ void OGrandPrixBalloons::Draw(s32 cameraId) { } } -void OGrandPrixBalloons::func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 vertexIndex, s32 index) { +void OGrandPrixBalloons::func_80053D74(s32 objectIndex, s32 cameraId, s32 vertexIndex, s32 index) { Object* object; Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_hedgehog); @@ -113,7 +113,7 @@ void OGrandPrixBalloons::func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 ver if (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX) { object = &gObjectList[objectIndex]; - FrameInterpolation_RecordOpenChild("Balloon", TAG_ITEM_ADDR((objectIndex << 7 | index))); + FrameInterpolation_RecordOpenChild("balloon", TAG_ITEM_ADDR((objectIndex << 11 | (cameraId << 7) | index))); D_80183E80[2] = (s16) (object->unk_084[6] + 0x8000); rsp_set_matrix_transformation(object->pos, (u16*) D_80183E80, object->sizeScaling); diff --git a/src/engine/objects/GrandPrixBalloons.h b/src/engine/objects/GrandPrixBalloons.h index 3eb4a1dfa..e6a8045b6 100644 --- a/src/engine/objects/GrandPrixBalloons.h +++ b/src/engine/objects/GrandPrixBalloons.h @@ -39,7 +39,7 @@ public: virtual void Tick() override; virtual void Draw(s32 cameraId) override; - void func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 vertexIndex, s32 index); + void func_80053D74(s32 objectIndex, s32 cameraId, s32 vertexIndex, s32 index); void func_80074924(s32 objectIndex); void func_80074D94(s32 objectIndex); diff --git a/src/engine/objects/Lakitu.cpp b/src/engine/objects/Lakitu.cpp index 7034e610b..121191a12 100644 --- a/src/engine/objects/Lakitu.cpp +++ b/src/engine/objects/Lakitu.cpp @@ -118,8 +118,6 @@ void OLakitu::Draw(s32 cameraId) { return; } - FrameInterpolation_RecordOpenChild("Lakitu", (uintptr_t) this); - objectIndex = mLakituId; camera = &cameras[cameraId]; if (is_obj_flag_status_active(objectIndex, 0x00000010) != 0) { @@ -130,6 +128,7 @@ void OLakitu::Draw(s32 cameraId) { if (func_80072354(objectIndex, 2) != 0) { s32 width = object->textureWidth; s32 height = object->textureHeight; + FrameInterpolation_RecordOpenChild("lakitu", (_idx << 4) | cameraId); rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007D78); s32 heightIndex; @@ -140,10 +139,12 @@ void OLakitu::Draw(s32 cameraId) { G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPVertex(gDisplayListHead++, (uintptr_t) object->vertex, 4, 0); gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display); + FrameInterpolation_RecordCloseChild(); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); } else { s32 width = object->textureWidth; s32 height = object->textureHeight; + FrameInterpolation_RecordOpenChild("lakitu2", (_idx << 4) | cameraId); rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007E98); gDPSetAlphaCompare(gDisplayListHead++, G_AC_DITHER); @@ -156,6 +157,7 @@ void OLakitu::Draw(s32 cameraId) { rsp_load_texture((u8*) object->activeTexture, width, height); gSPVertex(gDisplayListHead++, (uintptr_t) object->vertex, 4, 0); gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display); + FrameInterpolation_RecordCloseChild(); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); gDPSetAlphaCompare(gDisplayListHead++, G_AC_NONE); @@ -170,11 +172,12 @@ void OLakitu::Draw(s32 cameraId) { var_f2 = -var_f2; } if ((var_f0 + var_f2) <= 200.0) { + FrameInterpolation_RecordOpenChild("lakitu3", (_idx << 4) | cameraId); func_8004A630(&D_8018C0B0[cameraId], object->pos, 0.35f); + FrameInterpolation_RecordCloseChild(); } } } - FrameInterpolation_RecordCloseChild(); } void OLakitu::func_80079114(s32 objectIndex, s32 playerId, s32 arg2) { diff --git a/src/engine/objects/Penguin.cpp b/src/engine/objects/Penguin.cpp index 27c009489..a645b9633 100644 --- a/src/engine/objects/Penguin.cpp +++ b/src/engine/objects/Penguin.cpp @@ -137,7 +137,7 @@ void OPenguin::Draw(s32 cameraId) { //} temp_s1 = func_8008A364(objectIndex, cameraId, var_s1, drawDistance); if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - func_800557B4(objectIndex, (u32) temp_s1, var_s3); + func_800557B4(objectIndex, cameraId, (u32) temp_s1, var_s3); } } } diff --git a/src/engine/objects/Thwomp.cpp b/src/engine/objects/Thwomp.cpp index 054d8d534..b176dca70 100644 --- a/src/engine/objects/Thwomp.cpp +++ b/src/engine/objects/Thwomp.cpp @@ -170,8 +170,6 @@ void OThwomp::Tick60fps() { // func_80081210 if (_idx == 0) { for (var_s4 = 0; var_s4 < gObjectParticle2_SIZE; var_s4++) { - FrameInterpolation_RecordOpenChild("Thwomp_smoke", (uintptr_t) (var_s4 << 5)); - objectIndex = gObjectParticle2[var_s4]; if (objectIndex == DELETED_OBJECT_ID) { continue; @@ -184,9 +182,6 @@ void OThwomp::Tick60fps() { // func_80081210 continue; } delete_object_wrapper(&gObjectParticle2[var_s4]); - - // @port Pop the transform id. - FrameInterpolation_RecordCloseChild(); } } } @@ -732,9 +727,11 @@ void OThwomp::Draw(s32 cameraId) { if (objectIndex != NULL_OBJECT_ID) { object = &gObjectList[objectIndex]; if ((object->state > 0) && (Behaviour == States::MOVE_FAR)) { + FrameInterpolation_RecordOpenChild("thwomp_particle2", (_idx << 12) | (i << 4) | cameraId); rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling); gSPVertex(gDisplayListHead++, (uintptr_t) D_0D005C00, 3, 0); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D006930); + FrameInterpolation_RecordCloseChild(); } } } @@ -753,7 +750,7 @@ void OThwomp::Draw(s32 cameraId) { if ((object->state >= 2) && (Behaviour == States::MOVE_AND_ROTATE)) { func_8004B138(0x000000FF, 0x000000FF, 0x000000FF, (s32) object->primAlpha); D_80183E80[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos); - FrameInterpolation_RecordOpenChild("thwomp_particle", (i << 16) | (_idx << 6) | cameraId); + FrameInterpolation_RecordOpenChild("thwomp_particle", (_idx << 12) | (i << 4) | cameraId); func_800431B0(object->pos, D_80183E80, object->sizeScaling, (Vtx*) D_0D005AE0); FrameInterpolation_RecordCloseChild(); } diff --git a/src/engine/objects/TrashBin.cpp b/src/engine/objects/TrashBin.cpp index b483a7549..75c5390fa 100644 --- a/src/engine/objects/TrashBin.cpp +++ b/src/engine/objects/TrashBin.cpp @@ -64,8 +64,7 @@ void OTrashBin::Draw(s32 cameraId) { Vec3f Pos = { _pos.x + 63, _pos.y + 12, _pos.z + 25 }; Vec3s Rot = { 0, 0x4000, 0 }; - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("OTrashBin", (uintptr_t) object); + FrameInterpolation_RecordOpenChild("OTrashBin", (_objectIndex << 4) | cameraId); mtxf_pos_rotation_xyz(mtx, Pos, Rot); //mtxf_scale(mtx, 1.0f); @@ -73,7 +72,6 @@ void OTrashBin::Draw(s32 cameraId) { gSPDisplayList(gDisplayListHead++, BinMod); } - // @port Pop the transform id. FrameInterpolation_RecordCloseChild(); } } |
