fix everything else + organization + comments

This commit is contained in:
Reonu 2025-08-03 20:43:16 +01:00
parent 61d5c8c52b
commit 0bf978348e
7 changed files with 80 additions and 23 deletions

View file

@ -76,6 +76,15 @@ void camera_post_play_update(PlayState* play) {
if (force_interpolation) {
force_camera_interpolation();
}
// Dedicated section for workarounds where the heuristic fails to detect small camera teleports.
bool force_no_interpolation = false;
// Music Box House. The camera gets teleported by a very small amount when Link gets the Gibdo mask.
force_no_interpolation = play->sceneId == SCENE_MUSICHOUSE && play->csCtx.scriptIndex == 2 && play->csCtx.curFrame == 525;
if (force_no_interpolation) {
force_camera_skip_interpolation();
}
}
}
}

View file

@ -0,0 +1,26 @@
typedef enum PamelaLimb {
/* 0x00 */ PAMELA_LIMB_NONE,
/* 0x01 */ PAMELA_LIMB_ROOT,
/* 0x02 */ PAMELA_LIMB_UPPER_BODY_ROOT,
/* 0x03 */ PAMELA_LIMB_LEFT_UPPER_ARM,
/* 0x04 */ PAMELA_LIMB_LEFT_FOREARM,
/* 0x05 */ PAMELA_LIMB_LEFT_HAND,
/* 0x06 */ PAMELA_LIMB_RIGHT_UPPER_ARM,
/* 0x07 */ PAMELA_LIMB_RIGHT_FOREARM,
/* 0x08 */ PAMELA_LIMB_RIGHT_HAND,
/* 0x09 */ PAMELA_LIMB_HEAD,
/* 0x0A */ PAMELA_LIMB_HAIR_END,
/* 0x0B */ PAMELA_LIMB_CHEST,
/* 0x0C */ PAMELA_LIMB_NECK,
/* 0x0D */ PAMELA_LIMB_LEFT_THIGH,
/* 0x0E */ PAMELA_LIMB_LEFT_LEG,
/* 0x0F */ PAMELA_LIMB_LEFT_FOOT,
/* 0x10 */ PAMELA_LIMB_RIGHT_THIGH,
/* 0x11 */ PAMELA_LIMB_RIGHT_LEG,
/* 0x12 */ PAMELA_LIMB_RIGHT_FOOT,
/* 0x13 */ PAMELA_LIMB_FRONT_DRESS,
/* 0x14 */ PAMELA_LIMB_BACK_DRESS,
/* 0x15 */ PAMELA_LIMB_ABDOMEN,
/* 0x16 */ PAMELA_LIMB_PELVIS,
/* 0x17 */ PAMELA_LIMB_MAX
} PamelaLimb;

View file

@ -24,6 +24,8 @@ typedef enum {
/* 3 */ HG_CS_SONG_OF_HEALING
} HgCsIndex;
// @recomp Skip interpolation when the animations change during the cutscene, as the
// animation changes are meant to happen at the same time as the camera cuts.
void EnHg_HandleCutscene(EnHg* this, PlayState* play) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_484)) {
s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_484);

View file

@ -18,6 +18,8 @@ extern void EnHgo_Draw(Actor* thisx, PlayState* play);
extern void EnHgo_DoNothing(EnHgo* this, PlayState* play);
extern void EnHgo_SetupInitCollision(EnHgo* this);
// @recomp Skip interpolation when the animations change during the cutscene, as the
// animation changes are meant to happen at the same time as the camera cuts.
RECOMP_PATCH s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play) {
s32 cueChannel;

View file

@ -0,0 +1,26 @@
#include "patches.h"
#include "transform_ids.h"
#include "overlays/actors/ovl_Dm_Char05/z_dm_char05.h"
extern void func_80AADF54(PlayState* play, DmChar05* this);
// @recomp Patched to avoid an interpolation glitch in Pamela's dad's cutscene
// that happens when the mask is meant to teleport offscreen.
RECOMP_PATCH void func_80AADB4C(Actor* thisx, PlayState* play) {
DmChar05* this = (DmChar05*)thisx;
if (this->unk_18E == 0) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_518) &&
(play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518)]->id != 1)) {
// @recomp During this cue the mask does nothing other than teleport offscreen and stay still,
// so we can just skip interpolation the entire time.
if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518)]->id == 3) {
actor_set_interpolation_skipped(thisx);
}
Gfx_SetupDL25_Opa(play->state.gfxCtx);
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, NULL, NULL, &this->actor);
}
} else if (this->unk_18E == 1) {
func_80AADF54(play, this);
}
}

View file

@ -2,6 +2,20 @@
#include "transform_ids.h"
#include "overlays/actors/ovl_En_Pamera/z_en_pamera.h"
extern void EnPamera_Draw(Actor* thisx, PlayState* play);
extern void func_80BD9E88(EnPamera* this);
extern void func_80BD9EE0(EnPamera* this);
extern void func_80BDA038(EnPamera* this);
extern void func_80BDA0A0(EnPamera* this);
extern void func_80BDA170(EnPamera* this);
extern void func_80BDA288(EnPamera* this);
extern void func_80BD994C(EnPamera* this, PlayState* play);
extern void EnPamera_HandleDialogue(EnPamera* this, PlayState* play);
extern void func_80BD9904(EnPamera* this);
extern void func_80BD9E60(EnPamera* this);
// @recomp Skip interpolation when the animations change during the cutscene, as the
// animation changes are meant to happen at the same time as the camera cuts.
RECOMP_PATCH s32 func_80BD9CB8(EnPamera* this, PlayState* play) {
s32 cueChannel;
@ -42,6 +56,7 @@ RECOMP_PATCH s32 func_80BD9CB8(EnPamera* this, PlayState* play) {
default:
break;
}
actor_set_interpolation_skipped(&this->actor);
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
this->setupFunc(this, play);

View file

@ -13,7 +13,6 @@
#include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h"
#include "overlays/actors/ovl_En_Tanron1/z_en_tanron1.h"
#include "overlays/actors/ovl_En_Kusa2/z_en_kusa2.h"
#include "overlays/actors/ovl_Dm_Char05/z_dm_char05.h"
// Decomp renames, TODO update decomp and remove these
#define EnHonotrap_FlameGroup func_8092F878
@ -1375,25 +1374,3 @@ RECOMP_PATCH void func_80A5E6F0(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
}
extern void func_80AADF54(PlayState* play, DmChar05* this);
// @recomp Patched to avoid an interpolation glitch in Pamela's dad's cutscene
// that happens when the mask is meant to teleport offscreen.
RECOMP_PATCH void func_80AADB4C(Actor* thisx, PlayState* play) {
DmChar05* this = (DmChar05*)thisx;
if (this->unk_18E == 0) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_518) &&
(play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518)]->id != 1)) {
// @recomp During this cue the mask does nothing other than teleport offscreen and stay still,
// so we can just skip interpolation the entire time.
if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518)]->id == 3) {
actor_set_interpolation_skipped(thisx);
}
Gfx_SetupDL25_Opa(play->state.gfxCtx);
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, NULL, NULL, &this->actor);
}
} else if (this->unk_18E == 1) {
func_80AADF54(play, this);
}
}