Replace FrameInterpolation Pop/Push with RecordOpen/CloseChild (#542)

* Replaced Pop/Push for Yoshi Egg and Mario Sign actors

* Removed comments

* applied suggestions

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
Varuuna 2025-09-26 18:14:45 +02:00 committed by GitHub
parent dbcf1acd2f
commit 72b5773d4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 23 additions and 24 deletions

View File

@ -25,7 +25,7 @@ void render_actor_mario_sign(Camera* arg0, UNUSED Mat4 arg1, struct Actor* arg2)
}
if (!(unk < 0.0f)) {
FrameInterpolation_RecordMatrixPush(mtx);
FrameInterpolation_RecordOpenChild("mario_sign", TAG_OBJECT(arg2));
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
@ -33,7 +33,6 @@ void render_actor_mario_sign(Camera* arg0, UNUSED Mat4 arg1, struct Actor* arg2)
if (render_set_position(mtx, 0) != 0) {
gSPDisplayList(gDisplayListHead++, d_course_mario_raceway_dl_sign);
}
FrameInterpolation_RecordMatrixPop(mtx);
FrameInterpolation_RecordCloseChild();
}
}

View File

@ -53,7 +53,7 @@ void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg,
sp5C[1] = egg->eggRot;
sp5C[2] = 0;
FrameInterpolation_RecordMatrixPush(sp60);
FrameInterpolation_RecordOpenChild("yoshi_egg", TAG_OBJECT(egg));
mtxf_pos_rotation_xyz(sp60, egg->pos, sp5C);
if (render_set_position(sp60, 0) == 0) {
@ -62,18 +62,18 @@ void render_actor_yoshi_egg(Camera* arg0, Mat4 arg1, struct YoshiValleyEgg* egg,
gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_16D70);
FrameInterpolation_RecordMatrixPop(sp60);
FrameInterpolation_RecordCloseChild();
} else {
arg1[3][0] = egg->pos[0];
arg1[3][1] = egg->pos[1];
arg1[3][2] = egg->pos[2];
FrameInterpolation_RecordMatrixPush(arg1);
FrameInterpolation_RecordOpenChild("yoshi_egg2", TAG_OBJECT(egg));
if (render_set_position(arg1, 0) != 0) {
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_egg_lod0);
}
FrameInterpolation_RecordMatrixPop(arg1);
FrameInterpolation_RecordCloseChild();
}
}

View File

@ -96,7 +96,7 @@ void render_limb_or_add_mtx(Armature* arg0, s16* arg1, AnimationLimbVector arg2,
}
angle[i] = arg1[arg2[i].indexCycle + some_offset];
}
FrameInterpolation_RecordMatrixPush(modelMatrix);
FrameInterpolation_RecordOpenChild("animation", TAG_OBJECT(arg0));
mtxf_translate_rotate2(modelMatrix, pos, angle);
//convert_to_fixed_point_matrix_animation(&gGfxPool->mtxHud[gMatrixHudCount], modelMatrix);
sMatrixStackSize += 1;
@ -108,7 +108,7 @@ void render_limb_or_add_mtx(Armature* arg0, s16* arg1, AnimationLimbVector arg2,
model = (virtualModel);
gSPDisplayList(gDisplayListHead++, model);
}
FrameInterpolation_RecordMatrixPop(modelMatrix);
FrameInterpolation_RecordCloseChild();
}
void render_armature(Armature* animation, Animation* arg1, s16 timeCycle) {

View File

@ -686,13 +686,13 @@ void FrameInterpolation_RecordActorPosRotMatrix(void) {
next_is_actor_pos_rot_matrix = true;
}
void FrameInterpolation_RecordMatrixPush(Mat4* matrix) {
if (!check_if_recording()) {
return;
}
append(Op::MatrixPush).matrix_ptr = { (Mat4**) matrix };
}
//void FrameInterpolation_RecordMatrixPush(Mat4* matrix) {
// if (!check_if_recording()) {
// return;
// }
//
// append(Op::MatrixPush).matrix_ptr = { (Mat4**) matrix };
//}
void FrameInterpolation_RecordMarker(const char* file, int line) {
if (!check_if_recording()) {
@ -702,12 +702,12 @@ void FrameInterpolation_RecordMarker(const char* file, int line) {
append(Op::Marker).marker = { file, line };
}
void FrameInterpolation_RecordMatrixPop(Mat4* matrix) {
if (!check_if_recording()) {
return;
}
append(Op::MatrixPop).matrix_ptr = { (Mat4**) matrix };
}
//void FrameInterpolation_RecordMatrixPop(Mat4* matrix) {
// if (!check_if_recording()) {
// return;
// }
// append(Op::MatrixPop).matrix_ptr = { (Mat4**) matrix };
//}
void FrameInterpolation_RecordMatrixPut(MtxF* src) {
if (!check_if_recording()) {

View File

@ -52,9 +52,9 @@ void FrameInterpolation_RecordMatrixPosRotScaleXY(Mat4* matrix, s32 x, s32 y, u1
void FrameInterpolation_Record_SetTextMatrix(Mat4* matrix, f32 x, f32 y, f32 arg3, f32 arg4);
void FrameInterpolation_RecordMatrixPush(Mat4* matrix);
//void FrameInterpolation_RecordMatrixPush(Mat4* matrix);
void FrameInterpolation_RecordMatrixPop(Mat4* matrix);
//void FrameInterpolation_RecordMatrixPop(Mat4* matrix);
void FrameInterpolation_RecordMatrixMult(Mat4* matrix, MtxF* mf, u8 mode);