From c902e200ab1b465f557b2e35c1cdc1a06a74eba8 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Thu, 5 Feb 2026 12:44:26 -0700 Subject: [PATCH] Fix Interp Issues (#641) * Update Seagull.cpp * Update Seagull.h * Update Thwomp.cpp * Update Thwomp.h * Update Crab.cpp * Update render.inc.c * Update Mole.cpp * Update Mole.h * Update Mole.cpp * Update Thwomp.cpp * Update Thwomp.cpp * Update Thwomp.cpp * Update HotAirBalloon.cpp * Update HotAirBalloon.cpp * Update ChainChomp.cpp * Update Hedgehog.h * Update Hedgehog.cpp * Update Snowman.cpp * Update Flagpole.h * Update Flagpole.cpp * Update Flagpole.cpp --- src/actors/cow/render.inc.c | 3 +-- src/engine/objects/ChainChomp.cpp | 5 +++++ src/engine/objects/Crab.cpp | 9 +++++++++ src/engine/objects/Flagpole.cpp | 7 +++++-- src/engine/objects/Flagpole.h | 2 +- src/engine/objects/Hedgehog.cpp | 13 ++++++------- src/engine/objects/Hedgehog.h | 2 +- src/engine/objects/HotAirBalloon.cpp | 7 +++++++ src/engine/objects/Mole.cpp | 20 ++++++++------------ src/engine/objects/Mole.h | 4 ++-- src/engine/objects/Seagull.cpp | 9 ++++++--- src/engine/objects/Seagull.h | 2 +- src/engine/objects/Snowman.cpp | 6 ++---- src/engine/objects/Thwomp.cpp | 9 ++++----- src/engine/objects/Thwomp.h | 2 +- 15 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/actors/cow/render.inc.c b/src/actors/cow/render.inc.c index e15b10853..5c04c8135 100644 --- a/src/actors/cow/render.inc.c +++ b/src/actors/cow/render.inc.c @@ -19,8 +19,7 @@ void render_actor_cow(Camera* camera, Mat4 arg1, struct Actor* arg2) { return; } - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("render_actor_cow", TAG_OBJECT(arg2)); + FrameInterpolation_RecordOpenChild("render_actor_cow", TAG_OBJECT(((uintptr_t)arg2 << 5) | camera->cameraId)); arg1[3][0] = arg2->pos[0]; arg1[3][1] = arg2->pos[1]; diff --git a/src/engine/objects/ChainChomp.cpp b/src/engine/objects/ChainChomp.cpp index db12b3ba2..fcbd19cf9 100644 --- a/src/engine/objects/ChainChomp.cpp +++ b/src/engine/objects/ChainChomp.cpp @@ -1,5 +1,6 @@ #include "ChainChomp.h" #include "World.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "render_objects.h" @@ -79,15 +80,19 @@ void OChainChomp::func_80055AB8(s32 objectIndex, s32 cameraId) { D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos); D_80183E80[2] = 0x8000; + FrameInterpolation_RecordOpenChild("chain_chomp", TAG_OBJECT((_idx << 5) | cameraId)); func_800468E0(D_80183E40, D_80183E80, 0.54f, (u8*) d_course_rainbow_road_sphere, (Vtx*) D_0D0062B0, 0x00000020, 0x00000040, 0x00000020, 0x00000040, 5); + FrameInterpolation_RecordCloseChild(); } else { + FrameInterpolation_RecordOpenChild("chain_chomp2", TAG_OBJECT((_idx << 5) | cameraId)); rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle, gObjectList[objectIndex].sizeScaling); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D0077D0); render_animated_model((Armature*) gObjectList[objectIndex].model, (Animation**) gObjectList[objectIndex].vertex, 0, (s16) gObjectList[objectIndex].textureListIndex); + FrameInterpolation_RecordCloseChild(); } } } diff --git a/src/engine/objects/Crab.cpp b/src/engine/objects/Crab.cpp index c24c07221..7c3bc8d47 100644 --- a/src/engine/objects/Crab.cpp +++ b/src/engine/objects/Crab.cpp @@ -5,6 +5,7 @@ #include "CoreMath.h" #include "port/Game.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "macros.h" @@ -75,9 +76,12 @@ void OCrab::Draw(s32 cameraId) { s32 objectIndex = _objectIndex; if (gObjectList[objectIndex].state >= 2) { camera = &camera1[cameraId]; + FrameInterpolation_RecordOpenChild("crab", (_idx << 5) | cameraId); func_8004A6EC(objectIndex, 0.5f); + FrameInterpolation_RecordCloseChild(); gObjectList[objectIndex].orientation[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos); + FrameInterpolation_RecordOpenChild("crab2", (_idx << 5) | cameraId); rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007D78); @@ -86,6 +90,7 @@ void OCrab::Draw(s32 cameraId) { gSPVertex(gDisplayListHead++, (uintptr_t) common_vtx_crab, 4, 0); gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); + FrameInterpolation_RecordCloseChild(); } } @@ -99,9 +104,12 @@ void OCrab::DrawModel(s32 cameraId) { if (gObjectList[objectIndex].state >= 2) { camera = &camera1[cameraId]; + FrameInterpolation_RecordOpenChild("crab3", (_idx << 5) | cameraId); func_8004A6EC(objectIndex, 0.5f); + FrameInterpolation_RecordCloseChild(); gObjectList[objectIndex].orientation[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos); + FrameInterpolation_RecordOpenChild("crab4", (_idx << 5) | cameraId); rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007D78); @@ -110,6 +118,7 @@ void OCrab::DrawModel(s32 cameraId) { gSPVertex(gDisplayListHead++, (uintptr_t) common_vtx_crab, 4, 0); gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); + FrameInterpolation_RecordCloseChild(); } } } diff --git a/src/engine/objects/Flagpole.cpp b/src/engine/objects/Flagpole.cpp index 9f51bab92..89d9dd825 100644 --- a/src/engine/objects/Flagpole.cpp +++ b/src/engine/objects/Flagpole.cpp @@ -1,5 +1,6 @@ #include "Flagpole.h" #include "World.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "code_800029B0.h" @@ -51,13 +52,14 @@ void OFlagpole::Draw(s32 cameraId) { // func_80055228 func_8008A364(objectIndex, cameraId, 0x4000U, 0x000005DC); if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - OFlagpole::func_80055164(objectIndex); + OFlagpole::func_80055164(cameraId, objectIndex); } } -void OFlagpole::func_80055164(s32 objectIndex) { // func_80055164 +void OFlagpole::func_80055164(s32 cameraId, s32 objectIndex) { // func_80055164 if (gObjectList[objectIndex].state >= 2) { gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077A0); + FrameInterpolation_RecordOpenChild("flagpole", TAG_OBJECT((_idx << 5) | cameraId)); rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling); if (gIsGamePaused == 0) { @@ -68,6 +70,7 @@ void OFlagpole::func_80055164(s32 objectIndex) { // func_80055164 render_animated_model((Armature*) gObjectList[objectIndex].model, (Animation**) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2); } + FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/objects/Flagpole.h b/src/engine/objects/Flagpole.h index 99ef151ba..ebca915d4 100644 --- a/src/engine/objects/Flagpole.h +++ b/src/engine/objects/Flagpole.h @@ -47,7 +47,7 @@ public: virtual void Tick() override; virtual void Draw(s32 cameraId) override; - void func_80055164(s32 objectIndex); + void func_80055164(s32 cameraId, s32 objectIndex); void func_80082F1C(s32 objectIndex); void func_80083018(s32 objectIndex); void func_80083060(s32 objectIndex); diff --git a/src/engine/objects/Hedgehog.cpp b/src/engine/objects/Hedgehog.cpp index a028fde36..d2ffb95af 100644 --- a/src/engine/objects/Hedgehog.cpp +++ b/src/engine/objects/Hedgehog.cpp @@ -81,9 +81,10 @@ void OHedgehog::func_800555BC(s32 objectIndex, s32 cameraId) { if (gObjectList[objectIndex].state >= 2) { camera = &camera1[cameraId]; - OHedgehog::func_8004A870(objectIndex, 0.7f); + OHedgehog::func_8004A870(cameraId, objectIndex, 0.7f); gObjectList[objectIndex].orientation[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos); + FrameInterpolation_RecordOpenChild("hedgehog2", TAG_OBJECT((_idx << 5) | cameraId)); rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007D78); auto tlut = (u8*) gObjectList[objectIndex].activeTLUT; @@ -96,10 +97,11 @@ void OHedgehog::func_800555BC(s32 objectIndex, s32 cameraId) { gSPVertex(gDisplayListHead++, (uintptr_t) vtx, 4, 0); gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display); gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); + FrameInterpolation_RecordCloseChild(); } } -void OHedgehog::func_8004A870(s32 objectIndex, f32 arg1) { +void OHedgehog::func_8004A870(s32 cameraId, s32 objectIndex, f32 arg1) { Mat4 mtx; Object* object; @@ -110,9 +112,7 @@ void OHedgehog::func_8004A870(s32 objectIndex, f32 arg1) { D_80183E50[1] = object->surfaceHeight + 0.8; D_80183E50[2] = object->pos[2]; - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("hedgehog", (uintptr_t) &gObjectList[objectIndex]); - + FrameInterpolation_RecordOpenChild("hedgehog", (uintptr_t) (_idx << 5) | cameraId); set_transform_matrix(mtx, object->unk_01C, D_80183E50, 0U, arg1); // convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], mtx); // gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), @@ -121,7 +121,6 @@ void OHedgehog::func_8004A870(s32 objectIndex, f32 arg1) { AddHudMatrix(mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007B98); - // @port Pop the transform id. FrameInterpolation_RecordCloseChild(); } } @@ -248,4 +247,4 @@ void OHedgehog::DrawEditorProperties() { if (ImGui::Button(ICON_FA_UNDO "##ResetPatrolLoc")) { PatrolEnd = FVector2D(0.0f, 0.0f); } -} \ No newline at end of file +} diff --git a/src/engine/objects/Hedgehog.h b/src/engine/objects/Hedgehog.h index c5df0ea6f..4a377ef32 100644 --- a/src/engine/objects/Hedgehog.h +++ b/src/engine/objects/Hedgehog.h @@ -52,7 +52,7 @@ public: virtual void DrawEditorProperties() override; void func_800555BC(s32 objectIndex, s32 cameraId); - void func_8004A870(s32 objectIndex, f32 arg1); + void func_8004A870(s32 cameraId, s32 objectIndex, f32 arg1); void func_8008311C(s32 objectIndex, s32 arg1); void func_80083248(s32 objectIndex); diff --git a/src/engine/objects/HotAirBalloon.cpp b/src/engine/objects/HotAirBalloon.cpp index 74de17230..e080921e7 100644 --- a/src/engine/objects/HotAirBalloon.cpp +++ b/src/engine/objects/HotAirBalloon.cpp @@ -1,6 +1,7 @@ #include "HotAirBalloon.h" #include "World.h" #include "port/Game.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "render_objects.h" @@ -82,20 +83,26 @@ void OHotAirBalloon::func_80055CCC(s32 objectIndex, s32 cameraId) { if (gObjectList[objectIndex].state >= 2) { func_8008A454(objectIndex, cameraId, 0x0000012C); test = gObjectList[objectIndex].pos[1] - gObjectList[objectIndex].surfaceHeight; + FrameInterpolation_RecordOpenChild("hot_air_balloon", (_objectIndex << 5) | cameraId); func_8004A6EC(objectIndex, (20.0 / test) + 0.5); + FrameInterpolation_RecordCloseChild(); if (is_obj_index_flag_status_inactive(objectIndex, 0x00100000) != 0) { + FrameInterpolation_RecordOpenChild("hot_air_balloon2", (_objectIndex << 5) | cameraId); func_80043328(gObjectList[objectIndex].pos, (u16*) gObjectList[objectIndex].direction_angle, gObjectList[objectIndex].sizeScaling, (Gfx*)d_course_luigi_raceway_dl_F960); gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_luigi_raceway_dl_F650); + FrameInterpolation_RecordCloseChild(); } else { D_80183E80[0] = (s16) gObjectList[objectIndex].direction_angle[0]; D_80183E80[1] = (s16) (func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos) + 0x8000); D_80183E80[2] = (u16) gObjectList[objectIndex].direction_angle[2]; + FrameInterpolation_RecordOpenChild("hot_air_balloon3", (_objectIndex << 5) | cameraId); func_80043328(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling, (Gfx*)d_course_luigi_raceway_dl_FBE0); gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_luigi_raceway_dl_FA20); + FrameInterpolation_RecordCloseChild(); if (gPlayerCountSelection1 == 1) { gObjectList[objectIndex].direction_angle[1] = 0; } diff --git a/src/engine/objects/Mole.cpp b/src/engine/objects/Mole.cpp index 95c32ca0f..fe0211e1f 100644 --- a/src/engine/objects/Mole.cpp +++ b/src/engine/objects/Mole.cpp @@ -1,6 +1,7 @@ #include #include #include "Mole.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "macros.h" @@ -23,7 +24,6 @@ extern "C" { #include "external.h" #include } -#include "port/interpolation/FrameInterpolation.h" size_t OMole::_count = 0; @@ -66,7 +66,7 @@ void OMole::Draw(s32 cameraId) { OMole::func_80054D00(_objectIndex, cameraId); - OMole::func_80054EB8(); + OMole::func_80054EB8(cameraId); if (_idx == 0) { OMole::func_80054F04(cameraId); } @@ -323,12 +323,11 @@ void OMole::func_800821AC(s32 objectIndex, s32 arg1) { } // Holes -void OMole::func_80054E10(s32 objectIndex) { +void OMole::func_80054E10(s32 cameraId, s32 objectIndex) { if (gObjectList[objectIndex].state > 0) { if (is_obj_flag_status_active(objectIndex, 0x00800000) != 0) { - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("func_80054E10", TAG_OBJECT(&gObjectList[objectIndex])); + FrameInterpolation_RecordOpenChild("func_80054E10", TAG_OBJECT((_idx << 5) | cameraId)); D_80183E50[0] = gObjectList[objectIndex].pos[0]; D_80183E50[1] = gObjectList[objectIndex].surfaceHeight + 0.8; @@ -338,18 +337,17 @@ void OMole::func_80054E10(s32 objectIndex) { D_80183E70[2] = gObjectList[objectIndex].velocity[2]; func_8004A9B8(gObjectList[objectIndex].sizeScaling); - // @port Pop the transform id. FrameInterpolation_RecordCloseChild(); } } } // Almost certainly responsible for spawning/handling the moles on Moo Moo farm -void OMole::func_80054EB8() { +void OMole::func_80054EB8(s32 cameraId) { s32 someIndex; // for (someIndex = 0; someIndex < NUM_TOTAL_MOLES; someIndex++) { - func_80054E10(_moleIndex); + func_80054E10(cameraId, _moleIndex); //} } @@ -362,7 +360,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", (uintptr_t)&gObjectList[objectIndex]); + FrameInterpolation_RecordOpenChild("func_80054D00", TAG_OBJECT((_idx << 5) | cameraId)); D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0]; D_80183E80[1] = @@ -394,14 +392,12 @@ void OMole::func_80054F04(s32 cameraId) { if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) { - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("func_80054F04", TAG_OBJECT(object) | (i << 32)); + FrameInterpolation_RecordOpenChild("func_80054F04", TAG_OBJECT(_idx << 13) | (cameraId << 8) | i); object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos); rsp_set_matrix_gObjectList(objectIndex); gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D006980); - // @port Pop the transform id. FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/objects/Mole.h b/src/engine/objects/Mole.h index da3a151a2..342b77aa7 100644 --- a/src/engine/objects/Mole.h +++ b/src/engine/objects/Mole.h @@ -29,8 +29,8 @@ public: virtual void Tick() override; virtual void Draw(s32 cameraId) override; - void func_80054E10(s32 objectIndex); - void func_80054EB8(); + void func_80054E10(s32 cameraId, s32 objectIndex); + void func_80054EB8(s32 cameraId); void func_80054F04(s32 cameraId); void render_object_moles(s32 cameraId); void func_80054D00(s32 objectIndex, s32 cameraId); diff --git a/src/engine/objects/Seagull.cpp b/src/engine/objects/Seagull.cpp index fb926892c..1b9d0f041 100644 --- a/src/engine/objects/Seagull.cpp +++ b/src/engine/objects/Seagull.cpp @@ -5,6 +5,7 @@ #include "World.h" #include "port/Game.h" +#include "port/interpolation/FrameInterpolation.h" extern "C" { #include "macros.h" @@ -120,12 +121,13 @@ void OSeagull::Draw(s32 cameraId) { // render_object_seagulls _toggle = true; } if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - OSeagull::func_800552BC(objectIndex); + OSeagull::func_800552BC(cameraId, objectIndex); } } -void OSeagull::func_800552BC(s32 objectIndex) { +void OSeagull::func_800552BC(s32 cameraId, s32 objectIndex) { if (gObjectList[objectIndex].state >= 2) { + FrameInterpolation_RecordOpenChild("seagull", (objectIndex << 5) | cameraId); rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle, gObjectList[objectIndex].sizeScaling); gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077D0); @@ -137,6 +139,7 @@ void OSeagull::func_800552BC(s32 objectIndex) { render_animated_model((Armature*) gObjectList[objectIndex].model, (Animation**) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2); } + FrameInterpolation_RecordCloseChild(); } } @@ -197,4 +200,4 @@ void OSeagull::func_80082714(s32 objectIndex, s32 arg1) { default: break; } -} \ No newline at end of file +} diff --git a/src/engine/objects/Seagull.h b/src/engine/objects/Seagull.h index 11b59e41c..70b969fe4 100644 --- a/src/engine/objects/Seagull.h +++ b/src/engine/objects/Seagull.h @@ -31,7 +31,7 @@ public: virtual void Tick() override; virtual void Draw(s32 cameraId) override; - void func_800552BC(s32 objectIndex); + void func_800552BC(s32 cameraId, s32 objectIndex); void func_8008275C(s32 objectIndex); void func_8008241C(s32 objectIndex, s32 arg1); diff --git a/src/engine/objects/Snowman.cpp b/src/engine/objects/Snowman.cpp index 6e6335f2c..c68088ed0 100644 --- a/src/engine/objects/Snowman.cpp +++ b/src/engine/objects/Snowman.cpp @@ -123,8 +123,7 @@ void OSnowman::DrawHead(s32 cameraId) { func_8008A364(objectIndex, cameraId, 0x2AABU, 0x00000258); if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("OSnowman::DrawHead", (uintptr_t) &gObjectList[objectIndex]); + FrameInterpolation_RecordOpenChild("OSnowman::DrawHead", (uintptr_t) (_idx << 5) | cameraId); D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0]; D_80183E80[1] = @@ -179,8 +178,7 @@ void OSnowman::DrawBody(s32 cameraId) { func_8008A364(objectIndex, cameraId, 0x2AABU, 0x000001F4); if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("OSnowman::DrawBody", (uintptr_t) object); + FrameInterpolation_RecordOpenChild("OSnowman::DrawBody", (uintptr_t) (_idx << 5) | cameraId); object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], sp44->pos); rsp_set_matrix_gObjectList(objectIndex); diff --git a/src/engine/objects/Thwomp.cpp b/src/engine/objects/Thwomp.cpp index 1bde243a9..fdd36a21b 100644 --- a/src/engine/objects/Thwomp.cpp +++ b/src/engine/objects/Thwomp.cpp @@ -168,8 +168,7 @@ void OThwomp::Tick60fps() { // func_80081210 if (_idx == 0) { for (var_s4 = 0; var_s4 < gObjectParticle2_SIZE; var_s4++) { - // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("Thwomp_part", (uintptr_t) var_s4); + FrameInterpolation_RecordOpenChild("Thwomp_smoke", (uintptr_t) (var_s4 << 5)); objectIndex = gObjectParticle2[var_s4]; if (objectIndex == DELETED_OBJECT_ID) { @@ -715,7 +714,7 @@ void OThwomp::Draw(s32 cameraId) { plusone = gObjectList[objectIndex].unk_0DF + 1; if (gGamestate != CREDITS_SEQUENCE) { - OThwomp::DrawModel(objectIndex); + OThwomp::DrawModel(cameraId, objectIndex); } gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D0079C8); @@ -758,9 +757,9 @@ void OThwomp::Draw(s32 cameraId) { } } -void OThwomp::DrawModel(s32 objectIndex) { +void OThwomp::DrawModel(s32 cameraId, s32 objectIndex) { if ((gObjectList[objectIndex].state >= 2) && (func_80072354(objectIndex, 0x00000040) != 0)) { - FrameInterpolation_RecordOpenChild("Thwomp_Main", TAG_THWOMP(this)); + FrameInterpolation_RecordOpenChild("Thwomp_Main", TAG_THWOMP((_idx << 5) | cameraId)); func_8004A7AC(objectIndex, 1.75f); rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling); diff --git a/src/engine/objects/Thwomp.h b/src/engine/objects/Thwomp.h index 52996a018..b737ee0f4 100644 --- a/src/engine/objects/Thwomp.h +++ b/src/engine/objects/Thwomp.h @@ -71,7 +71,7 @@ public: virtual void DrawEditorProperties() override; void SetVisibility(s32 objectIndex); void func_80080B28(s32 objectIndex, s32 playerId); - void DrawModel(s32); + void DrawModel(s32, s32); void TranslateThwompLights(); void ThwompLights(s32 objectIndex); void func_80080DE4(s32 arg0);