diff --git a/include/functions.h b/include/functions.h index 91fa5d29d9..690558f38a 100644 --- a/include/functions.h +++ b/include/functions.h @@ -722,7 +722,7 @@ void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx); void func_800BA798(PlayState* play, ActorContext* actorCtx); void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play); Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params); -Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 params, u32 cutscene, u32 halfDaysBits, Actor* parent); +Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 params, u32 csId, u32 halfDaysBits, Actor* parent); Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params); void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx); void Enemy_StartFinishingBlow(PlayState* play, Actor* actor); @@ -1064,23 +1064,6 @@ s32 Actor_TrackPlayerSetFocusHeight(PlayState* play, Actor* actor, Vec3s* headRo s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* torsoRot, Vec3f focusPos); void SaveContext_Init(void); -void Cutscene_Init(PlayState* play, CutsceneContext* csCtx); -void Cutscene_Start(PlayState* play, CutsceneContext* csCtx); -void Cutscene_End(PlayState* play, CutsceneContext* csCtx); -void Cutscene_Update1(PlayState* play, CutsceneContext* csCtx); -void Cutscene_Update2(PlayState* play, CutsceneContext* csCtx); -void func_800EDBE0(PlayState* play); -void func_800EDDB0(PlayState* play); -void Cutscene_LoadCutsceneData(PlayState* play, u8 csIndex); -void Cutscene_ActorTranslate(Actor* actor, PlayState* play, s32 actorActionIndex); -void Cutscene_ActorTranslateAndYaw(Actor* actor, PlayState* play, s32 actorActionIndex); -void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, PlayState* play, s32 actorActionIndex); -void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 actorActionIndex); -s32 Cutscene_GetSceneLayer(PlayState* play); -s32 Cutscene_GetActorActionIndex(PlayState* play, u16 actorActionCmd); -s32 Cutscene_CheckActorAction(PlayState* play, u16 actorActionCmd); -u8 Cutscene_IsPlaying(PlayState* play); - void GetItem_Draw(PlayState* play, s16 drawId); void SoundSource_InitAll(PlayState* play); @@ -1090,35 +1073,6 @@ void SoundSource_PlaySfxEachFrameAtFixedWorldPos(PlayState* play, Vec3f* worldPo u16 QuestHint_GetTatlTextId(PlayState* play); u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet); -void EnvFlags_UnsetAll(PlayState* play); -void EnvFlags_Set(PlayState* play, s16 flag); -void EnvFlags_Unset(PlayState* play, s16 flag); -s32 EnvFlags_Get(PlayState* play, s16 flag); -s16 func_800F1460(s16 param_1); -ActorCutscene* ActorCutscene_GetCutsceneImpl(s16 index); -void ActorCutscene_Init(PlayState* play, ActorCutscene* cutscenes, s32 num); -void func_800F15D8(Camera* camera); -void ActorCutscene_ClearWaiting(void); -// void ActorCutscene_ClearNextCutscenes(void); -// void ActorCutscene_MarkNextCutscenes(void); -// void ActorCutscene_End(void); -s16 ActorCutscene_Update(void); -void ActorCutscene_SetIntentToPlay(s16 index); -s16 ActorCutscene_GetCanPlayNext(s16 index); -s16 ActorCutscene_StartAndSetUnkLinkFields(s16 index, Actor* actor); -s16 ActorCutscene_StartAndSetFlag(s16 index, Actor* actor); -s16 ActorCutscene_Start(s16 index, Actor* actor); -s16 ActorCutscene_Stop(s16 index); -s16 ActorCutscene_GetCurrentIndex(void); -ActorCutscene* ActorCutscene_GetCutscene(s16 index); -s16 ActorCutscene_GetAdditionalCutscene(s16 index); -s16 ActorCutscene_GetLength(s16 index); -s32 func_800F2138(s32 arg0); -s32 func_800F2178(s16 arg0); -s16 ActorCutscene_GetCurrentSubCamId(s16 index); -s16 func_800F21CC(void); -s32 func_800F22C4(s16 param_1, Actor* actor); -void ActorCutscene_SetReturnCamera(s16 index); s32 func_800F3940(PlayState* play); // void func_800F39B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); @@ -1776,8 +1730,8 @@ void Scene_Command09(PlayState* play, SceneCmd* cmd); void Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd); void Scene_CommandEchoSetting(PlayState* play, SceneCmd* cmd); void Scene_CommandAltHeaderList(PlayState* play, SceneCmd* cmd); +void Scene_CommandCutsceneScriptList(PlayState* play, SceneCmd* cmd); void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd); -void Scene_CommandActorCutsceneList(PlayState* play, SceneCmd* cmd); void Scene_CommandMiniMap(PlayState* play, SceneCmd* cmd); void Scene_Command1D(PlayState* play, SceneCmd* cmd); void Scene_CommandMiniMapCompassInfo(PlayState* play, SceneCmd* cmd); @@ -1957,27 +1911,6 @@ void Message_FindCreditsMessage(PlayState* play, u16 textId); void func_8015E7EC(PlayState* play, UNK_PTR puParm2); // void func_8015F8A8(UNK_TYPE4 ctxt); -// void func_80161180(void); -s32 func_8016119C(Camera* camera, DbCameraUnkStruct* arg1); -// void func_8016122C(void); -// void func_801612B8(void); -s32 func_80161998(u8* cmd, DbCameraUnkStruct* arg1); -// s32 func_80161BAC(void); -void func_80161BE0(s16 arg0); -void func_80161C0C(void); -// void func_80161C20(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_80161E4C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_801620CC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_8016237C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE4 param_6); -// void func_801623E4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_801624EC(void); -// void func_8016253C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_801629BC(void); -// void func_80162A50(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_80162FF8(void); -// void func_801631DC(void); -// void func_80163334(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); -// void func_80163660(void); void* KaleidoManager_FaultAddrConv(void* address, void* param); void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl); @@ -2070,7 +2003,7 @@ s32 FrameAdvance_IsEnabled(GameState* thisx); s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw); s32 Play_IsUnderwater(PlayState* this, Vec3f* pos); s32 Play_IsDebugCamEnabled(void); -void Play_AssignPlayerActorCsIdsFromScene(GameState* thisx, s32 startActorCsId); +void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId); void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha); void Play_Init(GameState* thisx); @@ -2560,7 +2493,7 @@ OcarinaStaff* AudioOcarina_GetRecordingStaff(void); OcarinaStaff* AudioOcarina_GetPlayingStaff(void); OcarinaStaff* AudioOcarina_GetPlaybackStaff(void); void AudioOcarina_TerminaWallGenerateNotes(void); -void AudioOcarina_PlayLongScarecrowAfterCredits(void); +void AudioOcarina_PlayLongScarecrowSong(void); void Audio_Update(void); void AudioSfx_SetProperties(u8 bankId, u8 entryIndex, u8 channelIndex); diff --git a/include/regs.h b/include/regs.h index 8de13fb66e..112a002398 100644 --- a/include/regs.h +++ b/include/regs.h @@ -166,4 +166,7 @@ extern RegEditor* gRegEditor; #define R_ITEM_ICON_WIDTH(i) VREG(76 + i) #define R_ITEM_BTN_WIDTH(i) VREG(80 + i) +// Name inferred from OoT. Set to true to manually set play->csCtx.script +#define R_USE_DEBUG_CUTSCENE dREG(95) + #endif diff --git a/include/variables.h b/include/variables.h index b90fadcc60..f3d668b2b9 100644 --- a/include/variables.h +++ b/include/variables.h @@ -431,19 +431,9 @@ extern EffectShieldParticleInit shieldParticleInitWood; // extern UNK_TYPE2 D_801BB0FC; // extern UNK_TYPE1 D_801BB100; -extern u8 D_801BB12C; +extern u8 gOpeningEntranceIndex; -// extern UNK_TYPE1 D_801BC41E; -extern ActorCutscene actorCutscenesGlobalCutscenes[8]; -extern s16 actorCutsceneCurrent; -extern s16 actorCutsceneCurrentLength; -extern s16 actorCutsceneEnding; -extern s16 actorCutsceneCurrentCamera; -extern Actor* actorCutsceneCurrentCutsceneActor; -// extern UNK_TYPE4 actorCutsceneStartMethod; -extern PlayState* actorCutscenesPlayState; -extern s16 actorCutsceneReturnCamera; -extern s16 D_801BD8C6; +extern ActorCutscene sGlobalCutsceneList[8]; extern GameStateOverlay gGameStateOverlayTable[]; extern s32 gGraphNumGameStates; // extern UNK_TYPE2 D_801BDA70; @@ -764,7 +754,7 @@ extern s32 gDbgCamEnabled; // extern UNK_TYPE2 sQuakeIndex; // extern UNK_TYPE2 sIsCameraUnderwater; extern Input* D_801D0D60; -// extern UNK_TYPE2 D_801D0D64; +// extern UNK_TYPE2 sPlayerCsIdToCsCamId; // extern UNK_TYPE1 D_801D0D7A; // extern UNK_TYPE1 D_801D0D80; // extern UNK_TYPE1 D_801D11F4; @@ -2335,14 +2325,14 @@ extern SaveContext gSaveContext; // extern UNK_TYPE1 D_801F48C8; extern UNK_TYPE D_801F4DDC; -extern u8 D_801F4DE0; -extern s16 D_801F4DE2; +extern u8 gDisablePlayerCsModeStartPos; +extern s16 gDungeonBossWarpSceneId; -extern ActorCutscene* actorCutscenes; -extern s16 actorCutsceneCount; -extern u8 actorCutsceneWaiting[16]; +extern ActorCutscene* sSceneCutsceneList; +extern s16 sSceneCutsceneCount; +extern u8 sWaitingCutsceneList[16]; // extern UNK_TYPE1 D_801F4E08; -extern u8 actorCutsceneNextCutscenes[16]; +extern u8 sNextCutsceneList[16]; // extern UNK_TYPE1 D_801F4E20; extern u8 D_801F4E30; // extern UNK_TYPE1 D_801F4E31; @@ -2420,7 +2410,7 @@ extern s16 D_801F4E7A; // extern UNK_TYPE1 D_801F6B1E; // extern UNK_TYPE1 D_801F6B20; // extern UNK_TYPE1 D_801F6B22; -// extern UNK_TYPE4 D_801F6B50; +// extern UNK_TYPE4 sCurCsCamera; // extern UNK_TYPE1 D_801F6B58; extern void (*sKaleidoScopeUpdateFunc)(PlayState* play); extern void (*sKaleidoScopeDrawFunc)(PlayState* play); diff --git a/include/z64.h b/include/z64.h index f496f02f1a..50405690f5 100644 --- a/include/z64.h +++ b/include/z64.h @@ -87,19 +87,6 @@ typedef enum { /* 4 */ EQUIP_SLOT_A } EquipSlot; -typedef struct { - /* 0x0 */ s16 priority; // Lower means higher priority. -1 means it ignores priority - /* 0x2 */ s16 length; - /* 0x4 */ s16 csCamSceneDataId; // Index of CsCameraEntry to use. Negative indices use sGlobalCamDataSettings. Indices 0 and above use CsCameraEntry from scene - /* 0x6 */ s16 unk6; - /* 0x8 */ s16 additionalCutscene; - /* 0xA */ u8 sound; - /* 0xB */ u8 unkB; - /* 0xC */ s16 unkC; - /* 0xE */ u8 unkE; - /* 0xF */ u8 letterboxSize; -} ActorCutscene; // size = 0x10 - typedef struct { /* 0x0 */ s8 segment; /* 0x2 */ s16 type; @@ -647,7 +634,7 @@ typedef struct PlayState { /* 0x18790 */ void (*unk_18790)(struct PlayState* play, s16 arg1); /* 0x18794 */ PlayerItemAction (*unk_18794)(struct PlayState* play, Player* player, ItemId itemId); /* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, PlayerAnimationHeader* talkAnim, AnimationMode animMode); - /* 0x1879C */ s16 playerActorCsIds[10]; + /* 0x1879C */ s16 playerCsIds[PLAYER_CS_ID_MAX]; /* 0x187B0 */ MtxF viewProjectionMtxF; /* 0x187F0 */ Vec3f projectionMtxFDiagonal; /* 0x187FC */ MtxF billboardMtxF; @@ -678,7 +665,7 @@ typedef struct PlayState { /* 0x1887F */ u8 transitionType; // fadeTransition /* 0x18880 */ u8 unk_18880; /* 0x18884 */ CollisionCheckContext colChkCtx; - /* 0x18B20 */ u16 envFlags[20]; + /* 0x18B20 */ u16 cutsceneFlags[20]; /* 0x18B48 */ u8 curSpawn; /* 0x18B49 */ u8 unk_18B49; /* 0x18B4A */ u8 transitionMode; @@ -797,35 +784,4 @@ enum fram_mode { FRAM_MODE_STATUS }; -typedef struct { - /* 0x00 */ UNK_TYPE1 unk_00[0x14]; - /* 0x14 */ s16 unk_14; - /* 0x16 */ s16 unk_16; - /* 0x18 */ s16 unk_18; - /* 0x1A */ UNK_TYPE1 unk_1A[0x3]; - /* 0x0C */ u8 unk_1D; - /* 0x1E */ UNK_TYPE1 unk_1E[0xC]; - /* 0x2A */ s16 unk_2A; - /* 0x1E */ UNK_TYPE1 unk_2C[0x1]; - /* 0x2D */ u8 unk_2D; - /* 0x2E */ UNK_TYPE1 unk_2E[2]; -} DbCameraUnkSubStruct; // size = 0x30 - -typedef struct { - /* 0x00 */ s16 unk_00; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ s16 unk_0A; - /* 0x0C */ s16 unk_0C; - /* 0x0E */ UNK_TYPE1 unk_0E[0x02]; - /* 0x10 */ DbCameraUnkSubStruct unk_10; - /* 0x40 */ DbCameraUnkSubStruct unk_40; - /* 0x70 */ UNK_PTR unk_70; - /* 0x74 */ UNK_PTR unk_74; - /* 0x78 */ UNK_PTR unk_78; - /* 0x7C */ Camera* camera; -} DbCameraUnkStruct; // size = 0x80 - #endif diff --git a/include/z64actor.h b/include/z64actor.h index bfce67188a..7cc4275ac6 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -174,7 +174,7 @@ typedef struct Actor { /* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on /* 0x020 */ s16 halfDaysBits; // Bitmask indicating which half-days this actor is allowed to not be killed(?) (TODO: not sure how to word this). If the current halfDayBit is not part of this mask then the actor is killed when spawning the setup actors /* 0x024 */ PosRot world; // Position/rotation in the world - /* 0x038 */ s8 cutscene; + /* 0x038 */ s8 csId; // ActorCutscene index, see `CutsceneId` /* 0x039 */ u8 audioFlags; // Another set of flags? Seems related to sfx or bgm /* 0x03C */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot /* 0x050 */ u16 sfxId; // Id of sound effect to play. Plays when value is set, then is cleared the following update cycle diff --git a/include/z64camera.h b/include/z64camera.h index 9c101bf73b..3205496e73 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -1319,7 +1319,7 @@ typedef struct { /* 0x0C */ f32 unk_0C; /* 0x10 */ f32 unk_10; /* 0x14 */ f32 unk_14; - /* 0x18 */ VecSph unk_18; // sp18-1C-20--24-26-28 // CutsceneCameraPoint? + /* 0x18 */ VecSph unk_18; /* 0x20 */ s16 unk_20; /* 0x22 */ s16 timer; } Demo4ReadWriteData; // size = 0x24 diff --git a/include/z64cutscene.h b/include/z64cutscene.h index f4cc10802c..1fc32be289 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -4,158 +4,575 @@ #include "ultra64.h" #include "unk.h" -typedef struct { - /* 0x0 */ s8 continueFlag; - /* 0x1 */ s8 cameraRoll; - /* 0x2 */ u16 nextPointFrame; - /* 0x4 */ f32 viewAngle; // in degrees - /* 0x8 */ Vec3s pos; -} CutsceneCameraPoint; // size = 0x10 -typedef struct { - /* 0x00 */ Vec3f at; - /* 0x0C */ Vec3f eye; - /* 0x18 */ s16 roll; - /* 0x1A */ s16 fov; -} CutsceneCameraAngle; // size = 0x1C - -typedef struct { - /* 0x0 */ CutsceneCameraPoint* atPoints; - /* 0x4 */ CutsceneCameraPoint* eyePoints; - /* 0x8 */ s16 relativeToPlayer; -} CutsceneCameraMove; // size = 0xC - -typedef struct { - /* 0x00 */ u16 action; // "dousa" - /* 0x02 */ u16 startFrame; - /* 0x04 */ u16 endFrame; - union { - /* 0x06 */ Vec3s rot; - /* 0x06 */ Vec3us urot; +typedef union { + struct { + /* 0x00 */ u16 id; // "dousa" + /* 0x02 */ u16 startFrame; + /* 0x04 */ u16 endFrame; + /* 0x06 */ Vec3us rot; + /* 0x0C */ Vec3i startPos; + /* 0x18 */ Vec3i endPos; + /* 0x24 */ Vec3f normal; }; - /* 0x0C */ Vec3i startPos; - /* 0x18 */ Vec3i endPos; - /* 0x24 */ Vec3f normal; -} CsCmdActorAction; // size = 0x30 + s32 _words[12]; +} CsCmdActorCue; // size = 0x30 -typedef struct { - /* 0x0 */ u16 base; - /* 0x2 */ u16 startFrame; - /* 0x4 */ u16 endFrame; - /* 0x6 */ u16 unk_06; -} CsCmdBase; // size = 0x8 +typedef union { + struct { + /* 0x0 */ u16 type; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + }; + s32 _words[2]; +} CsCmdMisc; // size = 0x30 -typedef struct { - /* 0x0 */ u16 unk0; - /* 0x2 */ u16 startFrame; - /* 0x4 */ u16 endFrame; - /* 0x6 */ u8 hour; - /* 0x7 */ u8 minute; - /* 0x8 */ UNK_TYPE1 unk_08[0x04]; -} CsCmdDayTime; // size = 0xC +typedef union { + struct { + /* 0x0 */ u16 unused0; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + /* 0x6 */ u8 hour; + /* 0x7 */ u8 minute; + }; + s32 _words[3]; +} CsCmdTime; // size = 0xC -typedef struct { - /* 0x0 */ u16 setting; - /* 0x2 */ u16 startFrame; - /* 0x4 */ u16 endFrame; - /* 0x6 */ u16 unk_06; -} CsCmdEnvLighting; // size = 0x8 +typedef union { + struct { + /* 0x0 */ u16 settingPlusOne; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdLightSetting; // size = 0x8 -typedef struct { - /* 0x0 */ u16 sequence; - /* 0x2 */ u16 startFrame; - /* 0x4 */ u16 endFrame; - /* 0x6 */ u16 unk_06; -} CsCmdSequenceChange; // size = 0x8 +typedef union { + struct { + /* 0x0 */ u16 seqIdPlusOne; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + }; + s32 _words[2]; +} CsCmdStartSeq; // size = 0x8 -typedef struct { - /* 0x0 */ u16 type; - /* 0x2 */ u16 startFrame; - /* 0x4 */ u16 endFrame; - /* 0x6 */ u16 unk_06; - /* 0x8 */ u32 unk_08; -} CsCmdSequenceFade; // size = 0xC +typedef union { + struct { + /* 0x0 */ u16 seqIdPlusOne; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + }; + s32 _words[2]; +} CsCmdStopSeq; // size = 0x8 -typedef struct { - /* 0x0 */ u16 base; - /* 0x2 */ u16 startFrame; - /* 0x4 */ u16 endFrame; - /* 0x6 */ u16 type; - /* 0x8 */ u16 textId1; - /* 0xA */ u16 textId2; -} CsCmdTextbox; // size = 0xC +typedef union { + struct { + /* 0x0 */ u16 seqPlayer; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + }; + s32 _words[3]; +} CsCmdFadeOutSeq; // size = 0xC typedef enum { - /* -1 */ CS_TEXTBOX_TYPE_NONE = -1, - /* 0 */ CS_TEXTBOX_TYPE_DEFAULT, - /* 1 */ CS_TEXTBOX_TYPE_1, - /* 2 */ CS_TEXTBOX_TYPE_LEARN_SONG, - /* 3 */ CS_TEXTBOX_TYPE_3, - /* 4 */ CS_TEXTBOX_TYPE_BOSSES_REMAINS, - /* 5 */ CS_TEXTBOX_TYPE_ALL_NORMAL_MASKS -} CutsceneTextboxType; + /* 1 */ CS_FADE_OUT_BGM_MAIN = 1, + /* 2 */ CS_FADE_OUT_FANFARE +} CutsceneFadeOutSeqPlayer; -typedef struct { - /* 0x0 */ u16 type; - /* 0x2 */ u16 startFrame; - /* 0x4 */ u16 endFrame; - /* 0x6 */ u8 intensity; - /* 0x7 */ u8 decayTimer; - /* 0x8 */ u8 decayStep; - /* 0x9 */ UNK_TYPE1 pad9[0x3]; +typedef union { + struct { + /* 0x0 */ u16 unused0; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdStartAmbience; // size = 0x8 + +typedef union { + struct { + /* 0x0 */ u16 unused0; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + }; + s32 _words[2]; +} CsCmdFadeOutAmbience; // size = 0x8 + +typedef union { + struct { + /* 0x0 */ u16 type; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdModifySeq; // size = 0x8 + +typedef enum { + /* 1 */ CS_MOD_SEQ_0 = 1, + /* 2 */ CS_MOD_SEQ_1, + /* 3 */ CS_MOD_SEQ_2, + /* 4 */ CS_MOD_AMBIENCE_0, + /* 5 */ CS_MOD_AMBIENCE_1, + /* 6 */ CS_MOD_AMBIENCE_2, + /* 7 */ CS_MOD_SEQ_STORE, + /* 8 */ CS_MOD_SEQ_RESTORE +} CsModifySeqType; + +typedef union { + struct { + /* 0x0 */ u16 type; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdDestination; // size = 0x8 + +typedef enum { + /* 1 */ CS_DESTINATION_DEFAULT = 1, + /* 2 */ CS_DESTINATION_BOSS_WARP +} CsDestinationType; + +typedef union { + struct { + /* 0x0 */ u16 type; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdChooseCreditsScene; // size = 0x8 + +typedef enum { + /* 1 */ CS_CREDITS_DESTINATION = CS_DESTINATION_DEFAULT, + /* 2 */ CS_CREDITS_MASK_KAMARO, + /* 3 */ CS_CREDITS_MASK_GREAT_FAIRY, + /* 4 */ CS_CREDITS_MASK_ROMANI, + /* 5 */ CS_CREDITS_MASK_BLAST, + /* 6 */ CS_CREDITS_MASK_CIRCUS_LEADER, + /* 7 */ CS_CREDITS_MASK_BREMEN, + /* 8 */ CS_CREDITS_IKANA, + /* 9 */ CS_CREDITS_MASK_COUPLE, + /* 10 */ CS_CREDITS_MASK_BUNNY, + /* 11 */ CS_CREDITS_MASK_POSTMAN +} CsChooseCreditsSceneType; + +typedef union { + struct { + /* 0x0 */ u16 type; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + }; + s32 _words[2]; +} CsCmdMotionBlur; // size = 0x8 + +typedef enum { + /* 1 */ CS_MOTION_BLUR_ENABLE = 1, // enable instantly + /* 2 */ CS_MOTION_BLUR_DISABLE // disable gradually +} CsMotionBlurType; + +typedef union { + struct { + /* 0x0 */ u16 unused0; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdSfxReverbIndexTo2; // size = 0x8 + +typedef union { + struct { + /* 0x0 */ u16 unused0; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdSfxReverbIndexTo1; // size = 0x8 + +typedef union { + struct { + /* 0x0 */ u16 type; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + }; + s32 _words[2]; +} CsCmdTransition; // size = 0x8 + +typedef enum { + /* 1 */ CS_TRANS_GRAY_FILL_IN = 1, // has hardcoded sounds for some scenes + /* 2 */ CS_TRANS_BLUE_FILL_IN, + /* 3 */ CS_TRANS_RED_FILL_OUT, + /* 4 */ CS_TRANS_GREEN_FILL_OUT, + /* 5 */ CS_TRANS_GRAY_FILL_OUT, + /* 6 */ CS_TRANS_BLUE_FILL_OUT, + /* 7 */ CS_TRANS_RED_FILL_IN, + /* 8 */ CS_TRANS_GREEN_FILL_IN, + /* 9 */ CS_TRANS_TRIGGER_INSTANCE, // used with `TRANS_MODE_INSTANCE_WAIT` + /* 10 */ CS_TRANS_BLACK_FILL_OUT, + /* 11 */ CS_TRANS_BLACK_FILL_IN, + /* 12 */ CS_TRANS_GRAY_TO_BLACK, + /* 13 */ CS_TRANS_BLACK_TO_GRAY +} CutsceneTransitionType; + +typedef union { + struct { + /* 0x0 */ u16 textId; // can also be an ocarina action for `CS_TEXT_OCARINA_ACTION` + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + /* 0x6 */ u16 type; + /* 0x8 */ u16 altTextId1; + /* 0xA */ u16 altTextId2; + }; + s32 _words[3]; +} CsCmdText; // size = 0xC + +typedef enum { + /* -1 */ CS_TEXT_TYPE_NONE = -1, + /* 0 */ CS_TEXT_TYPE_DEFAULT, + /* 1 */ CS_TEXT_TYPE_1, + /* 2 */ CS_TEXT_OCARINA_ACTION, + /* 3 */ CS_TEXT_TYPE_3, + /* 4 */ CS_TEXT_TYPE_BOSSES_REMAINS, // use `altText1` in the Giant Cutscene if all remains are already obtained + /* 5 */ CS_TEXT_TYPE_ALL_NORMAL_MASKS +} CutsceneTextType; + +typedef union { + struct { + /* 0x0 */ u16 type; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + /* 0x6 */ u8 intensity; + /* 0x7 */ u8 decayTimer; + /* 0x8 */ u8 decayStep; + }; + s32 _words[3]; } CsCmdRumble; // size = 0xC -typedef struct { - /* 0x0 */ u16 unk0; - /* 0x2 */ u16 startFrame; - /* 0x4 */ u16 endFrame; - /* 0x6 */ Color_RGB8 color; - /* 0x9 */ UNK_TYPE1 pad9[0x3]; -} CsCmdFadeScreen; // size = 0xC +typedef enum { + /* 1 */ CS_RUMBLE_ONCE = 1, // rumble once when startFrame is reached + /* 2 */ CS_RUMBLE_PULSE // rumble every 64 frames between startFrame and endFrame +} CutsceneRumbleType; + +typedef union { + struct { + /* 0x0 */ u16 type; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; + /* 0x6 */ Color_RGB8 color; + }; + s32 _words[3]; +} CsCmdTransitionGeneral; // size = 0xC typedef enum { - /* 0 */ CS_STATE_0, - /* 1 */ CS_STATE_1, - /* 2 */ CS_STATE_2, - /* 3 */ CS_STATE_3, - /* 4 */ CS_STATE_4 + /* 1 */ CS_TRANS_GENERAL_FILL_IN = 1, + /* 2 */ CS_TRANS_GENERAL_FILL_OUT +} CsTransitionGeneralType; + +typedef union { + struct { + /* 0x0 */ u16 giveTatl; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdGiveTatl; // size = 0x8 + +typedef enum { + /* 0 */ CS_STATE_IDLE, + /* 1 */ CS_STATE_START, + /* 2 */ CS_STATE_RUN, + /* 3 */ CS_STATE_STOP, + /* 4 */ CS_STATE_RUN_UNSTOPPABLE } CutsceneState; +typedef union { + struct { + /* 0x0 */ u16 unused0; + /* 0x2 */ u16 startFrame; + /* 0x4 */ u16 endFrame; // unused + }; + s32 _words[2]; +} CsCmdUnimplemented; // size = 0x8 + typedef enum { - /* 0x00A */ CS_CMD_TEXTBOX = 0xA, - /* 0x05A */ CS_CMD_CAMERA = 0x5A, - /* 0x096 */ CS_CMD_MISC = 0x96, - /* 0x097 */ CS_CMD_SET_LIGHTING, - /* 0x098 */ CS_CMD_SCENE_TRANS_FX, - /* 0x099 */ CS_CMD_MOTIONBLUR, - /* 0x09A */ CS_CMD_GIVETATL, - /* 0x09B */ CS_CMD_FADESCREEN, - /* 0x09C */ CS_CMD_FADESEQ, - /* 0x09D */ CS_CMD_SETTIME, - /* 0x0C8 */ CS_CMD_SET_PLAYER_ACTION = 0xC8, - /* 0x0FA */ CS_CMD_UNK_FA = 0xFA, - /* 0x0FE */ CS_CMD_UNK_FE = 0xFE, - /* 0x0FF */ CS_CMD_UNK_FF, - /* 0x100 */ CS_CMD_UNK_100, - /* 0x101 */ CS_CMD_UNK_101, - /* 0x102 */ CS_CMD_UNK_102, - /* 0x103 */ CS_CMD_UNK_103, - /* 0x104 */ CS_CMD_UNK_104, - /* 0x105 */ CS_CMD_UNK_105, - /* 0x108 */ CS_CMD_UNK_108 = 0x108, - /* 0x109 */ CS_CMD_UNK_109, - /* 0x12C */ CS_CMD_PLAYSEQ = 0x12C, - /* 0x12D */ CS_CMD_STOPSEQ, - /* 0x12E */ CS_CMD_PLAYAMBIENCE, - /* 0x12F */ CS_CMD_FADEAMBIENCE, - /* 0x130 */ CS_CMD_130, - /* 0x131 */ CS_CMD_131, - /* 0x132 */ CS_CMD_132, - /* 0x15E */ CS_CMD_TERMINATOR = 0x15E, + /* 0x00A */ CS_CMD_TEXT = 10, + /* 0x05A */ CS_CMD_CAMERA_SPLINE = 90, + /* 0x064 */ CS_CMD_ACTOR_CUE_100 = 100, + /* 0x065 */ CS_CMD_ACTOR_CUE_101, + /* 0x066 */ CS_CMD_ACTOR_CUE_102, + /* 0x067 */ CS_CMD_ACTOR_CUE_103, + /* 0x068 */ CS_CMD_ACTOR_CUE_104, + /* 0x069 */ CS_CMD_ACTOR_CUE_105, + /* 0x06A */ CS_CMD_ACTOR_CUE_106, + /* 0x06B */ CS_CMD_ACTOR_CUE_107, + /* 0x06C */ CS_CMD_ACTOR_CUE_108, + /* 0x06D */ CS_CMD_ACTOR_CUE_109, + /* 0x06E */ CS_CMD_ACTOR_CUE_110, + /* 0x06F */ CS_CMD_ACTOR_CUE_111, + /* 0x070 */ CS_CMD_ACTOR_CUE_112, + /* 0x071 */ CS_CMD_ACTOR_CUE_113, + /* 0x072 */ CS_CMD_ACTOR_CUE_114, + /* 0x073 */ CS_CMD_ACTOR_CUE_115, + /* 0x074 */ CS_CMD_ACTOR_CUE_116, + /* 0x075 */ CS_CMD_ACTOR_CUE_117, + /* 0x076 */ CS_CMD_ACTOR_CUE_118, + /* 0x077 */ CS_CMD_ACTOR_CUE_119, + /* 0x078 */ CS_CMD_ACTOR_CUE_120, + /* 0x079 */ CS_CMD_ACTOR_CUE_121, + /* 0x07A */ CS_CMD_ACTOR_CUE_122, + /* 0x07B */ CS_CMD_ACTOR_CUE_123, + /* 0x07C */ CS_CMD_ACTOR_CUE_124, + /* 0x07D */ CS_CMD_ACTOR_CUE_125, + /* 0x07E */ CS_CMD_ACTOR_CUE_126, + /* 0x07F */ CS_CMD_ACTOR_CUE_127, + /* 0x080 */ CS_CMD_ACTOR_CUE_128, + /* 0x081 */ CS_CMD_ACTOR_CUE_129, + /* 0x082 */ CS_CMD_ACTOR_CUE_130, + /* 0x083 */ CS_CMD_ACTOR_CUE_131, + /* 0x084 */ CS_CMD_ACTOR_CUE_132, + /* 0x085 */ CS_CMD_ACTOR_CUE_133, + /* 0x086 */ CS_CMD_ACTOR_CUE_134, + /* 0x087 */ CS_CMD_ACTOR_CUE_135, + /* 0x088 */ CS_CMD_ACTOR_CUE_136, + /* 0x089 */ CS_CMD_ACTOR_CUE_137, + /* 0x08A */ CS_CMD_ACTOR_CUE_138, + /* 0x08B */ CS_CMD_ACTOR_CUE_139, + /* 0x08C */ CS_CMD_ACTOR_CUE_140, + /* 0x08D */ CS_CMD_ACTOR_CUE_141, + /* 0x08E */ CS_CMD_ACTOR_CUE_142, + /* 0x08F */ CS_CMD_ACTOR_CUE_143, + /* 0x090 */ CS_CMD_ACTOR_CUE_144, + /* 0x091 */ CS_CMD_ACTOR_CUE_145, + /* 0x092 */ CS_CMD_ACTOR_CUE_146, + /* 0x093 */ CS_CMD_ACTOR_CUE_147, + /* 0x094 */ CS_CMD_ACTOR_CUE_148, + /* 0x095 */ CS_CMD_ACTOR_CUE_149, + /* 0x096 */ CS_CMD_MISC, + /* 0x097 */ CS_CMD_LIGHT_SETTING, + /* 0x098 */ CS_CMD_TRANSITION, + /* 0x099 */ CS_CMD_MOTION_BLUR, + /* 0x09A */ CS_CMD_GIVE_TATL, + /* 0x09B */ CS_CMD_TRANSITION_GENERAL, + /* 0x09C */ CS_CMD_FADE_OUT_SEQ, + /* 0x09D */ CS_CMD_TIME, + /* 0x0C8 */ CS_CMD_PLAYER_CUE = 200, + /* 0x0C9 */ CS_CMD_ACTOR_CUE_201, + /* 0x0FA */ CS_CMD_UNK_DATA_FA = 0xFA, + /* 0x0FE */ CS_CMD_UNK_DATA_FE = 0xFE, + /* 0x0FF */ CS_CMD_UNK_DATA_FF, + /* 0x100 */ CS_CMD_UNK_DATA_100, + /* 0x101 */ CS_CMD_UNK_DATA_101, + /* 0x102 */ CS_CMD_UNK_DATA_102, + /* 0x103 */ CS_CMD_UNK_DATA_103, + /* 0x104 */ CS_CMD_UNK_DATA_104, + /* 0x105 */ CS_CMD_UNK_DATA_105, + /* 0x108 */ CS_CMD_UNK_DATA_108 = 0x108, + /* 0x109 */ CS_CMD_UNK_DATA_109, + /* 0x12C */ CS_CMD_START_SEQ = 300, + /* 0x12D */ CS_CMD_STOP_SEQ, + /* 0x12E */ CS_CMD_START_AMBIENCE, + /* 0x12F */ CS_CMD_FADE_OUT_AMBIENCE, + /* 0x130 */ CS_CMD_SFX_REVERB_INDEX_2, + /* 0x131 */ CS_CMD_SFX_REVERB_INDEX_1, + /* 0x132 */ CS_CMD_MODIFY_SEQ, + /* 0x15E */ CS_CMD_DESTINATION = 350, /* 0x15F */ CS_CMD_CHOOSE_CREDITS_SCENES, - /* 0x190 */ CS_CMD_RUMBLE = 0x190 + /* 0x190 */ CS_CMD_RUMBLE = 400, + /* 0x1C2 */ CS_CMD_ACTOR_CUE_450 = 450, + /* 0x1C3 */ CS_CMD_ACTOR_CUE_451, + /* 0x1C4 */ CS_CMD_ACTOR_CUE_452, + /* 0x1C5 */ CS_CMD_ACTOR_CUE_453, + /* 0x1C6 */ CS_CMD_ACTOR_CUE_454, + /* 0x1C7 */ CS_CMD_ACTOR_CUE_455, + /* 0x1C8 */ CS_CMD_ACTOR_CUE_456, + /* 0x1C9 */ CS_CMD_ACTOR_CUE_457, + /* 0x1CA */ CS_CMD_ACTOR_CUE_458, + /* 0x1CB */ CS_CMD_ACTOR_CUE_459, + /* 0x1CC */ CS_CMD_ACTOR_CUE_460, + /* 0x1CD */ CS_CMD_ACTOR_CUE_461, + /* 0x1CE */ CS_CMD_ACTOR_CUE_462, + /* 0x1CF */ CS_CMD_ACTOR_CUE_463, + /* 0x1D0 */ CS_CMD_ACTOR_CUE_464, + /* 0x1D1 */ CS_CMD_ACTOR_CUE_465, + /* 0x1D2 */ CS_CMD_ACTOR_CUE_466, + /* 0x1D3 */ CS_CMD_ACTOR_CUE_467, + /* 0x1D4 */ CS_CMD_ACTOR_CUE_468, + /* 0x1D5 */ CS_CMD_ACTOR_CUE_469, + /* 0x1D6 */ CS_CMD_ACTOR_CUE_470, + /* 0x1D7 */ CS_CMD_ACTOR_CUE_471, + /* 0x1D8 */ CS_CMD_ACTOR_CUE_472, + /* 0x1D9 */ CS_CMD_ACTOR_CUE_473, + /* 0x1DA */ CS_CMD_ACTOR_CUE_474, + /* 0x1DB */ CS_CMD_ACTOR_CUE_475, + /* 0x1DC */ CS_CMD_ACTOR_CUE_476, + /* 0x1DD */ CS_CMD_ACTOR_CUE_477, + /* 0x1DE */ CS_CMD_ACTOR_CUE_478, + /* 0x1DF */ CS_CMD_ACTOR_CUE_479, + /* 0x1E0 */ CS_CMD_ACTOR_CUE_480, + /* 0x1E1 */ CS_CMD_ACTOR_CUE_481, + /* 0x1E2 */ CS_CMD_ACTOR_CUE_482, + /* 0x1E3 */ CS_CMD_ACTOR_CUE_483, + /* 0x1E4 */ CS_CMD_ACTOR_CUE_484, + /* 0x1E5 */ CS_CMD_ACTOR_CUE_485, + /* 0x1E6 */ CS_CMD_ACTOR_CUE_486, + /* 0x1E7 */ CS_CMD_ACTOR_CUE_487, + /* 0x1E8 */ CS_CMD_ACTOR_CUE_488, + /* 0x1E9 */ CS_CMD_ACTOR_CUE_489, + /* 0x1EA */ CS_CMD_ACTOR_CUE_490, + /* 0x1EB */ CS_CMD_ACTOR_CUE_491, + /* 0x1EC */ CS_CMD_ACTOR_CUE_492, + /* 0x1ED */ CS_CMD_ACTOR_CUE_493, + /* 0x1EE */ CS_CMD_ACTOR_CUE_494, + /* 0x1EF */ CS_CMD_ACTOR_CUE_495, + /* 0x1F0 */ CS_CMD_ACTOR_CUE_496, + /* 0x1F1 */ CS_CMD_ACTOR_CUE_497, + /* 0x1F2 */ CS_CMD_ACTOR_CUE_498, + /* 0x1F3 */ CS_CMD_ACTOR_CUE_499, + /* 0x1F4 */ CS_CMD_ACTOR_CUE_500, + /* 0x1F5 */ CS_CMD_ACTOR_CUE_501, + /* 0x1F6 */ CS_CMD_ACTOR_CUE_502, + /* 0x1F7 */ CS_CMD_ACTOR_CUE_503, + /* 0x1F8 */ CS_CMD_ACTOR_CUE_504, + /* 0x1F9 */ CS_CMD_ACTOR_CUE_505, + /* 0x1FA */ CS_CMD_ACTOR_CUE_506, + /* 0x1FB */ CS_CMD_ACTOR_CUE_507, + /* 0x1FC */ CS_CMD_ACTOR_CUE_508, + /* 0x1FD */ CS_CMD_ACTOR_CUE_509, + /* 0x1FE */ CS_CMD_ACTOR_CUE_510, + /* 0x1FF */ CS_CMD_ACTOR_CUE_511, + /* 0x200 */ CS_CMD_ACTOR_CUE_512, + /* 0x201 */ CS_CMD_ACTOR_CUE_513, + /* 0x202 */ CS_CMD_ACTOR_CUE_514, + /* 0x203 */ CS_CMD_ACTOR_CUE_515, + /* 0x204 */ CS_CMD_ACTOR_CUE_516, + /* 0x205 */ CS_CMD_ACTOR_CUE_517, + /* 0x206 */ CS_CMD_ACTOR_CUE_518, + /* 0x207 */ CS_CMD_ACTOR_CUE_519, + /* 0x208 */ CS_CMD_ACTOR_CUE_520, + /* 0x209 */ CS_CMD_ACTOR_CUE_521, + /* 0x20A */ CS_CMD_ACTOR_CUE_522, + /* 0x20B */ CS_CMD_ACTOR_CUE_523, + /* 0x20C */ CS_CMD_ACTOR_CUE_524, + /* 0x20D */ CS_CMD_ACTOR_CUE_525, + /* 0x20E */ CS_CMD_ACTOR_CUE_526, + /* 0x20F */ CS_CMD_ACTOR_CUE_527, + /* 0x210 */ CS_CMD_ACTOR_CUE_528, + /* 0x211 */ CS_CMD_ACTOR_CUE_529, + /* 0x212 */ CS_CMD_ACTOR_CUE_530, + /* 0x213 */ CS_CMD_ACTOR_CUE_531, + /* 0x214 */ CS_CMD_ACTOR_CUE_532, + /* 0x215 */ CS_CMD_ACTOR_CUE_533, + /* 0x216 */ CS_CMD_ACTOR_CUE_534, + /* 0x217 */ CS_CMD_ACTOR_CUE_535, + /* 0x218 */ CS_CMD_ACTOR_CUE_536, + /* 0x219 */ CS_CMD_ACTOR_CUE_537, + /* 0x21A */ CS_CMD_ACTOR_CUE_538, + /* 0x21B */ CS_CMD_ACTOR_CUE_539, + /* 0x21C */ CS_CMD_ACTOR_CUE_540, + /* 0x21D */ CS_CMD_ACTOR_CUE_541, + /* 0x21E */ CS_CMD_ACTOR_CUE_542, + /* 0x21F */ CS_CMD_ACTOR_CUE_543, + /* 0x220 */ CS_CMD_ACTOR_CUE_544, + /* 0x221 */ CS_CMD_ACTOR_CUE_545, + /* 0x222 */ CS_CMD_ACTOR_CUE_546, + /* 0x223 */ CS_CMD_ACTOR_CUE_547, + /* 0x224 */ CS_CMD_ACTOR_CUE_548, + /* 0x225 */ CS_CMD_ACTOR_CUE_549, + /* 0x226 */ CS_CMD_ACTOR_CUE_550, + /* 0x227 */ CS_CMD_ACTOR_CUE_551, + /* 0x228 */ CS_CMD_ACTOR_CUE_552, + /* 0x229 */ CS_CMD_ACTOR_CUE_553, + /* 0x22A */ CS_CMD_ACTOR_CUE_554, + /* 0x22B */ CS_CMD_ACTOR_CUE_555, + /* 0x22C */ CS_CMD_ACTOR_CUE_556, + /* 0x22D */ CS_CMD_ACTOR_CUE_557, + /* 0x22E */ CS_CMD_ACTOR_CUE_558, + /* 0x22F */ CS_CMD_ACTOR_CUE_559, + /* 0x230 */ CS_CMD_ACTOR_CUE_560, + /* 0x231 */ CS_CMD_ACTOR_CUE_561, + /* 0x232 */ CS_CMD_ACTOR_CUE_562, + /* 0x233 */ CS_CMD_ACTOR_CUE_563, + /* 0x234 */ CS_CMD_ACTOR_CUE_564, + /* 0x235 */ CS_CMD_ACTOR_CUE_565, + /* 0x236 */ CS_CMD_ACTOR_CUE_566, + /* 0x237 */ CS_CMD_ACTOR_CUE_567, + /* 0x238 */ CS_CMD_ACTOR_CUE_568, + /* 0x239 */ CS_CMD_ACTOR_CUE_569, + /* 0x23A */ CS_CMD_ACTOR_CUE_570, + /* 0x23B */ CS_CMD_ACTOR_CUE_571, + /* 0x23C */ CS_CMD_ACTOR_CUE_572, + /* 0x23D */ CS_CMD_ACTOR_CUE_573, + /* 0x23E */ CS_CMD_ACTOR_CUE_574, + /* 0x23F */ CS_CMD_ACTOR_CUE_575, + /* 0x240 */ CS_CMD_ACTOR_CUE_576, + /* 0x241 */ CS_CMD_ACTOR_CUE_577, + /* 0x242 */ CS_CMD_ACTOR_CUE_578, + /* 0x243 */ CS_CMD_ACTOR_CUE_579, + /* 0x244 */ CS_CMD_ACTOR_CUE_580, + /* 0x245 */ CS_CMD_ACTOR_CUE_581, + /* 0x246 */ CS_CMD_ACTOR_CUE_582, + /* 0x247 */ CS_CMD_ACTOR_CUE_583, + /* 0x248 */ CS_CMD_ACTOR_CUE_584, + /* 0x249 */ CS_CMD_ACTOR_CUE_585, + /* 0x24A */ CS_CMD_ACTOR_CUE_586, + /* 0x24B */ CS_CMD_ACTOR_CUE_587, + /* 0x24C */ CS_CMD_ACTOR_CUE_588, + /* 0x24D */ CS_CMD_ACTOR_CUE_589, + /* 0x24E */ CS_CMD_ACTOR_CUE_590, + /* 0x24F */ CS_CMD_ACTOR_CUE_591, + /* 0x250 */ CS_CMD_ACTOR_CUE_592, + /* 0x251 */ CS_CMD_ACTOR_CUE_593, + /* 0x252 */ CS_CMD_ACTOR_CUE_594, + /* 0x253 */ CS_CMD_ACTOR_CUE_595, + /* 0x254 */ CS_CMD_ACTOR_CUE_596, + /* 0x255 */ CS_CMD_ACTOR_CUE_597, + /* 0x256 */ CS_CMD_ACTOR_CUE_598, + /* 0x257 */ CS_CMD_ACTOR_CUE_599, + /* -2 */ CS_CMD_ACTOR_CUE_POST_PROCESS = 0xFFFFFFFE, + /* -1 */ CS_CAM_STOP // OoT Remnant } CutsceneCmd; +typedef enum { + /* 0x00 */ CS_MISC_UNIMPLEMENTED_0, + /* 0x01 */ CS_MISC_RAIN, + /* 0x02 */ CS_MISC_LIGHTNING, + /* 0x03 */ CS_MISC_LIFT_FOG, + /* 0x04 */ CS_MISC_CLOUDY_SKY, + /* 0x05 */ CS_MISC_STOP_CUTSCENE, + /* 0x06 */ CS_MISC_UNIMPLEMENTED_6, + /* 0x07 */ CS_MISC_SHOW_TITLE_CARD, + /* 0x08 */ CS_MISC_EARTHQUAKE_MEDIUM, + /* 0x09 */ CS_MISC_EARTHQUAKE_STOP, + /* 0x0A */ CS_MISC_VISMONO_BLACK_AND_WHITE, + /* 0x0B */ CS_MISC_VISMONO_SEPIA, + /* 0x0C */ CS_MISC_HIDE_ROOM, + /* 0x0D */ CS_MISC_RED_PULSATING_LIGHTS, + /* 0x0E */ CS_MISC_HALT_ALL_ACTORS, + /* 0x0F */ CS_MISC_RESUME_ALL_ACTORS, + /* 0x10 */ CS_MISC_SANDSTORM_FILL, + /* 0x11 */ CS_MISC_SUNSSONG_START, + /* 0x12 */ CS_MISC_FREEZE_TIME, + /* 0x13 */ CS_MISC_LONG_SCARECROW_SONG, + /* 0x14 */ CS_MISC_SET_CSFLAG_3, + /* 0x15 */ CS_MISC_SET_CSFLAG_4, + /* 0x16 */ CS_MISC_PLAYER_FORM_DEKU, + /* 0x17 */ CS_MISC_ENABLE_PLAYER_REFLECTION, + /* 0x18 */ CS_MISC_DISABLE_PLAYER_REFLECTION, + /* 0x19 */ CS_MISC_PLAYER_FORM_HUMAN, + /* 0x1A */ CS_MISC_EARTHQUAKE_STRONG, + /* 0x1B */ CS_MISC_DEST_MOON_CRASH_FIRE_WALL, + /* 0x1C */ CS_MISC_MOON_CRASH_SKYBOX, + /* 0x1D */ CS_MISC_PLAYER_FORM_RESTORED, + /* 0x1E */ CS_MISC_DISABLE_PLAYER_CSMODE_START_POS, + /* 0x1F */ CS_MISC_ENABLE_PLAYER_CSMODE_START_POS, + /* 0x20 */ CS_MISC_UNIMPLEMENTED_20, + /* 0x21 */ CS_MISC_SAVE_ENTER_CLOCK_TOWN, + /* 0x22 */ CS_MISC_RESET_SAVE_FROM_MOON_CRASH, + /* 0x23 */ CS_MISC_TIME_ADVANCE, + /* 0x24 */ CS_MISC_EARTHQUAKE_WEAK, + /* 0x25 */ CS_MISC_UNIMPLEMENTED_25, + /* 0x26 */ CS_MISC_DAWN_OF_A_NEW_DAY, + /* 0x27 */ CS_MISC_PLAYER_FORM_ZORA, + /* 0x28 */ CS_MISC_FINALE +} CutsceneMiscType; + typedef union CutsceneData { s32 i; f32 f; @@ -163,29 +580,291 @@ typedef union CutsceneData { s8 b[4]; } CutsceneData; -typedef struct { - /* 0x0 */ CutsceneData* segmentedData; - /* 0x4 */ s16 nextEntrance; - /* 0x6 */ u8 unk6; - /* 0x7 */ u8 unk7; // a weekEventReg bitpack? -} CutsceneEntry; // size = 0x8 +#define BIT_FLAG_TO_SHIFT(flag) \ + ((flag & 0x80) ? 7 : \ + (flag & 0x40) ? 6 : \ + (flag & 0x20) ? 5 : \ + (flag & 0x10) ? 4 : \ + (flag & 0x8) ? 3 : \ + (flag & 0x4) ? 2 : \ + (flag & 0x2) ? 1 : \ + (flag & 0x1) ? 0 : \ + 0) + +// Do not trigger the scripted cutscene upon any spawn +#define CS_SPAWN_FLAG_NONE 0xFF +// Always trigger the scripted cutscene upon the specified spawn +#define CS_SPAWN_FLAG_ALWAYS 0xFE +// Trigger the scripted cutscene once upon the specified spawn if `weekEventFlags` is not set. Set `weekEventFlags` after the cutscene. +//! @note Despite there being more than `0x1F` indices for weekEventFlags, this u8 flag entry can only check weekEventFlags with indices [0 - 0x1F] +#define CS_SPAWN_FLAG_ONCE(weekEventFlag) ((((weekEventFlag) & 0x1F00) >> 5) | BIT_FLAG_TO_SHIFT((weekEventFlag) & 0xFF)) + +#define CHECK_CS_SPAWN_FLAG_WEEKEVENTREG(spawnFlags) (GET_WEEKEVENTREG((spawnFlags) / 8) & (1 << ((spawnFlags) % 8))) +#define SET_CS_SPAWN_FLAG_WEEKEVENTREG(spawnFlags) (WEEKEVENTREG((spawnFlags) / 8) = GET_WEEKEVENTREG((spawnFlags) / 8) | (1 << ((spawnFlags) % 8))) + typedef struct { - /* 0x00 */ u8 sceneCsCount; - /* 0x04 */ CutsceneData* csData; - /* 0x08 */ u8 state; - /* 0x0C */ f32 unk_0C; - /* 0x10 */ u16 frames; - /* 0x12 */ u16 currentCsIndex; - /* 0x14 */ s32 subCamId; - /* 0x18 */ u16 unk_18; - /* 0x1A */ u8 unk_1A; - /* 0x1B */ u8 unk_1B; - /* 0x1C */ CutsceneCameraPoint* atPoints; - /* 0x20 */ CutsceneCameraPoint* eyePoints; - /* 0x24 */ CsCmdActorAction* playerAction; - /* 0x28 */ CsCmdActorAction* actorActions[10]; // "npcdemopnt" - /* 0x50 */ CutsceneEntry* sceneCsList; + /* 0x0 */ CutsceneData* script; + /* 0x4 */ s16 nextEntrance; + /* 0x6 */ u8 spawn; + /* 0x7 */ u8 spawnFlags; // See `CS_SPAWN_FLAG_` +} CutsceneScriptEntry; // size = 0x8 + +// ZAPD compatibility typedefs +// TODO: Remove when ZAPD adds support for them +typedef CutsceneScriptEntry CutsceneEntry; + +typedef struct { + /* 0x00 */ u8 scriptListCount; + /* 0x04 */ CutsceneData* script; + /* 0x08 */ u8 state; + /* 0x0C */ f32 timer; + /* 0x10 */ u16 curFrame; + /* 0x12 */ u16 scriptIndex; + /* 0x14 */ s32 subCamId; + /* 0x18 */ u16 camEyeSplinePointsAppliedFrame; // Remnant of OoT. Set but never used. + /* 0x1C */ UNK_TYPE1 unk_1C[0xA]; // Remnant of cam data from OoT + /* 0x24 */ CsCmdActorCue* playerCue; + /* 0x28 */ CsCmdActorCue* actorCues[10]; // "npcdemopnt" + /* 0x50 */ CutsceneScriptEntry* scriptList; } CutsceneContext; // size = 0x54 +/* Actor Cutscenes, which encompasses all cutscenes */ + +typedef struct { + /* 0x00 */ s16 priority; // Lower means higher priority. -1 means it ignores priority + /* 0x02 */ s16 length; + /* 0x04 */ s16 csCamId; // Index of CsCameraEntry to use. Negative indices use sGlobalCamDataSettings. Indices 0 and above use CsCameraEntry from a sceneLayer + /* 0x06 */ s16 scriptIndex; + /* 0x08 */ s16 additionalCsId; + /* 0x0A */ u8 endSfx; + /* 0x0B */ u8 customValue; // 0 - 99: actor-specific custom value. 100+: spawn. 255: none + /* 0x0C */ s16 hudVisibility; + /* 0x0E */ u8 endCam; + /* 0x0F */ u8 letterboxSize; +} ActorCutscene; // size = 0x10 +// TODO: rename `ActorCutscene` to `CutsceneEntry` once ZAPD uses `CutsceneScriptEntry` +// typedef CutsceneEntry ActorCutscene; + +typedef enum { + /* -1 */ CS_ID_NONE = -1, + // CsId's 0 - 119 are sceneLayer-specific and index `ActorCutscene` + /* 0x78 */ CS_ID_GLOBAL_78 = 120, + /* 0x79 */ CS_ID_GLOBAL_79, + /* 0x7A */ CS_ID_GLOBAL_7A, + /* 0x7B */ CS_ID_GLOBAL_ELEGY, + /* 0x7C */ CS_ID_GLOBAL_TALK, + /* 0x7D */ CS_ID_GLOBAL_DOOR, + /* 0x7E */ CS_ID_GLOBAL_RETURN_TO_CAM, // smoothly return to the previous camera + /* 0x7F */ CS_ID_GLOBAL_END +} CutsceneId; + +typedef enum { + /* 0 */ PLAYER_CS_ID_ITEM_OCARINA, + /* 1 */ PLAYER_CS_ID_ITEM_GET, + /* 2 */ PLAYER_CS_ID_ITEM_BOTTLE, + /* 3 */ PLAYER_CS_ID_ITEM_SHOW, + /* 4 */ PLAYER_CS_ID_WARP_PAD_MOON, + /* 5 */ PLAYER_CS_ID_MASK_TRANSFORMATION, + /* 6 */ PLAYER_CS_ID_DEATH, + /* 7 */ PLAYER_CS_ID_REVIVE, + /* 8 */ PLAYER_CS_ID_SONG_WARP, // Song of Time and Song of Soaring + /* 9 */ PLAYER_CS_ID_WARP_PAD_ENTRANCE, + /* 10 */ PLAYER_CS_ID_MAX +} PlayerCsId; + +#define CS_SCRIPT_ID_NONE -1 + +typedef enum { + // global (see sGlobalCamDataSettings) + /* -25 */ CS_CAM_ID_GLOBAL_ELEGY = -25, // CAM_SET_ELEGY_SHELL + /* -24 */ CS_CAM_ID_GLOBAL_SIDED, // CAM_SET_SIDED + /* -23 */ CS_CAM_ID_GLOBAL_BOAT_CRUISE, // CAM_SET_BOAT_CRUISE + /* -22 */ CS_CAM_ID_GLOBAL_N16, // CAM_SET_NONE + /* -21 */ CS_CAM_ID_GLOBAL_SUBJECTD, // CAM_SET_SUBJECTD + /* -20 */ CS_CAM_ID_GLOBAL_NORMALD, // CAM_SET_NORMALD + /* -19 */ CS_CAM_ID_GLOBAL_N13, // CAM_SET_NONE + /* -18 */ CS_CAM_ID_GLOBAL_N12, // CAM_SET_NONE + /* -17 */ CS_CAM_ID_GLOBAL_N11, // CAM_SET_NONE + /* -16 */ CS_CAM_ID_GLOBAL_WARP_PAD_ENTRANCE, // CAM_SET_WARP_PAD_ENTRANCE + /* -15 */ CS_CAM_ID_GLOBAL_ATTENTION, // CAM_SET_ATTENTION + /* -14 */ CS_CAM_ID_GLOBAL_CONNECT, // CAM_SET_CONNECT0 + /* -13 */ CS_CAM_ID_GLOBAL_REMOTE_BOMB, // CAM_SET_REMOTEBOMB + /* -12 */ CS_CAM_ID_GLOBAL_N0C, // CAM_SET_NONE + /* -11 */ CS_CAM_ID_GLOBAL_MASK_TRANSFORMATION, // CAM_SET_MASK_TRANSFORMATION + /* -10 */ CS_CAM_ID_GLOBAL_LONG_CHEST_OPENING, // CAM_SET_LONG_CHEST_OPENING + /* -9 */ CS_CAM_ID_GLOBAL_REVIVE, // CAM_SET_REBIRTH + /* -8 */ CS_CAM_ID_GLOBAL_DEATH, // CAM_SET_DEATH + /* -7 */ CS_CAM_ID_GLOBAL_WARP_PAD_MOON, // CAM_SET_WARP_PAD_MOON + /* -6 */ CS_CAM_ID_GLOBAL_SONG_WARP, // CAM_SET_NAVI + /* -5 */ CS_CAM_ID_GLOBAL_ITEM_SHOW, // CAM_SET_ITEM3 + /* -4 */ CS_CAM_ID_GLOBAL_ITEM_BOTTLE, // CAM_SET_ITEM2 + /* -3 */ CS_CAM_ID_GLOBAL_ITEM_OCARINA, // CAM_SET_ITEM1 + /* -2 */ CS_CAM_ID_GLOBAL_ITEM_GET, // CAM_SET_ITEM0 + /* -1 */ CS_CAM_ID_NONE + // CamCsId's 0+ are sceneLayer-specific and index `ActorCsCamInfo` +} CutsceneCamId; + +typedef enum { + /* -1 */ CS_HUD_VISIBILITY_ALL_ALT = -1, + /* 0 */ CS_HUD_VISIBILITY_NONE, + /* 1 */ CS_HUD_VISIBILITY_ALL, + /* 2 */ CS_HUD_VISIBILITY_A_HEARTS_MAGIC, + /* 3 */ CS_HUD_VISIBILITY_C_HEARTS_MAGIC, + /* 4 */ CS_HUD_VISIBILITY_ALL_NO_MINIMAP, + /* 5 */ CS_HUD_VISIBILITY_A_B_C, + /* 6 */ CS_HUD_VISIBILITY_B_MINIMAP, + /* 7 */ CS_HUD_VISIBILITY_A +} CutsceneHudVisibility; + +typedef enum { + /* 0 */ CS_END_SFX_NONE, + /* 1 */ CS_END_SFX_TRE_BOX_APPEAR, + /* 2 */ CS_END_SFX_CORRECT_CHIME, + /* 255 */ CS_END_SFX_NONE_ALT = 0xFF +} CutsceneEndSfx; + +typedef enum { + /* 0 */ CS_END_CAM_0, + /* 1 */ CS_END_CAM_1, + /* 2 */ CS_END_CAM_SMOOTH +} CutsceneEndCam; + +/* Cutscene Camera Spline Scripts */ + +typedef struct { + /* 0x0 */ s16 numEntries; + /* 0x2 */ s16 unk_02; // unused + /* 0x4 */ s16 unk_04; // unused + /* 0x6 */ s16 duration; // total duration +} CsCmdCamSpline; // size = 0x8 + +// Both camAt and camEye +typedef struct { + /* 0x0 */ u8 interpType; // see `CutsceneCamInterpType` + /* 0x1 */ u8 weight; // for certain types of interpTypes, shifts the weight to certain points. Default is 100. + /* 0x2 */ s16 duration; // duration of current point + /* 0x4 */ Vec3s pos; + /* 0xA */ s16 relativeTo; // see `CutsceneCamRelativeTo` +} CsCmdCamPoint; // size = 0xC + +typedef enum { + /* 0 */ CS_CAM_INTERP_0, + /* 1 */ CS_CAM_INTERP_1, + /* 2 */ CS_CAM_INTERP_2, + /* 3 */ CS_CAM_INTERP_3, + /* 4 */ CS_CAM_INTERP_4, + /* 5 */ CS_CAM_INTERP_5, + /* 6 */ CS_CAM_INTERP_6, + /* 7 */ CS_CAM_INTERP_7 +} CutsceneCamInterpType; + +typedef enum { + /* 0 */ CS_CAM_REL_0, + /* 1 */ CS_CAM_REL_1, + /* 2 */ CS_CAM_REL_2, + /* 3 */ CS_CAM_REL_3, + /* 4 */ CS_CAM_REL_4, + /* 5 */ CS_CAM_REL_5 +} CutsceneCamRelativeTo; + + +// Roll and Fov Data +typedef struct { + /* 0x0 */ s16 unused0; // unused + /* 0x2 */ s16 roll; + /* 0x4 */ s16 fov; + /* 0x6 */ s16 unused1; // unused +} CsCmdCamMisc; // size = 0x8 + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ Vec3f unk_0C; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x2A */ f32 unk_20; + /* 0x24 */ s16 unk_24; + /* 0x26 */ s16 unk_26; + /* 0x28 */ s16 unk_28; + /* 0x2A */ s16 numEntries; + /* 0x1E */ u8 curPoint; + /* 0x2D */ u8 unk_2D; + /* 0x2E */ UNK_TYPE1 unk_2E[2]; +} CutsceneCameraInterp; // size = 0x30 + +typedef struct { + /* 0x00 */ s16 splineIndex; + /* 0x02 */ s16 cmdIndex; + /* 0x04 */ s16 splineNeedsInit; + /* 0x06 */ s16 state; + /* 0x08 */ s16 nextSplineTimer; + /* 0x0A */ s16 updateSplineTimer; + /* 0x0C */ s16 duration; // Duration of the current spline + /* 0x10 */ CutsceneCameraInterp eyeInterp; + /* 0x40 */ CutsceneCameraInterp atInterp; + /* 0x70 */ CsCmdCamPoint* atCmd; + /* 0x74 */ CsCmdCamPoint* eyeCmd; + /* 0x78 */ CsCmdCamMisc* miscCmd; + /* 0x7C */ Camera* camera; +} CutsceneCamera; // size = 0x80 + +typedef enum { + /* 0 */ CS_CAM_STATE_UPDATE_ALL, // Update spline and next spline timer + /* 0 */ CS_CAM_STATE_UPDATE_SPLINE, // Update spline, do not advance next spline timer + /* 0 */ CS_CAM_STATE_PAUSE, // No updates + /* 0 */ CS_CAM_STATE_DONE_SPLINE, // Finished the current spline, ready for the next one + /* 0 */ CS_CAM_STATE_DONE = 999 // Finished all the splines. +} CutsceneCameraState; + +// OoT Remnant +#define CS_CAM_DATA_NOT_APPLIED 0xFFFF + +void Cutscene_InitContext(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_StartManual(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_StopManual(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_UpdateManual(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_UpdateScripted(struct PlayState* play, CutsceneContext* csCtx); +void Cutscene_HandleEntranceTriggers(struct PlayState* play); +void func_800EDDB0(struct PlayState* play); +void Cutscene_StartScripted(struct PlayState* play, u8 scriptIndex); +void Cutscene_ActorTranslate(Actor* actor, struct PlayState* play, s32 cueChannel); +void Cutscene_ActorTranslateAndYaw(Actor* actor, struct PlayState* play, s32 cueChannel); +void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, struct PlayState* play, s32 cueChannel); +void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, struct PlayState* play, s32 cueChannel); +s32 Cutscene_GetSceneLayer(struct PlayState* play); +s32 Cutscene_GetCueChannel(struct PlayState* play, u16 cueType); +s32 Cutscene_IsCueInChannel(struct PlayState* play, u16 cueType); +u8 Cutscene_IsPlaying(struct PlayState* play); + +void CutsceneManager_Init(struct PlayState* play, ActorCutscene* cutsceneList, s16 numEntries); +void CutsceneManager_StoreCamera(Camera* camera); +void CutsceneManager_ClearWaiting(void); +s16 CutsceneManager_Update(void); +void CutsceneManager_Queue(s16 csId); +s16 CutsceneManager_IsNext(s16 csId); +s16 CutsceneManager_StartWithPlayerCs(s16 csId, Actor* actor); +s16 CutsceneManager_StartWithPlayerCsAndSetFlag(s16 csId, Actor* actor); +s16 CutsceneManager_Start(s16 csId, Actor* actor); +s16 CutsceneManager_Stop(s16 csId); +s16 CutsceneManager_GetCurrentCsId(void); +ActorCutscene* CutsceneManager_GetCutsceneEntry(s16 csId); +s16 CutsceneManager_GetAdditionalCsId(s16 csId); +s16 CutsceneManager_GetLength(s16 csId); +s16 CutsceneManager_GetCutsceneScriptIndex(s16 csId); +s16 CutsceneManager_GetCutsceneCustomValue(s16 csId); +s16 CutsceneManager_GetCurrentSubCamId(s16 csId); +s16 CutsceneManager_FindEntranceCsId(void); +s32 func_800F22C4(s16 csId, Actor* actor); +void CutsceneManager_SetReturnCamera(s16 camId); + +s32 CutsceneCamera_Init(Camera* camera, CutsceneCamera* csCamera); +s32 CutsceneCamera_UpdateSplines(u8* script, CutsceneCamera* csCamera); +void CutsceneCamera_SetState(s16 state); +void CutsceneCamera_Reset(void); + +void CutsceneFlags_UnsetAll(struct PlayState* play); +void CutsceneFlags_Set(struct PlayState* play, s16 flag); +void CutsceneFlags_Unset(struct PlayState* play, s16 flag); +s32 CutsceneFlags_Get(struct PlayState* play, s16 flag); + #endif diff --git a/include/z64cutscene_commands.h b/include/z64cutscene_commands.h index 1ab6533ac2..50e1ce451e 100644 --- a/include/z64cutscene_commands.h +++ b/include/z64cutscene_commands.h @@ -5,13 +5,19 @@ #include "z64cutscene.h" /** + * Cutscene scripts are arrays of `CutsceneData` words, including bit-packed integers and floats. + */ + +/** + * Marks the beginning of a cutscene script. + * * ARGS - * s32 totalEntries (e), s32 endFrame (n) + * s32 totalEntries (e), s32 frameCount (n) * FORMAT * eeeeeeee nnnnnnnn * size = 0x8 */ -#define CS_BEGIN_CUTSCENE(totalEntries, endFrame) { CMD_W(totalEntries) }, { CMD_W(endFrame) } +#define CS_BEGIN_CUTSCENE(totalEntries, frameCount) { CMD_W(totalEntries) }, { CMD_W(frameCount) } /** @@ -21,83 +27,83 @@ * 0000000A eeeeeeee * size = 0x8 */ -#define CS_TEXT_LIST(entries) { CS_CMD_TEXTBOX }, { CMD_W(entries) } +#define CS_TEXT_LIST(entries) { CS_CMD_TEXT }, { CMD_W(entries) } /** * ARGS - * s16 messageId (i), s16 startFrame (s), s16 endFrame (e), s16 type (o), + * s16 textId (i), s16 startFrame (s), s16 endFrame (e), s16 type (o), * s16 topOptionBranch (y), s16 bottomOptionBranch (n) * FORMAT * iiiissss eeeeoooo yyyynnnn * size = 0xC */ -#define CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, type, topOptionBranch, bottomOptionBranch) \ - { CMD_HH(messageId, startFrame) }, { CMD_HH(endFrame, type) }, { CMD_HH(topOptionBranch, bottomOptionBranch) } +#define CS_TEXT(textId, startFrame, endFrame, type, topOptionBranch, bottomOptionBranch) \ + { CMD_HH(textId, startFrame) }, { CMD_HH(endFrame, type) }, { CMD_HH(topOptionBranch, bottomOptionBranch) } /** * ARGS - * s16 messageId (i), s16 startFrame (s), s16 endFrame (e), + * s16 textId (i), s16 startFrame (s), s16 endFrame (e), * s16 topOptionBranch (y), s16 bottomOptionBranch (n) * FORMAT * iiiissss eeee0000 yyyynnnn * size = 0xC */ -#define CS_TEXT_DEFAULT(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \ - CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_DEFAULT, topOptionBranch, bottomOptionBranch) +#define CS_TEXT_DEFAULT(textId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \ + CS_TEXT(textId, startFrame, endFrame, CS_TEXT_TYPE_DEFAULT, topOptionBranch, bottomOptionBranch) /** * ARGS - * s16 messageId (i), s16 startFrame (s), s16 endFrame (e), + * s16 textId (i), s16 startFrame (s), s16 endFrame (e), * s16 topOptionBranch (y), s16 bottomOptionBranch (n) * FORMAT * iiiissss eeee0001 yyyynnnn * size = 0xC */ -#define CS_TEXT_TYPE_1(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \ - CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_1, topOptionBranch, bottomOptionBranch) +#define CS_TEXT_TYPE_1(textId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \ + CS_TEXT(textId, startFrame, endFrame, CS_TEXT_TYPE_1, topOptionBranch, bottomOptionBranch) /** * ARGS - * s16 ocarinaSongAction (o), s16 startFrame (s), s16 endFrame (e), s16 messageId (i) + * s16 ocarinaSongAction (o), s16 startFrame (s), s16 endFrame (e), s16 textId (i) * FORMAT * oooossss eeee0002 iiiiFFFF * size = 0xC */ -#define CS_TEXT_LEARN_SONG(ocarinaSongAction, startFrame, endFrame, messageId) \ - CS_TEXT_DISPLAY_TEXTBOX(ocarinaSongAction, startFrame, endFrame, CS_TEXTBOX_TYPE_LEARN_SONG, messageId, 0xFFFF) +#define CS_TEXT_OCARINA_ACTION(ocarinaSongAction, startFrame, endFrame, textId) \ + CS_TEXT(ocarinaSongAction, startFrame, endFrame, CS_TEXT_OCARINA_ACTION, textId, 0xFFFF) /** * ARGS - * s16 messageId (i), s16 startFrame (s), s16 endFrame (e), + * s16 textId (i), s16 startFrame (s), s16 endFrame (e), * s16 topOptionBranch (y), s16 bottomOptionBranch (n) * FORMAT * iiiissss eeee0003 yyyynnnn * size = 0xC */ -#define CS_TEXT_TYPE_3(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \ - CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_3, topOptionBranch, bottomOptionBranch) +#define CS_TEXT_TYPE_3(textId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \ + CS_TEXT(textId, startFrame, endFrame, CS_TEXT_TYPE_3, topOptionBranch, bottomOptionBranch) /** - * If Player has all 4 bosses' remains then alternativeMessageId is used, otherwise defaultMessageId is used + * If Player has all 4 bosses' remains then alternativeTextId is used, otherwise defaultTextId is used * ARGS - * s16 defaultMessageId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeMessageId (a) + * s16 defaultTextId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeTextId (a) * FORMAT * ddddssss eeee0004 aaaaFFFF * size = 0xC */ -#define CS_TEXT_BOSSES_REMAINS(defaultMessageId, startFrame, endFrame, alternativeMessageId) \ - CS_TEXT_DISPLAY_TEXTBOX(defaultMessageId, startFrame, endFrame, CS_TEXTBOX_TYPE_BOSSES_REMAINS, alternativeMessageId, 0xFFFF) +#define CS_TEXT_BOSSES_REMAINS(defaultTextId, startFrame, endFrame, alternativeTextId) \ + CS_TEXT(defaultTextId, startFrame, endFrame, CS_TEXT_TYPE_BOSSES_REMAINS, alternativeTextId, 0xFFFF) /** - * If Player has every non-transformation mask then alternativeMessageId is used, otherwise defaultMessageId is used + * If Player has every non-transformation mask then alternativeTextId is used, otherwise defaultTextId is used * ARGS - * s16 defaultMessageId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeMessageId (a) + * s16 defaultTextId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeTextId (a) * FORMAT * ddddssss eeee0005 aaaaFFFF * size = 0xC */ -#define CS_TEXT_ALL_NORMAL_MASKS(defaultMessageId, startFrame, endFrame, alternativeMessageId) \ - CS_TEXT_DISPLAY_TEXTBOX(defaultMessageId, startFrame, endFrame, CS_TEXTBOX_TYPE_ALL_NORMAL_MASKS, alternativeMessageId, 0xFFFF) +#define CS_TEXT_ALL_NORMAL_MASKS(defaultTextId, startFrame, endFrame, alternativeTextId) \ + CS_TEXT(defaultTextId, startFrame, endFrame, CS_TEXT_TYPE_ALL_NORMAL_MASKS, alternativeTextId, 0xFFFF) /** * ARGS @@ -107,22 +113,57 @@ * size = 0xC */ #define CS_TEXT_NONE(startFrame, endFrame) \ - CS_TEXT_DISPLAY_TEXTBOX(0xFFFF, startFrame, endFrame, CS_TEXTBOX_TYPE_NONE, 0xFFFF, 0xFFFF) + CS_TEXT(0xFFFF, startFrame, endFrame, CS_TEXT_TYPE_NONE, 0xFFFF, 0xFFFF) /** * ARGS - * s32 entries (e) + * s32 numBytes (b) * FORMAT - * 0000005A eeeeeeee + * 0000005A bbbbbbbb * size = 0x8 */ -#define CS_CAMERA_LIST(entries) { CS_CMD_CAMERA }, { CMD_W(entries) } +#define CS_CAM_SPLINE_LIST(numBytes) { CS_CMD_CAMERA_SPLINE }, { CMD_W(numBytes) } -// TODO: Camera command macros. Requieres func_80161998 being decomped +/** + * ARGS + * s16 numEntries (e), s16 duration (d) + * FORMAT + * Capital U is Unused + * eeeeUUUU UUUUdddd + * size = 0x8 + */ +#define CS_CAM_SPLINE(numEntries, unused0, unused1, duration) \ + { CMD_HH(numEntries, unused0) }, { CMD_HH(unused1, duration) } + +/** + * ARGS + * u8 interpType (i), u8 weight (2), s16 duration (d), Vec3s pos (x/y/z), s16 relativeTo (r) + * FORMAT + * ii22dddd xxxxyyyy zzzzrrrr + * size = 0xC + */ +#define CS_CAM_POINT(interpType, weight, duration, posX, posY, posZ, relativeTo) \ + { CMD_BBH(interpType, weight, duration) }, { CMD_HH(posX, posY) }, { CMD_HH(posZ, relativeTo) } + +/** + * ARGS + * s16 roll (r), s16 fov (f) + * FORMAT + * Capital U is Unused + * UUUUrrrr ffffUUUU + * size = 0x8 + */ +#define CS_CAM_MISC(unused0, roll, fov, unused1) \ + { CMD_HH(unused0, roll) }, { CMD_HH(fov, unused1) } + +// First half-word is read from as `numEntries` in `CS_CAM_SPLINE()` +#define CS_CAM_END() { CMD_HH(0xFFFF, 4) } /** + * Declares a list of `CS_MISC` entries. + * * ARGS * s32 entries (e) * FORMAT @@ -132,36 +173,46 @@ #define CS_MISC_LIST(entries) { CS_CMD_MISC }, { CMD_W(entries) } /** + * Various miscellaneous commands. + * @see `CutsceneMiscType` enum for the different types of commands. + * @note setting `endFrame` to same value as `startFrame` will not behave as expected. + * For commands that only need to last one frame, set `endFrame` to `startFrame + 1`. + * * ARGS - * s16 unk (u), s16 startFrame (s), s16 endFrame (e) + * s16 type (t), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * uuuussss eeeeUUUU - * size = 0x08 + * ttttssss eeeeUUUU + * size = 0x8 */ -#define CS_MISC(unk, startFrame, endFrame, unk_06) \ - { CMD_HH(unk, startFrame) }, { CMD_HH(endFrame, unk_06) } +#define CS_MISC(type, startFrame, endFrame, unused0) \ + { CMD_HH(type, startFrame) }, { CMD_HH(endFrame, unused0) } /** + * Declares a list of `CS_LIGHT_SETTING` entries. + * * ARGS * s32 entries (e) * FORMAT * 00000097 eeeeeeee * size = 0x8 */ -#define CS_LIGHTING_LIST(entries) { CS_CMD_SET_LIGHTING }, { CMD_W(entries) } +#define CS_LIGHT_SETTING_LIST(entries) { CS_CMD_LIGHT_SETTING }, { CMD_W(entries) } /** + * Changes the environment lights to the specified setting. + * The lighting change will take place immediately with no blending. + * * ARGS - * s16 setting (m), s16 startFrame (s), s16 endFrame (e) + * s16 setting (t), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * ttttssss eeeeUUUU + * size = 0x8 */ -#define CS_LIGHTING(setting, startFrame, endFrame) \ - { CMD_HH(setting, startFrame) }, { CMD_HH(endFrame, endFrame) } +#define CS_LIGHT_SETTING(lightSetting, startFrame, endFrame) \ + { CMD_BBH(0, (lightSetting + 1), startFrame) }, { CMD_HH(endFrame, endFrame) } /** @@ -171,18 +222,18 @@ * 00000098 eeeeeeee * size = 0x8 */ -#define CS_SCENE_TRANS_FX_LIST(entries) { CS_CMD_SCENE_TRANS_FX }, { CMD_W(entries) } +#define CS_TRANSITION_LIST(entries) { CS_CMD_TRANSITION }, { CMD_W(entries) } /** * ARGS - * s16 transitionType (m), s16 startFrame (s), s16 endFrame (e) + * s16 type (t), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * ttttssss eeeeUUUU + * size = 0x8 */ -#define CS_SCENE_TRANS_FX(transitionType, startFrame, endFrame) \ - { CMD_HH(transitionType, startFrame) }, { CMD_HH(endFrame, endFrame) } +#define CS_TRANSITION(type, startFrame, endFrame) \ + { CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) } /** @@ -190,20 +241,20 @@ * s32 entries (e) * FORMAT * 00000099 eeeeeeee - * size = 0x08 + * size = 0x8 */ -#define CS_MOTIONBLUR_LIST(entries) { CS_CMD_MOTIONBLUR }, { CMD_W(entries) } +#define CS_MOTION_BLUR_LIST(entries) { CS_CMD_MOTION_BLUR }, { CMD_W(entries) } /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 type (t), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * ttttssss eeeeUUUU + * size = 0x8 */ -#define CS_MOTIONBLUR(base, startFrame, endFrame) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) } +#define CS_MOTION_BLUR(type, startFrame, endFrame) \ + { CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) } /** @@ -213,18 +264,18 @@ * 0000009A eeeeeeee * size = 0x8 */ -#define CS_GIVETATL_LIST(entries) { CS_CMD_GIVETATL }, { CMD_W(entries) } +#define CS_GIVE_TATL_LIST(entries) { CS_CMD_GIVE_TATL }, { CMD_W(entries) } /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 giveTatl (t), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * ttttssss eeeeUUUU + * size = 0x8 */ -#define CS_GIVETATL(base, startFrame, endFrame) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) } +#define CS_GIVE_TATL(giveTatl, startFrame, endFrame) \ + { CMD_HH(giveTatl, startFrame) }, { CMD_HH(endFrame, endFrame) } /** @@ -234,75 +285,66 @@ * 0000009B eeeeeeee * size = 0x8 */ -#define CS_FADESCREEN_LIST(entries) { CS_CMD_FADESCREEN }, { CMD_W(entries) } +#define CS_TRANSITION_GENERAL_LIST(entries) { CS_CMD_TRANSITION_GENERAL }, { CMD_W(entries) } /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e), + * s16 type (t), s16 startFrame (s), s16 endFrame (e), * u8 red (r), u8 green (g), blue (b) * FORMAT * Capital U is Unused - * mmmmssss eeeerrgg bbUUUUUU + * ttttssss eeeerrgg bbUUUUUU * size = 0x0C */ -#define CS_FADESCREEN(base, startFrame, endFrame, red, green, blue) \ - { CMD_HH(base, startFrame) }, { CMD_HBB(endFrame, red, green) }, { CMD_BBBB(blue, 0, 0, 0) } - - -/** - * ARGS - * s32 entries (e) - * FORMAT - * 0000009C eeeeeeee - * size = 0x8 - */ -#define CS_FADESEQ_LIST(entries) { CS_CMD_FADESEQ }, { CMD_W(entries) } - -/** - * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) - * FORMAT - * Capital U is Unused - * mmmmssss eeeeUUUU UUUUUUUU - * size = 0x0C - */ -#define CS_FADESEQ(base, startFrame, endFrame) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, 0) }, { CMD_W(0) } +#define CS_TRANSITION_GENERAL(type, startFrame, endFrame, red, green, blue) \ + { CMD_HH(type, startFrame) }, { CMD_HBB(endFrame, red, green) }, { CMD_BBBB(blue, 0, 0, 0) } /** + * Declares a list of `CS_TIME` entries. + * * ARGS * s32 entries (e) * FORMAT * 0000009D eeeeeeee * size = 0x8 */ -#define CS_TIME_LIST(entries) { CS_CMD_SETTIME }, { CMD_W(entries) } +#define CS_TIME_LIST(entries) { CS_CMD_TIME }, { CMD_W(entries) } /** + * Sets the time of day. + * Both the day time and skybox time are set by this command. + * @note `endFrame` is not used in the implementation of the command, so its value does not matter + * * ARGS - * s16 unk (u), s16 startFrame (s), s16 endFrame (e), s8 hour (h), s8 min (m) + * s16 startFrame (s), s16 endFrame (e), s8 hour (h), s8 min (m) * FORMAT * Capital U is Unused - * uuuussss eeeehhmm UUUUUUUU + * UUUUssss eeeehhmm UUUUUUUU * size = 0xC */ -#define CS_TIME(unk, startFrame, endFrame, hour, min, unused) \ - { CMD_HH(unk, startFrame) }, { CMD_HBB(endFrame, hour, min) }, { CMD_W(unused) } +#define CS_TIME(unused0, startFrame, endFrame, hour, min) \ + { CMD_HH(unused0, startFrame) }, { CMD_HBB(endFrame, hour, min) }, { CMD_W(0) } /** + * Declares a list of `CS_ACTOR_CUE` entries. + * * ARGS * s32 cmdType (c), s32 entries (e) * FORMAT * cccccccc eeeeeeee * size = 0x8 */ -#define CS_ACTOR_ACTION_LIST(cmdType, entries) { CMD_W(cmdType) }, { CMD_W(entries) } +#define CS_ACTOR_CUE_LIST(cmdType, entries) { CMD_W(cmdType) }, { CMD_W(entries) } /** + * Defines a cue that an actor can listen for. + * The actor can choose whether or not to use the position and rotation data supplied to it. + * The cue `id` is a number that has an actor-specific meaning. + * * ARGS - * s16 npcAction (a), s16 startFrame (s), s16 endFrame (e), + * s16 id (a), s16 startFrame (s), s16 endFrame (e), * s16 rotX (u), s16 rotY (v), s16 rotZ (w), * s32 startX (i), s32 startY (j), s32 startZ (k), * s32 endX (l), s32 endY (m), s32 endZ (n), @@ -311,25 +353,29 @@ * aaaassss eeeeuuuu vvvvwwww iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmm nnnnnnnn xxxxxxxx yyyyyyyy zzzzzzzz * size = 0x30 */ -#define CS_ACTOR_ACTION(npcAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \ - { CMD_HH(npcAction, startFrame) }, { CMD_HH(endFrame, rotX) }, { CMD_HH(rotY, rotZ) }, \ +#define CS_ACTOR_CUE(id, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \ + { CMD_HH(id, startFrame) }, { CMD_HH(endFrame, rotX) }, { CMD_HH(rotY, rotZ) }, \ { CMD_W(startX) }, { CMD_W(startY) }, { CMD_W(startZ) }, \ { CMD_W(endX) }, { CMD_W(endY) }, { CMD_W(endZ) }, \ { CMD_F(normX) }, { CMD_F(normY) }, { CMD_F(normZ) } /** + * Declares a list of `CS_PLAYER_CUE` entries. + * * ARGS * s32 cmdType (c), s32 entries (e) * FORMAT * 000000C8 eeeeeeee * size = 0x8 */ -#define CS_PLAYER_ACTION_LIST(entries) { CS_CMD_SET_PLAYER_ACTION }, { CMD_W(entries) } +#define CS_PLAYER_CUE_LIST(entries) { CS_CMD_PLAYER_CUE }, { CMD_W(entries) } /** + * A player cue is the same as `CS_ACTOR_CUE` but is specifically for player. + * * ARGS - * s16 playerAction (a), s16 startFrame (s), s16 endFrame (e), + * s16 id (a), s16 startFrame (s), s16 endFrame (e), * s16 rotX (u), s16 rotY (v), s16 rotZ (w), * s32 startX (i), s32 startY (j), s32 startZ (k), * s32 endX (l), s32 endY (m), s32 endZ (n), @@ -338,113 +384,87 @@ * aaaassss eeeeuuuu vvvvwwww iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmm nnnnnnnn xxxxxxxx yyyyyyyy zzzzzzzz * size = 0x30 */ -#define CS_PLAYER_ACTION(playerAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \ - CS_ACTOR_ACTION(playerAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) +#define CS_PLAYER_CUE(id, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \ + CS_ACTOR_CUE(id, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) /** + * Declares a list of `CS_START_SEQ` entries. + * * ARGS * s32 entries (e) * FORMAT * 0000012C eeeeeeee * size = 0x8 */ -#define CS_PLAYSEQ_LIST(entries) { CS_CMD_PLAYSEQ }, { CMD_W(entries) } +#define CS_START_SEQ_LIST(entries) \ + { CS_CMD_START_SEQ }, { CMD_W(entries) } /** + * Starts a sequence at the specified time. + * @note `endFrame` is not used in the implementation of the command, so its value does not matter + * * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 seqId (i), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 - */ -#define CS_PLAYSEQ(sequence, startFrame, endFrame) \ - { CMD_HH(sequence, startFrame) }, { CMD_HH(endFrame, endFrame) } - - -/** - * ARGS - * s32 entries (e) - * FORMAT - * 00000130 eeeeeeee + * iiiissss eeeeUUUU * size = 0x8 */ -#define CS_SCENE_UNK_130_LIST(entries) { CS_CMD_130 }, { CMD_W(entries) } - -/** - * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) - * FORMAT - * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x30 - */ -#define CS_SCENE_UNK_130(base, startFrame, endFrame, unk_06) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) } - - -/** - * ARGS - * s32 entries (e) - * FORMAT - * 00000131 eeeeeeee - * size = 0x8 - */ -#define CS_SCENE_UNK_131_LIST(entries) { CS_CMD_131 }, { CMD_W(entries) } - -/** - * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) - * FORMAT - * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 - */ -#define CS_SCENE_UNK_131(base, startFrame, endFrame, unk_06) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) } - - -/** - * ARGS - * s32 entries (e) - * FORMAT - * 00000132 eeeeeeee - * size = 0x8 - */ -#define CS_SCENE_UNK_132_LIST(entries) { CS_CMD_132 }, { CMD_W(entries) } - -/** - * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) - * FORMAT - * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 - */ -#define CS_SCENE_UNK_132(base, startFrame, endFrame) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) } +#define CS_START_SEQ(seqId, startFrame, endFrame) \ + { CMD_HH((seqId + 1), startFrame) }, { CMD_HH(endFrame, endFrame) } /** + * Declares a list of `CS_STOP_SEQ` entries. + * * ARGS * s32 entries (e) * FORMAT * 00000133 eeeeeeee * size = 0x8 */ -#define CS_STOPSEQ_LIST(entries) { CS_CMD_STOPSEQ }, { CMD_W(entries) } +#define CS_STOP_SEQ_LIST(entries) { CS_CMD_STOP_SEQ }, { CMD_W(entries) } /** + * Stops a sequence at the specified time. + * * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 seqId (i), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * iiiissss eeeeUUUU + * size = 0x8 */ -#define CS_STOPSEQ(base, startFrame, endFrame, unk_06) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) } +#define CS_STOP_SEQ(seqId, startFrame, endFrame, unk_06) \ + { CMD_HH((seqId + 1), startFrame) }, { CMD_HH(endFrame, unk_06) } + + +/** + * Stops a sequence at the specified time. + * @note `endFrame` is not used in the implementation of the command, so its value does not matter + * + * ARGS + * s32 entries (e) + * FORMAT + * 0000009C eeeeeeee + * size = 0x8 + */ +#define CS_FADE_OUT_SEQ_LIST(entries) { CS_CMD_FADE_OUT_SEQ }, { CMD_W(entries) } + +/** + * Fade out the sequence that is playing on the specified sequence player, over the specified frame range. + * @see `CutsceneFadeOutSeqPlayer` + * + * ARGS + * s16 seqPlayer (p), s16 startFrame (s), s16 endFrame (e) + * FORMAT + * Capital U is Unused + * ppppssss eeeeUUUU UUUUUUUU + * size = 0x0C + */ +#define CS_FADE_OUT_SEQ(seqPlayer, startFrame, endFrame) \ + { CMD_HH(seqPlayer, startFrame) }, { CMD_HH(endFrame, 0) }, { CMD_W(0) } /** @@ -454,18 +474,18 @@ * 00000134 eeeeeeee * size = 0x8 */ -#define CS_PLAYAMBIENCE_LIST(entries) { CS_CMD_PLAYAMBIENCE }, { CMD_W(entries) } +#define CS_START_AMBIENCE_LIST(entries) { CS_CMD_START_AMBIENCE }, { CMD_W(entries) } /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * UUUUssss eeeeUUUU + * size = 0x8 */ -#define CS_PLAYAMBIENCE(base, startFrame, endFrame, unk_06) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) } +#define CS_START_AMBIENCE(unused0, startFrame, endFrame) \ + { CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, 0) } /** @@ -475,39 +495,106 @@ * 00000135 eeeeeeee * size = 0x8 */ -#define CS_FADEAMBIENCE_LIST(entries) { CS_CMD_FADEAMBIENCE }, { CMD_W(entries) } +#define CS_FADE_OUT_AMBIENCE_LIST(entries) { CS_CMD_FADE_OUT_AMBIENCE }, { CMD_W(entries) } /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * UUUUssss eeeeUUUU + * size = 0x8 */ -#define CS_FADEAMBIENCE(base, startFrame, endFrame, unk_06) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) } +#define CS_FADE_OUT_AMBIENCE(unused0, startFrame, endFrame) \ + { CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, 0) } /** * ARGS * s32 entries (e) * FORMAT - * 0000015E eeeeeeee + * 00000132 eeeeeeee * size = 0x8 */ -#define CS_TERMINATOR_LIST(entries) { CS_CMD_TERMINATOR }, { CMD_W(entries) } +#define CS_MODIFY_SEQ_LIST(entries) { CS_CMD_MODIFY_SEQ }, { CMD_W(entries) } /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 type (t), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * ttttssss eeeeUUUU + * size = 0x8 */ -#define CS_TERMINATOR(base, startFrame, endFrame) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) } +#define CS_MODIFY_SEQ(type, startFrame, endFrame) \ + { CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) } + + +/** + * ARGS + * s32 entries (e) + * FORMAT + * 00000130 eeeeeeee + * size = 0x8 + */ +#define CS_SFX_REVERB_INDEX_2_LIST(entries) { CS_CMD_SFX_REVERB_INDEX_2 }, { CMD_W(entries) } + +/** + * ARGS + * s16 startFrame (s), s16 endFrame (e) + * FORMAT + * Capital U is Unused + * UUUUssss eeeeUUUU + * size = 0x30 + */ +#define CS_SFX_REVERB_INDEX_2(unused0, startFrame, endFrame) \ + { CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, 0) } + + +/** + * ARGS + * s32 entries (e) + * FORMAT + * 00000131 eeeeeeee + * size = 0x8 + */ +#define CS_SFX_REVERB_INDEX_1_LIST(entries) { CS_CMD_SFX_REVERB_INDEX_1 }, { CMD_W(entries) } + +/** + * ARGS + * s16 startFrame (s), s16 endFrame (e) + * FORMAT + * Capital U is Unused + * UUUUssss eeeeUUUU + * size = 0x8 + */ +#define CS_SFX_REVERB_INDEX_1(unused0, startFrame, endFrame) \ + { CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, 0) } + + +/** + * Declares a list of `CS_DESTINATION` entries. + * + * ARGS + * s32 entries (e) + * FORMAT + * 0000015E eeeeeeee + * size = 0x8 + */ +#define CS_DESTINATION_LIST(entries) { CS_CMD_DESTINATION }, { CMD_W(entries) } + +/** + * Sends the player to a new destination using the entry defined in `CutsceneScriptEntry`. + * + * ARGS + * s16 type (t), s16 startFrame (s), s16 endFrame (e) + * FORMAT + * Capital U is Unused + * ttttssss eeeeUUUU + * size = 0x8 + */ +#define CS_DESTINATION(type, startFrame, endFrame) \ + { CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) } /** @@ -521,14 +608,14 @@ /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 type (t), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * ttttssss eeeeUUUU + * size = 0x8 */ -#define CS_CHOOSE_CREDITS_SCENES(base, startFrame, endFrame) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) } +#define CS_CHOOSE_CREDITS_SCENES(type, startFrame, endFrame) \ + { CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) } /** @@ -542,14 +629,14 @@ /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 type (t), s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * ttttssss eeeeUUUU + * size = 0x8 */ -#define CS_RUMBLE(base, startFrame, endFrame, intensity, decayTimer, decayStep) \ - { CMD_HH(base, startFrame) }, { CMD_HBB(endFrame, intensity, decayTimer) }, { CMD_BBBB(decayStep, 0, 0, 0) } +#define CS_RUMBLE(type, startFrame, endFrame, intensity, decayTimer, decayStep) \ + { CMD_HH(type, startFrame) }, { CMD_HBB(endFrame, intensity, decayTimer) }, { CMD_BBBB(decayStep, 0, 0, 0) } /** @@ -563,14 +650,14 @@ /** * ARGS - * s16 base (m), s16 startFrame (s), s16 endFrame (e) + * s16 startFrame (s), s16 endFrame (e) * FORMAT * Capital U is Unused - * mmmmssss eeeeUUUU - * size = 0x08 + * UUUUssss eeeeUUUU + * size = 0x8 */ -#define CS_UNK_DATA(base, startFrame, endFrame, unk_06) \ - { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) } +#define CS_UNK_DATA(unused0, startFrame, endFrame, unk_06) \ + { CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, unk_06) } /** @@ -578,4 +665,47 @@ */ #define CS_END() { CMD_W(0xFFFFFFFF) } +// TODO: Fix ZAPD and delete these +#define CS_ACTOR_ACTION_LIST CS_ACTOR_CUE_LIST +#define CS_ACTOR_ACTION CS_ACTOR_CUE +#define CS_PLAYER_ACTION_LIST CS_PLAYER_CUE_LIST +#define CS_PLAYER_ACTION CS_PLAYER_CUE +#define CS_LIGHTING_LIST CS_LIGHT_SETTING_LIST +#define CS_CAMERA_LIST CS_CAM_SPLINE_LIST +#define CS_TEXT_DISPLAY_TEXTBOX CS_TEXT +#define CS_TEXT_LEARN_SONG CS_TEXT_OCARINA_ACTION +#define CS_SCENE_TRANS_FX_LIST CS_TRANSITION_LIST +#define CS_SCENE_TRANS_FX CS_TRANSITION +#define CS_GIVETATL_LIST CS_GIVE_TATL_LIST +#define CS_GIVETATL CS_GIVE_TATL +#define CS_PLAYSEQ_LIST CS_START_SEQ_LIST +#define CS_STOPSEQ_LIST CS_STOP_SEQ_LIST +#define CS_FADESEQ_LIST CS_FADE_OUT_SEQ_LIST +#define CS_FADESEQ CS_FADE_OUT_SEQ +#define CS_PLAYAMBIENCE_LIST CS_START_AMBIENCE_LIST +#define CS_PLAYAMBIENCE CS_START_AMBIENCE +#define CS_FADEAMBIENCE_LIST CS_FADE_OUT_AMBIENCE_LIST +#define CS_FADEAMBIENCE CS_FADE_OUT_AMBIENCE +#define CS_SCENE_UNK_130_LIST CS_SFX_REVERB_INDEX_2_LIST +#define CS_SCENE_UNK_130 CS_SFX_REVERB_INDEX_2 +#define CS_SCENE_UNK_131_LIST CS_SFX_REVERB_INDEX_1_LIST +#define CS_SCENE_UNK_131 CS_SFX_REVERB_INDEX_1 +#define CS_SCENE_UNK_132_LIST CS_MODIFY_SEQ_LIST +#define CS_SCENE_UNK_132 CS_MODIFY_SEQ +#define CS_MOTIONBLUR_LIST CS_MOTION_BLUR_LIST +#define CS_MOTIONBLUR CS_MOTION_BLUR +#define CS_FADESCREEN_LIST CS_TRANSITION_GENERAL_LIST +#define CS_FADESCREEN CS_TRANSITION_GENERAL +#define CS_TERMINATOR_LIST CS_DESTINATION_LIST +#define CS_TERMINATOR CS_DESTINATION + +#define CS_PLAYSEQ(seqId, startFrame, endFrame) \ +CS_START_SEQ((seqId)-1, startFrame, endFrame) + +#define CS_STOPSEQ(seqId, startFrame, endFrame, unk_06) \ +CS_STOP_SEQ((seqId)-1, startFrame, endFrame, unk_06) + +#define CS_LIGHTING(lightSetting, startFrame, endFrame) \ +CS_LIGHT_SETTING((lightSetting)-1, startFrame, endFrame) + #endif diff --git a/include/z64player.h b/include/z64player.h index 27a5865555..54894893ff 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -535,8 +535,8 @@ typedef enum PlayerCsMode { /* 0x03 */ PLAYER_CSMODE_3, /* 0x04 */ PLAYER_CSMODE_4, /* 0x05 */ PLAYER_CSMODE_5, - /* 0x06 */ PLAYER_CSMODE_6, - /* 0x07 */ PLAYER_CSMODE_7, + /* 0x06 */ PLAYER_CSMODE_END, + /* 0x07 */ PLAYER_CSMODE_WAIT, /* 0x08 */ PLAYER_CSMODE_8, /* 0x09 */ PLAYER_CSMODE_9, /* 0x0A */ PLAYER_CSMODE_10, @@ -1018,7 +1018,7 @@ typedef struct Player { /* 0xA7C */ Actor* boomerangActor; /* 0xA80 */ Actor* tatlActor; /* 0xA84 */ s16 tatlTextId; - /* 0xA86 */ s8 unk_A86; // actorCutsceneIndex? + /* 0xA86 */ s8 csId; /* 0xA87 */ s8 exchangeItemId; // PlayerItemAction enum /* 0xA88 */ Actor* talkActor; /* 0xA8C */ f32 talkActorDistance; diff --git a/include/z64save.h b/include/z64save.h index 362a16e924..1f59fea013 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -299,7 +299,7 @@ typedef struct Save { /* 0x05 */ u8 isFirstCycle; // "opening_flag" /* 0x06 */ u8 unk_06; /* 0x07 */ u8 linkAge; // "link_age" - /* 0x08 */ s32 cutscene; // "day_time" + /* 0x08 */ s32 cutsceneIndex; // "day_time" /* 0x0C */ u16 time; // "zelda_time" /* 0x0E */ u16 owlSaveLocation; /* 0x10 */ s32 isNight; // "asahiru_fg" @@ -707,7 +707,7 @@ typedef enum { #define WEEKEVENTREG_20_01 PACK_WEEKEVENTREG_FLAG(20, 0x01) // woodfall temple purification cutscene watched -#define WEEKEVENTREG_20_02 PACK_WEEKEVENTREG_FLAG(20, 0x02) +#define WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE PACK_WEEKEVENTREG_FLAG(20, 0x02) #define WEEKEVENTREG_20_04 PACK_WEEKEVENTREG_FLAG(20, 0x04) #define WEEKEVENTREG_20_08 PACK_WEEKEVENTREG_FLAG(20, 0x08) @@ -851,7 +851,7 @@ typedef enum { #define WEEKEVENTREG_33_40 PACK_WEEKEVENTREG_FLAG(33, 0x40) // Mountain village is unfrozen -#define WEEKEVENTREG_33_80 PACK_WEEKEVENTREG_FLAG(33, 0x80) +#define WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE PACK_WEEKEVENTREG_FLAG(33, 0x80) // Spoken to MINIFROG_YELLOW #define WEEKEVENTREG_34_01 PACK_WEEKEVENTREG_FLAG(34, 0x01) @@ -1015,7 +1015,7 @@ typedef enum { #define WEEKEVENTREG_52_10 PACK_WEEKEVENTREG_FLAG(52, 0x10) // cleared Stone Tower Temple -#define WEEKEVENTREG_52_20 PACK_WEEKEVENTREG_FLAG(52, 0x20) +#define WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE PACK_WEEKEVENTREG_FLAG(52, 0x20) #define WEEKEVENTREG_52_40 PACK_WEEKEVENTREG_FLAG(52, 0x40) #define WEEKEVENTREG_52_80 PACK_WEEKEVENTREG_FLAG(52, 0x80) @@ -1047,7 +1047,7 @@ typedef enum { #define WEEKEVENTREG_55_40 PACK_WEEKEVENTREG_FLAG(55, 0x40) // Gyorg has been defeated -#define WEEKEVENTREG_55_80 PACK_WEEKEVENTREG_FLAG(55, 0x80) +#define WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE PACK_WEEKEVENTREG_FLAG(55, 0x80) #define WEEKEVENTREG_56_01 PACK_WEEKEVENTREG_FLAG(56, 0x01) #define WEEKEVENTREG_56_02 PACK_WEEKEVENTREG_FLAG(56, 0x02) @@ -1576,7 +1576,7 @@ void Sram_IncrementDay(void); u16 Sram_CalcChecksum(void* data, size_t count); void Sram_InitNewSave(void); void Sram_InitDebugSave(void); -void func_80144A94(SramContext* sramCtx); +void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx); void Sram_OpenSave(struct FileSelectState* fileSelect, SramContext* sramCtx); void func_8014546C(SramContext* sramCtx); void func_801457CC(struct FileSelectState* fileSelect, SramContext* sramCtx); diff --git a/include/z64scene.h b/include/z64scene.h index 84b405b902..c31b7ce58f 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -177,9 +177,9 @@ typedef struct { typedef struct { /* 0x0 */ u8 code; - /* 0x1 */ u8 sceneCsCount; + /* 0x1 */ u8 scriptListCount; /* 0x4 */ void* segment; -} SCmdCutsceneList; // size = 0x8 +} SCmdCsScriptList; // size = 0x8 typedef struct { /* 0x0 */ u8 code; @@ -202,7 +202,7 @@ typedef struct { /* 0x0 */ u8 code; /* 0x1 */ u8 num; /* 0x4 */ void* segment; -} SCmdCutsceneActorList; // size = 0x8 +} SCmdCutsceneList; // size = 0x8 typedef struct { /* 0x0 */ u8 code; @@ -531,11 +531,11 @@ typedef union { /* Command: 0x14 */ SCmdEndMarker endMarker; /* Command: 0x15 */ SCmdSoundSettings soundSettings; /* Command: 0x16 */ SCmdEchoSettings echoSettings; - /* Command: 0x17 */ SCmdCutsceneList cutsceneList; + /* Command: 0x17 */ SCmdCsScriptList scriptList; /* Command: 0x18 */ SCmdAltHeaders altHeaders; /* Command: 0x19 */ SCmdRegionVisited regionVisited; /* Command: 0x1A */ SCmdTextureAnimations textureAnimations; - /* Command: 0x1B */ SCmdCutsceneActorList cutsceneActorList; + /* Command: 0x1B */ SCmdCutsceneList cutsceneList; /* Command: 0x1C */ SCmdMinimapSettings minimapSettings; /* Command: 0x1D */ // Unused /* Command: 0x1E */ SCmdMinimapChests minimapChests; @@ -822,6 +822,15 @@ typedef enum { */ #define ENTRANCE(scene, spawn) ((((ENTR_SCENE_##scene) & 0x7F) << 9) | (((spawn) & 0x1F) << 4)) +/* +* Entrances used in cutscene destination. Includes scene layer that's immediately applied to `nextCutsceneIndex` and removed. +* See `CutsceneScriptEntry.nextEntrance` +* 0xFE00: Index into sSceneEntranceTable (Scene) +* 0x01F0: Index into the scenes specific entrance table (Spawn) +* 0x000F: Index into the specific entrance table (Layer) +*/ +#define CS_ENTRANCE(scene, spawn, layer) ((((ENTR_SCENE_##scene) & 0x7F) << 9) | (((spawn) & 0x1F) << 4) | ((layer) & 0xF)) + // SceneTableEntry draw configs typedef enum { /* 0 */ SCENE_DRAW_CFG_DEFAULT, @@ -867,7 +876,7 @@ typedef enum { /* 0x14 */ SCENE_CMD_ID_END, /* 0x15 */ SCENE_CMD_ID_SOUND_SETTINGS, /* 0x16 */ SCENE_CMD_ID_ECHO_SETTINGS, - /* 0x17 */ SCENE_CMD_ID_CUTSCENE_LIST, + /* 0x17 */ SCENE_CMD_ID_CUTSCENE_SCRIPT_LIST, /* 0x18 */ SCENE_CMD_ID_ALTERNATE_HEADER_LIST, /* 0x19 */ SCENE_CMD_ID_SET_REGION_VISITED, /* 0x1A */ SCENE_CMD_ID_ANIMATED_MATERIAL_LIST, @@ -952,21 +961,20 @@ typedef enum { #define SCENE_CMD_ECHO_SETTINGS(echo) \ { SCENE_CMD_ID_ECHO_SETTINGS, 0, CMD_BBBB(0, 0, 0, echo) } -#define SCENE_CMD_CUTSCENE_LIST(numCutscene, cutsceneList) \ - { SCENE_CMD_ID_CUTSCENE_LIST, numCutscene, CMD_PTR(cutsceneList) } +#define SCENE_CMD_CUTSCENE_SCRIPT_LIST(numEntries, scriptList) \ + { SCENE_CMD_ID_CUTSCENE_SCRIPT_LIST, numEntries, CMD_PTR(scriptList) } #define SCENE_CMD_ALTERNATE_HEADER_LIST(alternateHeaderList) \ { SCENE_CMD_ID_ALTERNATE_HEADER_LIST, 0, CMD_PTR(alternateHeaderList) } -#define SCENE_CMD_MISC_SETTINGS SCENE_CMD_SET_REGION_VISITED // TODO: ZAPD Capatability #define SCENE_CMD_SET_REGION_VISITED() \ { SCENE_CMD_ID_SET_REGION_VISITED, 0, CMD_W(0) } #define SCENE_CMD_ANIMATED_MATERIAL_LIST(matAnimList) \ { SCENE_CMD_ID_ANIMATED_MATERIAL_LIST, 0, CMD_PTR(matAnimList) } -#define SCENE_CMD_ACTOR_CUTSCENE_LIST(actorCutsceneCount, actorCutsceneList) \ - { SCENE_CMD_ID_ACTOR_CUTSCENE_LIST, actorCutsceneCount, CMD_PTR(actorCutsceneList) } +#define SCENE_CMD_ACTOR_CUTSCENE_LIST(numEntries, actorCutsceneList) \ + { SCENE_CMD_ID_ACTOR_CUTSCENE_LIST, numEntries, CMD_PTR(actorCutsceneList) } #define SCENE_CMD_MINIMAP_INFO(minimapInfo) \ { SCENE_CMD_ID_MINIMAP_INFO, 0, CMD_PTR(minimapInfo) } @@ -974,4 +982,8 @@ typedef enum { #define SCENE_CMD_MINIMAP_COMPASS_ICON_INFO(compassIconCount, compassIconInfo) \ { SCENE_CMD_ID_MINIMAP_COMPASS_ICON_INFO, compassIconCount, CMD_PTR(compassIconInfo) } + // TODO: ZAPD Capatability +#define SCENE_CMD_MISC_SETTINGS SCENE_CMD_SET_REGION_VISITED +#define SCENE_CMD_CUTSCENE_LIST SCENE_CMD_CUTSCENE_SCRIPT_LIST + #endif diff --git a/include/z64subs.h b/include/z64subs.h index cc0e7ba2fb..ad2b7044f7 100644 --- a/include/z64subs.h +++ b/include/z64subs.h @@ -11,9 +11,9 @@ extern Vec3f gOneVec3f; #define SUBS_TIME_PATHING_ORDER 3 typedef enum { - /* 0 */ SUBS_CUTSCENE_SET_UNK_LINK_FIELDS, + /* 0 */ SUBS_CUTSCENE_WITH_PLAYER, /* 1 */ SUBS_CUTSCENE_NORMAL, - /* 2 */ SUBS_CUTSCENE_SET_FLAG + /* 2 */ SUBS_CUTSCENE_WITH_PLAYER_SET_FLAG } SubSCutsceneType; //! TODO: rename based on func_8013E748 and func_800B8500 @@ -153,8 +153,8 @@ s32 SubS_ActorPathing_SetNextPoint(struct PlayState* play, ActorPathing* actorPa void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animationInfo, s32 nextAnimIndex, s32* curAnimIndex); -s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type); -s32 SubS_FillCutscenesList(Actor* actor, s16 cutscenes[], s16 numCutscenes); +s32 SubS_StartCutscene(Actor* actor, s16 nextCsId, s16 curCsId, s32 type); +s32 SubS_FillCutscenesList(Actor* actor, s16 csIdList[], s16 numCutscenes); void SubS_ConstructPlane(Vec3f* point, Vec3f* unitVec, Vec3s* rot, Plane* plane); s32 SubS_LineSegVsPlane(Vec3f* point, Vec3s* rot, Vec3f* unitVec, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersect); diff --git a/spec b/spec index 417609b6f4..481fd099dd 100644 --- a/spec +++ b/spec @@ -470,7 +470,6 @@ beginseg include "build/data/code/z_eventmgr.bss.o" include "build/src/code/z_fcurve_data.o" include "build/src/code/z_fcurve_data_skelanime.o" - include "build/data/code/code_801BD830.data.o" include "build/src/code/z_fireobj.o" include "build/src/code/z_game_dlftbls.o" include "build/src/code/z_horse.o" @@ -539,8 +538,8 @@ beginseg include "build/src/code/z_message_staff.o" include "build/src/code/z_player_call.o" include "build/src/code/z_shrink_window.o" - include "build/src/code/db_camera.o" - include "build/data/code/db_camera.bss.o" + include "build/src/code/cutscene_camera.o" + include "build/data/code/cutscene_camera.bss.o" include "build/src/code/z_kaleido_manager.o" include "build/src/code/z_kaleido_scope_call.o" include "build/src/code/z_fbdemo_dlftbls.o" diff --git a/src/audio/code_8019AF00.c b/src/audio/code_8019AF00.c index 5af712e993..d107e65b72 100644 --- a/src/audio/code_8019AF00.c +++ b/src/audio/code_8019AF00.c @@ -3357,7 +3357,7 @@ void AudioOcarina_Update(void) { #define OCARINA_INSTRUMENT_OOT_MAX 7 -void AudioOcarina_PlayLongScarecrowAfterCredits(void) { +void AudioOcarina_PlayLongScarecrowSong(void) { static u8 sScarecrowAfterCreditsState = 0; static u8 sScarecrowAfterCreditsIntrumentId = OCARINA_INSTRUMENT_DEFAULT; static u16 sScarecrowAfterCreditsTimer = 1200; diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c index 2b8a887283..6c63e2a706 100644 --- a/src/boot_O2_g3/idle.c +++ b/src/boot_O2_g3/idle.c @@ -1,3 +1,4 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "stack.h" #include "buffers.h" diff --git a/src/boot_O2_g3/yaz0.c b/src/boot_O2_g3/yaz0.c index aa7ecdfe12..3517b97ae4 100644 --- a/src/boot_O2_g3/yaz0.c +++ b/src/boot_O2_g3/yaz0.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" u8 sYaz0DataBuffer[0x400]; diff --git a/src/code/cutscene_camera.c b/src/code/cutscene_camera.c new file mode 100644 index 0000000000..d5f028b947 --- /dev/null +++ b/src/code/cutscene_camera.c @@ -0,0 +1,380 @@ +#include "global.h" + +extern CutsceneCamera* sCurCsCamera; + +typedef s16 (*CsCamInterpolateCallback)(Vec3f*, f32*, s16*, CsCmdCamPoint*, CsCmdCamMisc*, CutsceneCameraInterp*); + +// function declarations +s16 func_80161180(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +s16 func_8016237C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +s16 func_8016253C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +s16 func_80162A50(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +s16 func_801623E4(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +s16 func_80161C20(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +s16 func_80161E4C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +s16 func_801620CC(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +s16 func_80163334(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc, + CutsceneCameraInterp* interp); +f32 func_80163660(Actor* actor); + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161180.s") + +/** + * Initializes Cutscene Camera Info + */ +s32 CutsceneCamera_Init(Camera* camera, CutsceneCamera* csCamera) { + csCamera->camera = camera; + + csCamera->nextSplineTimer = csCamera->updateSplineTimer = 0; + csCamera->cmdIndex = 0; + csCamera->splineIndex = 0xFFFF; + csCamera->splineNeedsInit = true; + csCamera->state = CS_CAM_STATE_UPDATE_ALL; + + sCurCsCamera = csCamera; + + __osMemset(&csCamera->eyeInterp, 0, sizeof(CutsceneCameraInterp)); + __osMemset(&csCamera->atInterp, 0, sizeof(CutsceneCameraInterp)); + + csCamera->eyeInterp.unk_2D = csCamera->atInterp.unk_2D = 7; + + return 1; +} + +CsCamInterpolateCallback CutsceneCamera_Interpolate(u8 interpType) { + switch (interpType) { + case CS_CAM_INTERP_7: + default: + return func_80161180; + + case CS_CAM_INTERP_0: + return func_8016237C; + + case CS_CAM_INTERP_5: + return func_8016253C; + + case CS_CAM_INTERP_4: + return func_80162A50; + + case CS_CAM_INTERP_1: + return func_801623E4; + + case CS_CAM_INTERP_2: + return func_80161C20; + + case CS_CAM_INTERP_3: + return func_80161E4C; + + case CS_CAM_INTERP_6: + return func_801620CC; + } +} + +u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) { + s32 sp5C; + f32* fov; + s16* roll; + CsCamInterpolateCallback interpHandler; + Player* player; + Actor* target; + s16 numPoints; + + sp5C = true; + if (csCamera->state == CS_CAM_STATE_DONE_SPLINE) { + return false; + } + + player = GET_PLAYER(csCamera->camera->play); + target = csCamera->camera->target; + + if (csCamera->eyeCmd[csCamera->atInterp.curPoint].interpType < + csCamera->atCmd[csCamera->eyeInterp.curPoint].interpType) { + sp5C = false; + } + + csCamera->eyeInterp.unk_00 = csCamera->camera->eye; + csCamera->atInterp.unk_00 = csCamera->camera->at; + + if (sp5C) { + fov = NULL; + } else { + fov = &csCamera->camera->fov; + } + + if (sp5C) { + roll = NULL; + } else { + roll = &csCamera->camera->roll; + } + + interpHandler = CutsceneCamera_Interpolate(csCamera->atCmd[csCamera->eyeInterp.curPoint].interpType); + + switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) { + case CS_CAM_REL_2: + OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 2); + break; + + case CS_CAM_REL_3: + OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1); + break; + + case CS_CAM_REL_1: + OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1); + break; + + case CS_CAM_REL_4: + OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, 1); + break; + + case CS_CAM_REL_5: + OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, 2); + break; + + default: // CS_CAM_REL_0 + break; + } + + numPoints = interpHandler(&csCamera->camera->at, fov, roll, &csCamera->atCmd[csCamera->eyeInterp.curPoint], + &csCamera->miscCmd[csCamera->eyeInterp.curPoint], &csCamera->eyeInterp); + + switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) { + case CS_CAM_REL_2: + OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 2); + break; + + case CS_CAM_REL_3: + OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1); + csCamera->camera->at.y += func_80163660(&player->actor); + break; + + case CS_CAM_REL_1: + OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1); + break; + + case CS_CAM_REL_4: + OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->at, &csCamera->camera->at, 1); + break; + + case CS_CAM_REL_5: + OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->at, &csCamera->camera->at, 2); + break; + + default: // CS_CAM_REL_0 + break; + } + + csCamera->eyeInterp.curPoint += numPoints; + + if (sp5C) { + fov = &csCamera->camera->fov; + } else { + fov = NULL; + } + + if (sp5C) { + roll = &csCamera->camera->roll; + } else { + roll = NULL; + } + + interpHandler = CutsceneCamera_Interpolate(csCamera->eyeCmd[csCamera->atInterp.curPoint].interpType); + + switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) { + case CS_CAM_REL_2: + OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 2); + break; + + case CS_CAM_REL_3: + OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1); + break; + + case CS_CAM_REL_1: + OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1); + break; + + case CS_CAM_REL_4: + OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 1); + break; + + case CS_CAM_REL_5: + OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 2); + break; + + default: // CS_CAM_REL_0 + break; + } + + numPoints = interpHandler(&csCamera->camera->eye, fov, roll, &csCamera->eyeCmd[csCamera->atInterp.curPoint], + &csCamera->miscCmd[csCamera->atInterp.curPoint], &csCamera->atInterp); + + switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) { + case CS_CAM_REL_2: + OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 2); + break; + + case CS_CAM_REL_3: + OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1); + csCamera->camera->eye.y += func_80163660(&player->actor); + break; + + case CS_CAM_REL_1: + OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1); + break; + + case CS_CAM_REL_4: + OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 1); + break; + + case CS_CAM_REL_5: + OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 2); + break; + + default: // CS_CAM_REL_0 + break; + } + + csCamera->atInterp.curPoint += numPoints; + + if ((csCamera->eyeInterp.curPoint >= csCamera->eyeInterp.numEntries) || + (csCamera->atInterp.curPoint >= csCamera->atInterp.numEntries)) { + return false; + } + + return true; +} + +/** + * Processes camera cutscene commands + */ +s32 CutsceneCamera_UpdateSplines(u8* script, CutsceneCamera* csCamera) { + CsCmdCamSpline* spline; + + switch (csCamera->state) { + case CS_CAM_STATE_DONE: + return 0; + + case CS_CAM_STATE_PAUSE: + return csCamera->nextSplineTimer; + + case CS_CAM_STATE_UPDATE_SPLINE: + if (csCamera->updateSplineTimer <= csCamera->duration) { + csCamera->updateSplineTimer++; + if (csCamera->updateSplineTimer <= csCamera->duration) { + // Process Spline + if (!CutsceneCamera_ProcessSpline(csCamera)) { + csCamera->state = CS_CAM_STATE_DONE_SPLINE; + } + } + } + break; + + case CS_CAM_STATE_DONE_SPLINE: + break; + + default: // CS_CAM_STATE_UPDATE_ALL + if (csCamera->splineNeedsInit == true) { + // Spline Header + spline = (CsCmdCamSpline*)&script[csCamera->cmdIndex]; + csCamera->atInterp.numEntries = csCamera->eyeInterp.numEntries = spline->numEntries; + csCamera->duration = spline->duration; + csCamera->cmdIndex += sizeof(CsCmdCamSpline); + + // At Point + csCamera->atCmd = (CsCmdCamPoint*)&script[csCamera->cmdIndex]; + csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamPoint)); + + // Misc Point + csCamera->eyeCmd = (CsCmdCamPoint*)&script[csCamera->cmdIndex]; + csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamPoint)); + + // Misc + csCamera->miscCmd = (CsCmdCamMisc*)&script[csCamera->cmdIndex]; + csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamMisc)); + + // Other Params + csCamera->eyeInterp.curPoint = 0; + csCamera->atInterp.curPoint = 0; + + csCamera->splineNeedsInit = false; + //! FAKE: csCamera->splineIndex++; + csCamera->splineIndex = (csCamera->splineIndex & 0xFFFF) + 1; + csCamera->state = CS_CAM_STATE_UPDATE_ALL; + csCamera->nextSplineTimer = csCamera->updateSplineTimer = 0; + csCamera->eyeInterp.unk_2D = csCamera->atInterp.unk_2D = 7; + } + + csCamera->nextSplineTimer++; + + if (csCamera->updateSplineTimer <= csCamera->duration) { + csCamera->updateSplineTimer++; + if (csCamera->updateSplineTimer <= csCamera->duration) { + // Process SubCommands + if (!CutsceneCamera_ProcessSpline(csCamera)) { + csCamera->state = CS_CAM_STATE_DONE_SPLINE; + } + } + } + break; + } + + if (csCamera->nextSplineTimer > csCamera->duration) { + // Next Spline + csCamera->splineNeedsInit = true; + spline = (CsCmdCamSpline*)&script[csCamera->cmdIndex]; + if (spline->numEntries == -1) { + csCamera->state = CS_CAM_STATE_DONE; + return 0; + } + } + + return csCamera->nextSplineTimer; +} + +// Unused +s16 func_80161BAC(void) { + return (sCurCsCamera->state == CS_CAM_STATE_PAUSE) || (sCurCsCamera->state == CS_CAM_STATE_UPDATE_SPLINE); +} + +void CutsceneCamera_SetState(s16 state) { + if (sCurCsCamera->state == CS_CAM_STATE_UPDATE_ALL) { + sCurCsCamera->state = state; + } +} + +void CutsceneCamera_Reset(void) { + sCurCsCamera->state = CS_CAM_STATE_UPDATE_ALL; +} + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161C20.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161E4C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801620CC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_8016237C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801623E4.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801624EC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_8016253C.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801629BC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80162A50.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80162FF8.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801631DC.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80163334.s") + +#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80163660.s") diff --git a/src/code/db_camera.c b/src/code/db_camera.c deleted file mode 100644 index 92b6d87f91..0000000000 --- a/src/code/db_camera.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161180.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_8016119C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_8016122C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801612B8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161998.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161BAC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161BE0.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161C0C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161C20.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161E4C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801620CC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_8016237C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801623E4.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801624EC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_8016253C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801629BC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80162A50.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80162FF8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801631DC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80163334.s") - -#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80163660.s") diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 8e2f659653..84501dcbbe 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1371,7 +1371,7 @@ void func_800B722C(GameState* gameState, Player* player) { s32 func_800B724C(PlayState* play, Actor* actor, u8 csMode) { Player* player = GET_PLAYER(play); - if ((player->csMode == PLAYER_CSMODE_5) || ((csMode == PLAYER_CSMODE_6) && (player->csMode == PLAYER_CSMODE_0))) { + if ((player->csMode == PLAYER_CSMODE_5) || ((csMode == PLAYER_CSMODE_END) && (player->csMode == PLAYER_CSMODE_0))) { return false; } @@ -1880,7 +1880,7 @@ s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, Player player->talkActorDistance = actor->xzDistToPlayer; player->exchangeItemId = exchangeItemId; - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); return true; } @@ -2048,7 +2048,7 @@ s32 Actor_OfferGetItem(Actor* actor, PlayState* play, GetItemId getItemId, f32 x player->getItemDirection = absYawDiff; if ((getItemId > GI_NONE) && (getItemId < GI_MAX)) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[1]); + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_ITEM_GET]); } return true; @@ -2123,7 +2123,7 @@ s32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) { PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000))) { player->rideActor = horse; player->mountSide = mountSide; - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); return true; } @@ -3126,8 +3126,8 @@ void Actor_FreeOverlay(ActorOverlay* entry) { Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params) { - return Actor_SpawnAsChildAndCutscene(actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params, -1, - HALFDAYBIT_ALL, NULL); + return Actor_SpawnAsChildAndCutscene(actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params, + CS_ID_NONE, HALFDAYBIT_ALL, NULL); } ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) { @@ -3171,7 +3171,7 @@ ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) { } Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX, - s16 rotY, s16 rotZ, s32 params, u32 cutscene, u32 halfDaysBits, Actor* parent) { + s16 rotY, s16 rotZ, s32 params, u32 csId, u32 halfDaysBits, Actor* parent) { s32 pad; Actor* actor; ActorInit* actorInit; @@ -3237,10 +3237,10 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1 actor->home.rot.y = rotY; actor->home.rot.z = rotZ; actor->params = params & 0xFFFF; - actor->cutscene = (cutscene & 0x7F); + actor->csId = csId & 0x7F; - if (actor->cutscene == 0x7F) { - actor->cutscene = -1; + if (actor->csId == 0x7F) { + actor->csId = CS_ID_NONE; } if (halfDaysBits != 0) { @@ -3263,8 +3263,8 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1 Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params) { - return Actor_SpawnAsChildAndCutscene(actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params, -1, - parent->halfDaysBits, parent); + return Actor_SpawnAsChildAndCutscene(actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params, + CS_ID_NONE, parent->halfDaysBits, parent); } void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) { @@ -4404,7 +4404,7 @@ s16 func_800BDB6C(Actor* actor, PlayState* play, s16 arg2, f32 arg3) { Player* player = GET_PLAYER(play); f32 phi_f2; - if ((play->csCtx.state != CS_STATE_0) || gDbgCamEnabled) { + if ((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) { phi_f2 = Math_Vec3f_DistXYZ(&actor->world.pos, &play->view.eye) * 0.25f; } else { phi_f2 = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos); diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index a8e9fbb80a..3df77c0c41 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -3613,31 +3613,31 @@ CameraSetting sCameraSettings[] = { }; s16 sGlobalCamDataSettings[] = { - /* -25 */ CAM_SET_ELEGY_SHELL, - /* -24 */ CAM_SET_SIDED, - /* -23 */ CAM_SET_BOAT_CRUISE, - /* -22 */ CAM_SET_NONE, - /* -21 */ CAM_SET_SUBJECTD, - /* -20 */ CAM_SET_NORMALD, - /* -19 */ CAM_SET_NONE, - /* -18 */ CAM_SET_NONE, - /* -17 */ CAM_SET_NONE, - /* -16 */ CAM_SET_WARP_PAD_ENTRANCE, - /* -15 */ CAM_SET_ATTENTION, - /* -14 */ CAM_SET_CONNECT0, - /* -13 */ CAM_SET_REMOTEBOMB, - /* -12 */ CAM_SET_NONE, - /* -11 */ CAM_SET_MASK_TRANSFORMATION, - /* -10 */ CAM_SET_LONG_CHEST_OPENING, - /* -9 */ CAM_SET_REBIRTH, - /* -8 */ CAM_SET_DEATH, - /* -7 */ CAM_SET_WARP_PAD_MOON, - /* -6 */ CAM_SET_NAVI, - /* -5 */ CAM_SET_ITEM3, - /* -4 */ CAM_SET_ITEM2, - /* -3 */ CAM_SET_ITEM1, - /* -2 */ CAM_SET_ITEM0, - /* -1 */ CAM_SET_STOP0, + /* -25 */ CAM_SET_ELEGY_SHELL, // CS_CAM_ID_GLOBAL_ELEGY + /* -24 */ CAM_SET_SIDED, // CS_CAM_ID_GLOBAL_SIDED + /* -23 */ CAM_SET_BOAT_CRUISE, // CS_CAM_ID_GLOBAL_BOAT_CRUISE + /* -22 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N16 + /* -21 */ CAM_SET_SUBJECTD, // CS_CAM_ID_GLOBAL_SUBJECTD + /* -20 */ CAM_SET_NORMALD, // CS_CAM_ID_GLOBAL_NORMALD + /* -19 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N13 + /* -18 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N12 + /* -17 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N11 + /* -16 */ CAM_SET_WARP_PAD_ENTRANCE, // CS_CAM_ID_GLOBAL_WARP_PAD_ENTRANCE + /* -15 */ CAM_SET_ATTENTION, // CS_CAM_ID_GLOBAL_ATTENTION + /* -14 */ CAM_SET_CONNECT0, // CS_CAM_ID_GLOBAL_CONNECT + /* -13 */ CAM_SET_REMOTEBOMB, // CS_CAM_ID_GLOBAL_REMOTE_BOMB + /* -12 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N0C + /* -11 */ CAM_SET_MASK_TRANSFORMATION, // CS_CAM_ID_GLOBAL_MASK_TRANSFORMATION + /* -10 */ CAM_SET_LONG_CHEST_OPENING, // CS_CAM_ID_GLOBAL_LONG_CHEST_OPENING + /* -9 */ CAM_SET_REBIRTH, // CS_CAM_ID_GLOBAL_REVIVE + /* -8 */ CAM_SET_DEATH, // CS_CAM_ID_GLOBAL_DEATH + /* -7 */ CAM_SET_WARP_PAD_MOON, // CS_CAM_ID_GLOBAL_WARP_PAD_MOON + /* -6 */ CAM_SET_NAVI, // CS_CAM_ID_GLOBAL_SONG_WARP + /* -5 */ CAM_SET_ITEM3, // CS_CAM_ID_GLOBAL_ITEM_SHOW + /* -4 */ CAM_SET_ITEM2, // CS_CAM_ID_GLOBAL_ITEM_BOTTLE + /* -3 */ CAM_SET_ITEM1, // CS_CAM_ID_GLOBAL_ITEM_OCARINA + /* -2 */ CAM_SET_ITEM0, // CS_CAM_ID_GLOBAL_ITEM_GET + /* -1 */ CAM_SET_STOP0, // CS_CAM_ID_NONE /* 0 */ CAM_SET_NONE, }; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 6ecbd617a8..20083f3c46 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" Vec3f D_801EDE00; diff --git a/src/code/z_demo.c b/src/code/z_demo.c index dc32223a88..79270adce5 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,171 +1,177 @@ +#include "prevent_bss_reordering.h" #include "global.h" #include "z64quake.h" #include "z64rumble.h" #include "z64shrink_window.h" #include "overlays/gamestates/ovl_daytelop/z_daytelop.h" -void Cutscene_DoNothing(PlayState* play, CutsceneContext* csCtx); -void func_800EA258(PlayState* play, CutsceneContext* csCtx); -void func_800ED9C4(PlayState* play, CutsceneContext* csCtx); -void func_800EA2B8(PlayState* play, CutsceneContext* csCtx); -void func_800ED980(PlayState* play, CutsceneContext* csCtx); -void func_800EDA04(PlayState* play, CutsceneContext* csCtx); -void func_800EDA84(PlayState* play, CutsceneContext* csCtx); +void CutsceneHandler_DoNothing(PlayState* play, CutsceneContext* csCtx); +void CutsceneHandler_StartManual(PlayState* play, CutsceneContext* csCtx); +void CutsceneHandler_StopManual(PlayState* play, CutsceneContext* csCtx); +void CutsceneHandler_StartScript(PlayState* play, CutsceneContext* csCtx); +void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx); +void CutsceneHandler_StopScript(PlayState* play, CutsceneContext* csCtx); +void Cutscene_SetupScripted(PlayState* play, CutsceneContext* csCtx); // Unused UNK_TYPE4 D_801BB120 = 0; -u16 D_801BB124 = 0; -u16 D_801BB128 = 0; -u8 D_801BB12C = 0; +u16 sCurTextId = 0; +u16 sCurOcarinaAction = 0; +u8 gOpeningEntranceIndex = 0; u8 sCutsceneStoredPlayerForm = 0; // bss #ifndef NON_MATCHING -static u16 seqId; +static u16 sSeqId; #endif s16 sCutsceneQuakeIndex; -DbCameraUnkStruct sCutsceneCameraInfo; -u16 D_801F4DC8[10]; +CutsceneCamera sCutsceneCameraInfo; +u16 sCueTypeList[10]; UNK_TYPE D_801F4DDC; -u8 D_801F4DE0; -s16 D_801F4DE2; +u8 gDisablePlayerCsModeStartPos; +s16 gDungeonBossWarpSceneId; -void Cutscene_Init(PlayState* play, CutsceneContext* csCtx) { +void Cutscene_InitContext(PlayState* play, CutsceneContext* csCtx) { s32 i; - csCtx->state = CS_STATE_0; - csCtx->frames = 0; - csCtx->unk_0C = 0.0f; - play->csCtx.sceneCsCount = 0; - play->csCtx.currentCsIndex = 0; + csCtx->state = CS_STATE_IDLE; + csCtx->curFrame = 0; + csCtx->timer = 0.0f; + play->csCtx.scriptListCount = 0; + play->csCtx.scriptIndex = 0; - for (i = 0; i < ARRAY_COUNT(D_801F4DC8); i++) { - D_801F4DC8[i] = 0; + for (i = 0; i < ARRAY_COUNT(sCueTypeList); i++) { + sCueTypeList[i] = 0; } - D_801F4DE0 = 0; + gDisablePlayerCsModeStartPos = 0; Audio_SetCutsceneFlag(false); } -void Cutscene_Start(PlayState* play, CutsceneContext* csCtx) { - csCtx->state = CS_STATE_1; - csCtx->playerAction = NULL; +void Cutscene_StartManual(PlayState* play, CutsceneContext* csCtx) { + csCtx->state = CS_STATE_START; + csCtx->playerCue = NULL; } -void Cutscene_End(PlayState* play, CutsceneContext* csCtx) { - if (csCtx->state != CS_STATE_4) { - csCtx->state = CS_STATE_3; +void Cutscene_StopManual(PlayState* play, CutsceneContext* csCtx) { + if (csCtx->state != CS_STATE_RUN_UNSTOPPABLE) { + csCtx->state = CS_STATE_STOP; } } -typedef void (*CutsceneStateHandler)(PlayState* play, CutsceneContext* csCtx); +typedef void (*CutsceneHandler)(PlayState* play, CutsceneContext* csCtx); -CutsceneStateHandler sCsStateHandlers1[] = { - Cutscene_DoNothing, // CS_STATE_0 - func_800EA258, // CS_STATE_1 - Cutscene_DoNothing, // CS_STATE_2 - func_800ED9C4, // CS_STATE_3 - Cutscene_DoNothing, // CS_STATE_4 +CutsceneHandler sManualCutsceneHandlers[] = { + CutsceneHandler_DoNothing, // CS_STATE_IDLE + CutsceneHandler_StartManual, // CS_STATE_START + CutsceneHandler_DoNothing, // CS_STATE_RUN + CutsceneHandler_StopManual, // CS_STATE_STOP + CutsceneHandler_DoNothing, // CS_STATE_RUN_UNSTOPPABLE }; -void Cutscene_Update1(PlayState* play, CutsceneContext* csCtx) { - if (gSaveContext.save.cutscene < 0xFFF0) { - sCsStateHandlers1[csCtx->state](play, csCtx); +void Cutscene_UpdateManual(PlayState* play, CutsceneContext* csCtx) { + if (gSaveContext.save.cutsceneIndex < 0xFFF0) { + sManualCutsceneHandlers[csCtx->state](play, csCtx); } } -CutsceneStateHandler sCsStateHandlers2[] = { - Cutscene_DoNothing, // CS_STATE_0 - func_800EA2B8, // CS_STATE_1 - func_800ED980, // CS_STATE_2 - func_800EDA04, // CS_STATE_3 - func_800ED980, // CS_STATE_4 +CutsceneHandler sScriptedCutsceneHandlers[] = { + CutsceneHandler_DoNothing, // CS_STATE_IDLE + CutsceneHandler_StartScript, // CS_STATE_START + CutsceneHandler_RunScript, // CS_STATE_RUN + CutsceneHandler_StopScript, // CS_STATE_STOP + CutsceneHandler_RunScript, // CS_STATE_RUN_UNSTOPPABLE }; -void Cutscene_Update2(PlayState* play, CutsceneContext* csCtx) { +void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx) { if ((gSaveContext.cutsceneTrigger != 0) && (play->transitionTrigger == TRANS_TRIGGER_START)) { gSaveContext.cutsceneTrigger = 0; } - if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_0)) { - gSaveContext.save.cutscene = 0xFFFD; + if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE)) { + gSaveContext.save.cutsceneIndex = 0xFFFD; gSaveContext.cutsceneTrigger = 1; } - if (gSaveContext.save.cutscene >= 0xFFF0) { - func_800EDA84(play, csCtx); - sCsStateHandlers2[csCtx->state](play, csCtx); + if (gSaveContext.save.cutsceneIndex >= 0xFFF0) { + Cutscene_SetupScripted(play, csCtx); + sScriptedCutsceneHandlers[csCtx->state](play, csCtx); } } -void Cutscene_DoNothing(PlayState* play, CutsceneContext* csCtx) { +void CutsceneHandler_DoNothing(PlayState* play, CutsceneContext* csCtx) { } -s32 func_800EA220(PlayState* play, CutsceneContext* csCtx, f32 target) { - return Math_StepToF(&csCtx->unk_0C, target, 0.1f); +s32 Cutscene_StepTimer(PlayState* play, CutsceneContext* csCtx, f32 target) { + return Math_StepToF(&csCtx->timer, target, 0.1f); } -void func_800EA258(PlayState* play, CutsceneContext* csCtx) { +void CutsceneHandler_StartManual(PlayState* play, CutsceneContext* csCtx) { Interface_SetHudVisibility(HUD_VISIBILITY_NONE); ShrinkWindow_Letterbox_SetSizeTarget(32); - if (func_800EA220(play, csCtx, 1.0f)) { + + if (Cutscene_StepTimer(play, csCtx, 1.0f)) { Audio_SetCutsceneFlag(true); - csCtx->state++; + csCtx->state++; // CS_STATE_RUN } } -void func_800EA2B8(PlayState* play, CutsceneContext* csCtx) { - func_800ED980(play, csCtx); +void CutsceneHandler_StartScript(PlayState* play, CutsceneContext* csCtx) { + CutsceneHandler_RunScript(play, csCtx); Interface_SetHudVisibility(HUD_VISIBILITY_NONE); ShrinkWindow_Letterbox_SetSizeTarget(32); - if (func_800EA220(play, csCtx, 1.0f)) { + + if (Cutscene_StepTimer(play, csCtx, 1.0f)) { Audio_SetCutsceneFlag(true); - csCtx->state++; + csCtx->state++; // CS_STATE_RUN } } /* Start of command handling section */ -// Command 0x96: Miscellaneous commands. -void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { +void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) { static u16 D_801BB15C = 0xFFFF; Player* player = GET_PLAYER(play); - f32 progress; - u8 isStartFrame = false; + f32 lerp; + u8 isFirstFrame = false; SceneTableEntry* loadedScene; - if ((csCtx->frames < cmd->startFrame) || ((csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame))) { + if (!((csCtx->curFrame >= cmd->startFrame) && + ((csCtx->curFrame < cmd->endFrame) || (cmd->endFrame == cmd->startFrame)))) { return; } - progress = Environment_LerpWeight(cmd->endFrame - 1, cmd->startFrame, csCtx->frames); - if (csCtx->frames == cmd->startFrame) { - isStartFrame = true; + lerp = Environment_LerpWeight(cmd->endFrame - 1, cmd->startFrame, csCtx->curFrame); + + if (csCtx->curFrame == cmd->startFrame) { + isFirstFrame = true; } - // TODO: consider creating an enum for this when we understand what each value does - switch (cmd->base) { - case 0x1: - if (isStartFrame) { + switch (cmd->type) { + case CS_MISC_RAIN: + if (isFirstFrame) { func_800FD78C(play); - play->envCtx.unk_F2[0] = 0x3C; + play->envCtx.unk_F2[0] = 60; } break; - case 0x2: - if (isStartFrame) { + + case CS_MISC_LIGHTNING: + if (isFirstFrame) { Audio_SetAmbienceChannelIO(AMBIENCE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0); Environment_AddLightningBolts(play, 3); D_801F4E68 = 1; } break; - case 0x3: + + case CS_MISC_LIFT_FOG: if (play->envCtx.lightSettings.zFar < 12800) { play->envCtx.lightSettings.zFar += 35; } break; - case 0x4: - if (isStartFrame) { + + case CS_MISC_CLOUDY_SKY: + if (isFirstFrame) { play->envCtx.unk_19 = 1; play->envCtx.unk_17 = 1; play->envCtx.unk_18 = 0; @@ -177,49 +183,57 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c play->envCtx.unk_22 = play->envCtx.unk_24; } break; - case 0x5: - if (isStartFrame && (csCtx->state != CS_STATE_4)) { - csCtx->state = CS_STATE_3; + + case CS_MISC_STOP_CUTSCENE: + if (isFirstFrame && (csCtx->state != CS_STATE_RUN_UNSTOPPABLE)) { + csCtx->state = CS_STATE_STOP; } break; - case 0x7: - if (isStartFrame) { + + case CS_MISC_SHOW_TITLE_CARD: + if (isFirstFrame) { loadedScene = play->loadedScene; if (loadedScene->titleTextId != 0) { func_80151A68(play, loadedScene->titleTextId); } } break; - case 0x8: + + case CS_MISC_EARTHQUAKE_MEDIUM: func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG); - if (isStartFrame) { + if (isFirstFrame) { sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); Quake_SetSpeed(sCutsceneQuakeIndex, 22000); Quake_SetQuakeValues(sCutsceneQuakeIndex, 6, 4, 0, 0); Quake_SetCountdown(sCutsceneQuakeIndex, 800); } break; - case 0x9: - if (isStartFrame) { + + case CS_MISC_EARTHQUAKE_STOP: + if (isFirstFrame) { Quake_Init(); } break; - case 0xA: + + case CS_MISC_VISMONO_BLACK_AND_WHITE: gVisMonoColor.r = 255; gVisMonoColor.g = 255; gVisMonoColor.b = 255; - gVisMonoColor.a = 255 * progress; + gVisMonoColor.a = 255 * lerp; break; - case 0xB: + + case CS_MISC_VISMONO_SEPIA: gVisMonoColor.r = 255; gVisMonoColor.g = 180; gVisMonoColor.b = 100; - gVisMonoColor.a = 255 * progress; + gVisMonoColor.a = 255 * lerp; break; - case 0xC: + + case CS_MISC_HIDE_ROOM: play->roomCtx.curRoom.segment = NULL; break; - case 0xD: + + case CS_MISC_RED_PULSATING_LIGHTS: if (play->state.frames & 8) { if (play->envCtx.lightSettings.ambientColor[0] < 40) { play->envCtx.lightSettings.ambientColor[0] += 2; @@ -234,96 +248,118 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c } } break; - case 0xE: + + case CS_MISC_HALT_ALL_ACTORS: play->haltAllActors = true; break; - case 0xF: + + case CS_MISC_RESUME_ALL_ACTORS: play->haltAllActors = false; break; - case 0x10: - if (isStartFrame) { + + case CS_MISC_SANDSTORM_FILL: + if (isFirstFrame) { play->envCtx.sandstormState = 1; } func_8019F128(NA_SE_EV_SAND_STORM - SFX_FLAG); break; - case 0x11: + + case CS_MISC_SUNSSONG_START: gSaveContext.sunsSongState = SUNSSONG_START; break; - case 0x12: + + case CS_MISC_FREEZE_TIME: if (!gSaveContext.save.isNight) { gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)R_TIME_SPEED; } else { gSaveContext.save.time = ((void)0, gSaveContext.save.time) - (u16)(2 * R_TIME_SPEED); } break; - case 0x13: - AudioOcarina_PlayLongScarecrowAfterCredits(); - csCtx->frames = cmd->startFrame - 1; + + case CS_MISC_LONG_SCARECROW_SONG: + AudioOcarina_PlayLongScarecrowSong(); + csCtx->curFrame = cmd->startFrame - 1; // the cutscene runs forever break; - case 0x14: - EnvFlags_Set(play, 3); + + case CS_MISC_SET_CSFLAG_3: + CutsceneFlags_Set(play, 3); break; - case 0x15: - EnvFlags_Set(play, 4); + + case CS_MISC_SET_CSFLAG_4: + CutsceneFlags_Set(play, 4); break; - case 0x16: + + case CS_MISC_PLAYER_FORM_DEKU: gSaveContext.save.playerForm = PLAYER_FORM_DEKU; break; - case 0x17: + + case CS_MISC_ENABLE_PLAYER_REFLECTION: player->stateFlags2 |= PLAYER_STATE2_4000000; break; - case 0x18: + + case CS_MISC_DISABLE_PLAYER_REFLECTION: player->stateFlags2 &= ~PLAYER_STATE2_4000000; break; - case 0x19: + + case CS_MISC_PLAYER_FORM_HUMAN: sCutsceneStoredPlayerForm = gSaveContext.save.playerForm; gSaveContext.save.playerForm = PLAYER_FORM_HUMAN; gSaveContext.save.equippedMask = PLAYER_MASK_NONE; break; - case 0x1A: + + case CS_MISC_EARTHQUAKE_STRONG: func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG); - if (isStartFrame) { + if (isFirstFrame) { sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); Quake_SetSpeed(sCutsceneQuakeIndex, 30000); Quake_SetQuakeValues(sCutsceneQuakeIndex, 20, 10, 0, 0); Quake_SetCountdown(sCutsceneQuakeIndex, 800); } break; - case 0x1B: - if (isStartFrame) { + + case CS_MISC_DEST_MOON_CRASH_FIRE_WALL: + if (isFirstFrame) { play->nextEntrance = ENTRANCE(CUTSCENE, 0); gSaveContext.nextCutsceneIndex = 0xFFF8; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; } break; - case 0x1C: - if (isStartFrame) { + + case CS_MISC_MOON_CRASH_SKYBOX: + if (isFirstFrame) { + // skyboxConfig play->envCtx.unk_17 = 0xD; } break; - case 0x1D: + + case CS_MISC_PLAYER_FORM_RESTORED: gSaveContext.save.playerForm = sCutsceneStoredPlayerForm; break; - case 0x1E: - D_801F4DE0 = true; + + case CS_MISC_DISABLE_PLAYER_CSMODE_START_POS: + gDisablePlayerCsModeStartPos = true; break; - case 0x1F: - D_801F4DE0 = false; + + case CS_MISC_ENABLE_PLAYER_CSMODE_START_POS: + gDisablePlayerCsModeStartPos = false; break; - case 0x21: - if (isStartFrame) { + + case CS_MISC_SAVE_ENTER_CLOCK_TOWN: + if (isFirstFrame) { Sram_SaveSpecialEnterClockTown(play); } break; - case 0x22: - if (isStartFrame) { - func_80144A94(&play->sramCtx); + + case CS_MISC_RESET_SAVE_FROM_MOON_CRASH: + if (isFirstFrame) { + Sram_ResetSaveFromMoonCrash(&play->sramCtx); } break; - case 0x23: - if (csCtx->frames != D_801BB15C) { - D_801BB15C = csCtx->frames; + + case CS_MISC_TIME_ADVANCE: + if (csCtx->curFrame != D_801BB15C) { + D_801BB15C = csCtx->curFrame; if (R_TIME_SPEED != 0) { gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED; @@ -332,9 +368,10 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c } } break; - case 0x24: + + case CS_MISC_EARTHQUAKE_WEAK: func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG); - if (isStartFrame) { + if (isFirstFrame) { sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_6); Quake_SetSpeed(sCutsceneQuakeIndex, 22000); Quake_SetQuakeValues(sCutsceneQuakeIndex, 2, 1, 0, 0); @@ -342,10 +379,8 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c } break; - case 0x26: - // Seems to be used to trigger "Dawn of A New Day" - - gSaveContext.save.day = 9; + case CS_MISC_DAWN_OF_A_NEW_DAY: + gSaveContext.save.day = 9; // 9 % 5 is day number 4, see `CURRENT_DAY` STOP_GAMESTATE(&play->state); SET_NEXT_GAMESTATE(&play->state, DayTelop_Init, sizeof(DayTelopState)); @@ -353,21 +388,23 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c Sram_SaveSpecialNewDay(play); break; - case 0x27: + case CS_MISC_PLAYER_FORM_ZORA: gSaveContext.save.playerForm = PLAYER_FORM_ZORA; break; - case 0x28: - csCtx->frames = cmd->startFrame - 1; + case CS_MISC_FINALE: + csCtx->curFrame = cmd->startFrame - 1; // the cutscene runs forever + break; + + default: break; } } -// Command 0x97: Set Environment Lighting -void Cutscene_Command_SetLighting(PlayState* play, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) { - if (csCtx->frames == cmd->startFrame) { - if (cmd->setting != 0x20) { - play->envCtx.lightSettingOverride = cmd->setting - 1; +void CutsceneCmd_SetLightSetting(PlayState* play, CutsceneContext* csCtx, CsCmdLightSetting* cmd) { + if (csCtx->curFrame == cmd->startFrame) { + if (cmd->settingPlusOne != 32) { + play->envCtx.lightSettingOverride = cmd->settingPlusOne - 1; play->envCtx.lightBlend = 1.0f; } else { play->envCtx.lightSettingOverride = 0xFF; @@ -375,51 +412,45 @@ void Cutscene_Command_SetLighting(PlayState* play, CutsceneContext* csCtx, CsCmd } } -// Command 0x12C: Plays a sequence (Background music or Fanfare) -void Cutscene_Command_PlaySequence(PlayState* play, CutsceneContext* csCtx, CsCmdSequenceChange* cmd) { - if (csCtx->frames == cmd->startFrame) { - Audio_PlaySequenceInCutscene(cmd->sequence - 1); +void CutsceneCmd_StartSequence(PlayState* play, CutsceneContext* csCtx, CsCmdStartSeq* cmd) { + if (csCtx->curFrame == cmd->startFrame) { + Audio_PlaySequenceInCutscene(cmd->seqIdPlusOne - 1); } } -// Command 0x12D: Stops a sequence (Background music or Fanfare) -void Cutscene_Command_StopSequence(PlayState* play, CutsceneContext* csCtx, CsCmdSequenceChange* cmd) { - if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) { - Audio_StopSequenceInCutscene(cmd->sequence - 1); +void CutsceneCmd_StopSequence(PlayState* play, CutsceneContext* csCtx, CsCmdStopSeq* cmd) { + if ((csCtx->curFrame >= cmd->startFrame) && (csCtx->curFrame <= cmd->endFrame)) { + Audio_StopSequenceInCutscene(cmd->seqIdPlusOne - 1); } } -// Command 0x9C: Fade a sequence (Background music or Fanfare) over duration -void Cutscene_Command_FadeSequence(PlayState* play, CutsceneContext* csCtx, CsCmdSequenceFade* cmd) { - if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame)) { - u8 fadeTimer = cmd->endFrame - cmd->startFrame; +void CutsceneCmd_FadeOutSequence(PlayState* play, CutsceneContext* csCtx, CsCmdFadeOutSeq* cmd) { + if ((csCtx->curFrame == cmd->startFrame) && (csCtx->curFrame < cmd->endFrame)) { + u8 fadeOutDuration = cmd->endFrame - cmd->startFrame; - if (cmd->type == 2) { - SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, fadeTimer); - } else { - SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, fadeTimer); + if (cmd->seqPlayer == CS_FADE_OUT_FANFARE) { + SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, fadeOutDuration); + } else { // CS_FADE_OUT_BGM_MAIN + SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, fadeOutDuration); } } } -// Command 0x12E: Play Ambience sequence -void Cutscene_Command_PlayAmbienceSequence(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - if (csCtx->frames == cmd->startFrame) { +void CutsceneCmd_StartAmbience(PlayState* play, CutsceneContext* csCtx, CsCmdStartAmbience* cmd) { + if (csCtx->curFrame == cmd->startFrame) { Audio_PlayAmbience(play->sequenceCtx.ambienceId); } } -// Command 0x130: -void func_800EAD48(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - if (csCtx->frames == cmd->startFrame) { +void Cutscene_SetSfxReverbIndexTo2(PlayState* play, CutsceneContext* csCtx, CsCmdSfxReverbIndexTo2* cmd) { + if (csCtx->curFrame == cmd->startFrame) { // Audio_SetSfxReverbIndexExceptOcarinaBank func_801A4428(2); } } -// Command 0x131: -void func_800EAD7C(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - if (csCtx->frames == cmd->startFrame) { +void Cutscene_SetSfxReverbIndexTo1(PlayState* play, CutsceneContext* csCtx, CsCmdSfxReverbIndexTo1* cmd) { + if (csCtx->curFrame == cmd->startFrame) { // Audio_SetSfxReverbIndexExceptOcarinaBank func_801A4428(1); } @@ -427,107 +458,103 @@ void func_800EAD7C(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { #ifdef NON_MATCHING // needs in-function static bss -// audio related -void func_800EADB0(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - static u16 seqId; +void CutsceneCmd_ModifySequence(PlayState* play, CutsceneContext* csCtx, CsCmdModifySeq* cmd) { + static u16 sSeqId; u8 dayMinusOne; - if (csCtx->frames == cmd->startFrame) { - dayMinusOne = (gSaveContext.save.day - 1); + if (csCtx->curFrame == cmd->startFrame) { + dayMinusOne = gSaveContext.save.day - 1; if (dayMinusOne >= 3) { dayMinusOne = 0; } - switch (cmd->base) { - case 1: - // func_801A246C(SEQ_PLAYER_BGM_MAIN, TYPE_1); + switch (cmd->type) { + case CS_MOD_SEQ_0: func_801A246C(SEQ_PLAYER_BGM_MAIN, 1); break; - case 2: - // func_801A246C(SEQ_PLAYER_BGM_MAIN, TYPE_0); + case CS_MOD_SEQ_1: func_801A246C(SEQ_PLAYER_BGM_MAIN, 0); break; - case 3: - // func_801A246C(SEQ_PLAYER_BGM_MAIN, TYPE_2); + case CS_MOD_SEQ_2: func_801A246C(SEQ_PLAYER_BGM_MAIN, 2); break; - case 4: - // func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_1); + case CS_MOD_AMBIENCE_0: func_801A246C(SEQ_PLAYER_AMBIENCE, 1); break; - case 5: - // func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_0); + case CS_MOD_AMBIENCE_1: func_801A246C(SEQ_PLAYER_AMBIENCE, 0); break; - case 6: - // func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_2); + case CS_MOD_AMBIENCE_2: func_801A246C(SEQ_PLAYER_AMBIENCE, 2); break; - case 7: - seqId = AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN); + case CS_MOD_SEQ_STORE: + sSeqId = AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN); break; - case 8: - if (seqId != NA_BGM_DISABLED) { - Audio_PlaySceneSequence(seqId, dayMinusOne); + case CS_MOD_SEQ_RESTORE: + if (sSeqId != NA_BGM_DISABLED) { + Audio_PlaySceneSequence(sSeqId, dayMinusOne); } break; + + default: + break; } } } #else -void func_800EADB0(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EADB0.s") +void CutsceneCmd_ModifySequence(PlayState* play, CutsceneContext* csCtx, CsCmdModifySeq* cmd); +#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/CutsceneCmd_ModifySequence.s") #endif -// Command 0x12F: Fade Ambience sequence -void Cutscene_Command_FadeAmbienceSequence(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - if (csCtx->frames == cmd->startFrame && csCtx->frames < cmd->endFrame) { - u8 fadeTimer = cmd->endFrame - cmd->startFrame; +void CutsceneCmd_FadeOutAmbience(PlayState* play, CutsceneContext* csCtx, CsCmdFadeOutAmbience* cmd) { + if ((csCtx->curFrame == cmd->startFrame) && (csCtx->curFrame < cmd->endFrame)) { + u8 fadeOutDuration = cmd->endFrame - cmd->startFrame; - SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_AMBIENCE, fadeTimer); + SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_AMBIENCE, fadeOutDuration); } } -// Command 0x190: Rumble -void Cutscene_Command_Rumble(PlayState* play, CutsceneContext* csCtx, CsCmdRumble* cmd) { +void CutsceneCmd_RumbleController(PlayState* play, CutsceneContext* csCtx, CsCmdRumble* cmd) { switch (cmd->type) { - case 1: - if (csCtx->frames == cmd->startFrame) { + case CS_RUMBLE_ONCE: + if (csCtx->curFrame == cmd->startFrame) { Rumble_Request(0.0f, cmd->intensity, cmd->decayTimer, cmd->decayStep); } break; - case 2: - if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) { - if ((csCtx->frames == cmd->startFrame) || (play->state.frames % 64 == 0)) { + case CS_RUMBLE_PULSE: + if ((csCtx->curFrame >= cmd->startFrame) && (csCtx->curFrame <= cmd->endFrame)) { + if ((csCtx->curFrame == cmd->startFrame) || (play->state.frames % 64 == 0)) { Rumble_Request(0.0f, cmd->intensity, cmd->decayTimer, cmd->decayStep); } } break; + + default: + break; } } -// Command 0x9B: -void Cutscene_Command_FadeColorScreen(PlayState* play, CutsceneContext* csCtx, CsCmdFadeScreen* cmd) { - if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) { +void CutsceneCmd_TransitionGeneral(PlayState* play, CutsceneContext* csCtx, CsCmdTransitionGeneral* cmd) { + if ((csCtx->curFrame >= cmd->startFrame) && (cmd->endFrame >= csCtx->curFrame)) { f32 alpha; play->envCtx.fillScreen = true; - alpha = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames); + alpha = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->curFrame); - if (((cmd->unk0 == 1)) || (cmd->unk0 == 2)) { + if (((cmd->type == CS_TRANS_GENERAL_FILL_IN)) || (cmd->type == CS_TRANS_GENERAL_FILL_OUT)) { play->envCtx.screenFillColor[0] = cmd->color.r; play->envCtx.screenFillColor[1] = cmd->color.g; play->envCtx.screenFillColor[2] = cmd->color.b; - if (cmd->unk0 == 2) { + if (cmd->type == CS_TRANS_GENERAL_FILL_OUT) { play->envCtx.screenFillColor[3] = (1.0f - alpha) * 255.0f; } else { play->envCtx.screenFillColor[3] = 255.0f * alpha; @@ -536,43 +563,45 @@ void Cutscene_Command_FadeColorScreen(PlayState* play, CutsceneContext* csCtx, C } } -// Command 0x9D: Set Time of Day & Environment Time -void Cutscene_Command_SetTime(PlayState* play, CutsceneContext* csCtx, CsCmdDayTime* cmd) { - u16 nextTime; +void CutsceneCmd_SetTime(PlayState* play, CutsceneContext* csCtx, CsCmdTime* cmd) { u16 hourAsMinutes; u16 minutes; - if (csCtx->frames == cmd->startFrame) { + if (csCtx->curFrame == cmd->startFrame) { hourAsMinutes = CLOCK_TIME_ALT_F(cmd->hour, 0); minutes = CLOCK_TIME_ALT_F(0, cmd->minute + 1); - nextTime = hourAsMinutes + minutes; - gSaveContext.save.time = nextTime; - gSaveContext.skyboxTime = nextTime; + gSaveContext.save.time = hourAsMinutes + minutes; + gSaveContext.skyboxTime = hourAsMinutes + minutes; } } -void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - csCtx->state = CS_STATE_4; +void CutsceneCmd_DestinationDefault(PlayState* play, CutsceneContext* csCtx, CsCmdDestination* cmd) { + csCtx->state = CS_STATE_RUN_UNSTOPPABLE; Play_DisableMotionBlur(); Audio_SetCutsceneFlag(false); gSaveContext.cutsceneTransitionControl = 1; - if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (csCtx->frames != cmd->startFrame)) { + // `hudVisibilityForceButtonAlphasByStatus` has a secondary purpose, which is to signal to the title + // screen actor that it should display immediately. This occurs when a title screen cutscene that + // is not the main clock town scene is skipped. + if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (csCtx->curFrame != cmd->startFrame)) { gSaveContext.hudVisibilityForceButtonAlphasByStatus = true; } - gSaveContext.save.cutscene = 0; - if (cmd->base == 1) { - play->nextEntrance = play->csCtx.sceneCsList[play->csCtx.currentCsIndex].nextEntrance; + gSaveContext.save.cutsceneIndex = 0; + + if (cmd->type == CS_DESTINATION_DEFAULT) { + play->nextEntrance = play->csCtx.scriptList[play->csCtx.scriptIndex].nextEntrance; gSaveContext.nextCutsceneIndex = 0; play->transitionTrigger = TRANS_TRIGGER_START; + if (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN) { Scene_SetExitFade(play); } else { - D_801BB12C++; - if (D_801BB12C >= 2) { - D_801BB12C = 0; + gOpeningEntranceIndex++; + if (gOpeningEntranceIndex >= 2) { + gOpeningEntranceIndex = 0; } play->transitionType = TRANS_TYPE_FADE_BLACK_FAST; } @@ -585,19 +614,18 @@ void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase* } } -// Command 0x15E -void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - if (cmd->base == 1) { - if (csCtx->frames == cmd->startFrame) { - Cutscene_TerminatorImpl(play, csCtx, cmd); +void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDestination* cmd) { + if (cmd->type == CS_DESTINATION_DEFAULT) { + if (csCtx->curFrame == cmd->startFrame) { + CutsceneCmd_DestinationDefault(play, csCtx, cmd); } - } else if (cmd->base == 2) { - if (csCtx->frames == cmd->startFrame) { + } else if (cmd->type == CS_DESTINATION_BOSS_WARP) { + if (csCtx->curFrame == cmd->startFrame) { Play_DisableMotionBlur(); - switch (D_801F4DE2) { - case 0x1F: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + switch (gDungeonBossWarpSceneId) { + case SCENE_MITURIN_BS: + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { play->nextEntrance = ENTRANCE(WOODFALL_TEMPLE, 1); play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; @@ -609,8 +637,8 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB } break; - case 0x44: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + case SCENE_HAKUGIN_BS: + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { play->nextEntrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 7); play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; @@ -622,36 +650,38 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB } break; - case 0x5F: - SET_WEEKEVENTREG(WEEKEVENTREG_55_80); + case SCENE_SEA_BS: + SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE); play->nextEntrance = ENTRANCE(ZORA_CAPE, 8); gSaveContext.nextCutsceneIndex = 0xFFF0; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; break; - case 0x36: - SET_WEEKEVENTREG(WEEKEVENTREG_52_20); + case SCENE_INISIE_BS: + SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE); play->nextEntrance = ENTRANCE(IKANA_CANYON, 0); gSaveContext.nextCutsceneIndex = 0xFFF1; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; break; + + default: + break; } } } } -// Command 0x15F: Chooses between a cutscene or a rotating mask depending on whether the player has the corresponding -// mask -void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - if ((csCtx->frames >= cmd->startFrame) && (func_801A3950(SEQ_PLAYER_BGM_MAIN, true) != 0xFF)) { - switch (cmd->base) { - case 1: - Cutscene_TerminatorImpl(play, csCtx, cmd); +// Chooses between a cutscene or a rotating mask depending on whether the player has the corresponding mask +void CutsceneCmd_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCtx, CsCmdChooseCreditsScene* cmd) { + if ((csCtx->curFrame >= cmd->startFrame) && (func_801A3950(SEQ_PLAYER_BGM_MAIN, true) != 0xFF)) { + switch (cmd->type) { + case CS_CREDITS_DESTINATION: + CutsceneCmd_DestinationDefault(play, csCtx, (CsCmdDestination*)cmd); break; - case 2: + case CS_CREDITS_MASK_KAMARO: if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) { play->nextEntrance = ENTRANCE(MILK_BAR, 0); gSaveContext.nextCutsceneIndex = 0xFFF0; @@ -662,7 +692,7 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt play->transitionTrigger = TRANS_TRIGGER_START; break; - case 3: + case CS_CREDITS_MASK_GREAT_FAIRY: if (INV_CONTENT(ITEM_MASK_GREAT_FAIRY) == ITEM_MASK_GREAT_FAIRY) { play->nextEntrance = ENTRANCE(FAIRY_FOUNTAIN, 0); gSaveContext.nextCutsceneIndex = 0xFFF0; @@ -673,7 +703,7 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt play->transitionTrigger = TRANS_TRIGGER_START; break; - case 4: + case CS_CREDITS_MASK_ROMANI: if (INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI) { play->nextEntrance = ENTRANCE(ROMANI_RANCH, 0); gSaveContext.nextCutsceneIndex = 0xFFF1; @@ -684,7 +714,7 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt play->transitionTrigger = TRANS_TRIGGER_START; break; - case 5: + case CS_CREDITS_MASK_BLAST: if (INV_CONTENT(ITEM_MASK_BLAST) == ITEM_MASK_BLAST) { play->nextEntrance = ENTRANCE(WEST_CLOCK_TOWN, 0); gSaveContext.nextCutsceneIndex = 0xFFF0; @@ -695,7 +725,7 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt play->transitionTrigger = TRANS_TRIGGER_START; break; - case 6: + case CS_CREDITS_MASK_CIRCUS_LEADER: if (INV_CONTENT(ITEM_MASK_CIRCUS_LEADER) == ITEM_MASK_CIRCUS_LEADER) { play->nextEntrance = ENTRANCE(MILK_BAR, 0); gSaveContext.nextCutsceneIndex = 0xFFF1; @@ -706,7 +736,7 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt play->transitionTrigger = TRANS_TRIGGER_START; break; - case 7: + case CS_CREDITS_MASK_BREMEN: if (INV_CONTENT(ITEM_MASK_BREMEN) == ITEM_MASK_BREMEN) { play->nextEntrance = ENTRANCE(MILK_BAR, 0); gSaveContext.nextCutsceneIndex = 0xFFF3; @@ -717,13 +747,13 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt play->transitionTrigger = TRANS_TRIGGER_START; break; - case 8: + case CS_CREDITS_IKANA: play->nextEntrance = ENTRANCE(IKANA_CANYON, 0); gSaveContext.nextCutsceneIndex = 0xFFF3; play->transitionTrigger = TRANS_TRIGGER_START; break; - case 9: + case CS_CREDITS_MASK_COUPLE: if (INV_CONTENT(ITEM_MASK_COUPLE) == ITEM_MASK_COUPLE) { play->nextEntrance = ENTRANCE(TERMINA_FIELD, 0); gSaveContext.nextCutsceneIndex = 0xFFF8; @@ -734,7 +764,7 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt play->transitionTrigger = TRANS_TRIGGER_START; break; - case 10: + case CS_CREDITS_MASK_BUNNY: if (INV_CONTENT(ITEM_MASK_BUNNY) == ITEM_MASK_BUNNY) { play->nextEntrance = ENTRANCE(CUCCO_SHACK, 0); gSaveContext.nextCutsceneIndex = 0xFFF0; @@ -745,7 +775,7 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt play->transitionTrigger = TRANS_TRIGGER_START; break; - case 11: + case CS_CREDITS_MASK_POSTMAN: if (INV_CONTENT(ITEM_MASK_POSTMAN) == ITEM_MASK_POSTMAN) { play->nextEntrance = ENTRANCE(TERMINA_FIELD, 1); gSaveContext.nextCutsceneIndex = 0xFFF8; @@ -755,35 +785,36 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt } play->transitionTrigger = TRANS_TRIGGER_START; break; + + default: + break; } } } -// Command 0x99: Motion blur -void Cutscene_Command_MotionBlur(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) { - if ((csCtx->frames == cmd->startFrame) && (cmd->base == 1)) { +void CutsceneCmd_MotionBlur(PlayState* play, CutsceneContext* csCtx, CsCmdMotionBlur* cmd) { + if ((csCtx->curFrame >= cmd->startFrame) && (cmd->endFrame >= csCtx->curFrame)) { + if ((csCtx->curFrame == cmd->startFrame) && (cmd->type == CS_MOTION_BLUR_ENABLE)) { Play_EnableMotionBlur(180); } - if (cmd->base == 2) { - f32 progress = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames); + if (cmd->type == CS_MOTION_BLUR_DISABLE) { + f32 lerp = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->curFrame); - if (progress >= 0.9f) { + if (lerp >= 0.9f) { Play_DisableMotionBlur(); } else { - Play_SetMotionBlurAlpha((1.0f - progress) * 180.0f); + Play_SetMotionBlurAlpha((1.0f - lerp) * 180.0f); } } } } -// Command 0x9A: Gives Tatl to the player -void Cutscene_Command_GiveTatlToPlayer(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { +void CutsceneCmd_GiveTatlToPlayer(PlayState* play, CutsceneContext* csCtx, CsCmdGiveTatl* cmd) { Player* player = GET_PLAYER(play); - if (csCtx->frames == cmd->startFrame) { - if (cmd->base == 1) { + if (csCtx->curFrame == cmd->startFrame) { + if (cmd->giveTatl == true) { gSaveContext.save.hasTatl = true; if (player->tatlActor != NULL) { return; @@ -794,109 +825,112 @@ void Cutscene_Command_GiveTatlToPlayer(PlayState* play, CutsceneContext* csCtx, } } -// Command 0x98 -void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { - if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) { - f32 temp_f0; +void CutsceneCmd_Transition(PlayState* play, CutsceneContext* csCtx, CsCmdTransition* cmd) { + if ((csCtx->curFrame >= cmd->startFrame) && (cmd->endFrame >= csCtx->curFrame)) { + f32 lerp; play->envCtx.fillScreen = true; - temp_f0 = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames); + lerp = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->curFrame); - switch (cmd->base) { - case 1: - case 5: + switch (cmd->type) { + case CS_TRANS_GRAY_FILL_IN: + case CS_TRANS_GRAY_FILL_OUT: play->envCtx.screenFillColor[0] = 160; play->envCtx.screenFillColor[1] = 160; play->envCtx.screenFillColor[2] = 160; - if (cmd->base == 1) { - play->envCtx.screenFillColor[3] = 255.0f * temp_f0; - if (temp_f0 == 0.0f) { + + if (cmd->type == CS_TRANS_GRAY_FILL_IN) { + play->envCtx.screenFillColor[3] = 255.0f * lerp; + if (lerp == 0.0f) { func_8019F128(NA_SE_EV_S_STONE_FLASH); } } else { - play->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f; + play->envCtx.screenFillColor[3] = (1.0f - lerp) * 255.0f; } break; - case 2: - case 6: + case CS_TRANS_BLUE_FILL_IN: + case CS_TRANS_BLUE_FILL_OUT: play->envCtx.screenFillColor[0] = 0; play->envCtx.screenFillColor[1] = 0; play->envCtx.screenFillColor[2] = 255; - if (cmd->base == 2) { - play->envCtx.screenFillColor[3] = 255.0f * temp_f0; + if (cmd->type == CS_TRANS_BLUE_FILL_IN) { + play->envCtx.screenFillColor[3] = 255.0f * lerp; } else { - play->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f; + play->envCtx.screenFillColor[3] = (1.0f - lerp) * 255.0f; } break; - case 3: - case 7: + case CS_TRANS_RED_FILL_OUT: + case CS_TRANS_RED_FILL_IN: play->envCtx.screenFillColor[0] = 255; play->envCtx.screenFillColor[1] = 0; play->envCtx.screenFillColor[2] = 0; - if (cmd->base == 3) { - play->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f; + if (cmd->type == CS_TRANS_RED_FILL_OUT) { + play->envCtx.screenFillColor[3] = (1.0f - lerp) * 255.0f; } else { - play->envCtx.screenFillColor[3] = 255.0f * temp_f0; + play->envCtx.screenFillColor[3] = 255.0f * lerp; } break; - case 4: - case 8: + case CS_TRANS_GREEN_FILL_OUT: + case CS_TRANS_GREEN_FILL_IN: play->envCtx.screenFillColor[0] = 0; play->envCtx.screenFillColor[1] = 255; play->envCtx.screenFillColor[2] = 0; - if (cmd->base == 4) { - play->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f; + if (cmd->type == CS_TRANS_GREEN_FILL_OUT) { + play->envCtx.screenFillColor[3] = (1.0f - lerp) * 255.0f; } else { - play->envCtx.screenFillColor[3] = 255.0f * temp_f0; + play->envCtx.screenFillColor[3] = 255.0f * lerp; } break; - case 9: + case CS_TRANS_TRIGGER_INSTANCE: gSaveContext.cutsceneTransitionControl = 1; break; - case 10: - case 11: + case CS_TRANS_BLACK_FILL_OUT: + case CS_TRANS_BLACK_FILL_IN: play->envCtx.screenFillColor[0] = 0; play->envCtx.screenFillColor[1] = 0; play->envCtx.screenFillColor[2] = 0; - if (cmd->base == 10) { - play->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f; + if (cmd->type == CS_TRANS_BLACK_FILL_OUT) { + play->envCtx.screenFillColor[3] = (1.0f - lerp) * 255.0f; } else { - play->envCtx.screenFillColor[3] = 255.0f * temp_f0; + play->envCtx.screenFillColor[3] = 255.0f * lerp; } break; - case 12: - play->envCtx.screenFillColor[0] = (160.0f * (1.0f - temp_f0)); + case CS_TRANS_GRAY_TO_BLACK: + play->envCtx.screenFillColor[0] = (1.0f - lerp) * 160.0f; play->envCtx.screenFillColor[1] = play->envCtx.screenFillColor[0]; play->envCtx.screenFillColor[2] = play->envCtx.screenFillColor[0]; play->envCtx.screenFillColor[3] = 255; break; - case 13: - play->envCtx.screenFillColor[0] = (160.0f * temp_f0); + case CS_TRANS_BLACK_TO_GRAY: + play->envCtx.screenFillColor[0] = 160.0f * lerp; play->envCtx.screenFillColor[1] = play->envCtx.screenFillColor[0]; play->envCtx.screenFillColor[2] = play->envCtx.screenFillColor[0]; play->envCtx.screenFillColor[3] = 255; break; + + default: + break; } } } -// Command 0x5A: Camera -s32 Cutscene_Command_Camera(PlayState* play, u8* cmd) { - s32 sp1C = 0; +s32 CutsceneCmd_UpdateCamSpline(PlayState* play, u8* script) { + s32 cmdBytes = 0; + + bcopy(script, &cmdBytes, sizeof(cmdBytes)); + script += sizeof(cmdBytes); - bcopy(cmd, &sp1C, sizeof(s32)); - cmd += sizeof(s32); if (!Play_IsDebugCamEnabled()) { - func_80161998(cmd, &sCutsceneCameraInfo); + CutsceneCamera_UpdateSplines(script, &sCutsceneCameraInfo); } - return sp1C + sizeof(s32); + return cmdBytes + sizeof(cmdBytes); } /** @@ -970,144 +1004,146 @@ s32 Cutscene_CountNormalMasks(void) { return count; } -// Command 0xA: Textbox -void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdTextbox* cmd) { - static s32 D_801BB160 = CS_TEXTBOX_TYPE_DEFAULT; +void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) { + static s32 sCutsceneTextboxType = CS_TEXT_TYPE_DEFAULT; u8 talkState; s32 pad; - u16 originalCsFrames; - s32 pad2; + u16 endFrame; - if ((cmd->startFrame >= csCtx->frames) || ((cmd->endFrame < csCtx->frames))) { + if ((csCtx->curFrame <= cmd->startFrame) || (csCtx->curFrame > cmd->endFrame)) { return; } - if (cmd->type != CS_TEXTBOX_TYPE_LEARN_SONG) { - if (D_801BB124 != cmd->base) { - if (D_801BB160 == CS_TEXTBOX_TYPE_3) { - csCtx->frames--; + if (cmd->type != CS_TEXT_OCARINA_ACTION) { + if (sCurTextId != cmd->textId) { + if (sCutsceneTextboxType == CS_TEXT_TYPE_3) { + csCtx->curFrame--; } - D_801BB160 = CS_TEXTBOX_TYPE_1; - D_801BB124 = cmd->base; - if (cmd->type == CS_TEXTBOX_TYPE_BOSSES_REMAINS) { + sCutsceneTextboxType = CS_TEXT_TYPE_1; + sCurTextId = cmd->textId; + if (cmd->type == CS_TEXT_TYPE_BOSSES_REMAINS) { if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) { - if (cmd->textId1 != 0xFFFF) { - Message_StartTextbox(play, cmd->textId1, NULL); + if (cmd->altTextId1 != 0xFFFF) { + Message_StartTextbox(play, cmd->altTextId1, NULL); } } else { - Message_StartTextbox(play, cmd->base, NULL); + Message_StartTextbox(play, cmd->textId, NULL); } - } else if (cmd->type == CS_TEXTBOX_TYPE_ALL_NORMAL_MASKS) { + } else if (cmd->type == CS_TEXT_TYPE_ALL_NORMAL_MASKS) { if (Cutscene_CountNormalMasks() == 20) { - if (cmd->textId1 != 0xFFFF) { - Message_StartTextbox(play, cmd->textId1, NULL); + if (cmd->altTextId1 != 0xFFFF) { + Message_StartTextbox(play, cmd->altTextId1, NULL); } } else { - Message_StartTextbox(play, cmd->base, NULL); + Message_StartTextbox(play, cmd->textId, NULL); } } else { - Message_StartTextbox(play, cmd->base, NULL); + Message_StartTextbox(play, cmd->textId, NULL); } - } else { - goto else_label; + //! FAKE: return; + goto end; } - } else if (D_801BB128 != cmd->base) { - D_801BB160 = CS_TEXTBOX_TYPE_LEARN_SONG; - D_801BB128 = cmd->base; - func_80152434(play, cmd->base); } else { - else_label: - if (csCtx->frames >= cmd->endFrame) { - // The Textbox command can change the current cutscene frame, mainly to prevent advancing the cutscene when - // a textbox that is expected to be closed by the user is still open. - - originalCsFrames = csCtx->frames; - talkState = Message_GetState(&play->msgCtx); - if ((talkState != TEXT_STATE_CLOSING) && (talkState != TEXT_STATE_NONE) && (talkState != TEXT_STATE_7) && - (talkState != TEXT_STATE_8)) { - csCtx->frames--; - if ((talkState == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) { - if (play->msgCtx.choiceIndex == 0) { - if (cmd->base == 0x33BD) { - func_8019F230(); - } - - if (cmd->textId1 != 0xFFFF) { - Message_ContinueTextbox(play, cmd->textId1); - if (cmd->type == CS_TEXTBOX_TYPE_3) { - D_801BB160 = CS_TEXTBOX_TYPE_3; - if (cmd->textId2 != 0xFFFF) { - csCtx->frames++; - } - } - } else { - Message_CloseTextbox(play); - csCtx->frames++; - } - } else { - if (cmd->base == 0x33BD) { - func_8019F208(); - } - - if (cmd->textId2 != 0xFFFF) { - Message_ContinueTextbox(play, cmd->textId2); - if (cmd->type == CS_TEXTBOX_TYPE_3) { - D_801BB160 = CS_TEXTBOX_TYPE_3; - if (cmd->textId1 != 0xFFFF) { - csCtx->frames++; - } - } - } else { - Message_CloseTextbox(play); - csCtx->frames++; - } - } - } - - if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { - func_80152434(play, cmd->base); - } - } - - if ((talkState == TEXT_STATE_CLOSING) && (D_801BB160 == CS_TEXTBOX_TYPE_3)) { - csCtx->frames--; - D_801BB124++; - } - - if (originalCsFrames == csCtx->frames) { - Interface_SetHudVisibility(HUD_VISIBILITY_NONE); - D_801BB124 = 0; - D_801BB128 = 0; - func_80161C0C(); - } else { - func_80161BE0(1); - } + if (sCurOcarinaAction != cmd->textId) { + sCutsceneTextboxType = CS_TEXT_OCARINA_ACTION; + sCurOcarinaAction = cmd->textId; + func_80152434(play, cmd->textId); + return; } } -} -// Related to actorActions. Maybe a generic actorAction setter? -void func_800ECD7C(CutsceneContext* csCtx, u8** cutscenePtr, s16 index) { - s32 i; - s32 count; + if (csCtx->curFrame >= cmd->endFrame) { + // The Textbox command can change the current cutscene frame, mainly to prevent advancing the cutscene when + // a textbox that is expected to be closed by the user is still open. + endFrame = csCtx->curFrame; + talkState = Message_GetState(&play->msgCtx); + if ((talkState != TEXT_STATE_CLOSING) && (talkState != TEXT_STATE_NONE) && (talkState != TEXT_STATE_7) && + (talkState != TEXT_STATE_8)) { + csCtx->curFrame--; - bcopy(*cutscenePtr, &count, sizeof(s32)); - *cutscenePtr += sizeof(s32); + if ((talkState == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) { + if (play->msgCtx.choiceIndex == 0) { + if (cmd->textId == 0x33BD) { + // Gorman Track: do you understand? + func_8019F230(); + } - for (i = 0; i < count; i++) { - CsCmdActorAction* actorAction = *(CsCmdActorAction**)cutscenePtr; + if (cmd->altTextId1 != 0xFFFF) { + Message_ContinueTextbox(play, cmd->altTextId1); + if (cmd->type == CS_TEXT_TYPE_3) { + sCutsceneTextboxType = CS_TEXT_TYPE_3; + if (cmd->altTextId2 != 0xFFFF) { + csCtx->curFrame++; + } + } + } else { + Message_CloseTextbox(play); + csCtx->curFrame++; + } + } else { + if (cmd->textId == 0x33BD) { + // Gorman Track: do you understand? + func_8019F208(); + } - if ((csCtx->frames >= actorAction->startFrame) && (csCtx->frames < actorAction->endFrame)) { - csCtx->actorActions[index] = actorAction; + if (cmd->altTextId2 != 0xFFFF) { + Message_ContinueTextbox(play, cmd->altTextId2); + if (cmd->type == CS_TEXT_TYPE_3) { + sCutsceneTextboxType = CS_TEXT_TYPE_3; + if (cmd->altTextId1 != 0xFFFF) { + csCtx->curFrame++; + } + } + } else { + Message_CloseTextbox(play); + csCtx->curFrame++; + } + } + } + + if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { + func_80152434(play, cmd->textId); + } } - *cutscenePtr += sizeof(CsCmdActorAction); + if ((talkState == TEXT_STATE_CLOSING) && (sCutsceneTextboxType == CS_TEXT_TYPE_3)) { + csCtx->curFrame--; + sCurTextId++; + } + + if (endFrame == csCtx->curFrame) { + Interface_SetHudVisibility(HUD_VISIBILITY_NONE); + sCurTextId = 0; + sCurOcarinaAction = 0; + CutsceneCamera_Reset(); + } else { + CutsceneCamera_SetState(CS_CAM_STATE_UPDATE_SPLINE); + } + } +end:; +} + +void Cutscene_SetActorCue(CutsceneContext* csCtx, u8** script, s16 cueChannel) { + s32 i; + s32 numCues; + + bcopy(*script, &numCues, sizeof(numCues)); + *script += sizeof(numCues); + + for (i = 0; i < numCues; i++) { + CsCmdActorCue* cue = *(CsCmdActorCue**)script; + + if ((csCtx->curFrame >= cue->startFrame) && (csCtx->curFrame < cue->endFrame)) { + csCtx->actorCues[cueChannel] = cue; + } + + *script += sizeof(CsCmdActorCue); } } /** - * Loops over the cutscene data itself (`cutscenePtr`), applying the effects of each command instantaneously (for most + * Loops over the cutscene data itself (`script`), applying the effects of each command instantaneously (for most * commands). * * The cutscene data is an irregularly-structured array of words, which is made up of @@ -1124,15 +1160,15 @@ void func_800ECD7C(CutsceneContext* csCtx, u8** cutscenePtr, s16 index) { * has (N). This is followed by N commands of the said category. (The exception is Camera, which has the length of the * list in bytes instead of the number of commands). * - * For most command lists categories (all but the actorActions and Camera commands): + * For most command lists categories (all but the actorCues and Camera commands): * - For each command list found, read the number of commands and loop over them, passing each one to the corresponding * function which handles the command, applying its effects and checking the frame range stored in the command. * * This function is invoked once per frame that a cutscene is active. * - * TODO: consider changing the type of `cutscenePtr` to `uintptr_t` when this function matches. + * TODO: consider changing the type of `script` to `uintptr_t` when this function matches. */ -void Cutscene_ProcessCommands(PlayState* play, CutsceneContext* csCtx, u8* cutscenePtr) { +void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script) { s32 i; s32 j; s32 pad; @@ -1140,44 +1176,46 @@ void Cutscene_ProcessCommands(PlayState* play, CutsceneContext* csCtx, u8* cutsc u32 cmdType; s32 cmdEntries; s32 pad2; - s32 cutsceneEndFrame; - CsCmdBase* cmd; + s32 csFrameCount; + void* cmd; // Read the command list count and the ending frame for this cutscene - bcopy(cutscenePtr, &totalEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); - bcopy(cutscenePtr, &cutsceneEndFrame, sizeof(s32)); - cutscenePtr += sizeof(s32); + bcopy(script, &totalEntries, sizeof(totalEntries)); + script += sizeof(totalEntries); - if (((u16)cutsceneEndFrame < csCtx->frames) && (play->transitionTrigger != TRANS_TRIGGER_START) && - (csCtx->state != CS_STATE_4)) { - csCtx->state = CS_STATE_3; + bcopy(script, &csFrameCount, sizeof(csFrameCount)); + script += sizeof(csFrameCount); + + if ((csCtx->curFrame > (u16)csFrameCount) && (play->transitionTrigger != TRANS_TRIGGER_START) && + (csCtx->state != CS_STATE_RUN_UNSTOPPABLE)) { + csCtx->state = CS_STATE_STOP; return; } // Loop over every command list for (i = 0; i < totalEntries; i++) { // Read the command type of the current command list. - bcopy(cutscenePtr, &cmdType, sizeof(u32)); - cutscenePtr += sizeof(u32); + bcopy(script, &cmdType, sizeof(cmdType)); + script += sizeof(cmdType); - // TODO: This should probably be added to the CutsceneCmd enum. Consider doing it when this function matches. - if (cmdType == 0xFFFFFFFF) { + if (cmdType == CS_CAM_STOP) { break; } - // Check special cases of command types. This are generic ActorActions - // Ranges: [0x64, 0x96), 0xC9, [0x1C2, 0x258) - if (((cmdType >= 100) && (cmdType < 150)) || (cmdType == 201) || ((cmdType >= 450) && (cmdType < 600))) { - for (j = 0; j < ARRAY_COUNT(D_801F4DC8); j = (s16)(j + 1)) { - if (D_801F4DC8[j] == (u16)cmdType) { - func_800ECD7C(csCtx, &cutscenePtr, j); - cmdType = -2; + if (((cmdType >= CS_CMD_ACTOR_CUE_100) && (cmdType <= CS_CMD_ACTOR_CUE_149)) || + (cmdType == CS_CMD_ACTOR_CUE_201) || + ((cmdType >= CS_CMD_ACTOR_CUE_450) && (cmdType <= CS_CMD_ACTOR_CUE_599))) { + for (j = 0; j < ARRAY_COUNT(sCueTypeList); j = (s16)(j + 1)) { + if (sCueTypeList[j] == (u16)cmdType) { + Cutscene_SetActorCue(csCtx, &script, j); + cmdType = CS_CMD_ACTOR_CUE_POST_PROCESS; break; - } else if (D_801F4DC8[j] == 0) { - D_801F4DC8[j] = cmdType; - func_800ECD7C(csCtx, &cutscenePtr, j); - cmdType = -2; + } + + if (sCueTypeList[j] == 0) { + sCueTypeList[j] = cmdType; + Cutscene_SetActorCue(csCtx, &script, j); + cmdType = CS_CMD_ACTOR_CUE_POST_PROCESS; break; } } @@ -1185,203 +1223,227 @@ void Cutscene_ProcessCommands(PlayState* play, CutsceneContext* csCtx, u8* cutsc switch (cmdType) { case CS_CMD_MISC: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_Misc(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_Misc(play, csCtx, (CsCmdMisc*)script); + script += sizeof(CsCmdMisc); } break; - case CS_CMD_SET_LIGHTING: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_LIGHT_SETTING: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_SetLighting(play, csCtx, (CsCmdEnvLighting*)cutscenePtr); - cutscenePtr += sizeof(CsCmdEnvLighting); + CutsceneCmd_SetLightSetting(play, csCtx, (CsCmdLightSetting*)script); + script += sizeof(CsCmdLightSetting); } break; - case CS_CMD_PLAYSEQ: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_START_SEQ: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_PlaySequence(play, csCtx, (CsCmdSequenceChange*)cutscenePtr); - cutscenePtr += sizeof(CsCmdSequenceChange); + CutsceneCmd_StartSequence(play, csCtx, (CsCmdStartSeq*)script); + script += sizeof(CsCmdStartSeq); } break; - case CS_CMD_STOPSEQ: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_STOP_SEQ: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_StopSequence(play, csCtx, (CsCmdSequenceChange*)cutscenePtr); - cutscenePtr += sizeof(CsCmdSequenceChange); + CutsceneCmd_StopSequence(play, csCtx, (CsCmdStopSeq*)script); + script += sizeof(CsCmdStartSeq); } break; - case CS_CMD_FADESEQ: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_FADE_OUT_SEQ: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_FadeSequence(play, csCtx, (CsCmdSequenceFade*)cutscenePtr); - cutscenePtr += sizeof(CsCmdSequenceFade); + CutsceneCmd_FadeOutSequence(play, csCtx, (CsCmdFadeOutSeq*)script); + script += sizeof(CsCmdFadeOutSeq); } break; - case CS_CMD_PLAYAMBIENCE: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_START_AMBIENCE: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_PlayAmbienceSequence(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_StartAmbience(play, csCtx, (CsCmdStartAmbience*)script); + script += sizeof(CsCmdStartAmbience); } break; - case CS_CMD_FADEAMBIENCE: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_FADE_OUT_AMBIENCE: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_FadeAmbienceSequence(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_FadeOutAmbience(play, csCtx, (CsCmdFadeOutAmbience*)script); + script += sizeof(CsCmdFadeOutAmbience); } break; - case CS_CMD_130: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_SFX_REVERB_INDEX_2: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - func_800EAD48(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + Cutscene_SetSfxReverbIndexTo2(play, csCtx, (CsCmdSfxReverbIndexTo2*)script); + script += sizeof(CsCmdSfxReverbIndexTo2); } break; - case CS_CMD_131: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_SFX_REVERB_INDEX_1: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - func_800EAD7C(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + Cutscene_SetSfxReverbIndexTo1(play, csCtx, (CsCmdSfxReverbIndexTo1*)script); + script += sizeof(CsCmdSfxReverbIndexTo1); } break; - case CS_CMD_132: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_MODIFY_SEQ: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - func_800EADB0(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_ModifySequence(play, csCtx, (CsCmdModifySeq*)script); + script += sizeof(CsCmdModifySeq); } break; case CS_CMD_RUMBLE: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_Rumble(play, csCtx, (CsCmdRumble*)cutscenePtr); - cutscenePtr += sizeof(CsCmdRumble); + CutsceneCmd_RumbleController(play, csCtx, (CsCmdRumble*)script); + script += sizeof(CsCmdRumble); } break; - case CS_CMD_FADESCREEN: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_TRANSITION_GENERAL: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_FadeColorScreen(play, csCtx, (CsCmdFadeScreen*)cutscenePtr); - cutscenePtr += sizeof(CsCmdFadeScreen); + CutsceneCmd_TransitionGeneral(play, csCtx, (CsCmdTransitionGeneral*)script); + script += sizeof(CsCmdTransitionGeneral); } break; - case CS_CMD_SETTIME: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_TIME: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_SetTime(play, csCtx, (CsCmdDayTime*)cutscenePtr); - cutscenePtr += sizeof(CsCmdDayTime); + CutsceneCmd_SetTime(play, csCtx, (CsCmdTime*)script); + script += sizeof(CsCmdTime); } break; - case CS_CMD_SET_PLAYER_ACTION: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_PLAYER_CUE: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - cmd = (CsCmdBase*)cutscenePtr; - if ((cmd->startFrame <= csCtx->frames) && (csCtx->frames < cmd->endFrame)) { - csCtx->playerAction = (CsCmdActorAction*)cmd; + cmd = script; + + if ((((CsCmdActorCue*)cmd)->startFrame <= csCtx->curFrame) && + (csCtx->curFrame < ((CsCmdActorCue*)cmd)->endFrame)) { + csCtx->playerCue = (CsCmdActorCue*)cmd; } - cutscenePtr += sizeof(CsCmdActorAction); + script += sizeof(CsCmdActorCue); } break; - case CS_CMD_CAMERA: - cutscenePtr += Cutscene_Command_Camera(play, cutscenePtr); + case CS_CMD_CAMERA_SPLINE: + script += CutsceneCmd_UpdateCamSpline(play, script); break; - case CS_CMD_TERMINATOR: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_DESTINATION: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_Terminator(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_Destination(play, csCtx, (CsCmdDestination*)script); + script += sizeof(CsCmdDestination); } break; case CS_CMD_CHOOSE_CREDITS_SCENES: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_ChooseCreditsScenes(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_ChooseCreditsScenes(play, csCtx, (CsCmdChooseCreditsScene*)script); + script += sizeof(CsCmdChooseCreditsScene); } break; - case CS_CMD_TEXTBOX: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_TEXT: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - cmd = (CsCmdBase*)cutscenePtr; - if (cmd->base != 0xFFFF) { - Cutscene_Command_Textbox(play, csCtx, (CsCmdTextbox*)cmd); + cmd = script; + + if (((CsCmdText*)cmd)->textId != 0xFFFF) { + CutsceneCmd_Text(play, csCtx, (CsCmdText*)cmd); } - cutscenePtr += sizeof(CsCmdTextbox); + script += sizeof(CsCmdText); } break; - case CS_CMD_SCENE_TRANS_FX: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_TRANSITION: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_TransitionFX(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_Transition(play, csCtx, (CsCmdTransition*)script); + script += sizeof(CsCmdTransition); } break; - case CS_CMD_MOTIONBLUR: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_MOTION_BLUR: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_MotionBlur(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_MotionBlur(play, csCtx, (CsCmdMotionBlur*)script); + script += sizeof(CsCmdMotionBlur); } break; - case CS_CMD_GIVETATL: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + case CS_CMD_GIVE_TATL: + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - Cutscene_Command_GiveTatlToPlayer(play, csCtx, (CsCmdBase*)cutscenePtr); - cutscenePtr += sizeof(CsCmdBase); + CutsceneCmd_GiveTatlToPlayer(play, csCtx, (CsCmdGiveTatl*)script); + script += sizeof(CsCmdGiveTatl); } break; - case -2: + case CS_CMD_ACTOR_CUE_POST_PROCESS: break; default: - bcopy(cutscenePtr, &cmdEntries, sizeof(s32)); - cutscenePtr += sizeof(s32); + bcopy(script, &cmdEntries, sizeof(cmdEntries)); + script += sizeof(cmdEntries); + for (j = 0; j < cmdEntries; j++) { - cutscenePtr += sizeof(CsCmdBase); + script += sizeof(CsCmdUnimplemented); } break; } @@ -1390,120 +1452,125 @@ void Cutscene_ProcessCommands(PlayState* play, CutsceneContext* csCtx, u8* cutsc /* End of command handling section */ -void func_800ED980(PlayState* play, CutsceneContext* csCtx) { - if (gSaveContext.save.cutscene >= 0xFFF0) { - csCtx->frames++; - Cutscene_ProcessCommands(play, csCtx, (u8*)play->csCtx.csData); +void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) { + if (gSaveContext.save.cutsceneIndex >= 0xFFF0) { + csCtx->curFrame++; + Cutscene_ProcessScript(play, csCtx, (u8*)play->csCtx.script); } } -void func_800ED9C4(PlayState* play, CutsceneContext* csCtx) { - if (func_800EA220(play, csCtx, 0.0f)) { +void CutsceneHandler_StopManual(PlayState* play, CutsceneContext* csCtx) { + if (Cutscene_StepTimer(play, csCtx, 0.0f)) { Audio_SetCutsceneFlag(false); - csCtx->state = CS_STATE_0; + csCtx->state = CS_STATE_IDLE; } } -// unused -void func_800EDA04(PlayState* play, CutsceneContext* csCtx) { - if (func_800EA220(play, csCtx, 0.0f)) { +void CutsceneHandler_StopScript(PlayState* play, CutsceneContext* csCtx) { + if (Cutscene_StepTimer(play, csCtx, 0.0f)) { s16 i; - csCtx->playerAction = NULL; + csCtx->playerCue = NULL; - for (i = 0; i < ARRAY_COUNT(csCtx->actorActions); i++) { - csCtx->actorActions[i] = NULL; + for (i = 0; i < ARRAY_COUNT(csCtx->actorCues); i++) { + csCtx->actorCues[i] = NULL; } - gSaveContext.save.cutscene = 0; + gSaveContext.save.cutsceneIndex = 0; gSaveContext.gameMode = GAMEMODE_NORMAL; - ActorCutscene_Stop(0x7F); + + CutsceneManager_Stop(CS_ID_GLOBAL_END); Audio_SetCutsceneFlag(false); - csCtx->state = CS_STATE_0; + csCtx->state = CS_STATE_IDLE; } } -void func_800EDA84(PlayState* play, CutsceneContext* csCtx) { - if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_0) && !Player_InCsMode(play)) { - gSaveContext.save.cutscene = 0xFFFD; +void Cutscene_SetupScripted(PlayState* play, CutsceneContext* csCtx) { + if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE) && !Player_InCsMode(play)) { + gSaveContext.save.cutsceneIndex = 0xFFFD; } - if ((gSaveContext.save.cutscene >= 0xFFF0) && (csCtx->state == CS_STATE_0)) { + if ((gSaveContext.save.cutsceneIndex >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) { s16 i; - D_801BB124 = 0; - D_801BB128 = 0; - csCtx->playerAction = NULL; + sCurTextId = 0; + sCurOcarinaAction = 0; + csCtx->playerCue = NULL; - for (i = 0; i < ARRAY_COUNT(csCtx->actorActions); i++) { - csCtx->actorActions[i] = NULL; + for (i = 0; i < ARRAY_COUNT(csCtx->actorCues); i++) { + csCtx->actorCues[i] = NULL; } - csCtx->state++; - if (csCtx->state == CS_STATE_1) { + csCtx->state++; // CS_STATE_START + + if (csCtx->state == CS_STATE_START) { Audio_SetCutsceneFlag(true); - csCtx->frames = 0xFFFF; - csCtx->subCamId = ActorCutscene_GetCurrentSubCamId(0x7F); - func_8016119C(Play_GetCamera(play, csCtx->subCamId), &sCutsceneCameraInfo); - csCtx->unk_18 = 0xFFFF; + csCtx->curFrame = 0xFFFF; + + csCtx->subCamId = CutsceneManager_GetCurrentSubCamId(CS_ID_GLOBAL_END); + CutsceneCamera_Init(Play_GetCamera(play, csCtx->subCamId), &sCutsceneCameraInfo); + + // OoT Remnant + csCtx->camEyeSplinePointsAppliedFrame = CS_CAM_DATA_NOT_APPLIED; if (gSaveContext.cutsceneTrigger == 0) { Interface_SetHudVisibility(HUD_VISIBILITY_NONE); ShrinkWindow_Letterbox_SetSizeTarget(32); ShrinkWindow_Letterbox_SetSize(32); - csCtx->state++; + csCtx->state++; // CS_STATE_RUN } - func_800ED980(play, csCtx); + CutsceneHandler_RunScript(play, csCtx); } gSaveContext.cutsceneTrigger = 0; } } -// HandleFlags? -void func_800EDBE0(PlayState* play) { +void Cutscene_HandleEntranceTriggers(PlayState* play) { s32 pad; - s16 sp2A; - SceneTableEntry* sp24; - s32 temp_v0_3; + s16 csId; + SceneTableEntry* scene; + s32 scriptIndex; if (((gSaveContext.gameMode == GAMEMODE_NORMAL) || (gSaveContext.gameMode == GAMEMODE_TITLE_SCREEN)) && (gSaveContext.respawnFlag <= 0)) { - sp2A = func_800F21CC(); - if (sp2A != -1) { - temp_v0_3 = func_800F2138(sp2A); - if (temp_v0_3 != -1) { - if ((play->csCtx.sceneCsList[temp_v0_3].unk7 != 0xFF) && (gSaveContext.respawnFlag == 0)) { - if (play->csCtx.sceneCsList[temp_v0_3].unk7 == 0xFE) { - ActorCutscene_Start(sp2A, NULL); + // Try to find an actor cutscene that's triggered by the current spawn + csId = CutsceneManager_FindEntranceCsId(); + if (csId != CS_ID_NONE) { + scriptIndex = CutsceneManager_GetCutsceneScriptIndex(csId); + if (scriptIndex != CS_SCRIPT_ID_NONE) { + // A scripted cutscene is triggered by a spawn + if ((play->csCtx.scriptList[scriptIndex].spawnFlags != CS_SPAWN_FLAG_NONE) && + (gSaveContext.respawnFlag == 0)) { + if (play->csCtx.scriptList[scriptIndex].spawnFlags == CS_SPAWN_FLAG_ALWAYS) { + // Entrance cutscenes that always run + CutsceneManager_Start(csId, NULL); gSaveContext.showTitleCard = false; - } else if (!(((void)0, gSaveContext.save.saveInfo - .weekEventReg[(play->csCtx.sceneCsList[temp_v0_3].unk7 / 8)]) & - (1 << (play->csCtx.sceneCsList[temp_v0_3].unk7 % 8)))) { - // TODO: macros for this kind of weekEventReg access - gSaveContext.save.saveInfo.weekEventReg[(play->csCtx.sceneCsList[temp_v0_3].unk7 / 8)] = - ((void)0, - gSaveContext.save.saveInfo.weekEventReg[(play->csCtx.sceneCsList[temp_v0_3].unk7 / 8)]) | - (1 << (play->csCtx.sceneCsList[temp_v0_3].unk7 % 8)); - ActorCutscene_Start(sp2A, NULL); + + } else if (!CHECK_CS_SPAWN_FLAG_WEEKEVENTREG(play->csCtx.scriptList[scriptIndex].spawnFlags)) { + // Entrance cutscenes that only run once + SET_CS_SPAWN_FLAG_WEEKEVENTREG(play->csCtx.scriptList[scriptIndex].spawnFlags); + CutsceneManager_Start(csId, NULL); + // The title card will be used by the cs misc command if necessary. gSaveContext.showTitleCard = false; } } } else { - ActorCutscene_StartAndSetUnkLinkFields(sp2A, NULL); + // A non-scripted cutscene is triggered by a spawn + CutsceneManager_StartWithPlayerCs(csId, NULL); } } } if ((gSaveContext.respawnFlag == 0) || (gSaveContext.respawnFlag == -2)) { - sp24 = play->loadedScene; - if ((sp24->titleTextId != 0) && gSaveContext.showTitleCard) { + scene = play->loadedScene; + if ((scene->titleTextId != 0) && gSaveContext.showTitleCard) { if ((Entrance_GetTransitionFlags(((void)0, gSaveContext.save.entrance) + ((void)0, gSaveContext.sceneLayer)) & 0x4000) != 0) { - func_80151A68(play, sp24->titleTextId); + func_80151A68(play, scene->titleTextId); } } @@ -1517,10 +1584,10 @@ void func_800EDDB0(PlayState* play) { void func_800EDDBC(UNK_TYPE arg0, UNK_TYPE arg1) { } -void Cutscene_LoadCutsceneData(PlayState* play, u8 csIndex) { - if (dREG(95) == 0) { - play->csCtx.currentCsIndex = csIndex; - play->csCtx.csData = Lib_SegmentedToVirtual(play->csCtx.sceneCsList[csIndex].segmentedData); +void Cutscene_StartScripted(PlayState* play, u8 scriptIndex) { + if (!R_USE_DEBUG_CUTSCENE) { + play->csCtx.scriptIndex = scriptIndex; + play->csCtx.script = Lib_SegmentedToVirtual(play->csCtx.scriptList[scriptIndex].script); } gSaveContext.cutsceneTrigger = 1; @@ -1532,32 +1599,32 @@ void Cutscene_LoadCutsceneData(PlayState* play, u8 csIndex) { * Interpolates the actor's position based on the corresponding actor action's position * and the current cutscene frame */ -void Cutscene_ActorTranslate(Actor* actor, PlayState* play, s32 actorActionIndex) { - Vec3f start; - Vec3f end; - CsCmdActorAction* entry = play->csCtx.actorActions[actorActionIndex]; - f32 progress; +void Cutscene_ActorTranslate(Actor* actor, PlayState* play, s32 cueChannel) { + Vec3f startPos; + Vec3f endPos; + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + f32 lerp; - start.x = entry->startPos.x; - start.y = entry->startPos.y; - start.z = entry->startPos.z; - end.x = entry->endPos.x; - end.y = entry->endPos.y; - end.z = entry->endPos.z; + startPos.x = cue->startPos.x; + startPos.y = cue->startPos.y; + startPos.z = cue->startPos.z; + endPos.x = cue->endPos.x; + endPos.y = cue->endPos.y; + endPos.z = cue->endPos.z; - progress = Environment_LerpWeight(entry->endFrame, entry->startFrame, play->csCtx.frames); + lerp = Environment_LerpWeight(cue->endFrame, cue->startFrame, play->csCtx.curFrame); - VEC3F_LERPIMPDST(&actor->world.pos, &start, &end, progress); + VEC3F_LERPIMPDST(&actor->world.pos, &startPos, &endPos, lerp); } /** * Interpolates the actor's position based on the corresponding actor action's position * and the current cutscene frame, and sets the actor's yaw using the actor action yaw */ -void Cutscene_ActorTranslateAndYaw(Actor* actor, PlayState* play, s32 actorActionIndex) { - Cutscene_ActorTranslate(actor, play, actorActionIndex); +void Cutscene_ActorTranslateAndYaw(Actor* actor, PlayState* play, s32 cueChannel) { + Cutscene_ActorTranslate(actor, play, cueChannel); - actor->world.rot.y = play->csCtx.actorActions[actorActionIndex]->urot.y; + actor->world.rot.y = play->csCtx.actorCues[cueChannel]->rot.y; actor->shape.rot.y = actor->world.rot.y; } @@ -1565,25 +1632,25 @@ void Cutscene_ActorTranslateAndYaw(Actor* actor, PlayState* play, s32 actorActio * Interpolates the actor's position and yaw based on the corresponding actor action's * position and the current cutscene frame */ -void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, PlayState* play, s32 actorActionIndex) { - Vec3f start; - Vec3f end; - CsCmdActorAction* entry; - f32 progress; +void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, PlayState* play, s32 cueChannel) { + Vec3f startPos; + Vec3f endPos; + CsCmdActorCue* cue; + f32 lerp; - start.x = play->csCtx.actorActions[actorActionIndex]->startPos.x; - start.y = play->csCtx.actorActions[actorActionIndex]->startPos.y; - start.z = play->csCtx.actorActions[actorActionIndex]->startPos.z; - end.x = play->csCtx.actorActions[actorActionIndex]->endPos.x; - end.y = play->csCtx.actorActions[actorActionIndex]->endPos.y; - end.z = play->csCtx.actorActions[actorActionIndex]->endPos.z; + startPos.x = play->csCtx.actorCues[cueChannel]->startPos.x; + startPos.y = play->csCtx.actorCues[cueChannel]->startPos.y; + startPos.z = play->csCtx.actorCues[cueChannel]->startPos.z; + endPos.x = play->csCtx.actorCues[cueChannel]->endPos.x; + endPos.y = play->csCtx.actorCues[cueChannel]->endPos.y; + endPos.z = play->csCtx.actorCues[cueChannel]->endPos.z; - entry = play->csCtx.actorActions[actorActionIndex]; - progress = Environment_LerpWeight(entry->endFrame, entry->startFrame, play->csCtx.frames); + cue = play->csCtx.actorCues[cueChannel]; + lerp = Environment_LerpWeight(cue->endFrame, cue->startFrame, play->csCtx.curFrame); - VEC3F_LERPIMPDST(&actor->world.pos, &start, &end, progress); + VEC3F_LERPIMPDST(&actor->world.pos, &startPos, &endPos, lerp); - Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&start, &end), 10, 1000, 1); + Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 1000, 1); actor->shape.rot.y = actor->world.rot.y; } @@ -1591,24 +1658,24 @@ void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, PlayState* play, s32 acto * Interpolates the actor's XZ position and yaw based on the corresponding actor action's * position and the current cutscene frame */ -void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 actorActionIndex) { - Vec3f start; - Vec3f end; - CsCmdActorAction* entry; - f32 progress; +void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 cueChannel) { + Vec3f startPos; + Vec3f endPos; + CsCmdActorCue* cue; + f32 lerp; - start.x = play->csCtx.actorActions[actorActionIndex]->startPos.x; - start.z = play->csCtx.actorActions[actorActionIndex]->startPos.z; - end.x = play->csCtx.actorActions[actorActionIndex]->endPos.x; - end.z = play->csCtx.actorActions[actorActionIndex]->endPos.z; + startPos.x = play->csCtx.actorCues[cueChannel]->startPos.x; + startPos.z = play->csCtx.actorCues[cueChannel]->startPos.z; + endPos.x = play->csCtx.actorCues[cueChannel]->endPos.x; + endPos.z = play->csCtx.actorCues[cueChannel]->endPos.z; - entry = play->csCtx.actorActions[actorActionIndex]; - progress = Environment_LerpWeight(entry->endFrame, entry->startFrame, play->csCtx.frames); + cue = play->csCtx.actorCues[cueChannel]; + lerp = Environment_LerpWeight(cue->endFrame, cue->startFrame, play->csCtx.curFrame); - actor->world.pos.x = start.x + (end.x - start.x) * progress; - actor->world.pos.z = start.z + (end.z - start.z) * progress; + actor->world.pos.x = startPos.x + (endPos.x - startPos.x) * lerp; + actor->world.pos.z = startPos.z + (endPos.z - startPos.z) * lerp; - Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&start, &end), 10, 1000, 1); + Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 1000, 1); actor->shape.rot.y = actor->world.rot.y; } @@ -1621,25 +1688,35 @@ s32 Cutscene_GetSceneLayer(PlayState* play) { return sceneLayer; } -s32 Cutscene_GetActorActionIndex(PlayState* play, u16 actorActionCmd) { +/** + * @param play See `PlayState` + * @param cueType See `cmdType` + * @return cue channel + */ +s32 Cutscene_GetCueChannel(PlayState* play, u16 cueType) { s32 i; - s32 index = -1; + s32 cueChannel = -1; - for (i = 0; i < ARRAY_COUNT(D_801F4DC8); i++) { - if (actorActionCmd == D_801F4DC8[i]) { - index = i; + for (i = 0; i < ARRAY_COUNT(sCueTypeList); i++) { + if (cueType == sCueTypeList[i]) { + cueChannel = i; } } - return index; + return cueChannel; } -s32 Cutscene_CheckActorAction(PlayState* play, u16 actorActionCmd) { - if (play->csCtx.state != CS_STATE_0) { - s32 index = Cutscene_GetActorActionIndex(play, actorActionCmd); +/** + * @param play See `PlayState` + * @param cueType See `cmdType` + * @return is cuetype in a channel + */ +s32 Cutscene_IsCueInChannel(PlayState* play, u16 cueType) { + if (play->csCtx.state != CS_STATE_IDLE) { + s32 cueChannel = Cutscene_GetCueChannel(play, cueType); - if (index != -1) { - return play->csCtx.actorActions[index] != NULL; + if (cueChannel != -1) { + return play->csCtx.actorCues[cueChannel] != NULL; } } @@ -1647,7 +1724,7 @@ s32 Cutscene_CheckActorAction(PlayState* play, u16 actorActionCmd) { } u8 Cutscene_IsPlaying(PlayState* play) { - return (gSaveContext.cutsceneTrigger != 0) || (play->csCtx.state != CS_STATE_0); + return (gSaveContext.cutsceneTrigger != 0) || (play->csCtx.state != CS_STATE_IDLE); } /* End of actor utilities section */ diff --git a/src/code/z_env_flags.c b/src/code/z_env_flags.c index 06e216cd35..0057128e22 100644 --- a/src/code/z_env_flags.c +++ b/src/code/z_env_flags.c @@ -1,33 +1,33 @@ #include "global.h" -void EnvFlags_UnsetAll(PlayState* play) { +void CutsceneFlags_UnsetAll(PlayState* play) { u8 i; - for (i = 0; i < ARRAY_COUNT(play->envFlags); i++) { - play->envFlags[i] = 0; + for (i = 0; i < ARRAY_COUNT(play->cutsceneFlags); i++) { + play->cutsceneFlags[i] = 0; } } -void EnvFlags_Set(PlayState* play, s16 flag) { +void CutsceneFlags_Set(PlayState* play, s16 flag) { s16 index = flag / 16; s16 bit = flag % 16; s16 mask = 1 << bit; - play->envFlags[index] |= mask; + play->cutsceneFlags[index] |= mask; } -void EnvFlags_Unset(PlayState* play, s16 flag) { +void CutsceneFlags_Unset(PlayState* play, s16 flag) { s16 index = flag / 16; s16 bit = flag % 16; s16 mask = (1 << bit) ^ 0xFFFF; - play->envFlags[index] &= mask; + play->cutsceneFlags[index] &= mask; } -s32 EnvFlags_Get(PlayState* play, s16 flag) { +s32 CutsceneFlags_Get(PlayState* play, s16 flag) { s16 index = flag / 16; s16 bit = flag % 16; s16 mask = 1 << bit; - return play->envFlags[index] & mask; + return play->cutsceneFlags[index] & mask; } diff --git a/src/code/z_eventmgr.c b/src/code/z_eventmgr.c index 5b8b8dce37..2575899ca8 100644 --- a/src/code/z_eventmgr.c +++ b/src/code/z_eventmgr.c @@ -1,52 +1,554 @@ +/** + * @file z_eventmgr.c + * + * Manages all cutscenes except for manual + */ #include "global.h" #include "z64shrink_window.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F1460.s") +ActorCutscene sGlobalCutsceneList[] = { + // CS_ID_GLOBAL_78 + { -100, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, 255, + 255 }, + // CS_ID_GLOBAL_79 + { -100, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, 255, + 255 }, + // CS_ID_GLOBAL_7A + { -100, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, 255, + 255 }, + // CS_ID_GLOBAL_ELEGY + { 2, -1, CS_CAM_ID_GLOBAL_ELEGY, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_NONE, + CS_END_CAM_0, 32 }, + // CS_ID_GLOBAL_TALK + { 32765, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, + CS_END_CAM_0, 255 }, + // CS_ID_GLOBAL_DOOR + { 32764, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, + CS_END_CAM_0, 255 }, + // CS_ID_GLOBAL_RETURN_TO_CAM + { 32766, -2, CS_CAM_ID_GLOBAL_CONNECT, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE, 255, + CS_HUD_VISIBILITY_ALL_ALT, CS_END_CAM_0, 32 }, + // CS_ID_GLOBAL_END + { 0, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE, 255, CS_HUD_VISIBILITY_ALL_ALT, + CS_END_CAM_0, 32 }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCutsceneImpl.s") +typedef enum { + /* 0 */ CS_START_0, + /* 1 */ CS_START_1, + /* 2 */ CS_START_2, +} ActorCutsceneStartMethod; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_Init.s") +typedef struct { + /* 0x00 */ s16 csId; + /* 0x02 */ s16 length; + /* 0x04 */ s16 endCsId; + /* 0x06 */ s16 subCamId; + /* 0x08 */ Actor* targetActor; + /* 0x0C */ s32 startMethod; + /* 0x10 */ PlayState* play; + /* 0x14 */ s16 retCamId; + /* 0x16 */ s16 isCameraStored; +} CutsceneManager; // size = 0x18 -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F15D8.s") +CutsceneManager sCutsceneMgr = { + CS_ID_NONE, 0, CS_ID_NONE, SUB_CAM_ID_DONE, NULL, CS_START_0, NULL, CAM_ID_MAIN, false, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_ClearWaiting.s") +s16 CutsceneManager_SetHudVisibility(s16 csHudVisibility) { + u16 hudVisibility; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_ClearNextCutscenes.s") + switch (csHudVisibility) { + case CS_HUD_VISIBILITY_NONE: + hudVisibility = HUD_VISIBILITY_NONE_ALT; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_MarkNextCutscenes.s") + case CS_HUD_VISIBILITY_ALL: + hudVisibility = HUD_VISIBILITY_ALL; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_End.s") + case CS_HUD_VISIBILITY_A_HEARTS_MAGIC: + hudVisibility = HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_Update.s") + case CS_HUD_VISIBILITY_C_HEARTS_MAGIC: + hudVisibility = HUD_VISIBILITY_HEARTS_MAGIC_C; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_SetIntentToPlay.s") + case CS_HUD_VISIBILITY_ALL_NO_MINIMAP: + hudVisibility = HUD_VISIBILITY_ALL_NO_MINIMAP; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCanPlayNext.s") + case CS_HUD_VISIBILITY_A_B_C: + hudVisibility = HUD_VISIBILITY_A_B_C; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_StartAndSetUnkLinkFields.s") + case CS_HUD_VISIBILITY_B_MINIMAP: + hudVisibility = HUD_VISIBILITY_B_MINIMAP; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_StartAndSetFlag.s") + case CS_HUD_VISIBILITY_A: + hudVisibility = HUD_VISIBILITY_A; + break; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_Start.s") + default: + hudVisibility = HUD_VISIBILITY_ALL; + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_Stop.s") + Interface_SetHudVisibility(hudVisibility); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCurrentIndex.s") + return hudVisibility; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCutscene.s") +ActorCutscene* CutsceneManager_GetCutsceneEntryImpl(s16 csId) { + if (csId < CS_ID_GLOBAL_78) { + return &sSceneCutsceneList[csId]; + } else { + csId -= CS_ID_GLOBAL_78; + return &sGlobalCutsceneList[csId]; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetAdditionalCutscene.s") +void CutsceneManager_Init(PlayState* play, ActorCutscene* cutsceneList, s16 numEntries) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetLength.s") + sSceneCutsceneList = cutsceneList; + sSceneCutsceneCount = numEntries; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F2138.s") + for (i = 0; i < ARRAY_COUNT(sWaitingCutsceneList); i++) { + sWaitingCutsceneList[i] = 0; + sNextCutsceneList[i] = 0; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F2178.s") + sCutsceneMgr.endCsId = CS_ID_NONE; + sCutsceneMgr.play = play; + sCutsceneMgr.length = -1; + sCutsceneMgr.targetActor = NULL; + sCutsceneMgr.subCamId = SUB_CAM_ID_DONE; + sCutsceneMgr.isCameraStored = false; + sCutsceneMgr.csId = sCutsceneMgr.endCsId; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCurrentSubCamId.s") +/** + * Store camera into subCam 2, and keep subCam 2 INACTIVE to preserve the struct. + */ +void CutsceneManager_StoreCamera(Camera* camera) { + if (camera != NULL) { + memcpy(&sCutsceneMgr.play->subCameras[2], camera, sizeof(Camera)); + sCutsceneMgr.play->subCameras[2].camId = camera->camId; + Camera_ChangeStatus(&sCutsceneMgr.play->subCameras[2], CAM_STATUS_INACTIVE); + sCutsceneMgr.isCameraStored = true; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F21CC.s") +void CutsceneManager_ClearWaiting(void) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F22C4.s") + for (i = 0; i < ARRAY_COUNT(sWaitingCutsceneList); i++) { + sWaitingCutsceneList[i] = 0; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_SetReturnCamera.s") +void CutsceneManager_ClearNextCutscenes(void) { + s32 i; + + for (i = 0; i < ARRAY_COUNT(sNextCutsceneList); i++) { + sNextCutsceneList[i] = 0; + } +} + +s16 CutsceneManager_MarkNextCutscenes(void) { + s16 bit; + s32 i; + s32 j; + s32 count = 0; + s16 csIdMax = CS_ID_NONE; + s16 priorityMax = SHT_MAX; // lower number means higher priority + s16 csId; + s16 priority; + + for (i = 0; i < ARRAY_COUNT(sNextCutsceneList); i++) { + for (bit = 1, j = 0; j < 8; j++) { + if (sWaitingCutsceneList[i] & bit) { + csId = (i << 3) | j; + priority = CutsceneManager_GetCutsceneEntryImpl(csId)->priority; + + if ((priority ^ 0) == -1) { + sNextCutsceneList[i] |= bit; + } else if ((priority < priorityMax) && (priority > 0)) { + csIdMax = csId; + priorityMax = priority; + } + count++; + } + bit <<= 1; + } + } + if (csIdMax != CS_ID_NONE) { + sNextCutsceneList[csIdMax >> 3] |= 1 << (csIdMax & 7); + } + return count; +} + +#define RET_CAM sCutsceneMgr.play->cameraPtrs[sCutsceneMgr.retCamId] +#define CUR_CAM sCutsceneMgr.play->cameraPtrs[sCutsceneMgr.subCamId] + +void CutsceneManager_End(void) { + ActorCutscene* csEntry; + s16 oldCamId; + s16 oldStateFlags; + + switch (sCutsceneMgr.startMethod) { + case CS_START_2: + sCutsceneMgr.targetActor->flags &= ~ACTOR_FLAG_100000; + // fallthrough + case CS_START_1: + func_800B7298(sCutsceneMgr.play, 0, PLAYER_CSMODE_END); + sCutsceneMgr.startMethod = CS_START_0; + break; + + default: + break; + } + + csEntry = CutsceneManager_GetCutsceneEntryImpl(sCutsceneMgr.csId); + + switch (csEntry->endSfx) { + case CS_END_SFX_TRE_BOX_APPEAR: + play_sound(NA_SE_SY_TRE_BOX_APPEAR); + break; + + case CS_END_SFX_CORRECT_CHIME: + play_sound(NA_SE_SY_CORRECT_CHIME); + break; + + default: // CS_END_SFX_NONE + break; + } + + switch (csEntry->endCam) { + case CS_END_CAM_SMOOTH: + Play_CopyCamera(sCutsceneMgr.play, sCutsceneMgr.retCamId, sCutsceneMgr.subCamId); + RET_CAM->stateFlags = + (RET_CAM->stateFlags & ~CAM_STATE_UNDERWATER) | (CUR_CAM->stateFlags & CAM_STATE_UNDERWATER); + CutsceneManager_Queue(CS_ID_GLOBAL_RETURN_TO_CAM); + break; + + case CS_END_CAM_0: + default: + Play_CopyCamera(sCutsceneMgr.play, sCutsceneMgr.retCamId, sCutsceneMgr.subCamId); + RET_CAM->stateFlags = + (RET_CAM->stateFlags & ~CAM_STATE_UNDERWATER) | (CUR_CAM->stateFlags & CAM_STATE_UNDERWATER); + break; + + case CS_END_CAM_1: + oldCamId = RET_CAM->camId; + oldStateFlags = RET_CAM->stateFlags; + + if (sCutsceneMgr.isCameraStored) { + // Restore the camera that was stored in subCam 2 + memcpy(RET_CAM, &sCutsceneMgr.play->subCameras[2], sizeof(Camera)); + + RET_CAM->stateFlags = + (RET_CAM->stateFlags & ~CAM_STATE_UNDERWATER) | (CUR_CAM->stateFlags & CAM_STATE_UNDERWATER); + + RET_CAM->stateFlags = (RET_CAM->stateFlags & ~CAM_STATE_2) | (oldStateFlags & CAM_STATE_2); + sCutsceneMgr.isCameraStored = false; + } + RET_CAM->camId = oldCamId; + break; + } + + if (sCutsceneMgr.subCamId != SUB_CAM_ID_DONE) { + Play_ClearCamera(sCutsceneMgr.play, sCutsceneMgr.subCamId); + Play_ChangeCameraStatus(sCutsceneMgr.play, sCutsceneMgr.retCamId, CAM_STATUS_ACTIVE); + } + + sCutsceneMgr.csId = CS_ID_NONE; + sCutsceneMgr.endCsId = CS_ID_NONE; + sCutsceneMgr.length = -1; + sCutsceneMgr.targetActor = NULL; + sCutsceneMgr.subCamId = SUB_CAM_ID_DONE; +} + +s16 CutsceneManager_Update(void) { + s16 sp1E = 0; + + if (CutsceneManager_IsNext(CS_ID_GLOBAL_RETURN_TO_CAM)) { + CutsceneManager_StartWithPlayerCs(CS_ID_GLOBAL_RETURN_TO_CAM, &GET_PLAYER(sCutsceneMgr.play)->actor); + } + + if (sCutsceneMgr.endCsId == CS_ID_NONE) { + if (sCutsceneMgr.csId != CS_ID_NONE) { + if (sCutsceneMgr.length > 0) { + sCutsceneMgr.length--; + } + sp1E = 1; + if (sCutsceneMgr.length == 0) { + CutsceneManager_Stop(sCutsceneMgr.csId); + } + } + } + + if (sCutsceneMgr.endCsId != CS_ID_NONE) { + CutsceneManager_End(); + sp1E = 2; + } + + CutsceneManager_ClearNextCutscenes(); + + if (sCutsceneMgr.csId == CS_ID_NONE) { + if ((CutsceneManager_MarkNextCutscenes() == 0) && (sp1E != 0)) { + ShrinkWindow_Letterbox_SetSizeTarget(0); + } else if (sp1E == 0) { + CutsceneManager_StoreCamera(Play_GetCamera(sCutsceneMgr.play, sCutsceneMgr.retCamId)); + } + } + return sp1E; +} + +void CutsceneManager_Queue(s16 csId) { + if (csId >= 0) { + sWaitingCutsceneList[csId >> 3] |= 1 << (csId & 7); + } +} + +s16 CutsceneManager_IsNext(s16 csId) { + if (csId == CS_ID_GLOBAL_END) { + if (sCutsceneMgr.csId == CS_ID_NONE) { + return 0x7F; + } else { + return 0; + } + } + if (csId <= CS_ID_NONE) { + return -1; + } + return (sNextCutsceneList[csId >> 3] & (1 << (csId & 7))) ? 1 : 0; +} + +/** + * Start an actor cutscene, activate Player Cutscene Mode "Wait" + */ +s16 CutsceneManager_StartWithPlayerCs(s16 csId, Actor* actor) { + s16 startCsId = CutsceneManager_Start(csId, actor); + + if (startCsId >= 0) { + func_800B7298(sCutsceneMgr.play, 0, PLAYER_CSMODE_WAIT); + if (sCutsceneMgr.length == 0) { + CutsceneManager_Stop(sCutsceneMgr.csId); + } + sCutsceneMgr.startMethod = CS_START_1; + } + return startCsId; +} + +/** + * Start an actor cutscene, activate Player Cutscene Mode "Wait", turn on ACTOR_FLAG_100000 + */ +s16 CutsceneManager_StartWithPlayerCsAndSetFlag(s16 csId, Actor* actor) { + s16 startCsId = CutsceneManager_Start(csId, actor); + + if (startCsId >= 0) { + func_800B7298(sCutsceneMgr.play, 0, PLAYER_CSMODE_WAIT); + if (sCutsceneMgr.length == 0) { + CutsceneManager_Stop(sCutsceneMgr.csId); + } + if (actor != NULL) { + actor->flags |= ACTOR_FLAG_100000; + sCutsceneMgr.startMethod = CS_START_2; + } else { + sCutsceneMgr.startMethod = CS_START_1; + } + } + return startCsId; +} + +s16 CutsceneManager_Start(s16 csId, Actor* actor) { + ActorCutscene* csEntry; + Camera* subCam; + Camera* retCam; + s32 csType = 0; + + if ((csId < 0) || (sCutsceneMgr.csId != CS_ID_NONE)) { + return csId; + } + + sCutsceneMgr.startMethod = CS_START_0; + csEntry = CutsceneManager_GetCutsceneEntryImpl(csId); + + ShrinkWindow_Letterbox_SetSizeTarget(csEntry->letterboxSize); + CutsceneManager_SetHudVisibility(csEntry->hudVisibility); + + if (csId == CS_ID_GLOBAL_END) { + csType = 1; + } else if (csEntry->scriptIndex != CS_SCRIPT_ID_NONE) { + // scripted cutscene + csType = 1; + } else if ((csId != CS_ID_GLOBAL_DOOR) && (csId != CS_ID_GLOBAL_TALK)) { + csType = 2; + } + + if (csType != 0) { + sCutsceneMgr.retCamId = Play_GetActiveCamId(sCutsceneMgr.play); + sCutsceneMgr.subCamId = Play_CreateSubCamera(sCutsceneMgr.play); + + subCam = Play_GetCamera(sCutsceneMgr.play, sCutsceneMgr.subCamId); + retCam = Play_GetCamera(sCutsceneMgr.play, sCutsceneMgr.retCamId); + + if ((retCam->setting == CAM_SET_START0) || (retCam->setting == CAM_SET_START2) || + (retCam->setting == CAM_SET_START1)) { + if (CutsceneManager_FindEntranceCsId() != csId) { + func_800E0348(retCam); + } else { + Camera_ClearFlags(retCam, CAM_STATE_2); + } + } + + memcpy(subCam, retCam, sizeof(Camera)); + subCam->camId = sCutsceneMgr.subCamId; + Camera_ClearFlags(subCam, CAM_STATE_6 | CAM_STATE_0); + + Play_ChangeCameraStatus(sCutsceneMgr.play, sCutsceneMgr.retCamId, CAM_STATUS_WAIT); + Play_ChangeCameraStatus(sCutsceneMgr.play, sCutsceneMgr.subCamId, CAM_STATUS_ACTIVE); + + subCam->target = sCutsceneMgr.targetActor = actor; + subCam->behaviorFlags = 0; + + if (csType == 1) { + Camera_ChangeSetting(subCam, CAM_SET_FREE0); + Cutscene_StartScripted(sCutsceneMgr.play, csEntry->scriptIndex); + sCutsceneMgr.length = csEntry->length; + } else { + if (csEntry->csCamId != CS_CAM_ID_NONE) { + Camera_ChangeDataIdx(subCam, csEntry->csCamId); + } else { + Camera_ChangeSetting(subCam, CAM_SET_FREE0); + } + sCutsceneMgr.length = csEntry->length; + } + } + sCutsceneMgr.csId = csId; + + return csId; +} + +s16 CutsceneManager_Stop(s16 csId) { + ActorCutscene* csEntry; + + if (csId < 0) { + return csId; + } + + csEntry = CutsceneManager_GetCutsceneEntryImpl(sCutsceneMgr.csId); + if ((sCutsceneMgr.length > 0) && (csEntry->scriptIndex == CS_SCRIPT_ID_NONE)) { + return -2; + } + if ((csId != CS_ID_GLOBAL_END) && (csEntry->scriptIndex != CS_SCRIPT_ID_NONE)) { + return -3; + } + + if (csId == CS_ID_GLOBAL_END) { + csId = sCutsceneMgr.csId; + } + if (csId == sCutsceneMgr.csId) { + sCutsceneMgr.endCsId = sCutsceneMgr.csId; + return sCutsceneMgr.endCsId; + } + return -1; +} + +s16 CutsceneManager_GetCurrentCsId(void) { + return sCutsceneMgr.csId; +} + +ActorCutscene* CutsceneManager_GetCutsceneEntry(s16 csId) { + return CutsceneManager_GetCutsceneEntryImpl(csId); +} + +s16 CutsceneManager_GetAdditionalCsId(s16 csId) { + if (csId < 0) { + return CS_ID_NONE; + } + return CutsceneManager_GetCutsceneEntryImpl(csId)->additionalCsId; +} + +s16 CutsceneManager_GetLength(s16 csId) { + if (csId < 0) { + return -1; + } + return CutsceneManager_GetCutsceneEntryImpl(csId)->length; +} + +s16 CutsceneManager_GetCutsceneScriptIndex(s16 csId) { + if (csId < 0) { + return -1; + } + return CutsceneManager_GetCutsceneEntryImpl(csId)->scriptIndex; +} + +s16 CutsceneManager_GetCutsceneCustomValue(s16 csId) { + if (csId < 0) { + return -1; + } + return CutsceneManager_GetCutsceneEntryImpl(csId)->customValue; +} + +s16 CutsceneManager_GetCurrentSubCamId(s16 csId) { + return sCutsceneMgr.subCamId; +} + +s16 CutsceneManager_FindEntranceCsId(void) { + PlayState* play; + s32 csId; + + for (csId = 0; csId < sSceneCutsceneCount; csId++) { + //! FAKE: + if ((sSceneCutsceneList[csId].scriptIndex != CS_SCRIPT_ID_NONE) && + (sSceneCutsceneList[csId].scriptIndex < (play = sCutsceneMgr.play)->csCtx.scriptListCount) && + (sCutsceneMgr.play->curSpawn == + sCutsceneMgr.play->csCtx.scriptList[sSceneCutsceneList[csId].scriptIndex].spawn)) { + return csId; + } + } + + for (csId = 0; csId < sSceneCutsceneCount; csId++) { + if ((sSceneCutsceneList[csId].customValue >= 100) && + (sSceneCutsceneList[csId].customValue == (sCutsceneMgr.play->curSpawn + 100))) { + return csId; + } + } + + return -1; +} + +s32 func_800F22C4(s16 csId, Actor* actor) { + f32 dist; + s16 screenPosX; + s16 screenPosY; + + if ((sCutsceneMgr.csId == CS_ID_NONE) || (csId == CS_ID_NONE)) { + return 4; + } + + Actor_GetScreenPos(sCutsceneMgr.play, actor, &screenPosX, &screenPosY); + + dist = OLib_Vec3fDist(&actor->focus.pos, &Play_GetCamera(sCutsceneMgr.play, sCutsceneMgr.subCamId)->eye); + + if ((screenPosX > 40) && (screenPosX < SCREEN_WIDTH - 40) && (screenPosY > 40) && + (screenPosY < SCREEN_HEIGHT - 40) && (dist < 700.0f)) { + return 1; + } + if (sCutsceneMgr.length < 6) { + return 2; + } + if (csId == sCutsceneMgr.csId) { + return 0; + } + return 3; +} + +void CutsceneManager_SetReturnCamera(s16 camId) { + sCutsceneMgr.retCamId = camId; +} diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index f873ea8ffa..148aad84e8 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -92,7 +92,7 @@ void KaleidoSetup_Update(PlayState* play) { if ((pauseCtx->state == PAUSE_STATE_OFF) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE)) { if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) { - if ((gSaveContext.save.cutscene < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) { + if ((gSaveContext.save.cutsceneIndex < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) { if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) { if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) && (gSaveContext.magicState != MAGIC_STATE_FILL)) { diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 1072587afe..88b8f14ccb 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1990,7 +1990,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) { } if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) { - if (ActorCutscene_GetCurrentIndex() == -1) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) { Interface_SetHudVisibility(HUD_VISIBILITY_ALL); } } @@ -2267,7 +2267,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) { s32 pad; s32 restoreHudVisibility = false; - if (gSaveContext.save.cutscene < 0xFFF0) { + if (gSaveContext.save.cutsceneIndex < 0xFFF0) { gSaveContext.hudVisibilityForceButtonAlphasByStatus = false; if ((player->stateFlags1 & PLAYER_STATE1_800000) || CHECK_WEEKEVENTREG(WEEKEVENTREG_08_01) || (!(CHECK_EVENTINF(EVENTINF_41)) && (play->unk_1887C >= 2))) { @@ -2434,7 +2434,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) { sPictoState = PICTO_BOX_STATE_OFF; } else if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) || (func_801A5100() == 1)) { if (!(CHECK_EVENTINF(EVENTINF_41)) || - ((CHECK_EVENTINF(EVENTINF_41)) && (ActorCutscene_GetCurrentIndex() == -1))) { + ((CHECK_EVENTINF(EVENTINF_41)) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE))) { play_sound(NA_SE_SY_CAMERA_SHUTTER); SREG(89) = 1; play->haltAllActors = true; diff --git a/src/code/z_play.c b/src/code/z_play.c index 99073fb5c6..bd4db8feca 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -567,11 +567,13 @@ void Play_UpdateTransition(PlayState* this) { if ((!(Entrance_GetTransitionFlags(this->nextEntrance + sceneLayer) & 0x8000) || ((this->nextEntrance == ENTRANCE(PATH_TO_MOUNTAIN_VILLAGE, 1)) && - !CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) || + !CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) || ((this->nextEntrance == ENTRANCE(ROAD_TO_SOUTHERN_SWAMP, 1)) && - !CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) || - ((this->nextEntrance == ENTRANCE(TERMINA_FIELD, 2)) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) || - ((this->nextEntrance == ENTRANCE(ROAD_TO_IKANA, 1)) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20))) && + !CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) || + ((this->nextEntrance == ENTRANCE(TERMINA_FIELD, 2)) && + !CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) || + ((this->nextEntrance == ENTRANCE(ROAD_TO_IKANA, 1)) && + !CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE))) && (!func_800FE590(this) || (Entrance_GetSceneId(this->nextEntrance + sceneLayer) < 0) || (AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_FINAL_HOURS))) { func_801A4058(20); @@ -983,8 +985,8 @@ void Play_UpdateMain(PlayState* this) { if (!this->haltAllActors) { Actor_UpdateAll(this, &this->actorCtx); } - Cutscene_Update1(this, &this->csCtx); - Cutscene_Update2(this, &this->csCtx); + Cutscene_UpdateManual(this, &this->csCtx); + Cutscene_UpdateScripted(this, &this->csCtx); Effect_UpdateAll(this); EffectSS_UpdateAllParticles(this); EffFootmark_Update(this); @@ -1502,8 +1504,8 @@ void Play_Main(GameState* thisx) { *CONTROLLER1(&this->state) = input; } - ActorCutscene_Update(); - ActorCutscene_ClearWaiting(); + CutsceneManager_Update(); + CutsceneManager_ClearWaiting(); } s32 Play_InCsMode(PlayState* this) { @@ -2016,37 +2018,47 @@ s32 Play_IsDebugCamEnabled(void) { return gDbgCamEnabled; } -// A mapping from playerActorCsIds to sGlobalCamDataSettings indices. -s16 D_801D0D64[] = { -3, -2, -4, -5, -7, -11, -8, -9, -6, -16 }; +// A mapping from playerCsIds to sGlobalCamDataSettings indices. +s16 sPlayerCsIdToCsCamId[] = { + CS_CAM_ID_GLOBAL_ITEM_OCARINA, // PLAYER_CS_ID_ITEM_OCARINA + CS_CAM_ID_GLOBAL_ITEM_GET, // PLAYER_CS_ID_ITEM_GET + CS_CAM_ID_GLOBAL_ITEM_BOTTLE, // PLAYER_CS_ID_ITEM_BOTTLE + CS_CAM_ID_GLOBAL_ITEM_SHOW, // PLAYER_CS_ID_ITEM_SHOW + CS_CAM_ID_GLOBAL_WARP_PAD_MOON, // PLAYER_CS_ID_WARP_PAD_MOON + CS_CAM_ID_GLOBAL_MASK_TRANSFORMATION, // PLAYER_CS_ID_MASK_TRANSFORMATION + CS_CAM_ID_GLOBAL_DEATH, // PLAYER_CS_ID_DEATH + CS_CAM_ID_GLOBAL_REVIVE, // PLAYER_CS_ID_REVIVE + CS_CAM_ID_GLOBAL_SONG_WARP, // PLAYER_CS_ID_SONG_WARP + CS_CAM_ID_GLOBAL_WARP_PAD_ENTRANCE, // PLAYER_CS_ID_WARP_PAD_ENTRANCE +}; // Used by Player /** - * Extract the common actor cutscene ids used by Player from the scene and set the actor cutscene ids in - * this->playerActorCsIds. If a playerActorCsId is not present in the scene, then that particular id is set - * to -1. Otherwise, if there is an ActorCutscene where csCamSceneDataId matches the appropriate element of D_801D0D64, - * set the corresponding playerActorCsId (and possibly change its priority for the zeroth one) + * Extract the common cutscene ids used by Player from the scene and set the cutscene ids in this->playerCsIds. + * If a playerCsId is not present in the scene, then that particular id is set to CS_ID_NONE. + * Otherwise, if there is an ActorCutscene where csCamId matches the appropriate element of sPlayerCsIdToCsCamId, + * set the corresponding playerActorCsId (and possibly change its priority for the zeroth one). */ -void Play_AssignPlayerActorCsIdsFromScene(GameState* thisx, s32 startActorCsId) { +void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId) { PlayState* this = (PlayState*)thisx; s32 i; - s16* curPlayerActorCsId = this->playerActorCsIds; - s16* phi_s1 = D_801D0D64; + s16* curPlayerCsId = this->playerCsIds; + s16* csCamId = sPlayerCsIdToCsCamId; - for (i = 0; i < ARRAY_COUNT(this->playerActorCsIds); i++, curPlayerActorCsId++, phi_s1++) { - ActorCutscene* actorCutscene; - s32 curActorCsId; + for (i = 0; i < ARRAY_COUNT(this->playerCsIds); i++, curPlayerCsId++, csCamId++) { + ActorCutscene* csEntry; + s32 curCsId; - *curPlayerActorCsId = -1; + *curPlayerCsId = CS_ID_NONE; - for (curActorCsId = startActorCsId; curActorCsId != -1; curActorCsId = actorCutscene->additionalCutscene) { - actorCutscene = ActorCutscene_GetCutscene(curActorCsId); + for (curCsId = spawnCsId; curCsId != CS_ID_NONE; curCsId = csEntry->additionalCsId) { + csEntry = CutsceneManager_GetCutsceneEntry(curCsId); - if (actorCutscene->csCamSceneDataId == *phi_s1) { - if ((actorCutscene->csCamSceneDataId == -3) && - (actorCutscene->priority == 700)) { // override ocarina cs priority - actorCutscene->priority = 550; + if (csEntry->csCamId == *csCamId) { + if ((csEntry->csCamId == CS_CAM_ID_GLOBAL_ITEM_OCARINA) && (csEntry->priority == 700)) { + csEntry->priority = 550; } - *curPlayerActorCsId = curActorCsId; + *curPlayerCsId = curCsId; break; } } @@ -2101,7 +2113,7 @@ void Play_Init(GameState* thisx) { scene = ((void)0, gSaveContext.save.entrance) >> 9; spawn = (((void)0, gSaveContext.save.entrance) >> 4) & 0x1F; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { if (scene == ENTR_SCENE_MOUNTAIN_VILLAGE_WINTER) { scene = ENTR_SCENE_MOUNTAIN_VILLAGE_SPRING; } else if (scene == ENTR_SCENE_GORON_VILLAGE_WINTER) { @@ -2115,7 +2127,7 @@ void Play_Init(GameState* thisx) { } } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { if (scene == ENTR_SCENE_SOUTHERN_SWAMP_POISONED) { scene = ENTR_SCENE_SOUTHERN_SWAMP_CLEARED; } else if (scene == ENTR_SCENE_WOODFALL) { @@ -2123,11 +2135,11 @@ void Play_Init(GameState* thisx) { } } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) && (scene == ENTR_SCENE_IKANA_CANYON)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) && (scene == ENTR_SCENE_IKANA_CANYON)) { gSaveContext.nextCutsceneIndex = 0xFFF2; } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80) && + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE) && ((scene == ENTR_SCENE_GREAT_BAY_COAST) || (scene == ENTR_SCENE_ZORA_CAPE))) { gSaveContext.nextCutsceneIndex = 0xFFF0; } @@ -2179,15 +2191,15 @@ void Play_Init(GameState* thisx) { EffectSS_Init(this, 100); CollisionCheck_InitContext(this, &this->colChkCtx); AnimationContext_Reset(&this->animationCtx); - Cutscene_Init(this, &this->csCtx); + Cutscene_InitContext(this, &this->csCtx); if (gSaveContext.nextCutsceneIndex != 0xFFEF) { - gSaveContext.save.cutscene = gSaveContext.nextCutsceneIndex; + gSaveContext.save.cutsceneIndex = gSaveContext.nextCutsceneIndex; gSaveContext.nextCutsceneIndex = 0xFFEF; } - if (gSaveContext.save.cutscene == 0xFFFD) { - gSaveContext.save.cutscene = 0; + if (gSaveContext.save.cutsceneIndex == 0xFFFD) { + gSaveContext.save.cutsceneIndex = 0; } if (gSaveContext.nextDayTime != 0xFFFF) { @@ -2204,13 +2216,13 @@ void Play_Init(GameState* thisx) { func_800EDDB0(this); if (((gSaveContext.gameMode != GAMEMODE_NORMAL) && (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN)) || - (gSaveContext.save.cutscene >= 0xFFF0)) { + (gSaveContext.save.cutsceneIndex >= 0xFFF0)) { gSaveContext.unk_3DC0 = 0; Magic_Reset(this); - gSaveContext.sceneLayer = (gSaveContext.save.cutscene & 0xF) + 1; + gSaveContext.sceneLayer = (gSaveContext.save.cutsceneIndex & 0xF) + 1; // Set saved cutscene to 0 so it doesn't immediately play, but instead let the `CutsceneManager` handle it. - gSaveContext.save.cutscene = 0; + gSaveContext.save.cutsceneIndex = 0; } else { gSaveContext.sceneLayer = 0; } @@ -2296,7 +2308,7 @@ void Play_Init(GameState* thisx) { D_801F6D4C->envColor.g = 0; D_801F6D4C->envColor.b = 0; D_801F6D4C->envColor.a = 0; - EnvFlags_UnsetAll(this); + CutsceneFlags_UnsetAll(this); THA_GetRemaining(&this->state.heap); zAllocSize = THA_GetRemaining(&this->state.heap); zAlloc = (uintptr_t)THA_AllocTailAlign16(&this->state.heap, zAllocSize); @@ -2319,13 +2331,13 @@ void Play_Init(GameState* thisx) { Camera_ChangeDataIdx(&this->mainCamera, player->actor.params & 0xFF); } - func_800F15D8(&this->mainCamera); + CutsceneManager_StoreCamera(&this->mainCamera); Interface_SetSceneRestrictions(this); func_800FB758(this); gSaveContext.seqId = this->sequenceCtx.seqId; gSaveContext.ambienceId = this->sequenceCtx.ambienceId; AnimationContext_Update(this, &this->animationCtx); - func_800EDBE0(this); + Cutscene_HandleEntranceTriggers(this); gSaveContext.respawnFlag = 0; sBombersNotebookOpen = false; BombersNotebook_Init(&sBombersNotebook); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 4c72496d07..f8b33b853b 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -359,9 +359,9 @@ void func_80122F28(Player* player) { PLAYER_STATE1_20000000))) && (!(player->stateFlags2 & PLAYER_STATE2_1))) { if (player->doorType <= PLAYER_DOORTYPE_TALKING) { - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); } else { - ActorCutscene_SetIntentToPlay(0x7D); + CutsceneManager_Queue(CS_ID_GLOBAL_DOOR); } } } diff --git a/src/code/z_scene.c b/src/code/z_scene.c index fc47c9bf7a..26dc39507d 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -402,7 +402,7 @@ void Scene_CommandTimeSettings(PlayState* play, SceneCmd* cmd) { play->envCtx.sunPos.y = (Math_CosS(((void)0, gSaveContext.save.time) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f; play->envCtx.sunPos.z = (Math_CosS(((void)0, gSaveContext.save.time) - CLOCK_TIME(12, 0)) * 20.0f) * 25.0f; - if ((play->envCtx.sceneTimeSpeed == 0) && (gSaveContext.save.cutscene < 0xFFF0)) { + if ((play->envCtx.sceneTimeSpeed == 0) && (gSaveContext.save.cutsceneIndex < 0xFFF0)) { gSaveContext.skyboxTime = gSaveContext.save.time; if ((gSaveContext.skyboxTime >= CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(6, 30))) { @@ -470,15 +470,15 @@ void Scene_CommandAltHeaderList(PlayState* play, SceneCmd* cmd) { } } -// SceneTableEntry Header Command 0x17: Cutscene List -void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd) { - play->csCtx.sceneCsCount = cmd->cutsceneList.sceneCsCount; - play->csCtx.sceneCsList = Lib_SegmentedToVirtual(cmd->cutsceneList.segment); +// SceneTableEntry Header Command 0x17: Cutscene Script List +void Scene_CommandCutsceneScriptList(PlayState* play, SceneCmd* cmd) { + play->csCtx.scriptListCount = cmd->scriptList.scriptListCount; + play->csCtx.scriptList = Lib_SegmentedToVirtual(cmd->scriptList.segment); } -// SceneTableEntry Header Command 0x1B: Actor Cutscene List -void Scene_CommandActorCutsceneList(PlayState* play, SceneCmd* cmd) { - ActorCutscene_Init(play, Lib_SegmentedToVirtual(cmd->cutsceneActorList.segment), cmd->cutsceneActorList.num); +// SceneTableEntry Header Command 0x1B: Cutscene List +void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd) { + CutsceneManager_Init(play, Lib_SegmentedToVirtual(cmd->cutsceneList.segment), cmd->cutsceneList.num); } // SceneTableEntry Header Command 0x1C: Mini Maps @@ -560,11 +560,11 @@ void (*sSceneCmdHandlers[])(PlayState*, SceneCmd*) = { NULL, Scene_CommandSoundSettings, Scene_CommandEchoSetting, - Scene_CommandCutsceneList, + Scene_CommandCutsceneScriptList, Scene_CommandAltHeaderList, Scene_CommandSetRegionVisitedFlag, Scene_CommandAnimatedMaterials, - Scene_CommandActorCutsceneList, + Scene_CommandCutsceneList, Scene_CommandMiniMap, Scene_Command1D, Scene_CommandMiniMapCompassInfo, @@ -601,7 +601,7 @@ u16 Entrance_Create(s32 scene, s32 spawn, s32 layer) { } /** - * Creates an layer 0 entranace from the current entrance and the given spawn. + * Creates an layer 0 entrance from the current entrance and the given spawn. */ u16 Entrance_CreateFromSpawn(s32 spawn) { return Entrance_Create((u32)gSaveContext.save.entrance >> 9, spawn, 0); diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c index c269e30f4c..c10c1943e3 100644 --- a/src/code/z_sram_NES.c +++ b/src/code/z_sram_NES.c @@ -939,10 +939,9 @@ void Sram_InitDebugSave(void) { Sram_GenerateRandomSaveFields(); } -// Unused -void func_80144A94(SramContext* sramCtx) { +void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) { s32 i; - s32 cutscene = gSaveContext.save.cutscene; + s32 cutsceneIndex = gSaveContext.save.cutsceneIndex; bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE); @@ -957,7 +956,7 @@ void func_80144A94(SramContext* sramCtx) { D_801C67F0[gSaveContext.fileNum * 2 + 1]); Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, sizeof(Save)); } - gSaveContext.save.cutscene = cutscene; + gSaveContext.save.cutsceneIndex = cutsceneIndex; for (i = 0; i < ARRAY_COUNT(gSaveContext.eventInf); i++) { gSaveContext.eventInf[i] = 0; @@ -1067,10 +1066,10 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) { } else { gSaveContext.save.entrance = D_801C6A58[(void)0, gSaveContext.save.owlSaveLocation]; if ((gSaveContext.save.entrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) && - CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { gSaveContext.save.entrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10); } else if ((gSaveContext.save.entrance == ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8)) && - CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { gSaveContext.save.entrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 8); } @@ -1532,7 +1531,7 @@ void Sram_InitSave(FileSelectState* fileSelect2, SramContext* sramCtx) { if (gSaveContext.unk_3F3F) { Sram_InitNewSave(); if (fileSelect->unk_24480 == 0) { - gSaveContext.save.cutscene = 0xFFF0; + gSaveContext.save.cutsceneIndex = 0xFFF0; } for (phi_v0 = 0; phi_v0 < ARRAY_COUNT(gSaveContext.save.saveInfo.playerData.playerName); phi_v0++) { @@ -1634,7 +1633,7 @@ void Sram_SaveSpecialEnterClockTown(PlayState* play) { * Saves when beating the game, after showing the "Dawn of the New Day" message */ void Sram_SaveSpecialNewDay(PlayState* play) { - s32 cutscene = gSaveContext.save.cutscene; + s32 cutsceneIndex = gSaveContext.save.cutsceneIndex; s32 day; u16 time = gSaveContext.save.time; @@ -1647,7 +1646,7 @@ void Sram_SaveSpecialNewDay(PlayState* play) { gSaveContext.save.day = day; gSaveContext.save.time = time; - gSaveContext.save.cutscene = cutscene; + gSaveContext.save.cutsceneIndex = cutsceneIndex; func_80185F64(play->sramCtx.saveBuf, D_801C67C8[gSaveContext.fileNum * 2], D_801C67F0[gSaveContext.fileNum * 2]); } diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index 210d6c36f1..a4d95af64b 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -1386,48 +1386,53 @@ void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* a *curAnimIndex = nextAnimIndex; } -s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type) { +s32 SubS_StartCutscene(Actor* actor, s16 nextCsId, s16 curCsId, s32 type) { s32 isStarted = false; - if ((curCutscene != -1) && (ActorCutscene_GetCurrentIndex() == curCutscene)) { - ActorCutscene_Stop(curCutscene); - ActorCutscene_SetIntentToPlay(nextCutscene); - } else if (ActorCutscene_GetCanPlayNext(nextCutscene)) { + if ((curCsId != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() == curCsId)) { + CutsceneManager_Stop(curCsId); + CutsceneManager_Queue(nextCsId); + } else if (CutsceneManager_IsNext(nextCsId)) { switch (type) { - case SUBS_CUTSCENE_SET_UNK_LINK_FIELDS: - ActorCutscene_StartAndSetUnkLinkFields(nextCutscene, actor); + case SUBS_CUTSCENE_WITH_PLAYER: + CutsceneManager_StartWithPlayerCs(nextCsId, actor); break; + case SUBS_CUTSCENE_NORMAL: - ActorCutscene_Start(nextCutscene, actor); + CutsceneManager_Start(nextCsId, actor); break; - case SUBS_CUTSCENE_SET_FLAG: - ActorCutscene_StartAndSetFlag(nextCutscene, actor); + + case SUBS_CUTSCENE_WITH_PLAYER_SET_FLAG: + CutsceneManager_StartWithPlayerCsAndSetFlag(nextCsId, actor); + break; + + default: break; } isStarted = true; } else { - ActorCutscene_SetIntentToPlay(nextCutscene); + CutsceneManager_Queue(nextCsId); } return isStarted; } -s32 SubS_FillCutscenesList(Actor* actor, s16 cutscenes[], s16 numCutscenes) { - s16 cs; +s32 SubS_FillCutscenesList(Actor* actor, s16 csIdList[], s16 numCutscenes) { + s16 csId; s32 i; for (i = 0; i < numCutscenes; i++) { - cutscenes[i] = -1; + csIdList[i] = CS_ID_NONE; } - cs = actor->cutscene; + csId = actor->csId; i = 0; - while (cs != -1) { - // Note: Infinite loop if numCutscenes is less than possible additional cutscenes + while (csId != CS_ID_NONE) { + // Note: Infinite loop if numCutscenes is less than possible additional csIdList if (i < numCutscenes) { - cutscenes[i] = cs; - cs = ActorCutscene_GetAdditionalCutscene(cs); + csIdList[i] = csId; + csId = CutsceneManager_GetAdditionalCsId(csId); i++; } } diff --git a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c index a2af1839dd..59348962a5 100644 --- a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.c @@ -113,7 +113,7 @@ void BgAstrBombwall_Init(Actor* thisx, PlayState* play) { return; } BgAstrBombwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, &this->collider); - SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList)); func_80C0A378(this); } @@ -175,7 +175,7 @@ void func_80C0A400(BgAstrBombwall* this, PlayState* play) { } void func_80C0A418(BgAstrBombwall* this, PlayState* play) { - if (SubS_StartActorCutscene(&this->dyna.actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->dyna.actor, this->csIdList[0], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { func_80C0A458(this, play); } } diff --git a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.h b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.h index 4f42a8b3c3..224d94d7a4 100644 --- a/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Astr_Bombwall/z_bg_astr_bombwall.h @@ -13,6 +13,6 @@ typedef struct BgAstrBombwall { /* 0x15C */ BgAstrBombwallActionFunc actionFunc; /* 0x160 */ ColliderTris collider; /* 0x180 */ ColliderTrisElement colliderElements[2]; - /* 0x238 */ s16 cutscenes[1]; + /* 0x238 */ s16 csIdList[1]; } BgAstrBombwall; #endif // Z_BG_ASTR_BOMBWALL_H diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 4c73987ecc..b2e59a51b6 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -153,7 +153,7 @@ s32 func_808B7380(BgBreakwall* this, PlayState* play) { } s32 func_808B73C4(BgBreakwall* this, PlayState* play) { - return CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80) || CHECK_WEEKEVENTREG(WEEKEVENTREG_21_01); + return CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE) || CHECK_WEEKEVENTREG(WEEKEVENTREG_21_01); } s32 func_808B73FC(BgBreakwall* this, PlayState* play) { @@ -176,7 +176,7 @@ s32 func_808B7460(BgBreakwall* this, PlayState* play) { } s32 func_808B74A8(BgBreakwall* this, PlayState* play) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { return false; } return true; @@ -285,7 +285,7 @@ void func_808B782C(BgBreakwall* this, PlayState* play) { } void func_808B78A4(BgBreakwall* this, PlayState* play) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c index 5ee73366a3..adf9b3c967 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c @@ -163,8 +163,8 @@ void BgCtowerGear_Update(Actor* thisx, PlayState* play) { void BgCtowerGear_UpdateOrgan(Actor* thisx, PlayState* play) { BgCtowerGear* this = THIS; - if (Cutscene_CheckActorAction(play, 104)) { - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 104)]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_104)) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_104)]->id) { case 1: this->dyna.actor.draw = NULL; DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c index e94b28d88c..571523fcb2 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c @@ -88,7 +88,7 @@ void BgCtowerRot_CorridorRotate(BgCtowerRot* this, PlayState* play) { Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); this->dyna.actor.shape.rot.z = rotZ * 16.384f; - if (play->csCtx.frames == 132) { + if (play->csCtx.curFrame == 132) { play_sound(NA_SE_SY_SPIRAL_DASH); } } @@ -100,7 +100,7 @@ void BgCtowerRot_DoorClose(BgCtowerRot* this, PlayState* play) { if (!Math_SmoothStepToF(&this->timer, 0.0f, 0.1f, 15.0f, 0.1f)) { if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } this->actionFunc = BgCtowerRot_DoorDoNothing; } else if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) { @@ -119,19 +119,19 @@ void BgCtowerRot_DoorIdle(BgCtowerRot* this, PlayState* play) { Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos); if (offset.z > 30.0f) { this->unk160 = 0.0f; - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); this->actionFunc = BgCtowerRot_SetupDoorClose; } } void BgCtowerRot_SetupDoorClose(BgCtowerRot* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); } this->actionFunc = BgCtowerRot_DoorClose; } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c b/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c index 51797185a8..2a59a9b8fd 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Balance/z_bg_dblue_balance.c @@ -627,16 +627,16 @@ void func_80B83518(Actor* thisx, PlayState* play) { if (this->unk_17F == 2) { this->unk_17E--; if (this->unk_17E <= 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); this->unk_17F = 0; } } else if ((this->unk_17F != 0) && (this->unk_17F == 1)) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->unk_17F = 2; this->unk_17E = 0x50; } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } this->unk_16C = this->unk_170; diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c index 960006b93f..570369f07e 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c @@ -97,7 +97,7 @@ static AnimatedMaterial* sTexAnims[] = { s16 D_80A2B96C[] = { 0, 0x16C, -0x16C, 0 }; -s16 D_80A2B974[] = { -1, -1 }; +static s16 sCsIdList[] = { CS_ID_NONE, CS_ID_NONE }; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE), @@ -197,7 +197,7 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) { this->xluDList = sXluDLists[this->unk_160]; this->texAnim = sTexAnims[this->unk_160]; - SubS_FillCutscenesList(&this->dyna.actor, this->unk_1B6, ARRAY_COUNT(this->unk_1B6)); + SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList)); switch (this->unk_160) { case 1: @@ -254,8 +254,8 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) { this->unk_2F8[1] = NULL; this->unk_2F8[0] = NULL; label: - for (i = 0; i < ARRAY_COUNT(D_80A2B974); i++) { - D_80A2B974[i] = this->unk_1B6[i]; + for (i = 0; i < ARRAY_COUNT(sCsIdList); i++) { + sCsIdList[i] = this->csIdList[i]; } this->unk_178 = func_80A29A80(play, this->unk_1C0, this->unk_1BC); this->unk_1CC = D_80A2B96C[this->unk_178]; @@ -385,8 +385,8 @@ void func_80A2A32C(BgDblueMovebg* this, PlayState* play) { } if (phi_v1) { - this->unk_180 = func_800F2178(this->unk_1B6[0]); - this->unk_1D2 = this->unk_1B6[0]; + this->unk_180 = CutsceneManager_GetCutsceneCustomValue(this->csIdList[0]); + this->csId = this->csIdList[0]; this->unk_172 |= 8; this->actionFunc = func_80A2A444; } else { @@ -447,7 +447,7 @@ void func_80A2A670(BgDblueMovebg* this, PlayState* play) { void func_80A2A688(BgDblueMovebg* this, PlayState* play) { this->unk_180--; if (this->unk_180 <= 0) { - ActorCutscene_Stop(this->unk_1B6[0]); + CutsceneManager_Stop(this->csIdList[0]); } if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 60.0f, 2.0f) && @@ -477,8 +477,8 @@ void func_80A2A714(BgDblueMovebg* this, PlayState* play) { } this->unk_17E = phi_v0 * phi_f0; - this->unk_180 = func_800F2178(this->unk_1B6[0]); - this->unk_1D2 = this->unk_1B6[0]; + this->unk_180 = CutsceneManager_GetCutsceneCustomValue(this->csIdList[0]); + this->csId = this->csIdList[0]; this->unk_172 |= 8; this->actionFunc = func_80A2A7F8; } @@ -549,12 +549,12 @@ void func_80A2AAB8(BgDblueMovebg* this, PlayState* play) { s32 sp18; if (this->unk_180-- <= 0) { - ActorCutscene_Stop(this->unk_1B6[0]); + CutsceneManager_Stop(this->csIdList[0]); } sp18 = false; - if ((this->unk_1D0 > 0) && ((D_80A2B974[0] >= 0) || (D_80A2B974[1] >= 0))) { - if (ActorCutscene_GetCurrentIndex() != -1) { + if ((this->unk_1D0 > 0) && ((sCsIdList[0] >= 0) || (sCsIdList[1] >= 0))) { + if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) { sp18 = true; } } @@ -642,13 +642,13 @@ void func_80A2AED0(BgDblueMovebg* this, PlayState* play) { switch (temp_v0_3) { case 1: case 2: - this->unk_1D2 = this->unk_1B6[0]; + this->csId = this->csIdList[0]; this->unk_17E = 40; break; case 0: case 3: - this->unk_1D2 = this->unk_1B6[1]; + this->csId = this->csIdList[1]; this->unk_17E = 15; break; } @@ -721,7 +721,7 @@ void BgDblueMovebg_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->unk_172 & 8) { - if (SubS_StartActorCutscene(&this->dyna.actor, this->unk_1D2, -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->dyna.actor, this->csId, CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { this->unk_172 &= ~8; } } diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h index 8fc0165858..6e81c24c1e 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h +++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h @@ -37,7 +37,7 @@ typedef struct BgDblueMovebg { /* 0x19C */ Vec3f unk_19C; /* 0x1A8 */ Vec3f unk_1A8; /* 0x1B4 */ UNK_TYPE1 unk1B4[2]; - /* 0x1B6 */ s16 unk_1B6[2]; + /* 0x1B6 */ s16 csIdList[2]; /* 0x1BC */ s32 unk_1BC; /* 0x1C0 */ s32 unk_1C0; /* 0x1C4 */ s32 unk_1C4; @@ -45,7 +45,7 @@ typedef struct BgDblueMovebg { /* 0x1CC */ s16 unk_1CC; /* 0x1CE */ s16 unk_1CE; /* 0x1D0 */ s16 unk_1D0; - /* 0x1D2 */ s16 unk_1D2; + /* 0x1D2 */ s16 csId; /* 0x1D4 */ f32 unk_1D4; /* 0x1D8 */ s16 unk_1D8[2][8]; /* 0x1F8 */ f32 unk_1F8[2][8]; diff --git a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c index 3ba003ee5f..8f3de2b2e0 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c +++ b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c @@ -423,13 +423,13 @@ void func_80B84928(BgDblueWaterfall* this, PlayState* play) { if (sp30 != 0) { func_80B83EA4(this, play); if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x800) { - this->unk_1A4 = this->actor.cutscene; + this->csId = this->actor.csId; func_80B84AD4(this, play); } } else { func_80B841A0(this, play); if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1000) { - this->unk_1A4 = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + this->csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); func_80B84AD4(this, play); } } @@ -448,9 +448,9 @@ void func_80B84AEC(BgDblueWaterfall* this, PlayState* play) { s32 pad; s32 sp20; - if (ActorCutscene_GetCanPlayNext(this->unk_1A4)) { + if (CutsceneManager_IsNext(this->csId)) { sp20 = func_80B83D04(this, play); - ActorCutscene_StartAndSetUnkLinkFields(this->unk_1A4, &this->actor); + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_1A3 = true; if (sp20) { func_80B83D94(this, play); @@ -460,7 +460,7 @@ void func_80B84AEC(BgDblueWaterfall* this, PlayState* play) { func_80B84B9C(this, play); } } else { - ActorCutscene_SetIntentToPlay(this->unk_1A4); + CutsceneManager_Queue(this->csId); } } @@ -533,7 +533,7 @@ void func_80B84BCC(BgDblueWaterfall* this, PlayState* play) { func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); } else { if (this->unk_1A3) { - ActorCutscene_Stop(this->unk_1A4); + CutsceneManager_Stop(this->csId); } func_80B8484C(this, play); } @@ -572,7 +572,7 @@ void func_80B84F20(BgDblueWaterfall* this, PlayState* play) { func_800B9010(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG); } else { if (this->unk_1A3) { - ActorCutscene_Stop(this->unk_1A4); + CutsceneManager_Stop(this->csId); } func_80B8484C(this, play); } diff --git a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.h b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.h index 5ab64495e2..fae5cca6ab 100644 --- a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.h +++ b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.h @@ -22,7 +22,7 @@ typedef struct BgDblueWaterfall { /* 0x1A0 */ u8 unk_1A0; /* 0x1A1 */ UNK_TYPE1 unk1A1[2]; /* 0x1A3 */ s8 unk_1A3; - /* 0x1A4 */ s16 unk_1A4; + /* 0x1A4 */ s16 csId; /* 0x1A6 */ UNK_TYPE1 unk1A6[1]; /* 0x1A7 */ s8 unk_1A7; /* 0x1A8 */ f32 unk_1A8; diff --git a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c index eb1848c56d..e9f8916d0b 100644 --- a/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c +++ b/src/overlays/actors/ovl_Bg_Dkjail_Ivy/z_bg_dkjail_ivy.c @@ -146,7 +146,7 @@ void BgDkjailIvy_WaitForCut(BgDkjailIvy* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; this->dyna.actor.flags |= ACTOR_FLAG_10; - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); BgDkjailIvy_SetupCutscene(this); } else { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); @@ -158,8 +158,8 @@ void BgDkjailIvy_SetupCutscene(BgDkjailIvy* this) { } void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->fadeOutTimer = 50; DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); Flags_SetSwitch(play, BG_DKJAIL_GET_SWITCH(&this->dyna.actor)); @@ -167,7 +167,7 @@ void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_GRASS_WALL_BROKEN); BgDkjailIvy_SetupFadeOut(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c b/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c index a39e10559c..be1958cb4d 100644 --- a/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c +++ b/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c @@ -157,16 +157,16 @@ s32 func_80BC3B00(BgF40Block* this) { } s32 func_80BC3CA4(BgF40Block* this) { - if (this->dyna.actor.cutscene == -1) { + if (this->dyna.actor.csId == CS_ID_NONE) { return true; } - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); return true; } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); return false; } @@ -277,13 +277,13 @@ void func_80BC4228(BgF40Block* this, PlayState* play) { this->unk_164 = this->unk_160 + 1; } else { this->actionFunc = func_80BC4530; - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C); } } if (func_80BC3D08(this, play, 0)) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); this->actionFunc = func_80BC41AC; Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F); return; @@ -337,13 +337,13 @@ void func_80BC4448(BgF40Block* this, PlayState* play) { this->unk_164 = this->unk_160 - 1; } else { this->actionFunc = func_80BC4380; - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C); } } if (func_80BC3D08(this, play, 0)) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); this->actionFunc = func_80BC43CC; Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F); } diff --git a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c index ffa9491d60..67703f0cd8 100644 --- a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c +++ b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c @@ -147,7 +147,7 @@ void BgF40Switch_Press(BgF40Switch* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH); Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10); if (this->isInitiator) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); this->isInitiator = false; } this->actionFunc = BgF40Switch_IdlePressed; @@ -157,19 +157,19 @@ void BgF40Switch_Press(BgF40Switch* this, PlayState* play) { } void BgF40Switch_WaitToPress(BgF40Switch* this, PlayState* play) { - if (!this->isInitiator || this->dyna.actor.cutscene == -1) { + if (!this->isInitiator || (this->dyna.actor.csId == CS_ID_NONE)) { this->actionFunc = BgF40Switch_Press; if (this->isInitiator) { Flags_SetSwitch(play, BGF40SWITCH_GET_SWITCHFLAG(&this->dyna.actor)); } - } else if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + } else if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->actionFunc = BgF40Switch_Press; if (this->isInitiator) { Flags_SetSwitch(play, BGF40SWITCH_GET_SWITCHFLAG(&this->dyna.actor)); } } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c index 8b02330f31..7d0ed6a1a8 100644 --- a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c +++ b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c @@ -42,7 +42,7 @@ void func_80B40080(BgGoronOyu* this) { void func_80B4009C(BgGoronOyu* this) { this->unk_17E = 0; - this->initialActorCutscene = this->dyna.actor.cutscene; + this->initCsId = this->dyna.actor.csId; this->actionFunc = func_80B40100; this->unk_164 = 20.0f; } @@ -53,11 +53,11 @@ void func_80B400C8(BgGoronOyu* this, PlayState* play) { } void func_80B40100(BgGoronOyu* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->initialActorCutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->initialActorCutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->initCsId)) { + CutsceneManager_StartWithPlayerCs(this->initCsId, &this->dyna.actor); this->actionFunc = func_80B40160; } else { - ActorCutscene_SetIntentToPlay(this->initialActorCutscene); + CutsceneManager_Queue(this->initCsId); } } @@ -69,7 +69,7 @@ void func_80B40160(BgGoronOyu* this, PlayState* play) { BgGoronOyu_UpdateWaterBoxInfo(this, play); if (this->unk_164 <= 0.0f) { - ActorCutscene_Stop(this->initialActorCutscene); + CutsceneManager_Stop(this->initCsId); this->unk_164 = 0.0f; func_80B40080(this); } diff --git a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.h b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.h index d17ff87b3d..57459364bc 100644 --- a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.h +++ b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.h @@ -15,7 +15,7 @@ typedef struct BgGoronOyu { /* 0x168 */ Vec3f waterBoxPos; /* 0x174 */ f32 waterBoxXLength; /* 0x178 */ f32 waterBoxZLength; - /* 0x17C */ s16 initialActorCutscene; + /* 0x17C */ s16 initCsId; /* 0x17E */ u16 unk_17E; } BgGoronOyu; // size = 0x180 diff --git a/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c b/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c index 387f5ec835..fc209773bc 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Haka_Bombwall/z_bg_haka_bombwall.c @@ -191,13 +191,13 @@ void func_80BD6274(BgHakaBombwall* this, PlayState* play) { void BgHakaBombwall_SetupPlayCutscene(BgHakaBombwall* this) { this->dyna.actor.flags |= ACTOR_FLAG_10; - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); this->actionFunc = BgHakaBombwall_PlayCutscene; } void BgHakaBombwall_PlayCutscene(BgHakaBombwall* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); func_80BD5E6C(this, play); this->dyna.actor.draw = NULL; Flags_SetSwitch(play, BGHAKABOMBWALL_GET_7F(&this->dyna.actor)); @@ -205,7 +205,7 @@ void BgHakaBombwall_PlayCutscene(BgHakaBombwall* this, PlayState* play) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); BgHakaBombwall_SetupEndCutscene(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -217,7 +217,7 @@ void BgHakaBombwall_SetupEndCutscene(BgHakaBombwall* this) { void BgHakaBombwall_EndCutscene(BgHakaBombwall* this, PlayState* play) { this->csTimer--; if (this->csTimer <= 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c index b90774172e..dfc176eff0 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c +++ b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c @@ -79,12 +79,12 @@ void func_80B6DCEC(BgHakaCurtain* this) { } void func_80B6DD00(BgHakaCurtain* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); func_80B6DD5C(this); return; } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } void func_80B6DD5C(BgHakaCurtain* this) { @@ -123,11 +123,11 @@ void func_80B6DEA8(BgHakaCurtain* this, PlayState* play) { void BgHakaCurtain_Update(Actor* thisx, PlayState* play) { BgHakaCurtain* this = THIS; - CsCmdActorAction* actorAction; + CsCmdActorCue* cue; - if (Cutscene_CheckActorAction(play, 469)) { - actorAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 469)]; - if (actorAction->startFrame == play->csCtx.frames && actorAction->action == 2) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_469)) { + cue = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_469)]; + if ((cue->startFrame == play->csCtx.curFrame) && (cue->id == 2)) { func_80B6DD80(this); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c index 94e7c57dca..693fff484a 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c @@ -47,7 +47,7 @@ void BgHakaTomb_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); DynaPolyActor_LoadMesh(play, &this->dyna, &object_haka_obj_Colheader_000EE8); - SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList)); func_80BD6624(this); } @@ -61,15 +61,15 @@ void func_80BD6624(BgHakaTomb* this) { this->actionFunc = func_80BD66AC; } -s32 func_80BD6638(s16* arg0, s16* arg1, s32 arg2) { +s32 func_80BD6638(s16* csId, s16* csIdList, s32 numCutscenes) { s32 pad; s32 retVal = false; s32 i; - *arg0 = ActorCutscene_GetCurrentIndex(); - if (*arg0 >= 0) { - for (i = 0; i < arg2; i++) { - if (*arg0 == arg1[i]) { + *csId = CutsceneManager_GetCurrentCsId(); + if (*csId >= 0) { + for (i = 0; i < numCutscenes; i++) { + if (*csId == csIdList[i]) { retVal = true; break; } @@ -80,12 +80,13 @@ s32 func_80BD6638(s16* arg0, s16* arg1, s32 arg2) { } void func_80BD66AC(BgHakaTomb* this, PlayState* play) { - s16 temp; + s16 csId; if (Flags_GetClear(play, this->dyna.actor.room)) { this->dyna.actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); } - if (!func_80BD6638(&temp, this->cutscenes, 1) && (temp < 0) && Flags_GetClear(play, this->dyna.actor.room)) { + if (!func_80BD6638(&csId, this->csIdList, ARRAY_COUNT(this->csIdList)) && (csId < 0) && + Flags_GetClear(play, this->dyna.actor.room)) { this->dyna.actor.flags |= ACTOR_FLAG_1; if (this->dyna.actor.isTargeted) { func_80BD6754(this); @@ -100,7 +101,7 @@ void func_80BD6754(BgHakaTomb* this) { } void func_80BD6768(BgHakaTomb* this, PlayState* play) { - if (SubS_StartActorCutscene(&this->dyna.actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->dyna.actor, this->csIdList[0], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { BgHakaTomb_SetupDoNothing(this); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h index 3c607e0e25..fa06a86958 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h +++ b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h @@ -10,7 +10,7 @@ typedef void (*BgHakaTombActionFunc)(struct BgHakaTomb*, PlayState*); typedef struct BgHakaTomb { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ BgHakaTombActionFunc actionFunc; - /* 0x160 */ s16 cutscenes[1]; + /* 0x160 */ s16 csIdList[1]; } BgHakaTomb; // size = 0x164 #endif // Z_BG_HAKA_TOMB_H diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c b/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c index 41112ccdca..99a5a759cf 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Bombwall/z_bg_hakugin_bombwall.c @@ -382,7 +382,7 @@ void func_80ABCCE4(BgHakuginBombwall* this, PlayState* play) { if (ptr->unk_20(this, play)) { this->dyna.actor.flags |= ACTOR_FLAG_10; - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); this->actionFunc = func_80ABCD98; } else { this->collider.base.acFlags &= ~AC_HIT; @@ -393,10 +393,10 @@ void func_80ABCCE4(BgHakuginBombwall* this, PlayState* play) { void func_80ABCD98(BgHakuginBombwall* this, PlayState* play) { s32 pad; - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { BgHakuginBombwallStruct* ptr = &D_80ABCFC0[BGHAKUGIN_BOMBWALL_100(&this->dyna.actor)]; - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); ptr->unk_24(this, play); this->dyna.actor.draw = NULL; this->unk_1AC = 20; @@ -404,7 +404,7 @@ void func_80ABCD98(BgHakuginBombwall* this, PlayState* play) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->actionFunc = func_80ABCE60; } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -413,7 +413,7 @@ void func_80ABCE60(BgHakuginBombwall* this, PlayState* play) { this->unk_1AC--; if (this->unk_1AC <= 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Actor_Kill(&this->dyna.actor); } else if (this->unk_1AC == ptr->unk_2C) { ptr->unk_28(this, play); diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c index 42a7c4e055..7cd94bd86e 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c @@ -104,15 +104,15 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) { this->unk_15C = 0; } if (this->unk_160) { - if (this->dyna.actor.cutscene == -1) { + if (this->dyna.actor.csId == CS_ID_NONE) { this->unk_160 = false; return; - } else if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + } else if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->unk_160 = false; return; } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c index 5a06fe4159..a8b6ce702a 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c @@ -28,9 +28,9 @@ void func_80A9CE00(BgHakuginPost* this); void func_80A9CE1C(BgHakuginPost* this, PlayState* play); void func_80A9D0A0(BgHakuginPost* this); void func_80A9D0B4(BgHakuginPost* this, PlayState* play); -void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 arg3, s16 arg4); +void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 csLength, s16 csId); void func_80A9D260(BgHakuginPost* this, PlayState* play); -void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 arg3, s16 arg4); +void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 csId, s16 additionalCsId); void func_80A9D360(BgHakuginPost* this, PlayState* play); void func_80A9D3E4(BgHakuginPost* this); void func_80A9D434(BgHakuginPost* this, PlayState* play); @@ -162,12 +162,12 @@ void func_80A9AFB4(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct* } else { unkStruct->unk_0000[i].unk_34 = 1; } - unkStruct->unk_0000[i].unk_2A = this->dyna.actor.cutscene; - unkStruct->unk_0000[i].unk_2C = ActorCutscene_GetAdditionalCutscene(unkStruct->unk_0000[i].unk_2A); + unkStruct->unk_0000[i].csId = this->dyna.actor.csId; + unkStruct->unk_0000[i].additionalCsId = CutsceneManager_GetAdditionalCsId(unkStruct->unk_0000[i].csId); } else { unkStruct->unk_0000[i].unk_34 = 1; - unkStruct->unk_0000[i].unk_2A = -1; - unkStruct->unk_0000[i].unk_2C = -1; + unkStruct->unk_0000[i].csId = CS_ID_NONE; + unkStruct->unk_0000[i].additionalCsId = CS_ID_NONE; } unkStruct->unk_0000[i].unk_2F = 1; @@ -783,7 +783,7 @@ void func_80A9CC84(BgHakuginPost* this) { void func_80A9CCA0(BgHakuginPost* this, PlayState* play) { if (this->unk_174 != 0) { func_80A9D1E0(this, func_80A9CD00, (this->unk_164 - this->dyna.actor.home.pos.y) + 100.0f, 60, - this->dyna.actor.cutscene); + this->dyna.actor.csId); } } @@ -823,7 +823,7 @@ void func_80A9CE1C(BgHakuginPost* this, PlayState* play) { if (this->unk_170 != 0) { func_80A9D1E0(this, func_80A9D0A0, (this->unk_164 - this->dyna.actor.home.pos.y) + 100.0f, 0x3C, - ActorCutscene_GetAdditionalCutscene(this->dyna.actor.cutscene)); + CutsceneManager_GetAdditionalCsId(this->dyna.actor.csId)); return; } @@ -843,8 +843,8 @@ void func_80A9CE1C(BgHakuginPost* this, PlayState* play) { func_8019F128(NA_SE_EV_SLIDE_DOOR_OPEN); Flags_SetSwitch(play, D_80A9E028.unk_0000[i].unk_2E); this->unk_178 = 20; - func_80A9D2C4(this, func_80A9CE00, D_80A9E028.unk_0000[i].unk_14.y + 50.0f, - D_80A9E028.unk_0000[i].unk_2A, D_80A9E028.unk_0000[i].unk_2C); + func_80A9D2C4(this, func_80A9CE00, D_80A9E028.unk_0000[i].unk_14.y + 50.0f, D_80A9E028.unk_0000[i].csId, + D_80A9E028.unk_0000[i].additionalCsId); break; } } @@ -884,12 +884,12 @@ void func_80A9D0B4(BgHakuginPost* this, PlayState* play) { } } -void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 arg3, s16 arg4) { +void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 csLength, s16 csId) { this->unkFunc = unkFunc; - this->unk_184 = arg4; - this->unk_180 = ActorCutscene_GetLength(arg4); - if (this->unk_180 < 0) { - this->unk_180 = arg3; + this->csId = csId; + this->csLength = CutsceneManager_GetLength(csId); + if (this->csLength < 0) { + this->csLength = csLength; } this->dyna.actor.focus.pos.x = this->dyna.actor.home.pos.x; this->dyna.actor.focus.pos.y = this->unk_16C + arg2; @@ -898,22 +898,22 @@ void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 } void func_80A9D260(BgHakuginPost* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_184)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_184, &this->dyna.actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->dyna.actor); this->unkFunc(this); } else { - ActorCutscene_SetIntentToPlay(this->unk_184); + CutsceneManager_Queue(this->csId); } } -void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 arg3, s16 arg4) { +void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 csId, s16 additionalCsId) { this->unkFunc = unkFunc; - this->unk_184 = arg3; - this->unk_186 = arg4; - this->unk_180 = -1; - this->unk_180 = ActorCutscene_GetLength(arg3); - if (this->unk_180 < 0) { - this->unk_180 = 15; + this->csId = csId; + this->additionalCsId = additionalCsId; + this->csLength = -1; + this->csLength = CutsceneManager_GetLength(csId); + if (this->csLength < 0) { + this->csLength = 15; } this->dyna.actor.focus.pos.x = this->dyna.actor.home.pos.x; this->dyna.actor.focus.pos.y = this->unk_16C + arg2; @@ -922,32 +922,32 @@ void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 } void func_80A9D360(BgHakuginPost* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_184)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_184, &this->dyna.actor); - if (this->unk_186 >= 0) { + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->dyna.actor); + if (this->additionalCsId >= 0) { func_80A9D3E4(this); } else { this->unkFunc(this); } } else { - ActorCutscene_SetIntentToPlay(this->unk_184); + CutsceneManager_Queue(this->csId); } } void func_80A9D3E4(BgHakuginPost* this) { - this->unk_182 = ActorCutscene_GetLength(this->unk_186); - if (this->unk_182 < 0) { - this->unk_182 = 30; + this->additionalCsLength = CutsceneManager_GetLength(this->additionalCsId); + if (this->additionalCsLength < 0) { + this->additionalCsLength = 30; } this->actionFunc = func_80A9D434; } void func_80A9D434(BgHakuginPost* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_186) != 0) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_186, &this->dyna.actor); + if (CutsceneManager_IsNext(this->additionalCsId)) { + CutsceneManager_StartWithPlayerCs(this->additionalCsId, &this->dyna.actor); this->unkFunc(this); } else { - ActorCutscene_SetIntentToPlay(this->unk_186); + CutsceneManager_Queue(this->additionalCsId); } } @@ -956,17 +956,17 @@ void BgHakuginPost_Update(Actor* thisx, PlayState* play) { f32 temp; func_80A9B46C(this, play); - if ((this->unk_180 >= 0) && ((this->actionFunc != func_80A9D260) || (this->actionFunc != func_80A9D360))) { - this->unk_180--; - if (this->unk_180 < 0) { - ActorCutscene_Stop(this->unk_184); + if ((this->csLength >= 0) && ((this->actionFunc != func_80A9D260) || (this->actionFunc != func_80A9D360))) { + this->csLength--; + if (this->csLength < 0) { + CutsceneManager_Stop(this->csId); } } - if ((this->unk_182 >= 0) && (this->actionFunc != func_80A9D434)) { - this->unk_182--; - if (this->unk_182 < 0) { - ActorCutscene_Stop(this->unk_186); + if ((this->additionalCsLength >= 0) && (this->actionFunc != func_80A9D434)) { + this->additionalCsLength--; + if (this->additionalCsLength < 0) { + CutsceneManager_Stop(this->additionalCsId); } } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.h b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.h index 5a23fa070b..4797a684a3 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.h +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.h @@ -19,8 +19,8 @@ typedef struct { /* 0x20 */ f32 unk_20; /* 0x24 */ f32 unk_24; /* 0x28 */ s16 unk_28; - /* 0x2A */ s16 unk_2A; - /* 0x2C */ s16 unk_2C; + /* 0x2A */ s16 csId; + /* 0x2C */ s16 additionalCsId; /* 0x2E */ u8 unk_2E; /* 0x2F */ u8 unk_2F; /* 0x30 */ s8 unk_30; @@ -64,10 +64,10 @@ typedef struct BgHakuginPost { /* 0x178 */ s8 unk_178; /* 0x179 */ s8 unk_179; /* 0x17C */ BgHakuginPostFunc unkFunc; - /* 0x180 */ s16 unk_180; - /* 0x182 */ s16 unk_182; - /* 0x184 */ s16 unk_184; - /* 0x186 */ s16 unk_186; + /* 0x180 */ s16 csLength; + /* 0x182 */ s16 additionalCsLength; + /* 0x184 */ s16 csId; + /* 0x186 */ s16 additionalCsId; } BgHakuginPost; // size = 0x188 #endif // Z_BG_HAKUGIN_POST_H diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c index 512a5b822f..c7fa3d69ed 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c @@ -143,12 +143,12 @@ void BgHakuginSwitch_Init(Actor* thisx, PlayState* play) { this->collider.dim.yShift = 0x1D; this->unk_1A8 = object_goronswitch_DL_000268; - this->unk_1B8 = this->dyna.actor.cutscene; + this->csId = this->dyna.actor.csId; if (sp34 == 0) { - this->unk_1BA = -1; + this->additionalCsId = CS_ID_NONE; } else { - this->unk_1BA = ActorCutscene_GetAdditionalCutscene(this->unk_1B8); + this->additionalCsId = CutsceneManager_GetAdditionalCsId(this->csId); } if (sp30) { @@ -166,8 +166,8 @@ void BgHakuginSwitch_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain2); this->unk_1A8 = D_80B1688C[sp34].unk_10; - this->unk_1B8 = this->dyna.actor.cutscene; - this->unk_1BA = ActorCutscene_GetAdditionalCutscene(this->unk_1B8); + this->csId = this->dyna.actor.csId; + this->additionalCsId = CutsceneManager_GetAdditionalCsId(this->csId); if (sp30 == sp28) { func_80B15F3C(this, play); @@ -186,9 +186,9 @@ void BgHakuginSwitch_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void func_80B15A4C(BgHakuginSwitch* this, BgHakuginSwitchUnkFunc func, s32 arg2) { +void func_80B15A4C(BgHakuginSwitch* this, BgHakuginSwitchUnkFunc func, s32 csId) { this->unk_1B4 = func; - this->unk_1BC = arg2; + this->curCsId = csId; this->actionFunc = func_80B15A68; } @@ -197,14 +197,14 @@ void func_80B15A68(BgHakuginSwitch* this, PlayState* play) { BgHakuginSwitchStruct* s = &D_80B1688C[BGHAKUGINSWITCH_GET_7(&this->dyna.actor)]; s32 sp18 = !(s->unk_14 & 0x40); - if (ActorCutscene_GetCanPlayNext(this->unk_1BC)) { + if (CutsceneManager_IsNext(this->curCsId)) { if (sp18) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_1BC, &this->dyna.actor); + CutsceneManager_StartWithPlayerCs(this->curCsId, &this->dyna.actor); this->unk_1BF = 40; } this->unk_1B4(this, play); } else if (sp18) { - ActorCutscene_SetIntentToPlay(this->unk_1BC); + CutsceneManager_Queue(this->curCsId); } } @@ -281,7 +281,7 @@ void func_80B15B74(BgHakuginSwitch* this, PlayState* play) { D_80B16AF0 = play->gameplayFrames; if (sp38->unk_14 & 0x10) { - func_80B15A4C(this, func_80B15E0C, this->unk_1B8); + func_80B15A4C(this, func_80B15E0C, this->csId); } else { func_80B15E0C(this, play); } @@ -343,7 +343,7 @@ void func_80B15F88(BgHakuginSwitch* this, PlayState* play) { if (phi_a0 != phi_v1) { if ((sp18->unk_14 & 0xFF) & 0x20) { if (D_80B16AF0 < play->gameplayFrames) { - func_80B15A4C(this, func_80B1606C, this->unk_1BA); + func_80B15A4C(this, func_80B1606C, this->additionalCsId); } } else { func_80B1606C(this, play); @@ -372,16 +372,16 @@ void func_80B160DC(BgHakuginSwitch* this, PlayState* play) { } } -void func_80B16180(BgHakuginSwitch* this, BgHakuginSwitchUnkFunc func, s32 arg2, s32 arg3) { +void func_80B16180(BgHakuginSwitch* this, BgHakuginSwitchUnkFunc func, s32 arg2, s32 csId) { this->unk_1B4 = func; this->unk_1BE = arg2; - this->unk_1BC = arg3; + this->curCsId = csId; this->actionFunc = func_80B161A0; } void func_80B161A0(BgHakuginSwitch* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_1BC)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_1BC, &this->dyna.actor); + if (CutsceneManager_IsNext(this->curCsId)) { + CutsceneManager_StartWithPlayerCs(this->curCsId, &this->dyna.actor); if (this->unk_1BE != 0) { Flags_SetSwitch(play, BGHAKUGINSWITCH_GET_SWITCHFLAG(&this->dyna.actor)); } else { @@ -390,7 +390,7 @@ void func_80B161A0(BgHakuginSwitch* this, PlayState* play) { this->unk_1BF = 50; this->unk_1B4(this, play); } else { - ActorCutscene_SetIntentToPlay(this->unk_1BC); + CutsceneManager_Queue(this->curCsId); } } @@ -427,7 +427,7 @@ void func_80B162AC(BgHakuginSwitch* this, PlayState* play) { if (sp24) { if (sp28) { - func_80B16180(this, func_80B163C4, 1, this->unk_1B8); + func_80B16180(this, func_80B163C4, 1, this->csId); } else { func_80B163C4(this, play); } @@ -466,7 +466,7 @@ void func_80B16494(BgHakuginSwitch* this, PlayState* play) { void func_80B16520(BgHakuginSwitch* this, PlayState* play) { if (!Flags_GetSwitch(play, BGHAKUGINSWITCH_GET_SWITCHFLAG(&this->dyna.actor))) { if (BGHAKUGINSWITCH_GET_7(&this->dyna.actor) == BGHAKUGINSWITCH_GET_7_1) { - func_80B16180(this, func_80B165A0, 0, this->unk_1BA); + func_80B16180(this, func_80B165A0, 0, this->additionalCsId); } else { func_80B165A0(this, play); } @@ -498,7 +498,7 @@ void BgHakuginSwitch_Update(Actor* thisx, PlayState* play) { if ((this->actionFunc != func_80B15A68) && (this->actionFunc != func_80B161A0)) { this->unk_1BF--; if (this->unk_1BF == 0) { - ActorCutscene_Stop(this->unk_1BC); + CutsceneManager_Stop(this->curCsId); } } } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.h b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.h index 164220b29e..caf3c2f65c 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.h +++ b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.h @@ -22,9 +22,9 @@ typedef struct BgHakuginSwitch { /* 0x1B0 */ s16 unk_1B0; /* 0x1B2 */ s8 unk_1B2; /* 0x1B4 */ BgHakuginSwitchUnkFunc unk_1B4; - /* 0x1B8 */ s16 unk_1B8; - /* 0x1BA */ s16 unk_1BA; - /* 0x1BC */ s16 unk_1BC; + /* 0x1B8 */ s16 csId; + /* 0x1BA */ s16 additionalCsId; + /* 0x1BC */ s16 curCsId; /* 0x1BE */ s8 unk_1BE; /* 0x1BF */ s8 unk_1BF; /* 0x1C0 */ s8 unk_1C0; diff --git a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c index 622c841009..401d3543e6 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c @@ -358,13 +358,13 @@ void BgIkanaBlock_Update(Actor* thisx, PlayState* play) { if (this->unk_17E != 0) { if (this->unk_17F > 0) { this->unk_17F--; - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); this->unk_17E = 0; - } else if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + } else if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->unk_17F = 30; } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c index 88f606ac0d..edcda4b373 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c @@ -319,13 +319,13 @@ void func_80BD4F9C(BgIkanaBombwall* this, PlayState* play) { void func_80BD4FF8(BgIkanaBombwall* this) { this->dyna.actor.flags |= ACTOR_FLAG_10; - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); this->actionFunc = func_80BD503C; } void func_80BD503C(BgIkanaBombwall* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); if (!BGIKANABOMBWALL_GET_100(&this->dyna.actor)) { func_80BD4720(this, play); } else { @@ -339,7 +339,7 @@ void func_80BD503C(BgIkanaBombwall* this, PlayState* play) { } func_80BD5118(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -352,11 +352,11 @@ void func_80BD5134(BgIkanaBombwall* this, PlayState* play) { if (!BGIKANABOMBWALL_GET_100(&this->dyna.actor)) { this->unk_1AC--; if (this->unk_1AC <= 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Actor_Kill(&this->dyna.actor); } - } else if (this->dyna.actor.cutscene >= 0) { - if (ActorCutscene_GetCurrentIndex() != this->dyna.actor.cutscene) { + } else if (this->dyna.actor.csId >= 0) { + if (CutsceneManager_GetCurrentCsId() != this->dyna.actor.csId) { Actor_Kill(&this->dyna.actor); } } else { diff --git a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c index aead34d283..44f81da9cd 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c @@ -115,7 +115,7 @@ void BgIkanaDharma_Init(Actor* thisx, PlayState* play2) { Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_BG_IKANA_DHARMA, this->dyna.actor.world.pos.x, segmentY, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, - BGIKANADHARMA_PARAMS(0, true, 0), this->dyna.actor.cutscene, + BGIKANADHARMA_PARAMS(0, true, 0), this->dyna.actor.csId, this->dyna.actor.halfDaysBits, NULL); } @@ -173,16 +173,16 @@ void BgIkanaDharma_WaitForHit(BgIkanaDharma* this, PlayState* play) { } void BgIkanaDharma_SetupStartCutscene(BgIkanaDharma* this) { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); this->actionFunc = BgIkanaDharma_StartCutscene; } void BgIkanaDharma_StartCutscene(BgIkanaDharma* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); BgIkanaDharma_SetupWaitForCutsceneToEnd(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -200,7 +200,7 @@ void BgIkanaDharma_WaitForCutsceneToEnd(BgIkanaDharma* this, PlayState* play) { sFirstHitBgIkanaDharma = NULL; } - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c index 432a5b5ff6..7398dbfd9e 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c @@ -179,7 +179,7 @@ void func_80B80440(BgIkanaRotaryroom* this, PlayState* play) { this->unk_204.unk_00 = Actor_SpawnAsChildAndCutscene( &play->actorCtx, play, ACTOR_BG_IKANA_BLOCK, sp50.x, sp50.y, sp50.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, -1, - ActorCutscene_GetAdditionalCutscene(this->dyna.actor.cutscene), this->dyna.actor.halfDaysBits, NULL); + CutsceneManager_GetAdditionalCsId(this->dyna.actor.csId), this->dyna.actor.halfDaysBits, NULL); Matrix_Pop(); } @@ -515,7 +515,7 @@ void func_80B81010(BgIkanaRotaryroom* this, PlayState* play) { CollisionPoly* sp7C; s32 sp78; - if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) { phi_s7 = true; for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) { @@ -582,7 +582,7 @@ void func_80B81234(BgIkanaRotaryroom* this, PlayState* play) { CollisionPoly* sp40; s32 sp3C; - if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) { if (player == NULL) { return; } @@ -646,7 +646,7 @@ void func_80B81234(BgIkanaRotaryroom* this, PlayState* play) { void func_80B814B8(BgIkanaRotaryroom* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) { if (player->actor.bgCheckFlags & BGCHECKFLAG_CRUSHED) { Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset); func_80169EFC(&play->state); @@ -791,14 +791,14 @@ void func_80B819DC(BgIkanaRotaryroom* this) { void func_80B819F0(Actor* thisx, PlayState* play) { BgIkanaRotaryroom* this = THIS; - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); - if (this->dyna.actor.cutscene >= 0) { - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); + if (this->dyna.actor.csId >= 0) { + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT); } func_80B81A64(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -926,7 +926,7 @@ void func_80B81DC8(Actor* thisx, PlayState* play) { this->unk_584--; if (this->unk_584 <= 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); func_80B818B4(this); } else if (this->unk_584 == 19) { s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); diff --git a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c index a7ba89cdc6..f39ca3b8c0 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c @@ -106,12 +106,12 @@ void func_80BD5878(BgIkanaShutter* this) { } void func_80BD5894(BgIkanaShutter* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); func_80BD58F0(this); return; } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } void func_80BD58F0(BgIkanaShutter* this) { @@ -177,13 +177,13 @@ void func_80BD5B44(BgIkanaShutter* this) { } void func_80BD5B60(BgIkanaShutter* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); Flags_SetClear(play, this->dyna.actor.room); func_80BD5BC4(this); return; } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } void func_80BD5BC4(BgIkanaShutter* this) { diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c index 824c58ee67..5a69e3ca7a 100644 --- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c +++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c @@ -179,11 +179,11 @@ void func_80C0ACD4(BgIkninSusceil* this) { } void func_80C0ACE8(BgIkninSusceil* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); func_80C0AD44(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -198,7 +198,7 @@ void func_80C0AD64(BgIkninSusceil* this, PlayState* play) { if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 365.0f, 0.5f, this->dyna.actor.velocity.y, 1.0f) < 0.1f) { func_80C0A86C(this, play, 1, 14, 3); - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); func_80C0AB14(this); } else { func_800B9010(&this->dyna.actor, NA_SE_EV_ICE_PILLAR_RISING - SFX_FLAG); diff --git a/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c b/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c index db343e84b1..36f8e94fca 100644 --- a/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c +++ b/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c @@ -80,16 +80,16 @@ void func_80C07220(BgIkninside* this, PlayState* play) { } void func_80C07230(BgIkninside* this, PlayState* play) { - if (this->dyna.actor.cutscene == -1) { + if (this->dyna.actor.csId == CS_ID_NONE) { this->actionFunc = func_80C07220; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->dyna.actor.csId); + } else if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->actionFunc = func_80C07220; } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c index 9cbfaec61b..2c24a55801 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c @@ -51,9 +51,9 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) { switch (BGIKNVDOUKUTU_GET_F(&this->dyna.actor)) { case BGIKNVDOUKUTU_F_0: this->actionFunc = func_80BD71BC; - this->csAction = 0x204; + this->cueType = CS_CMD_ACTOR_CUE_516; this->unk_160 = 1.0f; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) { this->dyna.actor.draw = func_80BD7768; this->actionFunc = func_80BD73D0; play->envCtx.lightSettingOverride = 25; @@ -65,7 +65,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) { case BGIKNVDOUKUTU_F_1: Actor_SetScale(&this->dyna.actor, 1.0f); this->dyna.actor.draw = func_80BD7820; - this->csAction = 0x204; + this->cueType = CS_CMD_ACTOR_CUE_516; DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_012788, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); @@ -75,7 +75,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) { break; case BGIKNVDOUKUTU_F_2: - this->csAction = 0x204; + this->cueType = CS_CMD_ACTOR_CUE_516; this->dyna.actor.draw = func_80BD78C4; DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_0117C8, &colHeader); @@ -116,8 +116,8 @@ void func_80BD716C(BgIknvDoukutu* this, PlayState* play) { void func_80BD71BC(BgIknvDoukutu* this, PlayState* play) { play->envCtx.lightSettingOverride = 24; - if (Cutscene_CheckActorAction(play, this->csAction) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action == 2)) { + if (Cutscene_IsCueInChannel(play, this->cueType) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 2)) { this->actionFunc = func_80BD716C; this->dyna.actor.draw = func_80BD7538; } @@ -135,8 +135,8 @@ void func_80BD7250(BgIknvDoukutu* this, PlayState* play) { } void func_80BD72BC(BgIknvDoukutu* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, this->csAction) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action == 3)) { + if (Cutscene_IsCueInChannel(play, this->cueType) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 3)) { this->actionFunc = func_80BD7250; } @@ -146,8 +146,8 @@ void func_80BD72BC(BgIknvDoukutu* this, PlayState* play) { } void func_80BD7360(BgIknvDoukutu* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, this->csAction) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action == 2)) { + if (Cutscene_IsCueInChannel(play, this->cueType) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 2)) { this->actionFunc = func_80BD72BC; } } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.h b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.h index f363938697..beeeb0b816 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.h +++ b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.h @@ -18,7 +18,7 @@ enum { typedef struct BgIknvDoukutu { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ s16 unk_15C; // set and not used - /* 0x15E */ u16 csAction; + /* 0x15E */ u16 cueType; /* 0x160 */ f32 unk_160; /* 0x164 */ BgIknvDoukutuActionFunc actionFunc; } BgIknvDoukutu;// size = 0x168 diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index 2651c52bc9..1419c34661 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -107,20 +107,20 @@ void BgIknvObj_Destroy(Actor* thisx, PlayState* play) { } s32 func_80BD7CEC(BgIknvObj* this) { - if (this->dyna.actor.cutscene == -1) { + if (this->dyna.actor.csId == CS_ID_NONE) { return true; } - if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) { return true; } - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); return true; } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); return false; } @@ -131,8 +131,8 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, PlayState* play) { func_800B9010(&this->dyna.actor, NA_SE_EV_WOOD_WATER_WHEEL - SFX_FLAG); } - if ((play->csCtx.state != 0) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 4) && - (play->csCtx.frames == 1495)) { + if ((play->csCtx.state != 0) && (gSaveContext.sceneLayer == 1) && (play->csCtx.scriptIndex == 4) && + (play->csCtx.curFrame == 1495)) { func_8019F128(NA_SE_EV_DOOR_UNLOCK); } } @@ -166,7 +166,7 @@ void func_80BD7F4C(BgIknvObj* this, PlayState* play) { this->actionFunc = func_80BD7ED8; } if ((this->dyna.actor.home.rot.x == 1) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_58_80)) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); this->dyna.actor.home.rot.x = 0; } CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 7ada76df80..502b29086e 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -126,7 +126,7 @@ s32 func_80953DA8(BgIngate* this, PlayState* play) { Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); if (CHECK_EVENTINF(EVENTINF_35)) { - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT); } else { SET_EVENTINF(EVENTINF_41); } @@ -169,7 +169,7 @@ void func_80953F14(BgIngate* this, PlayState* play) { if (this->timePath != NULL) { func_80953B40(this); } - this->unk16E = -1; + this->csId = CS_ID_NONE; this->actionFunc = func_80953F9C; } @@ -192,7 +192,7 @@ void func_80953F9C(BgIngate* this, PlayState* play) { if (this->timePath->unk1 != 0xFF) { func_80953E38(play); - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT); this->dyna.actor.textId = 0x9E4; Message_StartTextbox(play, this->dyna.actor.textId, NULL); this->unk16C += 1; @@ -206,13 +206,13 @@ void func_80953F9C(BgIngate* this, PlayState* play) { } this->actionFunc = func_809542A0; } - } else if ((ActorCutscene_GetCurrentIndex() == -1) && (this->timePath != NULL)) { + } else if ((CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && (this->timePath != NULL)) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CRUISER - SFX_FLAG); func_80953BEC(this); } } - if (ActorCutscene_GetCurrentIndex() != this->unk16E) { - if (ActorCutscene_GetCurrentIndex() != -1) { + if (CutsceneManager_GetCurrentCsId() != this->csId) { + if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) { Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0); player->stateFlags1 |= PLAYER_STATE1_20; play->actorCtx.flags &= ~ACTORCTX_FLAG_PICTO_BOX_ON; @@ -221,7 +221,7 @@ void func_80953F9C(BgIngate* this, PlayState* play) { player->stateFlags1 &= ~PLAYER_STATE1_20; } } - this->unk16E = ActorCutscene_GetCurrentIndex(); + this->csId = CutsceneManager_GetCurrentCsId(); } void func_809541B8(BgIngate* this, PlayState* play) { @@ -231,7 +231,7 @@ void func_809541B8(BgIngate* this, PlayState* play) { if ((player->transformation == PLAYER_FORM_HUMAN) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->dyna.actor.xzDistToPlayer < 40.0f)) { if (this->dyna.actor.playerHeightRel > 15.0f) { - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT); this->dyna.actor.textId = 0x9E6; Message_StartTextbox(play, this->dyna.actor.textId, NULL); this->actionFunc = func_809543D4; @@ -261,7 +261,7 @@ void func_809542A0(BgIngate* this, PlayState* play) { void func_80954340(BgIngate* this, PlayState* play) { if (!DECR(this->unk16A)) { if (this->timePath != NULL) { - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END); this->timePath = &play->setupPathList[this->timePath->unk1]; func_80953F14(this, play); Environment_StopTime(); @@ -280,7 +280,7 @@ void func_809543D4(BgIngate* this, PlayState* play) { break; case 0x9E5: if (play->msgCtx.choiceIndex == 0) { - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END); this->unk160 &= ~0x4; this->actionFunc = func_809541B8; Environment_StartTime(); @@ -301,7 +301,7 @@ void func_809543D4(BgIngate* this, PlayState* play) { CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_40); func_8019F208(); } else { - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END); this->unk160 &= ~0x4; this->actionFunc = func_809541B8; Environment_StartTime(); @@ -330,7 +330,7 @@ void BgIngate_Init(Actor* thisx, PlayState* play2) { Actor_SetScale(&this->dyna.actor, 1.0f); this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_FF(&this->dyna.actor), 0); this->dyna.actor.room = -1; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_40); } if (!CHECK_EVENTINF(EVENTINF_35) && CHECK_WEEKEVENTREG(WEEKEVENTREG_90_40)) { diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h index cc0befd194..6046fc31e4 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h @@ -17,7 +17,7 @@ typedef struct BgIngate { /* 0x168 */ s16 timePathTimeSpeed; /* 0x16A */ s16 unk16A; /* 0x16C */ s16 unk16C; - /* 0x16E */ s16 unk16E; + /* 0x16E */ s16 csId; /* 0x170 */ Vec3f timePathTargetPos; /* 0x17C */ f32 timePathProgress; /* 0x180 */ s32 timePathTotalTime; diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c index 77139783e7..a868b355ca 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c @@ -171,7 +171,7 @@ void BgKin2Bombwall_SetupWait(BgKin2Bombwall* this) { void BgKin2Bombwall_Wait(BgKin2Bombwall* this, PlayState* play) { if (BgKin2Bombwall_IsHitFromNearby(this, play)) { this->collider.base.acFlags &= ~AC_HIT; - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); BgKin2Bombwall_SetupPlayCutscene(this); } else { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); @@ -183,8 +183,8 @@ void BgKin2Bombwall_SetupPlayCutscene(BgKin2Bombwall* this) { } void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); Flags_SetSwitch(play, BG_KIN2_BOMBWALL_SWITCH_FLAG(&this->dyna.actor)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 60, NA_SE_EV_WALL_BROKEN); DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); @@ -193,7 +193,7 @@ void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, PlayState* play) { BgKin2Bombwall_SetupEndCutscene(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -205,7 +205,7 @@ void BgKin2Bombwall_SetupEndCutscene(BgKin2Bombwall* this) { void BgKin2Bombwall_EndCutscene(BgKin2Bombwall* this, PlayState* play) { this->timer--; if (this->timer <= 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c index 1550711e18..66ac026341 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c @@ -217,13 +217,13 @@ void BgKin2Fence_SetupPlayOpenCutscene(BgKin2Fence* this) { } void BgKin2Fence_PlayOpenCutscene(BgKin2Fence* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); Flags_SetSwitch(play, this->dyna.actor.params & 0x7F); BgKin2Fence_SetupWaitBeforeOpen(this); return; } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } void BgKin2Fence_SetupWaitBeforeOpen(BgKin2Fence* this) { diff --git a/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c b/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c index 2d7b61d0cf..7da9237bcd 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Picture/z_bg_kin2_picture.c @@ -202,7 +202,7 @@ void BgKin2Picture_Wait(BgKin2Picture* this, PlayState* play) { // hit by projectile if (this->colliderTris.base.acFlags & AC_HIT) { this->colliderTris.base.acFlags &= ~AC_HIT; - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); BgKin2Picture_SetupPlayCutscene(this); } else { // Gold Skulltula can be heard behind Skullkid's painting. if (this->skulltulaNoiseTimer >= 0) { @@ -227,12 +227,12 @@ void BgKin2Picture_SetupPlayCutscene(BgKin2Picture* this) { } void BgKin2Picture_PlayCutscene(BgKin2Picture* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->cutsceneStarted = true; BgKin2Picture_SetupShiver(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -314,7 +314,7 @@ void BgKin2Picture_Fall(BgKin2Picture* this, PlayState* play) { this->dyna.actor.shape.yOffset = 40.0f; if (this->cutsceneStarted) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } DynaPoly_EnableCollision(play, &play->colCtx.dyna, this->dyna.bgId); diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c index aacd9b0a71..208babf776 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -90,20 +90,20 @@ void BgLadder_Destroy(Actor* thisx, PlayState* play) { void BgLadder_Wait(BgLadder* this, PlayState* play) { // Wait for the flag to be set, then trigger the cutscene if (Flags_GetSwitch(play, this->switchFlag)) { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); this->action = BgLadder_StartCutscene; } } void BgLadder_StartCutscene(BgLadder* this, PlayState* play) { // Trigger the cutscene, then make the ladder fade in - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->dyna.actor.draw = BgLadder_Draw; Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SECRET_LADDER_APPEAR); this->action = BgLadder_FadeIn; } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -112,7 +112,7 @@ void BgLadder_FadeIn(BgLadder* this, PlayState* play) { this->alpha += 5; if (this->alpha >= 255) { this->alpha = 255; - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); DynaPoly_EnableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dyna.actor.flags &= ~ACTOR_FLAG_10; // always update = off this->action = BgLadder_DoNothing; diff --git a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c index 63a973d8b8..6085a93a2f 100644 --- a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c +++ b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c @@ -164,7 +164,7 @@ void BgLastBwall_Init(Actor* thisx, PlayState* play) { BgLastBwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, &this->colliderTris, D_80C18AC0[this->type]); - SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList)); func_80C187E4(this); } @@ -239,7 +239,7 @@ void func_80C1886C(BgLastBwall* this, PlayState* play) { } void func_80C18884(BgLastBwall* this, PlayState* play) { - if (SubS_StartActorCutscene(&this->dyna.actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->dyna.actor, this->csIdList[0], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { func_80C188C4(this, play); } } diff --git a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.h b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.h index 3fafc71ea5..e6d752c28f 100644 --- a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.h +++ b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.h @@ -22,7 +22,7 @@ typedef struct BgLastBwall { /* 0x160 */ ColliderTris colliderTris; /* 0x180 */ ColliderTrisElement colliderTrisElement[2]; /* 0x238 */ u8 type; - /* 0x23A */ s16 cutscenes[1]; + /* 0x23A */ s16 csIdList[1]; } BgLastBwall; // size = 0x23C #endif // Z_BG_LAST_BWALL_H diff --git a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c index 4e98620013..3a11a2fdfe 100644 --- a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c +++ b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c @@ -217,13 +217,13 @@ void BgNumaHana_SetupClosedIdle(BgNumaHana* this) { void BgNumaHana_ClosedIdle(BgNumaHana* this, PlayState* play) { if (this->fire.state != FIRE_STATE_NOT_LIT) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FLAME_IGNITION); - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); SET_WEEKEVENTREG(WEEKEVENTREG_12_01); Flags_SetSwitch(play, BG_NUMA_HANA_SWITCH_FLAG(&this->dyna.actor)); BgNumaHana_SetupUnfoldInnerPetals(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } } @@ -327,7 +327,7 @@ void BgNumaHana_RaiseFlower(BgNumaHana* this, PlayState* play) { this->flowerRotationalVelocity = 0x147; this->settleScale = 0.0f; - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); BgNumaHana_SetupOpenedIdle(this); } diff --git a/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c b/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c index 99950a4071..6acbc8aa8d 100644 --- a/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c +++ b/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c @@ -166,18 +166,18 @@ void func_80ACAEF0(BgOpenShutter* this, PlayState* play) { void BgOpenShutter_Update(Actor* thisx, PlayState* play2) { BgOpenShutter* this = THIS; PlayState* play = play2; - s32 index; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 0x7C)) { - index = Cutscene_GetActorActionIndex(play, 0x7C); - if (play->csCtx.actorActions[index]->action == BGOPENSHUTTER_DOOR_OPEN) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_124)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_124); + if (play->csCtx.actorCues[cueChannel]->id == BGOPENSHUTTER_DOOR_OPEN) { if (this->actionFunc == func_80ACAD88) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN); this->actionFunc = func_80ACAE5C; this->dyna.actor.velocity.y = 0.0f; } this->unk_164 = 0; - } else if (play->csCtx.actorActions[index]->action == BGOPENSHUTTER_DOOR_CLOSED) { + } else if (play->csCtx.actorCues[cueChannel]->id == BGOPENSHUTTER_DOOR_CLOSED) { if (this->actionFunc == func_80ACAE5C) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE); this->actionFunc = func_80ACAEF0; diff --git a/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c b/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c index dbe935b3fc..275b1b5659 100644 --- a/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c +++ b/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c @@ -47,13 +47,13 @@ void BgOpenSpot_Destroy(Actor* thisx, PlayState* play) { void BgOpenSpot_Update(Actor* thisx, PlayState* play) { BgOpenSpot* this = THIS; - u32 action; + u32 cueId; - if (Cutscene_CheckActorAction(play, 0x7D)) { - action = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x7D)]->action; - if (action == 1) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_125)) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_125)]->id; + if (cueId == 1) { this->actor.draw = NULL; - } else if (action == 2) { + } else if (cueId == 2) { this->actor.draw = BgOpenSpot_Draw; } } diff --git a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c index 41ecaa19e0..1b9e930093 100644 --- a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c +++ b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c @@ -45,7 +45,7 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) { Vec3f pos; s32 pad2; s32 shouldSpawnSeahorse; - s32 cs; + s32 csId; s32 i; DynaPolyActor_Init(&this->dyna, 0); @@ -54,11 +54,11 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) { Math_Vec3f_Copy(&pos, &this->dyna.actor.world.pos); pos.x += Math_SinS(this->dyna.actor.world.rot.y + 0x8000) * 3000.0f; pos.z += Math_CosS(this->dyna.actor.world.rot.y + 0x8000) * 3000.0f; - cs = this->dyna.actor.cutscene; + csId = this->dyna.actor.csId; i = 0; // clang-format off - while (cs != -1) { this->cutscenes[i] = cs; cs = ActorCutscene_GetAdditionalCutscene(cs); i++; } + while (csId != CS_ID_NONE) { this->csIdList[i] = csId; csId = CutsceneManager_GetAdditionalCsId(csId); i++; } // clang-format on this->dyna.actor.scale.x = 0.1f; @@ -74,9 +74,9 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) { if (this->deepPython != NULL) { EnDragon* dragon = (EnDragon*)this->deepPython; - dragon->grabCutsceneIndex = this->cutscenes[0]; - dragon->deathCutsceneIndex = this->cutscenes[1]; - dragon->actor.cutscene = this->dyna.actor.cutscene; + dragon->grabCsId = this->csIdList[0]; + dragon->deathCsId = this->csIdList[1]; + dragon->actor.csId = this->dyna.actor.csId; Math_Vec3f_Copy(&dragon->burrowEntrancePos, &this->dyna.actor.world.pos); dragon->pythonIndex = this->pythonIndex; } @@ -99,7 +99,7 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) { pos.z += (Math_CosS(this->dyna.actor.world.rot.y + 0x8000) * 500.0f); if (shouldSpawnSeahorse) { Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_OT, pos.x, pos.y, pos.z, 0, - this->dyna.actor.shape.rot.y, 0, 0x4000, this->dyna.actor.cutscene, + this->dyna.actor.shape.rot.y, 0, 0x4000, this->dyna.actor.csId, this->dyna.actor.halfDaysBits, NULL); } diff --git a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.h b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.h index abb341797b..96c771c627 100644 --- a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.h +++ b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.h @@ -12,7 +12,7 @@ typedef struct BgSinkaiKabe { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ BgSinkaiKabeActionFunc actionFunc; /* 0x160 */ Actor* deepPython; - /* 0x164 */ s16 cutscenes[2]; + /* 0x164 */ s16 csIdList[2]; /* 0x168 */ UNK_TYPE1 unk_168[0x4]; /* 0x16C */ s32 pythonIndex; } BgSinkaiKabe; // size = 0x170 diff --git a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c index 4bc3c87afc..0ebae5c1eb 100644 --- a/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c +++ b/src/overlays/actors/ovl_Bg_Spdweb/z_bg_spdweb.c @@ -229,7 +229,7 @@ void func_809CE234(BgSpdweb* this, PlayState* play) { } if (this->unk_162 == 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Actor_Kill(&this->dyna.actor); return; } @@ -369,8 +369,8 @@ void func_809CE830(BgSpdweb* this, PlayState* play) { } if (this->unk_162 == 0) { - if (ActorCutscene_GetLength(this->dyna.actor.cutscene) == -1) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + if (CutsceneManager_GetLength(this->dyna.actor.csId) == -1) { + CutsceneManager_Stop(this->dyna.actor.csId); } Actor_Kill(&this->dyna.actor); return; @@ -470,16 +470,16 @@ void func_809CEBC0(BgSpdweb* this, PlayState* play) { } void func_809CEE74(BgSpdweb* this) { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); this->actionFunc = func_809CEEAC; } void func_809CEEAC(BgSpdweb* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); func_809CE1D0(this, play); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index 683bf322e1..d4d2c7274f 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -47,24 +47,24 @@ void func_80919F30(BgUmajump* this, PlayState* play) { } void BgUmajump_StopCutscene(BgUmajump* this, PlayState* play) { - if ((play->csCtx.frames >= 6) && !this->hasSoundPlayed) { + if ((play->csCtx.curFrame >= 6) && !this->hasSoundPlayed) { this->hasSoundPlayed = true; play_sound(NA_SE_EV_KID_HORSE_NEIGH); } - if (play->csCtx.state == CS_STATE_0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + if (play->csCtx.state == CS_STATE_IDLE) { + CutsceneManager_Stop(this->dyna.actor.csId); this->dyna.actor.update = Actor_Noop; } } void BgUmajump_PlayCutscene(BgUmajump* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); SET_WEEKEVENTREG(WEEKEVENTREG_89_20); this->actionFunc = BgUmajump_StopCutscene; } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -95,7 +95,7 @@ void BgUmajump_Init(Actor* thisx, PlayState* play) { if ((thisx->params == BG_UMAJUMP_TYPE_2)) { if ((((play->sceneId == SCENE_F01) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_89_20)) && !CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) && - (thisx->cutscene != -1)) { + (thisx->csId != CS_ID_NONE)) { this->actionFunc = BgUmajump_CheckDistance; thisx->update = func_8091A5A0; thisx->flags |= ACTOR_FLAG_10; diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 1454fefa39..eae9fe0b3e 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -550,7 +550,7 @@ void Boss02_Init(Actor* thisx, PlayState* play) { s32 i; s32 pad[2]; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) && (this->actor.params == TWINMOLD_RED)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) && (this->actor.params == TWINMOLD_RED)) { sBlueWarp = (DoorWarp1*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, 60.0f, 0.0f, 0, 0, 0, 1); Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 0.0f, 30.0f, -150.0f, 0, 1, 0, 0); @@ -1631,7 +1631,7 @@ void func_809DD934(Boss02* this, PlayState* play) { switch (this->unk_1D18) { case 0: if (player->stateFlags1 & PLAYER_STATE1_100) { - Cutscene_Start(play, &play->csCtx); + Cutscene_StartManual(play, &play->csCtx); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); @@ -1751,7 +1751,7 @@ void func_809DD934(Boss02* this, PlayState* play) { this->unk_1D18 = 0; func_80169AFC(play, this->subCamId, 0); this->subCamId = SUB_CAM_ID_DONE; - Cutscene_End(play, &play->csCtx); + Cutscene_StopManual(play, &play->csCtx); this->actor.flags |= ACTOR_FLAG_1; player->stateFlags1 &= ~PLAYER_STATE1_100; this->unk_1D70 = 0.01f; @@ -2050,10 +2050,11 @@ void func_809DEAC4(Boss02* this, PlayState* play) { break; case 1: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) || ((u32)(KREG(13) + 15) >= this->unk_1D1C)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) || + ((u32)(KREG(13) + 15) >= this->unk_1D1C)) { break; } - Cutscene_Start(play, &play->csCtx); + Cutscene_StartManual(play, &play->csCtx); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); @@ -2138,8 +2139,8 @@ void func_809DEAC4(Boss02* this, PlayState* play) { if (this->unk_1D1C == (u32)(BREG(27) + 335)) { func_80169AFC(play, this->subCamId, 0); this->subCamId = SUB_CAM_ID_DONE; - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); this->actor.flags |= ACTOR_FLAG_1; this->unk_1D20 = 0; sRedTwinmold->unk_0144 = sBlueTwinmold->unk_0144 = 3; @@ -2149,8 +2150,8 @@ void func_809DEAC4(Boss02* this, PlayState* play) { break; case 100: - if (ActorCutscene_GetCurrentIndex() == -1) { - Cutscene_Start(play, &play->csCtx); + if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) { + Cutscene_StartManual(play, &play->csCtx); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); @@ -2199,8 +2200,8 @@ void func_809DEAC4(Boss02* this, PlayState* play) { if (this->unk_1D1C == 30) { func_80169AFC(play, this->subCamId, 0); this->subCamId = SUB_CAM_ID_DONE; - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); this->unk_1D20 = 0; this->actor.flags |= ACTOR_FLAG_1; sp68->unk_0144 = 10; diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c index 506f8a1fa0..c4c38982ea 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -48,8 +48,6 @@ * - Effect Update/Draw * - Seaweed */ - -#include "prevent_bss_reordering.h" #include "z_boss_03.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h" @@ -450,7 +448,7 @@ void Boss03_Init(Actor* thisx, PlayState* play2) { PlayState* play = play2; Vec3f sp70; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, PLATFORM_HEIGHT, 200.0f, 0, 0, 0, ENDOORWARP1_FF_1); Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 0.0f, PLATFORM_HEIGHT, 0.0f, 0, 0, 0, 0); @@ -1147,8 +1145,8 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { switch (this->csState) { case 0: if (player->actor.world.pos.y < 1350.0f) { - Cutscene_Start(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + Cutscene_StartManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); @@ -1369,8 +1367,8 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { mainCam->at = this->subCamAt; func_80169AFC(play, this->subCamId, 0); - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); this->subCamId = SUB_CAM_ID_DONE; func_809E344C(this, play); @@ -1446,8 +1444,8 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) { switch (this->csState) { case 0: - if (ActorCutscene_GetCurrentIndex() == -1) { - Cutscene_Start(play, &play->csCtx); + if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) { + Cutscene_StartManual(play, &play->csCtx); func_800B7298(play, &this->actor, PLAYER_CSMODE_1); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); @@ -1628,8 +1626,8 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) { mainCam->at = this->subCamAt; func_80169AFC(play, this->subCamId, 0); this->subCamId = SUB_CAM_ID_DONE; - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); this->csState = 3; Play_DisableMotionBlur(); Boss03_PlayUnderwaterSfx(&this->actor.projectedPos, NA_SE_EN_KONB_INIT_OLD); @@ -1661,8 +1659,8 @@ void Boss03_SpawnSmallFishesCutscene(Boss03* this, PlayState* play) { this->csTimer++; switch (this->csState) { case 0: - if (ActorCutscene_GetCurrentIndex() == -1) { - Cutscene_Start(play, &play->csCtx); + if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) { + Cutscene_StartManual(play, &play->csCtx); func_800B7298(play, &this->actor, PLAYER_CSMODE_1); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); @@ -1723,8 +1721,8 @@ void Boss03_SpawnSmallFishesCutscene(Boss03* this, PlayState* play) { func_80169AFC(play, this->subCamId, 0); this->subCamId = SUB_CAM_ID_DONE; - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); func_809E344C(this, play); this->workTimer[WORK_TIMER_UNK1_A] = 50; diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c index 6a6bc0c1de..a39b101431 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -254,16 +254,16 @@ void func_809EC568(Boss04* this, PlayState* play) { this->unk_2D0 = 2000.0f; if ((player->stateFlags1 & PLAYER_STATE1_100000) && (this->actor.projectedPos.z > 0.0f) && (fabsf(this->actor.projectedPos.x) < 300.0f) && (fabsf(this->actor.projectedPos.y) < 300.0f)) { - if ((this->unk_704 >= 15) && (ActorCutscene_GetCurrentIndex() == -1)) { + if ((this->unk_704 >= 15) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE)) { Actor* boss; this->unk_708 = 10; this->unk_704 = 0; - Cutscene_Start(play, &play->csCtx); + Cutscene_StartManual(play, &play->csCtx); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); player->actor.world.pos.x = this->unk_6E8; player->actor.world.pos.z = this->unk_6F0 + 410.0f; player->actor.shape.rot.y = 0x7FFF; @@ -389,8 +389,8 @@ void func_809EC568(Boss04* this, PlayState* play) { mainCam->at = this->subCamAt; func_80169AFC(play, this->subCamId, 0); this->subCamId = SUB_CAM_ID_DONE; - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); Play_DisableMotionBlur(); SET_EVENTINF(EVENTINF_60); } diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c index 13908ec4d3..3d8beb79dc 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -195,12 +195,12 @@ void func_809F24C8(Boss06* this, PlayState* play) { switch (this->unk_1C9) { case 0: - if (ActorCutscene_GetCurrentIndex() != -1) { + if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) { break; } - Cutscene_Start(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + Cutscene_StartManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); @@ -332,8 +332,8 @@ void func_809F24C8(Boss06* this, PlayState* play) { func_809F2ED0(this, play); func_80169AFC(play, this->subCamId, 0); this->subCamId = SUB_CAM_ID_DONE; - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); D_809F4970->unk_151 = 0; } break; diff --git a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c index aa37e7b855..6882c189a2 100644 --- a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c +++ b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c @@ -34,7 +34,7 @@ static s16 sObjectBankIndices[] = { OBJECT_GI_MASK14, OBJECT_GI_SWORD_4 }; static s16 sGetItemDraws[] = { GID_MASK_GREAT_FAIRY, GID_SWORD_GREAT_FAIRY }; -static u16 sCsActionIndices[] = { 0x6E, 0x236 }; +static u16 sCueTypes[] = { CS_CMD_ACTOR_CUE_110, CS_CMD_ACTOR_CUE_566 }; void DemoGetitem_Init(Actor* thisx, PlayState* play) { s32 pad; @@ -49,7 +49,7 @@ void DemoGetitem_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.25f); this->actionFunc = func_80A4FB10; this->item = sGetItemDraws[itemIndex]; - this->csAction = sCsActionIndices[itemIndex]; + this->cueType = sCueTypes[itemIndex]; objectIndex = Object_GetIndex(&play->objectCtx, sObjectBankIndices[itemIndex]); if (objectIndex < 0) { Actor_Kill(&this->actor); @@ -74,14 +74,14 @@ void func_80A4FB68(DemoGetitem* this, PlayState* play2) { PlayState* play = play2; u16 sp22 = (play->gameplayFrames * 1000) & 0xFFFF; - if (Cutscene_CheckActorAction(play, this->csAction)) { - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action != 4) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id != 4) { this->actor.shape.yOffset = 0.0f; } - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) { case 2: this->actor.draw = DemoGetitem_Draw; - Cutscene_ActorTranslate(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction)); + Cutscene_ActorTranslate(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); this->actor.shape.rot.y += 0x3E8; break; @@ -91,7 +91,7 @@ void func_80A4FB68(DemoGetitem* this, PlayState* play2) { case 4: this->actor.draw = DemoGetitem_Draw; - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction)); + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); this->actor.shape.yOffset = Math_SinS(sp22) * 15.0f; break; diff --git a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.h b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.h index 91c7dc97e9..ca00f60484 100644 --- a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.h +++ b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.h @@ -12,7 +12,7 @@ typedef void (*DemoGetitemActionFunc)(struct DemoGetitem*, PlayState*); typedef struct DemoGetitem { /* 0x000 */ Actor actor; /* 0x144 */ s16 item; - /* 0x146 */ u16 csAction; + /* 0x146 */ u16 cueType; /* 0x148 */ s8 objectIndex; /* 0x14C */ DemoGetitemActionFunc actionFunc; } DemoGetitem; // size = 0x150 diff --git a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c index b1d5c71282..111ce284fb 100644 --- a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c +++ b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c @@ -68,7 +68,7 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) { this->unk_3E6 = 0; this->unk_3DC = NULL; this->unk_3E0 = NULL; - this->unk_3F2 = 0; + this->cueId = 0; this->unk_3D8 = 1.0f; switch (DEMOSYOTEN_GET_F(&this->actor)) { @@ -81,7 +81,7 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) { this->actor.child = Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EFF_DUST, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 0); - this->unk_3F0 = 0x215; + this->cueType = CS_CMD_ACTOR_CUE_533; Actor_SetScale(&this->actor, 0.05f); break; @@ -91,14 +91,14 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) { this->unk_3E0 = Lib_SegmentedToVirtual(&object_syoten_Matanimheader_001448); this->unk_3E4 |= 1; this->actionFunc = func_80C16BD4; - this->unk_3F0 = 0x215; + this->cueType = CS_CMD_ACTOR_CUE_533; Actor_SetScale(&this->actor, 0.05f); break; case DEMOSYOTEN_F_2: this->unk_3DC = object_syoten_DL_001730; this->unk_3E0 = Lib_SegmentedToVirtual(&object_syoten_Matanimheader_0018B8); - this->unk_3F0 = 0x216; + this->cueType = CS_CMD_ACTOR_CUE_534; this->actionFunc = func_80C16DD4; this->unk_3E4 |= 2; Actor_SetScale(&this->actor, 4.0f); @@ -107,7 +107,7 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) { case DEMOSYOTEN_F_3: this->unk_3DC = object_syoten_DL_001DD0; this->unk_3E0 = Lib_SegmentedToVirtual(&object_syoten_Matanimheader_002B98); - this->unk_3F0 = 0x218; + this->cueType = CS_CMD_ACTOR_CUE_536; this->unk_3E4 |= 8; this->actionFunc = func_80C16EAC; Actor_SetScale(&this->actor, 0.5f); @@ -118,7 +118,7 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) { this->unk_3E0 = Lib_SegmentedToVirtual(&object_syoten_Matanimheader_002B88); this->unk_3E4 |= 2; this->actionFunc = func_80C17008; - this->unk_3F0 = 0x217; + this->cueType = CS_CMD_ACTOR_CUE_535; this->unk_3E4 |= 1; this->unk_3E4 |= 8; this->actor.draw = func_80C17690; @@ -219,20 +219,20 @@ void func_80C16A64(DemoSyoten* this, PlayState* play) { } void func_80C16A74(DemoSyoten* this, PlayState* play) { - u16 temp_a0; + u16 cueId; func_80183DE0(&this->unk_144); - if (Cutscene_CheckActorAction(play, this->unk_3F0)) { - if ((play->csCtx.frames >= 160) && (play->csCtx.frames < 322)) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + if ((play->csCtx.curFrame >= 160) && (play->csCtx.curFrame < 322)) { func_800B9010(&this->actor, NA_SE_EV_IKANA_SOUL_LV - SFX_FLAG); - } else if (play->csCtx.frames == 322) { + } else if (play->csCtx.curFrame == 322) { Actor_PlaySfx(&this->actor, NA_SE_EV_IKANA_SOUL_TRANSFORM); } - temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action; - if (this->unk_3F2 != temp_a0) { - this->unk_3F2 = temp_a0; - switch (temp_a0) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + if (this->cueId != cueId) { + this->cueId = cueId; + switch (cueId) { case 1: this->actor.draw = NULL; break; @@ -251,7 +251,7 @@ void func_80C16A74(DemoSyoten* this, PlayState* play) { } } - if (temp_a0 == 3) { + if (cueId == 3) { if (this->unk_3D8 > 0.0125f) { this->unk_3D8 -= 0.0125f; if (this->actor.child != NULL) { @@ -271,13 +271,13 @@ void func_80C16A74(DemoSyoten* this, PlayState* play) { void func_80C16BD4(DemoSyoten* this, PlayState* play) { s32 pad; - u16 temp_a0; + u16 cueId; - if (Cutscene_CheckActorAction(play, this->unk_3F0)) { - temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action; - if (this->unk_3F2 != temp_a0) { - this->unk_3F2 = temp_a0; - switch (temp_a0) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + if (this->cueId != cueId) { + this->cueId = cueId; + switch (cueId) { default: this->actor.draw = NULL; break; @@ -304,7 +304,7 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) { } } - switch (temp_a0) { + switch (cueId) { case 3: if (this->actor.scale.x < 0.05f) { this->actor.scale.x += 0.000625f; @@ -314,7 +314,7 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) { case 4: this->actor.speed = - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->urot.z * 0.005493164f; + play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->rot.z * 0.005493164f; if (this->unk_3EC < this->unk_3E8->count) { if (func_80C16818(this)) { this->unk_3EC++; @@ -330,13 +330,13 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) { void func_80C16DD4(DemoSyoten* this, PlayState* play) { s32 pad; - u16 temp_a0; + u16 cueId; - if (Cutscene_CheckActorAction(play, this->unk_3F0)) { - temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action; - if (this->unk_3F2 != temp_a0) { - this->unk_3F2 = temp_a0; - switch (temp_a0) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + if (this->cueId != cueId) { + this->cueId = cueId; + switch (cueId) { case 1: this->actor.draw = NULL; break; @@ -349,7 +349,7 @@ void func_80C16DD4(DemoSyoten* this, PlayState* play) { } } - if ((temp_a0 == 2) && (this->unk_3E6 < 40)) { + if ((cueId == 2) && (this->unk_3E6 < 40)) { this->unk_3E6++; } } else { @@ -359,13 +359,13 @@ void func_80C16DD4(DemoSyoten* this, PlayState* play) { void func_80C16EAC(DemoSyoten* this, PlayState* play) { s32 pad; - u16 temp_a0; + u16 cueId; - if (Cutscene_CheckActorAction(play, this->unk_3F0)) { - temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action; - if (this->unk_3F2 != temp_a0) { - this->unk_3F2 = temp_a0; - switch (temp_a0) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + if (this->cueId != cueId) { + this->cueId = cueId; + switch (cueId) { case 1: this->actor.draw = NULL; this->unk_3D8 = 0.0f; @@ -378,7 +378,7 @@ void func_80C16EAC(DemoSyoten* this, PlayState* play) { } } - if (temp_a0 == 2) { + if (cueId == 2) { if (this->actor.scale.x < 8.0f) { this->actor.scale.x += 0.1875f; } @@ -401,13 +401,13 @@ void func_80C16EAC(DemoSyoten* this, PlayState* play) { } void func_80C17008(DemoSyoten* this, PlayState* play) { - u16 temp_a0; + u16 cueId; - if (Cutscene_CheckActorAction(play, this->unk_3F0)) { - temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action; - if (this->unk_3F2 != temp_a0) { - this->unk_3F2 = temp_a0; - switch (temp_a0) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + if (this->cueId != cueId) { + this->cueId = cueId; + switch (cueId) { case 1: this->actor.draw = NULL; break; @@ -419,7 +419,7 @@ void func_80C17008(DemoSyoten* this, PlayState* play) { } } - if ((temp_a0 == 2) && (this->unk_3E6 < 15)) { + if ((cueId == 2) && (this->unk_3E6 < 15)) { this->unk_3E6++; } } else { diff --git a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.h b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.h index 7b60ae951e..1997a2bc53 100644 --- a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.h +++ b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.h @@ -32,8 +32,8 @@ typedef struct DemoSyoten { /* 0x3E6 */ s16 unk_3E6; /* 0x3E8 */ Path* unk_3E8; /* 0x3EC */ s32 unk_3EC; - /* 0x3F0 */ u16 unk_3F0; - /* 0x3F2 */ u16 unk_3F2; + /* 0x3F0 */ u16 cueType; + /* 0x3F2 */ u16 cueId; /* 0x3F4 */ DemoSyotenActionFunc actionFunc; } DemoSyoten; // size = 0x3F8 diff --git a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c index ccf41077d9..b640b9ba46 100644 --- a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c +++ b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c @@ -124,23 +124,23 @@ Actor* func_80C1D78C(PlayState* play) { void func_80C1D7FC(DmAh* this, PlayState* play) { s32 D_80C1DE00[] = { 0, 0, 0, 0, 0 }; - u16 csAction; - s32 actionIndex; + u16 cueId; + s32 cueChannel; if (play->csCtx.state != 0) { if (!this->unk_29C) { - this->action = 0xFF; + this->cueId = 255; this->unk_29C = true; this->animationIndex2 = this->animationIndex; } - if (Cutscene_CheckActorAction(play, 0x232)) { - actionIndex = Cutscene_GetActorActionIndex(play, 0x232); - csAction = play->csCtx.actorActions[actionIndex]->action; - if (this->action != (u8)csAction) { - this->action = csAction; - func_80C1D410(this, D_80C1DE00[csAction]); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_562)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_562); + cueId = play->csCtx.actorCues[cueChannel]->id; + if (this->cueId != (u8)cueId) { + this->cueId = cueId; + func_80C1D410(this, D_80C1DE00[cueId]); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } else if (this->unk_29C) { this->unk_29C = false; diff --git a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.h b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.h index df179c6f6e..b1e16f6e0e 100644 --- a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.h +++ b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.h @@ -19,7 +19,7 @@ typedef struct DmAh { /* 0x1B0 */ Vec3s morphTable[OBJECT_AH_LIMB_MAX]; /* 0x216 */ Vec3s jointTable[OBJECT_AH_LIMB_MAX]; /* 0x27C */ u16 unk_27C; - /* 0x27E */ u8 action; + /* 0x27E */ u8 cueId; /* 0x280 */ Actor* unk_280; /* 0x284 */ s16 unk_284; /* 0x286 */ s16 unk_286; diff --git a/src/overlays/actors/ovl_Dm_Al/z_dm_al.c b/src/overlays/actors/ovl_Dm_Al/z_dm_al.c index 2d1e58678e..d624f85ca0 100644 --- a/src/overlays/actors/ovl_Dm_Al/z_dm_al.c +++ b/src/overlays/actors/ovl_Dm_Al/z_dm_al.c @@ -48,23 +48,23 @@ s32 DmAl_ChangeAnim(DmAl* this, s32 animIndex) { void func_80C1BDD8(DmAl* this, PlayState* play) { s32 D_80C1C280[] = { 0, 0, 0, 0, 0 }; - u16 csAction; - s32 actionIndex; + u16 cueId; + s32 cueChannel; if (play->csCtx.state != 0) { if (!this->unk_45C) { - this->action = 0xFF; + this->cueId = 255; this->unk_45C = true; this->animIndex2 = this->animIndex; } - if (Cutscene_CheckActorAction(play, 0x232)) { - actionIndex = Cutscene_GetActorActionIndex(play, 0x232); - csAction = play->csCtx.actorActions[actionIndex]->action; - if (this->action != (u8)csAction) { - this->action = csAction; - DmAl_ChangeAnim(this, D_80C1C280[csAction]); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_562)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_562); + cueId = play->csCtx.actorCues[cueChannel]->id; + if (this->cueId != (u8)cueId) { + this->cueId = cueId; + DmAl_ChangeAnim(this, D_80C1C280[cueId]); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } else if (this->unk_45C) { this->unk_45C = false; diff --git a/src/overlays/actors/ovl_Dm_Al/z_dm_al.h b/src/overlays/actors/ovl_Dm_Al/z_dm_al.h index 57e462de15..4114b9f9c6 100644 --- a/src/overlays/actors/ovl_Dm_Al/z_dm_al.h +++ b/src/overlays/actors/ovl_Dm_Al/z_dm_al.h @@ -15,7 +15,7 @@ typedef struct DmAl { /* 0x18C */ MtxF shawlMatrices[6]; /* 0x30C */ Vec3s jointTable[MADAME_AROMA_LIMB_MAX]; /* 0x3AE */ Vec3s morphTable[MADAME_AROMA_LIMB_MAX]; - /* 0x450 */ u8 action; + /* 0x450 */ u8 cueId; /* 0x454 */ s32 animIndex; /* 0x458 */ s32 animIndex2; /* 0x45C */ s32 unk_45C; diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.c b/src/overlays/actors/ovl_Dm_An/z_dm_an.c index 555a04cc51..a9276d13b8 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.c +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.c @@ -195,28 +195,28 @@ void func_80C1C958(DmAn* this, PlayState* play) { void func_80C1CAB0(DmAn* this, PlayState* play) { s32 sp28[] = { 0, 0, 12, 2, 4, 6, 8, 10, 11, 3 }; - u16 action; - s32 sp20; + u16 cueId; + s32 cueChannel; if (play->csCtx.state != 0) { if (this->unk_2D0 == 0) { - this->unk_2B0 = 255; + this->cueId = 255; this->unk_2D0 = 1; this->unk_2D4 = 0; this->unk_2CC = this->unk_2C8; } - if (Cutscene_CheckActorAction(play, 0x22D)) { - sp20 = Cutscene_GetActorActionIndex(play, 0x22D); - action = play->csCtx.actorActions[sp20]->action; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_557)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_557); + cueId = play->csCtx.actorCues[cueChannel]->id; - if (this->unk_2B0 != (action & 0xFF)) { - this->unk_2B0 = action; + if (this->cueId != (u8)cueId) { + this->cueId = cueId; this->unk_2D4 = 1; - func_80C1C4D8(this, play, sp28[action]); + func_80C1C4D8(this, play, sp28[cueId]); } - switch (this->unk_2B0) { + switch (this->cueId) { case 2: case 4: case 5: @@ -230,7 +230,7 @@ void func_80C1CAB0(DmAn* this, PlayState* play) { } break; } - Cutscene_ActorTranslateAndYaw(&this->actor, play, sp20); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } else if (this->unk_2D0 != 0) { this->unk_2D0 = 0; diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.h b/src/overlays/actors/ovl_Dm_An/z_dm_an.h index 2001a8ba6f..6908e9342e 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.h +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.h @@ -21,7 +21,7 @@ typedef struct DmAn { /* 0x2AC */ s8 unk_2AC; /* 0x2AD */ s8 unk_2AD; /* 0x2AE */ u16 unk_2AE; - /* 0x2B0 */ u8 unk_2B0; + /* 0x2B0 */ u8 cueId; /* 0x2B4 */ Actor* unk_2B4; /* 0x2B8 */ s16 unk_2B8; /* 0x2BA */ s16 unk_2BA; diff --git a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c index cfd8044108..9e5ffed89e 100644 --- a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c +++ b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c @@ -74,15 +74,15 @@ void DmBal_DoNothing(DmBal* this, PlayState* play) { } void func_80C1EAE8(DmBal* this, PlayState* play) { - static u16 D_80C1F2C0 = 0x63; - s32 actionIndex; + static u16 sCueId = 99; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 0x238)) { - actionIndex = Cutscene_GetActorActionIndex(play, 0x238); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_568)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_568); - if (D_80C1F2C0 != play->csCtx.actorActions[actionIndex]->action) { - D_80C1F2C0 = play->csCtx.actorActions[actionIndex]->action; - switch (play->csCtx.actorActions[actionIndex]->action) { + if (sCueId != play->csCtx.actorCues[cueChannel]->id) { + sCueId = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->keepEyesShut = false; this->eyeIndex = 0; @@ -96,7 +96,7 @@ void func_80C1EAE8(DmBal* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 13); break; } - } else if (D_80C1F2C0 == 3) { + } else if (sCueId == 3) { if (Animation_OnFrame(&this->skelAnime, 0.0f)) { this->keepEyesShut = true; } else if (Animation_OnFrame(&this->skelAnime, 29.0f)) { @@ -104,12 +104,12 @@ void func_80C1EAE8(DmBal* this, PlayState* play) { this->eyeIndex = 0; } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); this->actor.home.pos = this->actor.world.pos; } else { this->keepEyesShut = false; this->eyeIndex = 0; - D_80C1F2C0 = 0x63; + sCueId = 99; } } diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c index 997004fea7..210f2ad373 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c @@ -150,7 +150,7 @@ void func_80AA5580(SkelAnime* skelAnime, AnimationInfo* animation, u16 idx) { void func_80AA561C(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames + 20) { + switch (play->csCtx.curFrame + 20) { case 503: case 926: case 979: @@ -169,7 +169,7 @@ void func_80AA561C(DmChar00* this, PlayState* play) { break; } } else { - switch (play->csCtx.frames + 20) { + switch (play->csCtx.curFrame + 20) { case 503: case 926: case 979: @@ -188,14 +188,14 @@ void func_80AA561C(DmChar00* this, PlayState* play) { } void func_80AA5720(DmChar00* this, PlayState* play) { - if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.frames == 505)) { + if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.curFrame == 505)) { Actor_PlaySfx(&this->actor, NA_SE_EV_SPOT_LIGHT_OPEN); } } void func_80AA575C(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 474: case 489: case 495: @@ -227,24 +227,24 @@ void func_80AA575C(DmChar00* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_BRAKE); break; } - } else if (play->csCtx.frames == 660) { + } else if (play->csCtx.curFrame == 660) { Actor_PlaySfx(&this->actor, NA_SE_EV_MONDO_SURPRISE); } } void func_80AA5890(DmChar00* this, PlayState* play) { - if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.frames == 20)) { + if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.curFrame == 20)) { Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } } void func_80AA58CC(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - if (play->csCtx.frames == 568) { + if (play->csCtx.curFrame == 568) { Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); } } else { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 375: case 479: Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); @@ -262,11 +262,11 @@ void func_80AA5950(DmChar00* this, PlayState* play) { void func_80AA5960(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - if (play->csCtx.frames == 280) { + if (play->csCtx.curFrame == 280) { Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); } } else { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 87: case 190: Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); @@ -281,7 +281,7 @@ void func_80AA5960(DmChar00* this, PlayState* play) { void func_80AA59E4(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 125: Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; @@ -291,14 +291,14 @@ void func_80AA59E4(DmChar00* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON); break; } - } else if (play->csCtx.frames == 125) { + } else if (play->csCtx.curFrame == 125) { Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); } } void func_80AA5A6C(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 44: Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; @@ -308,14 +308,14 @@ void func_80AA5A6C(DmChar00* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON); break; } - } else if (play->csCtx.frames == 44) { + } else if (play->csCtx.curFrame == 44) { Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); } } void func_80AA5AF4(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 352: case 401: Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); @@ -330,7 +330,7 @@ void func_80AA5AF4(DmChar00* this, PlayState* play) { break; } } else { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 362: case 401: Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); @@ -341,7 +341,7 @@ void func_80AA5AF4(DmChar00* this, PlayState* play) { break; } - if ((play->csCtx.frames >= 500) && (play->csCtx.frames < 602)) { + if ((play->csCtx.curFrame >= 500) && (play->csCtx.curFrame < 602)) { Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SHIVER - SFX_FLAG); } } @@ -349,7 +349,7 @@ void func_80AA5AF4(DmChar00* this, PlayState* play) { void func_80AA5BF8(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 762: Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_SHOT_DASH); break; @@ -358,7 +358,7 @@ void func_80AA5BF8(DmChar00* this, PlayState* play) { break; } } else { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 762: Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_SHOT_DASH); break; @@ -375,14 +375,14 @@ void func_80AA5BF8(DmChar00* this, PlayState* play) { } void func_80AA5CD4(DmChar00* this, PlayState* play) { - if ((DMCHAR00_GET(&this->actor) != DMCHAR00_0) && (play->csCtx.frames == 467)) { + if ((DMCHAR00_GET(&this->actor) != DMCHAR00_0) && (play->csCtx.curFrame == 467)) { Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH); } } void func_80AA5D10(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 8: Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE); break; @@ -396,7 +396,7 @@ void func_80AA5D10(DmChar00* this, PlayState* play) { void func_80AA5D6C(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 2: case 166: Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); @@ -411,7 +411,7 @@ void func_80AA5D6C(DmChar00* this, PlayState* play) { void func_80AA5DC8(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 233: case 415: case 593: @@ -427,7 +427,7 @@ void func_80AA5DC8(DmChar00* this, PlayState* play) { void func_80AA5E2C(DmChar00* this, PlayState* play) { if (DMCHAR00_GET(&this->actor) == DMCHAR00_1) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 32: Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); break; @@ -458,11 +458,11 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) { case SCENE_OPENINGDAN: if (gSaveContext.sceneLayer == 0) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { func_80AA5720(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { func_80AA575C(this, play); - } else if (play->csCtx.currentCsIndex == 2) { + } else if (play->csCtx.scriptIndex == 2) { func_80AA5890(this, play); } } @@ -470,17 +470,17 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) { case SCENE_OKUJOU: if (gSaveContext.sceneLayer == 0) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { func_80AA58CC(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { func_80AA5950(this, play); - } else if (play->csCtx.currentCsIndex == 2) { + } else if (play->csCtx.scriptIndex == 2) { func_80AA5960(this, play); } } else if (gSaveContext.sceneLayer == 2) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { func_80AA59E4(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { func_80AA5A6C(this, play); } } @@ -488,34 +488,34 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) { case SCENE_00KEIKOKU: if (gSaveContext.sceneLayer == 3) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { func_80AA5AF4(this, play); - } else if (play->csCtx.currentCsIndex == 2) { + } else if (play->csCtx.scriptIndex == 2) { func_80AA5E2C(this, play); } } else if (gSaveContext.sceneLayer == 7) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { func_80AA5BF8(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { func_80AA5CD4(this, play); } } break; case SCENE_MITURIN: - if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 1)) { + if ((gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 1)) { func_80AA5DC8(this, play); } break; case SCENE_INSIDETOWER: - if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0)) { + if ((gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 0)) { func_80AA5D10(this, play); } break; case SCENE_PIRATE: - if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0)) { + if ((gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 0)) { func_80AA5D6C(this, play); } break; @@ -535,7 +535,7 @@ void DmChar00_Init(Actor* thisx, PlayState* play) { this->unk_250 = D_80AA77D8[DMCHAR00_GET(thisx)]; thisx->targetArrowOffset = 3000.0f; - this->unk_260 = 99; + this->cueId = 99; this->unk_262 = DMCHAR00_GET_F800(thisx); ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 24.0f); @@ -551,18 +551,18 @@ void DmChar00_Destroy(Actor* thisx, PlayState* play) { } void func_80AA62FC(DmChar00* this, PlayState* play) { - u16 sp26 = DMCHAR00_GET(&this->actor) + 113; - s32 temp_v0; + u16 cueType = CS_CMD_ACTOR_CUE_113 + DMCHAR00_GET(&this->actor); + s32 cueChannel; s32 pad; - if (Cutscene_CheckActorAction(play, sp26)) { - temp_v0 = Cutscene_GetActorActionIndex(play, sp26); + if (Cutscene_IsCueInChannel(play, cueType)) { + cueChannel = Cutscene_GetCueChannel(play, cueType); - if (play->csCtx.frames == play->csCtx.actorActions[temp_v0]->startFrame) { - if (this->unk_260 != play->csCtx.actorActions[temp_v0]->action) { - this->unk_260 = play->csCtx.actorActions[temp_v0]->action; + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; - switch (play->csCtx.actorActions[temp_v0]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 0x1: this->unk_261 = 0; break; @@ -786,9 +786,9 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } else { - this->unk_260 = 99; + this->cueId = 99; } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -853,7 +853,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) { void func_80AA67F8(DmChar00* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((play->csCtx.state == 0) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 1)) { + if ((play->csCtx.state == 0) && (gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 1)) { if (this->unk_261 != 42) { this->unk_261 = 42; func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0); @@ -916,7 +916,7 @@ void DmChar00_Draw(Actor* thisx, PlayState* play2) { if ((play->csCtx.state == 0) && ((play->sceneId != SCENE_OPENINGDAN) || (gSaveContext.sceneLayer != 0) || (play->roomCtx.curRoom.num != 0) || - (play->csCtx.currentCsIndex != 1) || (DMCHAR00_GET(&this->actor) != DMCHAR00_0))) { + (play->csCtx.scriptIndex != 1) || (DMCHAR00_GET(&this->actor) != DMCHAR00_0))) { return; } diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h index 62ee0cb406..b4679647be 100644 --- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h +++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h @@ -23,7 +23,7 @@ typedef struct DmChar00 { /* 0x23C */ DmChar00ActionFunc actionFunc; /* 0x240 */ Color_RGBAf unk_240; /* 0x250 */ Color_RGBAf unk_250; - /* 0x260 */ u8 unk_260; + /* 0x260 */ u8 cueId; /* 0x261 */ u8 unk_261; /* 0x262 */ u16 unk_262; } DmChar00; // size = 0x264 diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c index e49a1ec567..7b700f4eb5 100644 --- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c +++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c @@ -67,7 +67,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) { switch (DMCHAR01_GET(&this->dyna.actor)) { case DMCHAR01_0: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { this->unk_34C = 2; this->actionFunc = func_80AA8F1C; break; @@ -97,7 +97,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) { break; case DMCHAR01_1: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02) || (gSaveContext.sceneLayer == 1)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE) || (gSaveContext.sceneLayer == 1)) { this->unk_34C = 1; this->actionFunc = func_80AA8F1C; } else { @@ -134,7 +134,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) { DynaPolyActor_LoadMesh(play, &this->dyna, &gWoodfallSceneryTempleRampAndPlatformCol); this->unk_34D = true; - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { this->actionFunc = func_80AA9020; this->dyna.actor.world.pos.y -= 120.0f; } else { @@ -187,19 +187,20 @@ void func_80AA8698(DmChar01* this, PlayState* play) { } void func_80AA884C(DmChar01* this, PlayState* play) { - s16 sp1E = this->dyna.actor.cutscene; + s16 csId = this->dyna.actor.csId; - if (ActorCutscene_GetCanPlayNext(sp1E)) { - ActorCutscene_Start(sp1E, &this->dyna.actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_Start(csId, &this->dyna.actor); this->actionFunc = func_80AA88A8; } else { - ActorCutscene_SetIntentToPlay(sp1E); + CutsceneManager_Queue(csId); } } void func_80AA88A8(DmChar01* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 135)) { - if (play->csCtx.frames == play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 135)]->startFrame) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_135)) { + if (play->csCtx.curFrame == + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_135)]->startFrame) { D_80AAAE24 = 1; Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FORT_RISING); } @@ -344,11 +345,11 @@ void func_80AA8F2C(DmChar01* this, PlayState* play) { } void func_80AA9020(DmChar01* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 135)) { - CsCmdActorAction* temp_v1 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 135)]; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_135)) { + CsCmdActorCue* cue = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_135)]; - if ((temp_v1->startFrame == play->csCtx.frames) && (temp_v1->action == 2)) { - SET_WEEKEVENTREG(WEEKEVENTREG_20_02); + if ((cue->startFrame == play->csCtx.curFrame) && (cue->id == 2)) { + SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE); this->actionFunc = func_80AA90AC; } } diff --git a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c index f1759b7fb9..7841d22f50 100644 --- a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c +++ b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c @@ -61,7 +61,7 @@ void DmChar02_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 } void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 95: Actor_PlaySfx(&this->actor, NA_SE_EV_OCARINA_BOUND_0); break; @@ -75,7 +75,7 @@ void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play) } void DmChar02_PlaySfxForCutscenes(DmChar02* this, PlayState* play) { - if ((play->csCtx.state != 0) && (play->sceneId == SCENE_OKUJOU) && (play->csCtx.currentCsIndex == 1)) { + if ((play->csCtx.state != 0) && (play->sceneId == SCENE_OKUJOU) && (play->csCtx.scriptIndex == 1)) { DmChar02_PlaySfxForDroppingOcarinaCutscene(this, play); } } @@ -101,12 +101,12 @@ void DmChar02_Destroy(Actor* thisx, PlayState* play) { void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) { u8 shouldChangeAnimation = true; - s32 actionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 0x83)) { - actionIndex = Cutscene_GetActorActionIndex(play, 0x83); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - switch (play->csCtx.actorActions[actionIndex]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_131)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_131); + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + switch (play->csCtx.actorCues[cueChannel]->id) { default: this->animIndex = DMCHAR02_ANIM_HIT_GROUND; shouldChangeAnimation = false; @@ -130,7 +130,7 @@ void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { @@ -174,8 +174,8 @@ void DmChar02_Draw(Actor* thisx, PlayState* play) { if ((play->csCtx.state == 0) && (this->actor.world.pos.y < 100.0f)) { shouldDraw = true; - } else if (Cutscene_CheckActorAction(play, 0x6B)) { - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x6B)]->action) { + } else if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_107)) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_107)]->id) { case 0x17: case 0x1C: case 0x26: diff --git a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c index b960ce6981..21b9f94df9 100644 --- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c +++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c @@ -76,14 +76,14 @@ void func_80AAB5F8(DmChar03* this, PlayState* play) { } void func_80AAB644(DmChar03* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x88)) { - s32 index = Cutscene_GetActorActionIndex(play, 0x88); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_136)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_136); - if (play->csCtx.actorActions[index]->action == 4) { + if (play->csCtx.actorCues[cueChannel]->id == 4) { this->unk_18E = true; - this->offset.x = play->csCtx.actorActions[index]->startPos.x; - this->offset.y = play->csCtx.actorActions[index]->startPos.y; - this->offset.z = play->csCtx.actorActions[index]->startPos.z; + this->offset.x = play->csCtx.actorCues[cueChannel]->startPos.x; + this->offset.y = play->csCtx.actorCues[cueChannel]->startPos.y; + this->offset.z = play->csCtx.actorCues[cueChannel]->startPos.z; } } } @@ -94,11 +94,11 @@ void DmChar03_DoNothing(DmChar03* this, PlayState* play) { void func_80AAB710(DmChar03* this, PlayState* play) { u8 shouldChangeAnim = true; - if (Cutscene_CheckActorAction(play, 0x88)) { - s32 index = Cutscene_GetActorActionIndex(play, 0x88); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_136)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_136); - if (play->csCtx.frames == play->csCtx.actorActions[index]->startFrame) { - switch (play->csCtx.actorActions[index]->action) { + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: shouldChangeAnim = false; break; @@ -124,7 +124,7 @@ void func_80AAB710(DmChar03* this, PlayState* play) { DmChar03_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, index); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } @@ -140,8 +140,8 @@ void func_80AAB838(DmChar03* this, PlayState* play) { void DmChar03_Update(Actor* thisx, PlayState* play) { DmChar03* this = THIS; - if (Cutscene_CheckActorAction(play, 0x88) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x88)]->action == 2)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_136) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_136)]->id == 2)) { SkelAnime_Update(&this->skelAnime); } this->actionFunc(this, play); @@ -163,8 +163,8 @@ void DmChar03_Draw(Actor* thisx, PlayState* play) { DmChar03* this = THIS; if (!this->unk_18E) { - if ((Cutscene_CheckActorAction(play, 0x88)) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x88)]->action != 1)) { + if ((Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_136)) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_136)]->id != 1)) { func_8012C28C(play->state.gfxCtx); SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, DmChar03_OverrideLimbDraw, DmChar03_PostLimbDraw, diff --git a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c index 5c835152df..ac479344de 100644 --- a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c +++ b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c @@ -66,7 +66,7 @@ void DmChar04_Init(Actor* thisx, PlayState* play) { this->primColors = sPrimColors[this->actor.params]; this->envColors = sEnvColors[this->actor.params]; this->actor.targetArrowOffset = 3000.0f; - this->csAction = 0x63; + this->cueId = 99; this->timer = this->actor.params << 0xB; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_Init(play, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, this->jointTable, @@ -81,15 +81,15 @@ void DmChar04_Destroy(Actor* thisx, PlayState* play) { } void func_80AABE34(DmChar04* this, PlayState* play) { - u16 params = this->actor.params + 0x71; + u16 cueType = CS_CMD_ACTOR_CUE_113 + this->actor.params; - if (Cutscene_CheckActorAction(play, params)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, params); + if (Cutscene_IsCueInChannel(play, cueType)) { + s32 cueChannel = Cutscene_GetCueChannel(play, cueType); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { - this->csAction = play->csCtx.actorActions[actionIndex]->action; - if (play->csCtx.actorActions[actionIndex]->action == 1) { + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + if (play->csCtx.actorCues[cueChannel]->id == 1) { this->animIndex = 0; } else { this->animIndex = 0; @@ -97,9 +97,9 @@ void func_80AABE34(DmChar04* this, PlayState* play) { DmChar04_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } else { - this->csAction = 0x63; + this->cueId = 99; } } diff --git a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h index 0f0fcb6a15..c3d809c63a 100644 --- a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h +++ b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.h @@ -15,7 +15,7 @@ typedef struct DmChar04 { /* 0x023C */ DmChar04ActionFunc actionFunc; /* 0x240 */ Color_RGBAf primColors; /* 0x250 */ Color_RGBAf envColors; - /* 0x260 */ u8 csAction; + /* 0x260 */ u8 cueId; /* 0x261 */ u8 animIndex; /* 0x262 */ u16 timer; } DmChar04; // size = 0x264 diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c index 77c7c5dabd..6b85df5d33 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c @@ -177,14 +177,14 @@ void func_80AAC990(DmChar05* this, PlayState* play) { } void func_80AAC9DC(DmChar05* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 109) != 0) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 109); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_109)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_109); - if (play->csCtx.actorActions[actionIndex]->action == 4) { + if (play->csCtx.actorCues[cueChannel]->id == 4) { this->unk_18E = 1; - this->unk_190.x = play->csCtx.actorActions[actionIndex]->startPos.x; - this->unk_190.y = play->csCtx.actorActions[actionIndex]->startPos.y; - this->unk_190.z = play->csCtx.actorActions[actionIndex]->startPos.z; + this->unk_190.x = play->csCtx.actorCues[cueChannel]->startPos.x; + this->unk_190.y = play->csCtx.actorCues[cueChannel]->startPos.y; + this->unk_190.z = play->csCtx.actorCues[cueChannel]->startPos.z; } } } @@ -199,17 +199,17 @@ void func_80AACA98(DmChar05* this, PlayState* play) { } void func_80AACAE4(DmChar05* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 564)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 564); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_564)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_564); - if (play->csCtx.actorActions[actionIndex]->action == 2) { - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { + if (play->csCtx.actorCues[cueChannel]->id == 2) { + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { Item_Give(play, ITEM_MASK_COUPLE); } this->unk_18E = 1; - this->unk_190.x = play->csCtx.actorActions[actionIndex]->startPos.x; - this->unk_190.y = play->csCtx.actorActions[actionIndex]->startPos.y; - this->unk_190.z = play->csCtx.actorActions[actionIndex]->startPos.z; + this->unk_190.x = play->csCtx.actorCues[cueChannel]->startPos.x; + this->unk_190.y = play->csCtx.actorCues[cueChannel]->startPos.y; + this->unk_190.z = play->csCtx.actorCues[cueChannel]->startPos.z; } else { this->unk_18E = 0; } @@ -277,13 +277,13 @@ void func_80AACD1C(DmChar05* this, PlayState* play) { } void func_80AACD68(DmChar05* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 473)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 473); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_473)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_473); this->unk_18E = 1; - this->unk_190.x = play->csCtx.actorActions[actionIndex]->startPos.x; - this->unk_190.y = play->csCtx.actorActions[actionIndex]->startPos.y; - this->unk_190.z = play->csCtx.actorActions[actionIndex]->startPos.z; + this->unk_190.x = play->csCtx.actorCues[cueChannel]->startPos.x; + this->unk_190.y = play->csCtx.actorCues[cueChannel]->startPos.y; + this->unk_190.z = play->csCtx.actorCues[cueChannel]->startPos.z; } } @@ -297,27 +297,27 @@ void func_80AACE10(DmChar05* this, PlayState* play) { } void func_80AACE5C(DmChar05* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 518)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 518); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_518)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518); this->unk_18E = 1; - this->unk_190.x = play->csCtx.actorActions[actionIndex]->startPos.x; - this->unk_190.y = play->csCtx.actorActions[actionIndex]->startPos.y; - this->unk_190.z = play->csCtx.actorActions[actionIndex]->startPos.z; + this->unk_190.x = play->csCtx.actorCues[cueChannel]->startPos.x; + this->unk_190.y = play->csCtx.actorCues[cueChannel]->startPos.y; + this->unk_190.z = play->csCtx.actorCues[cueChannel]->startPos.z; } } void func_80AACF04(DmChar05* this, PlayState* play) { u8 sp2F = true; - s32 actionIndex; + s32 cueChannel; switch (DMCHAR05_GET(&this->actor)) { case DMCHAR05_0: - if (Cutscene_CheckActorAction(play, 109)) { - actionIndex = Cutscene_GetActorActionIndex(play, 109); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_109)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_109); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - switch (play->csCtx.actorActions[actionIndex]->action) { + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: sp2F = false; break; @@ -351,16 +351,16 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } break; case DMCHAR05_1: - if (Cutscene_CheckActorAction(play, 473)) { - actionIndex = Cutscene_GetActorActionIndex(play, 473); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_473)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_473); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - switch (play->csCtx.actorActions[actionIndex]->action) { + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: sp2F = false; break; @@ -395,16 +395,16 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } break; case DMCHAR05_2: - if (Cutscene_CheckActorAction(play, 518)) { - actionIndex = Cutscene_GetActorActionIndex(play, 518); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_518)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - switch (play->csCtx.actorActions[actionIndex]->action) { + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: sp2F = false; break; @@ -438,16 +438,16 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } break; case DMCHAR05_3: - if (Cutscene_CheckActorAction(play, 559)) { - actionIndex = Cutscene_GetActorActionIndex(play, 559); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_559)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_559); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - switch (play->csCtx.actorActions[actionIndex]->action) { + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + switch (play->csCtx.actorCues[cueChannel]->id) { default: sp2F = false; break; @@ -474,10 +474,10 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } } - if (play->csCtx.actorActions[actionIndex]->action != 4) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + if (play->csCtx.actorCues[cueChannel]->id != 4) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } else { - Cutscene_ActorTranslate(&this->actor, play, actionIndex); + Cutscene_ActorTranslate(&this->actor, play, cueChannel); } } @@ -492,29 +492,29 @@ void func_80AACF04(DmChar05* this, PlayState* play) { } void func_80AAD3F8(DmChar05* this, PlayState* play) { - if (play->csCtx.frames == 490) { + if (play->csCtx.curFrame == 490) { Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER); } - if (play->csCtx.frames > 550) { + if (play->csCtx.curFrame > 550) { Actor_PlaySfx(&this->actor, NA_SE_EN_MASK_FLOAT - SFX_FLAG); } } void func_80AAD450(DmChar05* this, PlayState* play) { - if (play->csCtx.frames == 262) { + if (play->csCtx.curFrame == 262) { Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER); } - if (play->csCtx.frames > 318) { + if (play->csCtx.curFrame > 318) { Actor_PlaySfx(&this->actor, NA_SE_EN_MASK_FLOAT - SFX_FLAG); } } void func_80AAD4A8(DmChar05* this, PlayState* play) { if (DMCHAR05_GET(&this->actor) == DMCHAR05_0) { - if (Cutscene_CheckActorAction(play, 109) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 109)]->action == 3)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_109) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_109)]->id == 3)) { if (Animation_OnFrame(&this->skelAnime, 14.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_0); } else if (Animation_OnFrame(&this->skelAnime, 19.0f)) { @@ -522,15 +522,15 @@ void func_80AAD4A8(DmChar05* this, PlayState* play) { } } } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_1) { - if (Cutscene_CheckActorAction(play, 473)) { - if ((play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 473)]->action == 3) && + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_473)) { + if ((play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_473)]->id == 3) && Animation_OnFrame(&this->skelAnime, 5.0f)) { Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_SAND); } } } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_2) { - if (Cutscene_CheckActorAction(play, 518) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 518)]->action == 2)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_518) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518)]->id == 2)) { if (Animation_OnFrame(&this->skelAnime, 7.0f)) { Actor_PlaySfx(&this->actor, NA_SE_IT_MASK_BOUND_0); } @@ -546,18 +546,18 @@ void func_80AAD4A8(DmChar05* this, PlayState* play) { } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_3) { if (play->sceneId == SCENE_OKUJOU) { if (gSaveContext.sceneLayer == 2) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { func_80AAD3F8(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { func_80AAD450(this, play); } } } else if (play->sceneId == SCENE_SPOT00) { if (gSaveContext.sceneLayer == 9) { - if ((play->csCtx.currentCsIndex == 0) && (play->csCtx.frames == 255)) { + if ((play->csCtx.scriptIndex == 0) && (play->csCtx.curFrame == 255)) { Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER); } - } else if ((gSaveContext.sceneLayer == 0xB) && (play->csCtx.frames == 115)) { + } else if ((gSaveContext.sceneLayer == 0xB) && (play->csCtx.curFrame == 115)) { Actor_PlaySfx(&this->actor, NA_SE_EN_EVIL_POWER_PREDEMO); } } @@ -568,25 +568,25 @@ void DmChar05_Update(Actor* thisx, PlayState* play) { DmChar05* this = THIS; func_80AACF04(this, play); - if (Cutscene_CheckActorAction(play, 109)) { - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 109)]->action == 3) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_109)) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_109)]->id == 3) { SkelAnime_Update(&this->skelAnime); } - } else if (Cutscene_CheckActorAction(play, 473)) { - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 473)]->action == 3) { + } else if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_473)) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_473)]->id == 3) { SkelAnime_Update(&this->skelAnime); } - } else if (Cutscene_CheckActorAction(play, 518)) { - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 518)]->action == 2) { + } else if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_518)) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518)]->id == 2) { SkelAnime_Update(&this->skelAnime); } - } else if (Cutscene_CheckActorAction(play, 559)) { - if ((play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 559)]->action == 2) || - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 559)]->action == 3)) { + } else if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_559)) { + if ((play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_559)]->id == 2) || + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_559)]->id == 3)) { SkelAnime_Update(&this->skelAnime); } - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 559)]->action == 4) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_559)]->id == 4) { this->actor.world.rot.y += 0x258; this->actor.shape.rot.y += 0x258; } @@ -607,8 +607,8 @@ void func_80AAD998(Actor* thisx, PlayState* play) { s32 pad[2]; if (this->unk_18E == 0) { - if (Cutscene_CheckActorAction(play, 109) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 109)]->action != 1)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_109) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_109)]->id != 1)) { OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); @@ -628,8 +628,8 @@ void func_80AADA90(Actor* thisx, PlayState* play) { DmChar05* this = THIS; if (this->unk_18E == 0) { - if (Cutscene_CheckActorAction(play, 473) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 473)]->action != 1)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_473) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_473)]->id != 1)) { func_8012C28C(play->state.gfxCtx); SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, DmChar05_OverrideLimbDraw, DmChar05_PostLimbDraw, &this->actor); @@ -643,8 +643,8 @@ void func_80AADB4C(Actor* thisx, PlayState* play) { DmChar05* this = THIS; if (this->unk_18E == 0) { - if (Cutscene_CheckActorAction(play, 518) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 518)]->action != 1)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_518) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_518)]->id != 1)) { func_8012C28C(play->state.gfxCtx); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, NULL, &this->actor); @@ -657,19 +657,18 @@ void func_80AADB4C(Actor* thisx, PlayState* play) { void func_80AADC00(Actor* thisx, PlayState* play) { s32 pad; DmChar05* this = THIS; - s32 actionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 559)) { - actionIndex = Cutscene_GetActorActionIndex(play, 559); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_559)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_559); - if ((play->csCtx.actorActions[actionIndex]->action != 1) && - (play->csCtx.actorActions[actionIndex]->action != 4)) { + if ((play->csCtx.actorCues[cueChannel]->id != 1) && (play->csCtx.actorCues[cueChannel]->id != 4)) { func_8012C28C(play->state.gfxCtx); SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, DmChar05_OverrideLimbDraw, DmChar05_PostLimbDraw, &this->actor); } - if (play->csCtx.actorActions[actionIndex]->action == 4) { + if (play->csCtx.actorCues[cueChannel]->id == 4) { Matrix_Translate(-600.0f, 0.0f, 0.0f, MTXMODE_APPLY); Gfx_DrawDListOpa(play, object_dmask_DL_001E70); } diff --git a/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c b/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c index 0385a82d4f..747b2e0c98 100644 --- a/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c +++ b/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c @@ -37,7 +37,7 @@ void DmChar06_SetupAction(DmChar06* this, DmChar06ActionFunc actionFunc) { void DmChar06_Init(Actor* thisx, PlayState* play) { DmChar06* this = THIS; - SET_WEEKEVENTREG(WEEKEVENTREG_33_80); + SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE); Actor_SetScale(&this->actor, 1.0f); this->alpha = 255; DmChar06_SetupAction(this, func_80AAE6F0); @@ -47,17 +47,17 @@ void DmChar06_Destroy(Actor* thisx, PlayState* play) { } void func_80AAE6F0(DmChar06* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x1CF)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 0x1CF); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_463)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_463); - if ((play->csCtx.frames >= play->csCtx.actorActions[actionIndex]->startFrame) && - (play->csCtx.actorActions[actionIndex]->endFrame >= play->csCtx.frames)) { - if (play->csCtx.actorActions[actionIndex]->action == 1) { + if ((play->csCtx.curFrame >= play->csCtx.actorCues[cueChannel]->startFrame) && + (play->csCtx.actorCues[cueChannel]->endFrame >= play->csCtx.curFrame)) { + if (play->csCtx.actorCues[cueChannel]->id == 1) { this->alpha = 255; - } else if (play->csCtx.actorActions[actionIndex]->action == 2) { - f32 lerp = 1.0f - Environment_LerpWeight(play->csCtx.actorActions[actionIndex]->endFrame, - play->csCtx.actorActions[actionIndex]->startFrame, - play->csCtx.frames); + } else if (play->csCtx.actorCues[cueChannel]->id == 2) { + f32 lerp = + 1.0f - Environment_LerpWeight(play->csCtx.actorCues[cueChannel]->endFrame, + play->csCtx.actorCues[cueChannel]->startFrame, play->csCtx.curFrame); this->alpha = 255 * lerp; } } diff --git a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c index a1853d04d4..1b6d667c2b 100644 --- a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c +++ b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c @@ -275,27 +275,27 @@ void DmChar08_WaitForSong(DmChar08* this, PlayState* play) { } void DmChar08_SetupAppearCs(DmChar08* this, PlayState* play) { - s16 cs1 = this->dyna.actor.cutscene; - s16 cs = ActorCutscene_GetAdditionalCutscene( - ActorCutscene_GetAdditionalCutscene(ActorCutscene_GetAdditionalCutscene(cs1))); + s16 csId = this->dyna.actor.csId; + s16 additionalCsId = + CutsceneManager_GetAdditionalCsId(CutsceneManager_GetAdditionalCsId(CutsceneManager_GetAdditionalCsId(csId))); if (CHECK_WEEKEVENTREG(WEEKEVENTREG_93_08)) { - cs1 = cs; + csId = additionalCsId; } - if (ActorCutscene_GetCanPlayNext(cs1)) { - ActorCutscene_Start(cs1, &this->dyna.actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_Start(csId, &this->dyna.actor); SET_WEEKEVENTREG(WEEKEVENTREG_53_20); SET_WEEKEVENTREG(WEEKEVENTREG_93_08); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); this->actionFunc = func_80AAF884; } else { - ActorCutscene_SetIntentToPlay(cs1); + CutsceneManager_Queue(csId); } } void func_80AAF884(DmChar08* this, PlayState* play) { - if (play->csCtx.state == CS_STATE_0) { + if (play->csCtx.state == CS_STATE_IDLE) { DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS | DYNA_TRANSFORM_ROT_Y); DynaPolyActor_LoadMesh(play, &this->dyna, &gTurtleZoraCapeAwakeCol); this->dyna.actor.flags |= ACTOR_FLAG_1; @@ -321,22 +321,22 @@ void func_80AAF8F4(DmChar08* this, PlayState* play) { } void func_80AAFA18(DmChar08* this, PlayState* play) { - s16 nextCs; - s16 nextCs2; - s16 nextCs1; + s16 nextCsId; + s16 nextCsId2; + s16 nextCsId1; - nextCs1 = ActorCutscene_GetAdditionalCutscene(this->dyna.actor.cutscene); - nextCs2 = nextCs1; - nextCs1 = ActorCutscene_GetAdditionalCutscene(nextCs1); + nextCsId1 = CutsceneManager_GetAdditionalCsId(this->dyna.actor.csId); + nextCsId2 = nextCsId1; + nextCsId1 = CutsceneManager_GetAdditionalCsId(nextCsId1); - nextCs = CHECK_WEEKEVENTREG(WEEKEVENTREG_53_40) ? nextCs1 : nextCs2; + nextCsId = CHECK_WEEKEVENTREG(WEEKEVENTREG_53_40) ? nextCsId1 : nextCsId2; - if (ActorCutscene_GetCanPlayNext(nextCs) != 0) { + if (CutsceneManager_IsNext(nextCsId)) { SET_WEEKEVENTREG(WEEKEVENTREG_53_40); - ActorCutscene_Start(nextCs, &this->dyna.actor); + CutsceneManager_Start(nextCsId, &this->dyna.actor); this->actionFunc = DmChar08_DoNothing; } else { - ActorCutscene_SetIntentToPlay(nextCs); + CutsceneManager_Queue(nextCsId); } } @@ -390,7 +390,7 @@ void DmChar08_SpawnBubbles(DmChar08* this, PlayState* play) { void func_80AAFCCC(DmChar08* this, PlayState* play) { switch (play->sceneId) { case SCENE_31MISAKI: - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { switch (this->unk_206) { case 0: break; @@ -455,15 +455,15 @@ void DmChar08_DoNothing(DmChar08* this, PlayState* play) { } void func_80AAFE88(DmChar08* this, PlayState* play) { - s32 actorActionIndex; - CsCmdActorAction* csAction; + s32 cueChannel; + s32 pad; f32 phi_f12; - if (Cutscene_CheckActorAction(play, 474)) { - actorActionIndex = Cutscene_GetActorActionIndex(play, 474); - if (this->unk_1F6 != play->csCtx.actorActions[actorActionIndex]->action) { - this->unk_1F6 = play->csCtx.actorActions[actorActionIndex]->action; - switch (play->csCtx.actorActions[actorActionIndex]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_474)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_474); + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->animIndex = TURTLE_ANIM_IDLE; break; @@ -514,12 +514,12 @@ void func_80AAFE88(DmChar08* this, PlayState* play) { break; } } - switch (play->csCtx.actorActions[actorActionIndex]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 2: this->unk_1FF = 1; - phi_f12 = 2.0f * Environment_LerpWeight(play->csCtx.actorActions[actorActionIndex]->endFrame, - play->csCtx.actorActions[actorActionIndex]->startFrame, - play->csCtx.frames); + phi_f12 = + 2.0f * Environment_LerpWeight(play->csCtx.actorCues[cueChannel]->endFrame, + play->csCtx.actorCues[cueChannel]->startFrame, play->csCtx.curFrame); if (phi_f12 > 1.0f) { phi_f12 = 1.0f; } @@ -529,30 +529,30 @@ void func_80AAFE88(DmChar08* this, PlayState* play) { this->unk_1FF = 2; } - Cutscene_ActorTranslateAndYaw(&this->dyna.actor, play, actorActionIndex); + Cutscene_ActorTranslateAndYaw(&this->dyna.actor, play, cueChannel); break; case 5: - Cutscene_ActorTranslateAndYawSmooth(&this->dyna.actor, play, actorActionIndex); + Cutscene_ActorTranslateAndYawSmooth(&this->dyna.actor, play, cueChannel); break; case 14: - Cutscene_ActorTranslate(&this->dyna.actor, play, actorActionIndex); - Math_SmoothStepToS(&this->dyna.actor.world.rot.y, play->csCtx.actorActions[actorActionIndex]->rot.y, - 0xA, 0xDC, 1); + Cutscene_ActorTranslate(&this->dyna.actor, play, cueChannel); + Math_SmoothStepToS(&this->dyna.actor.world.rot.y, play->csCtx.actorCues[cueChannel]->rot.y, 0xA, 0xDC, + 1); this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y; break; default: - Cutscene_ActorTranslateAndYaw(&this->dyna.actor, play, actorActionIndex); + Cutscene_ActorTranslateAndYaw(&this->dyna.actor, play, cueChannel); break; } this->targetYPos = this->dyna.actor.world.pos.y; - if ((this->unk_1FF >= 2) || (play->csCtx.actorActions[actorActionIndex]->action == 2)) { + if ((this->unk_1FF >= 2) || (play->csCtx.actorCues[cueChannel]->id == 2)) { Math_SmoothStepToF(&this->unk_1F0, 1.0f, 0.02f, 0.1f, 0.00001f); } } else { - this->unk_1F6 = 99; + this->cueId = 99; } } @@ -894,8 +894,8 @@ void func_80AB032C(DmChar08* this, PlayState* play) { void func_80AB096C(DmChar08* this, PlayState* play) { if ((play->csCtx.state != 0) && (play->sceneId == SCENE_31MISAKI) && (gSaveContext.sceneLayer == 0) && - (play->csCtx.currentCsIndex == 0)) { - if ((play->csCtx.frames >= 890) && (play->csCtx.frames < 922)) { + (play->csCtx.scriptIndex == 0)) { + if ((play->csCtx.curFrame >= 890) && (play->csCtx.curFrame < 922)) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG); } } @@ -1097,7 +1097,7 @@ void DmChar08_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sBigTurtleEyeTextures[this->eyeIndex])); gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sBigTurtleEyeTextures[this->eyeIndex])); - if ((this->unk_1FF > 0) || (play->csCtx.state != CS_STATE_0)) { + if ((this->unk_1FF > 0) || (play->csCtx.state != CS_STATE_IDLE)) { SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, DmChar08_OverrideLimbDraw, DmChar08_PostLimbDraw, DmChar08_TransformLimbDraw, &this->dyna.actor); diff --git a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.h b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.h index f339bceaa1..9fdbade434 100644 --- a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.h +++ b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.h @@ -22,7 +22,7 @@ typedef struct DmChar08 { /* 0x1E8 */ UNK_TYPE1 unk_1E8[8]; /* 0x1F0 */ f32 unk_1F0; /* 0x1F4 */ s16 unk_1F4; - /* 0x1F6 */ s16 unk_1F6; + /* 0x1F6 */ s16 cueId; /* 0x1F6 */ s16 blinkTimer; /* 0x1FA */ s16 unk_1FA; /* 0x1FC */ u16 unk_1FC; diff --git a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c index 4420586779..567b33685c 100644 --- a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c +++ b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c @@ -127,24 +127,24 @@ void func_80AB2268(DmChar09* this, PlayState* play) { Path* path; s32 pad; s32 i; - s32 actionIndex; + s32 cueChannel; s32 max = 0; s32 pathnum; u8 temp = false; if (!DMCHAR09_GET_F(&this->actor)) { - if (play->csCtx.currentCsIndex == 1) { + if (play->csCtx.scriptIndex == 1) { temp = true; } - } else if (play->csCtx.currentCsIndex == 0) { + } else if (play->csCtx.scriptIndex == 0) { temp = true; } - if (Cutscene_CheckActorAction(play, 0x1F7) && temp) { - actionIndex = Cutscene_GetActorActionIndex(play, 0x1F7); - if (this->unk_22F != play->csCtx.actorActions[actionIndex]->action) { - this->unk_22F = play->csCtx.actorActions[actionIndex]->action; - switch (play->csCtx.actorActions[actionIndex]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_503) && temp) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_503); + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 2: max = 0; break; @@ -159,7 +159,7 @@ void func_80AB2268(DmChar09* this, PlayState* play) { break; } - if (play->csCtx.actorActions[actionIndex]->action >= 2) { + if (play->csCtx.actorCues[cueChannel]->id >= 2) { pathnum = DMCHAR09_GET_PATH(&this->actor); path = &play->setupPathList[pathnum]; @@ -175,7 +175,7 @@ void func_80AB2268(DmChar09* this, PlayState* play) { this->unk_220 = 1; this->unk_22E = true; - this->speed = (u16)play->csCtx.actorActions[actionIndex]->rot.z * 0.00390625f; + this->speed = (u16)play->csCtx.actorCues[cueChannel]->rot.z * 0.00390625f; this->actionFunc = func_80AB1FDC; } else { this->unk_22E = false; @@ -183,7 +183,7 @@ void func_80AB2268(DmChar09* this, PlayState* play) { } } } else { - this->unk_22F = 0x63; + this->cueId = 99; } } diff --git a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.h b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.h index dffe65975b..cfb3523e64 100644 --- a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.h +++ b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.h @@ -31,7 +31,7 @@ typedef struct DmChar09 { /* 0x22A */ s16 unk_22A; /* 0x22C */ UNK_TYPE1 pad22C[2]; /* 0x22E */ u8 unk_22E; - /* 0x22F */ u8 unk_22F; + /* 0x22F */ u8 cueId; } DmChar09; // size = 0x230 #endif // Z_DM_CHAR09_H diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c index 177a213949..f20c87cb4c 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c @@ -195,28 +195,28 @@ void func_80C248A8(DmGm* this, PlayState* play) { void func_80C24A00(DmGm* this, PlayState* play) { s32 sp28[] = { 0, 0, 12, 2, 4, 6, 8, 10, 11, 3 }; - u16 action; - s32 sp20; + u16 cueId; + s32 cueChannel; if (play->csCtx.state != 0) { if (this->unk_2D0 == 0) { - this->unk_2B0 = 255; + this->cueId = 255; this->unk_2D0 = 1; this->unk_2D4 = 0; this->unk_2CC = this->unk_2C8; } - if (Cutscene_CheckActorAction(play, 0x22D)) { - sp20 = Cutscene_GetActorActionIndex(play, 0x22D); - action = play->csCtx.actorActions[sp20]->action; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_557)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_557); + cueId = play->csCtx.actorCues[cueChannel]->id; - if (this->unk_2B0 != (action & 0xFF)) { - this->unk_2B0 = action; + if (this->cueId != (u8)cueId) { + this->cueId = cueId; this->unk_2D4 = 1; - func_80C24428(this, play, sp28[action]); + func_80C24428(this, play, sp28[cueId]); } - switch (this->unk_2B0) { + switch (this->cueId) { case 2: case 4: case 5: @@ -230,7 +230,7 @@ void func_80C24A00(DmGm* this, PlayState* play) { } break; } - Cutscene_ActorTranslateAndYaw(&this->actor, play, sp20); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } else if (this->unk_2D0 != 0) { this->unk_2D0 = 0; diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h index 54db8d30fb..8b6b3f652c 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h @@ -21,7 +21,7 @@ typedef struct DmGm { /* 0x2AC */ s8 unk_2AC; /* 0x2AD */ s8 unk_2AD; /* 0x2AE */ u16 unk_2AE; - /* 0x2B0 */ u8 unk_2B0; + /* 0x2B0 */ u8 cueId; /* 0x2B4 */ Actor* unk_2B4; /* 0x2B8 */ s16 unk_2B8; /* 0x2BA */ s16 unk_2BA; diff --git a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c index e9fa1cddd5..da2bd225a4 100644 --- a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c +++ b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c @@ -43,23 +43,23 @@ s32 func_80C1DED0(DmNb* this, s32 arg1) { void func_80C1DF18(DmNb* this, PlayState* play) { s32 sp2C[] = { 0, 0, 0, 0, 0 }; - u16 csAction; - s32 csActionIndex; + u16 cueId; + s32 cueChannel; if (play->csCtx.state != 0) { if (this->unk1F8 == 0) { - this->unk1EC = 0xFF; + this->cueId = 255; this->unk1F8 = 1; this->unk1F4 = this->unk1F0; } - if (Cutscene_CheckActorAction(play, 0x232)) { - csActionIndex = Cutscene_GetActorActionIndex(play, 0x232); - csAction = play->csCtx.actorActions[csActionIndex]->action; - if (this->unk1EC != (u8)csAction) { - this->unk1EC = csAction; - func_80C1DED0(this, sp2C[csAction]); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_562)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_562); + cueId = play->csCtx.actorCues[cueChannel]->id; + if (this->cueId != (u8)cueId) { + this->cueId = cueId; + func_80C1DED0(this, sp2C[cueId]); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, csActionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } else if (this->unk1F8 != 0) { this->unk1F8 = 0; diff --git a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.h b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.h index 3f35beea0f..7bb7b39cde 100644 --- a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.h +++ b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.h @@ -14,7 +14,7 @@ typedef struct DmNb { /* 0x188 */ DmNbActionFunc actionFunc; /* 0x18C */ Vec3s jointTable[NB_LIMB_MAX]; /* 0x1BC */ Vec3s morphTable[NB_LIMB_MAX]; - /* 0x1EC */ u8 unk1EC; + /* 0x1EC */ u8 cueId; /* 0x1F0 */ s32 unk1F0; /* 0x1F4 */ s32 unk1F4; /* 0x1F8 */ s32 unk1F8; diff --git a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c index db76db2787..e0d2fc2a3e 100644 --- a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c +++ b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c @@ -70,24 +70,24 @@ void DmOpstage_Destroy(Actor* thisx, PlayState* play) { } void DmOpstage_FollowCutsceneScript(DmOpstage* this, PlayState* play) { - s32 actionIndex; + s32 cueChannel; if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) == DMOPSTAGE_TYPE_GROUND) { - if (Cutscene_CheckActorAction(play, 0x73)) { - actionIndex = Cutscene_GetActorActionIndex(play, 0x73); - if (play->csCtx.actorActions[actionIndex]->action == 2) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_115)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_115); + if (play->csCtx.actorCues[cueChannel]->id == 2) { this->dyna.actor.scale.x = 0.075f; this->dyna.actor.scale.z = 0.3f; } else { this->dyna.actor.scale.x = 0.1f; this->dyna.actor.scale.z = 0.1f; } - Cutscene_ActorTranslateAndYaw(&this->dyna.actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->dyna.actor, play, cueChannel); } - } else if (Cutscene_CheckActorAction(play, DMOPSTAGE_GET_ACTORACTION(&this->dyna.actor) + 0x74)) { + } else if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_116 + DMOPSTAGE_GET_CUE_TYPE_OFFSET(&this->dyna.actor))) { Cutscene_ActorTranslateAndYaw( &this->dyna.actor, play, - Cutscene_GetActorActionIndex(play, DMOPSTAGE_GET_ACTORACTION(&this->dyna.actor) + 0x74)); + Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_116 + DMOPSTAGE_GET_CUE_TYPE_OFFSET(&this->dyna.actor))); } } @@ -95,7 +95,7 @@ void DmOpstage_Update(Actor* thisx, PlayState* play) { DmOpstage* this = THIS; this->actionFunc(this, play); - if ((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 0) && (play->csCtx.frames == 480)) { + if ((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 0) && (play->csCtx.curFrame == 480)) { // This actor is responsible for playing the fairy sound during the exposition in the intro, // during the transition to Lost Woods, before Ocarina gets stolen. func_8019F128(NA_SE_EV_NAVY_FLY_REBIRTH); diff --git a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h index 3d9195413b..03fd093f3c 100644 --- a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h +++ b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h @@ -4,7 +4,7 @@ #include "global.h" #define DMOPSTAGE_GET_TYPE(thisx) ((thisx)->params & 0xFF) -#define DMOPSTAGE_GET_ACTORACTION(thisx) (((thisx)->params >> 8) & 0xFF) +#define DMOPSTAGE_GET_CUE_TYPE_OFFSET(thisx) (((thisx)->params >> 8) & 0xFF) struct DmOpstage; diff --git a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c index cd6890505b..42a846357b 100644 --- a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c +++ b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c @@ -63,7 +63,7 @@ void DmRavine_Update(Actor* thisx, PlayState* play) { play->roomCtx.unk7A[1]++; if (play->roomCtx.unk7A[1] > 254) { play->roomCtx.unk7A[1] = 254; - if (play->csCtx.frames > 700) { + if (play->csCtx.curFrame > 700) { play->roomCtx.unk7A[1] = 255; play->roomCtx.unk7A[0] = 0; this->state++; // -> DM_RAVINE_STATE_PENDING_DEATH diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index f8210a9de4..164d6ea532 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -336,7 +336,7 @@ void DmStk_ChangeAnim(DmStk* this, PlayState* play, SkelAnime* skelAnime, Animat * after Skull Kid steals Epona. */ void DmStk_PlaySfxForIntroCutsceneFirstPart(DmStk* this, PlayState* play) { - switch (play->csCtx.frames + 20) { + switch (play->csCtx.curFrame + 20) { case 1195: Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_APPEAR); break; @@ -427,7 +427,7 @@ void DmStk_PlaySfxForIntroCutsceneFirstPart(DmStk* this, PlayState* play) { * any sound in-game, since all sound effects are muted when it plays. */ void DmStk_PlaySfxForTitleCutscene(DmStk* this, PlayState* play) { - if (play->csCtx.frames == 535) { + if (play->csCtx.curFrame == 535) { func_8019F128(NA_SE_EV_CLOCK_TOWER_BELL); } } @@ -437,7 +437,7 @@ void DmStk_PlaySfxForTitleCutscene(DmStk* this, PlayState* play) { * that starts after the fade-to-white and ends when the player gains control. */ void DmStk_PlaySfxForIntroCutsceneSecondPart(DmStk* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 78: case 89: case 100: @@ -469,7 +469,7 @@ void DmStk_PlaySfxForIntroCutsceneSecondPart(DmStk* this, PlayState* play) { * the Happy Mask Salesman. */ void DmStk_PlaySfxForObtainingMajorasMaskCutscene(DmStk* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 18: Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_GASAGOSO); break; @@ -490,7 +490,7 @@ void DmStk_PlaySfxForObtainingMajorasMaskCutscene(DmStk* this, PlayState* play) * the hallucinatory Deku Scrubs scene. */ void DmStk_PlaySfxForCurseCutsceneFirstPart(DmStk* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 415: func_801A479C(&this->actor.projectedPos, NA_SE_EN_STALKIDS_FLOAT, 100); break; @@ -518,7 +518,7 @@ void DmStk_PlaySfxForCurseCutsceneFirstPart(DmStk* this, PlayState* play) { void DmStk_PlaySfxForCurseCutsceneSecondPart(DmStk* this, PlayState* play) { Player* player = GET_PLAYER(play); - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 10: func_801A479C(&this->actor.projectedPos, NA_SE_EN_STALKIDS_FLOAT, 50); break; @@ -558,7 +558,7 @@ void DmStk_PlaySfxForCurseCutsceneSecondPart(DmStk* this, PlayState* play) { if (player) {} - if ((play->csCtx.frames >= 263) && (play->csCtx.frames < 698)) { + if ((play->csCtx.curFrame >= 263) && (play->csCtx.curFrame < 698)) { Actor_PlaySfx(&player->actor, NA_SE_EN_STALKIDS_BODY_LEV - SFX_FLAG); } } @@ -571,7 +571,7 @@ void DmStk_PlaySfxForCurseCutsceneSecondPart(DmStk* this, PlayState* play) { void DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(DmStk* this, PlayState* play) { static s32 sMoonCallTimer = 0; - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 140: func_801A479C(&this->actor.projectedPos, NA_SE_EN_STALKIDS_FLOAT, 80); break; @@ -594,7 +594,7 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(DmStk* this, PlayState* pla break; } - if ((this->animIndex == SK_ANIM_OCARINA_JUGGLE) && (play->csCtx.frames < 700)) { + if ((this->animIndex == SK_ANIM_OCARINA_JUGGLE) && (play->csCtx.curFrame < 700)) { if (Animation_OnFrame(&this->skelAnime, 5.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_OTEDAMA1); } else if (Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 40.0f)) { @@ -602,7 +602,7 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(DmStk* this, PlayState* pla } } - if (play->csCtx.frames >= 700) { + if (play->csCtx.curFrame >= 700) { if (sMoonCallTimer < 128) { if ((sMoonCallTimer & 0x1F) == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_STAL20_CALL_MOON); @@ -621,7 +621,7 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(DmStk* this, PlayState* pla * Handles sound effects for the cutscene where Skull Kid drops the Ocarina of Time. */ void DmStk_PlaySfxForDroppingOcarinaCutscene(DmStk* this, PlayState* play) { - if (play->csCtx.frames == 3) { + if (play->csCtx.curFrame == 3) { Actor_PlaySfx(&this->actor, NA_SE_EN_STAL06_SURPRISED); Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_DOWN_K); } @@ -631,7 +631,7 @@ void DmStk_PlaySfxForDroppingOcarinaCutscene(DmStk* this, PlayState* play) { * Handles sound effects for the cutscene where Skull Kid is shivering in the rain. */ void DmStk_PlaySfxForShiveringInRainCutscene(DmStk* this, PlayState* play) { - if ((play->csCtx.frames >= 642) && (play->csCtx.frames < 845)) { + if ((play->csCtx.curFrame >= 642) && (play->csCtx.curFrame < 845)) { Actor_PlaySfx(&this->actor, NA_SE_NE_STAL23_COLD - SFX_FLAG); } } @@ -641,7 +641,7 @@ void DmStk_PlaySfxForShiveringInRainCutscene(DmStk* this, PlayState* play) { * in Termina Field. */ void DmStk_PlaySfxForPlayingWithFairiesCutscene(DmStk* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 58: case 61: case 68: @@ -668,7 +668,7 @@ void DmStk_PlaySfxForPlayingWithFairiesCutscene(DmStk* this, PlayState* play) { * the Giants are walking away. */ void DmStk_PlaySfxForEndingCutsceneFirstPart(DmStk* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 5: Audio_PlayAmbience(AMBIENCE_ID_0C); break; @@ -686,7 +686,7 @@ void DmStk_PlaySfxForEndingCutsceneFirstPart(DmStk* this, PlayState* play) { void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) { Player* player = GET_PLAYER(play); - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 5: Audio_PlayAmbience(AMBIENCE_ID_0C); break; @@ -760,7 +760,7 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) { void DmStk_PlaySfxForClockTowerIntroCutsceneVersion2(DmStk* this, PlayState* play) { static s32 sMoonCallTimer = 0; - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 40: func_801A479C(&this->actor.projectedPos, NA_SE_EN_STALKIDS_FLOAT, 80); break; @@ -779,7 +779,7 @@ void DmStk_PlaySfxForClockTowerIntroCutsceneVersion2(DmStk* this, PlayState* pla break; } - if (play->csCtx.frames >= 408) { + if (play->csCtx.curFrame >= 408) { if (sMoonCallTimer < 128) { if ((sMoonCallTimer & 0x1F) == 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_STAL20_CALL_MOON); @@ -803,7 +803,7 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla this->oathToOrderCutsceneVoicePos.y = this->actor.projectedPos.y; this->oathToOrderCutsceneVoicePos.z = this->actor.projectedPos.z; - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 64: Audio_PlaySfxAtPos(&this->oathToOrderCutsceneVoicePos, NA_SE_EN_STAL06_SURPRISED); break; @@ -847,13 +847,13 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla if (1) {} - if ((play->csCtx.frames >= 62) && (play->csCtx.frames < 273)) { + if ((play->csCtx.curFrame >= 62) && (play->csCtx.curFrame < 273)) { if ((Rand_ZeroOne() < 0.75f) && ((play->state.frames % 2) != 0)) { Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_EARTHQUAKE); } } - if ((play->csCtx.frames >= 498) && (play->csCtx.frames < 577)) { + if ((play->csCtx.curFrame >= 498) && (play->csCtx.curFrame < 577)) { if ((play->state.frames % 4) == 0) { if ((play->state.frames & 4) != 0) { Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_BODY_LEV); @@ -863,7 +863,7 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla } } - if (play->csCtx.frames >= 290) { + if (play->csCtx.curFrame >= 290) { func_8019F128(NA_SE_EV_KYOJIN_VOICE_SUCCESS - SFX_FLAG); } } @@ -874,7 +874,7 @@ void DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(DmStk* this, PlayState* pla * moon, which is slightly longer. */ void DmStk_PlaySfxForMoonWarpCutsceneVersion1(DmStk* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 551: Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_PULLED); break; @@ -896,7 +896,7 @@ void DmStk_PlaySfxForMoonWarpCutsceneVersion1(DmStk* this, PlayState* play) { * warps to the moon, which is slightly shorter. */ void DmStk_PlaySfxForMoonWarpCutsceneVersion2(DmStk* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 311: Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_PULLED); break; @@ -923,7 +923,7 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { DmStk_PlaySfxForIntroCutsceneFirstPart(this, play); } else if (gSaveContext.sceneLayer == 0) { DmStk_PlaySfxForIntroCutsceneSecondPart(this, play); - } else if ((gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) { + } else if ((gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0)) { DmStk_PlaySfxForObtainingMajorasMaskCutscene(this, play); } break; @@ -936,9 +936,9 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { case SCENE_OPENINGDAN: if (gSaveContext.sceneLayer == 0) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { DmStk_PlaySfxForCurseCutsceneFirstPart(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { DmStk_PlaySfxForCurseCutsceneSecondPart(this, play); } } @@ -946,19 +946,19 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { case SCENE_OKUJOU: if (gSaveContext.sceneLayer == 0) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { DmStk_PlaySfxForClockTowerIntroCutsceneVersion1(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { DmStk_PlaySfxForDroppingOcarinaCutscene(this, play); - } else if (play->csCtx.currentCsIndex == 2) { + } else if (play->csCtx.scriptIndex == 2) { DmStk_PlaySfxForClockTowerIntroCutsceneVersion2(this, play); - } else if (play->csCtx.currentCsIndex == 3) { + } else if (play->csCtx.scriptIndex == 3) { DmStk_PlaySfxForCutsceneAfterPlayingOathToOrder(this, play); } } else if (gSaveContext.sceneLayer == 2) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { DmStk_PlaySfxForMoonWarpCutsceneVersion1(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { DmStk_PlaySfxForMoonWarpCutsceneVersion2(this, play); } } @@ -966,15 +966,15 @@ void DmStk_PlaySfxForCutscenes(DmStk* this, PlayState* play) { case SCENE_00KEIKOKU: if (gSaveContext.sceneLayer == 3) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { DmStk_PlaySfxForShiveringInRainCutscene(this, play); - } else if (play->csCtx.currentCsIndex == 2) { + } else if (play->csCtx.scriptIndex == 2) { DmStk_PlaySfxForPlayingWithFairiesCutscene(this, play); } } else if (gSaveContext.sceneLayer == 7) { - if (play->csCtx.currentCsIndex == 0) { + if (play->csCtx.scriptIndex == 0) { DmStk_PlaySfxForEndingCutsceneFirstPart(this, play); - } else if (play->csCtx.currentCsIndex == 1) { + } else if (play->csCtx.scriptIndex == 1) { DmStk_PlaySfxForEndingCutsceneSecondPart(this, play); } } @@ -1119,7 +1119,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->fadeOutTimer = 0; this->alpha = this->alpha; this->actor.targetArrowOffset = 1100.0f; - this->csAction = 99; + this->cueId = 99; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(play, &this->skelAnime, &gSkullKidSkel, NULL, NULL, NULL, 0); DmStk_ChangeAnim(this, play, &this->skelAnime, &sAnimationInfo[this->animIndex], 0); @@ -1127,7 +1127,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 3) && (play->csCtx.currentCsIndex > 0)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 3) && (play->csCtx.scriptIndex > 0)) { play->envCtx.unk_17 = 15; play->envCtx.unk_18 = 15; } @@ -1165,35 +1165,35 @@ void DmStk_WaitForTelescope(DmStk* this, PlayState* play) { * Plays the cutscene in the telescope where the Moon's Tear falls. */ void DmStk_StartTelescopeCutscene(DmStk* this, PlayState* play) { - s16 dayOneAndTwoCutscene = this->actor.cutscene; - s16 dayThreeCutscene = ActorCutscene_GetAdditionalCutscene(dayOneAndTwoCutscene); - s16 finalHoursCutscene = ActorCutscene_GetAdditionalCutscene(dayThreeCutscene); - s16 cutscene; + s16 dayOneAndTwoCsId = this->actor.csId; + s16 dayThreeCsId = CutsceneManager_GetAdditionalCsId(dayOneAndTwoCsId); + s16 finalHoursCsId = CutsceneManager_GetAdditionalCsId(dayThreeCsId); + s16 csId; if (gSaveContext.save.day < 3) { - cutscene = dayOneAndTwoCutscene; + csId = dayOneAndTwoCsId; } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40) || ((CURRENT_DAY == 3) && (gSaveContext.save.time < CLOCK_TIME(6, 0)))) { - cutscene = finalHoursCutscene; + csId = finalHoursCsId; } else { - cutscene = dayThreeCutscene; + csId = dayThreeCsId; } - if (ActorCutscene_GetCanPlayNext(cutscene)) { - ActorCutscene_Start(cutscene, &this->actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_Start(csId, &this->actor); Environment_StartTime(); this->actionFunc = DmStk_DoNothing; } else { - ActorCutscene_SetIntentToPlay(cutscene); + CutsceneManager_Queue(csId); } } void DmStk_ClockTower_StartIntroCutsceneVersion1(DmStk* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(9)) { - ActorCutscene_Start(9, &this->actor); + if (CutsceneManager_IsNext(9)) { + CutsceneManager_Start(9, &this->actor); this->actionFunc = DmStk_ClockTower_WaitForIntroCutsceneVersion1ToEnd; } else { - ActorCutscene_SetIntentToPlay(9); + CutsceneManager_Queue(9); } } @@ -1207,11 +1207,11 @@ void DmStk_ClockTower_WaitForIntroCutsceneVersion1ToEnd(DmStk* this, PlayState* } void DmStk_ClockTower_StartIntroCutsceneVersion2(DmStk* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(11)) { - ActorCutscene_Start(11, &this->actor); + if (CutsceneManager_IsNext(11)) { + CutsceneManager_Start(11, &this->actor); this->actionFunc = DmStk_ClockTower_WaitForIntroCutsceneVersion2ToEnd; } else { - ActorCutscene_SetIntentToPlay(11); + CutsceneManager_Queue(11); } } @@ -1224,21 +1224,21 @@ void DmStk_ClockTower_WaitForIntroCutsceneVersion2ToEnd(DmStk* this, PlayState* } void DmStk_ClockTower_StartDropOcarinaCutscene(DmStk* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(10)) { + if (CutsceneManager_IsNext(10)) { Actor_PlaySfx(&this->actor, NA_SE_EN_STALKIDS_DAMAGE); - ActorCutscene_Start(10, &this->actor); + CutsceneManager_Start(10, &this->actor); this->actor.shape.rot.x = 0; this->actor.world.rot.x = this->actor.shape.rot.x; this->actor.shape.rot.y = this->actor.shape.rot.x; this->actor.world.rot.y = this->actor.shape.rot.x; this->actionFunc = DmStk_ClockTower_WaitForDropOcarinaCutsceneToEnd; } else { - ActorCutscene_SetIntentToPlay(10); + CutsceneManager_Queue(10); } } void DmStk_ClockTower_WaitForDropOcarinaCutsceneToEnd(DmStk* this, PlayState* play) { - if ((play->csCtx.state != 0) && (play->csCtx.frames > 20)) { + if ((play->csCtx.state != 0) && (play->csCtx.curFrame > 20)) { this->actionFunc = DmStk_ClockTower_Idle; } } @@ -1307,21 +1307,21 @@ void DmStk_ClockTower_WaitForDeflectionToEnd(DmStk* this, PlayState* play) { */ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { s32 pad; - s32 actorActionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 107)) { - actorActionIndex = Cutscene_GetActorActionIndex(play, 107); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_107)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_107); - if (play->csCtx.frames == play->csCtx.actorActions[actorActionIndex]->startFrame) { - if (this->csAction != play->csCtx.actorActions[actorActionIndex]->action) { - this->csAction = play->csCtx.actorActions[actorActionIndex]->action; + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; if (play->sceneId == SCENE_CLOCKTOWER) { this->handType = SK_HAND_TYPE_HOLDING_FLUTE; } else { this->handType = SK_HAND_TYPE_DEFAULT; } - switch (play->csCtx.actorActions[actorActionIndex]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 0: case 1: this->animIndex = SK_ANIM_IDLE; @@ -1581,9 +1581,9 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actorActionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } else { - this->csAction = 99; + this->cueId = 99; } if (this->fadeInState == SK_FADE_IN_STATE_START) { @@ -1794,12 +1794,12 @@ void DmStk_Update(Actor* thisx, PlayState* play) { break; case SK_DEKU_PIPES_CS_STATE_PLAYER_USED_OCARINA: - if (ActorCutscene_GetCanPlayNext(16)) { + if (CutsceneManager_IsNext(16)) { this->dekuPipesCutsceneState = SK_DEKU_PIPES_CS_STATE_START; - ActorCutscene_Start(16, &this->actor); + CutsceneManager_Start(16, &this->actor); this->actionFunc = DmStk_ClockTower_Idle; } else { - ActorCutscene_SetIntentToPlay(16); + CutsceneManager_Queue(16); } break; @@ -1814,7 +1814,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) { // Skull Kid is always loaded in the scene, even if he isn't visible, hence why time always passes. if ((play->actorCtx.flags & ACTORCTX_FLAG_1) && (play->msgCtx.msgMode != 0) && (play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&play->state) && - (play->transitionTrigger == TRANS_TRIGGER_OFF) && (ActorCutscene_GetCurrentIndex() == -1) && + (play->transitionTrigger == TRANS_TRIGGER_OFF) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && (play->csCtx.state == 0)) { gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED; if (R_TIME_SPEED != 0) { @@ -1824,7 +1824,7 @@ void DmStk_Update(Actor* thisx, PlayState* play) { } } - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 3) && (play->csCtx.currentCsIndex > 0)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 3) && (play->csCtx.scriptIndex > 0)) { play->envCtx.unk_17 = 15; play->envCtx.unk_18 = 15; } @@ -1888,7 +1888,7 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot case SK_MASK_TYPE_NORMAL: if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneLayer == 1) && - (play->csCtx.frames < 1400)) { + (play->csCtx.curFrame < 1400)) { if (this->fogN == this->fogF) { this->fogF = this->fogN; } @@ -1905,8 +1905,8 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot gSPDisplayList(POLY_OPA_DISP++, gSkullKidMajorasMask1DL); gSPDisplayList(POLY_OPA_DISP++, gSkullKidMajorasMaskEyesDL); - if (Cutscene_CheckActorAction(play, 513) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 513)]->action == 2) && + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_513) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_513)]->id == 2) && (this->objectStk2ObjectIndex >= 0)) { Matrix_Push(); Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.h b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.h index f55321ef7c..0f58c534d4 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.h +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.h @@ -41,7 +41,7 @@ typedef struct DmStk { /* 0x32E */ u8 fadeInState; /* 0x32F */ u8 fadeOutState; /* 0x330 */ s32 fadeOutTimer; - /* 0x334 */ u8 csAction; + /* 0x334 */ u8 cueId; /* 0x335 */ u8 hasBeenHit; // set but never used /* 0x336 */ s8 objectStkObjectIndex; /* 0x337 */ s8 objectStk2ObjectIndex; diff --git a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c index 13a7e264f7..fd945787d3 100644 --- a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c +++ b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c @@ -65,37 +65,37 @@ Actor* func_80C22350(DmTag* this, PlayState* play, u8 actorCat, s16 actorId) { return foundActor; } -s32 func_80C22400(DmTag* this, s16 arg1) { +s32 func_80C22400(DmTag* this, s16 csId) { s32 ret = false; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(arg1); - } else if (ActorCutscene_GetCanPlayNext(arg1)) { - ActorCutscene_StartAndSetUnkLinkFields(arg1, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(csId); + } else if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); ret = true; } else { - ActorCutscene_SetIntentToPlay(arg1); + CutsceneManager_Queue(csId); } return ret; } -s16 func_80C2247C(DmTag* this, s32 arg1) { +s16 func_80C2247C(DmTag* this, s32 numCutscenes) { s32 i; - s16 cs = this->actor.cutscene; + s16 csId = this->actor.csId; - for (i = 0; i < arg1; i++) { - cs = ActorCutscene_GetAdditionalCutscene(cs); + for (i = 0; i < numCutscenes; i++) { + csId = CutsceneManager_GetAdditionalCsId(csId); } - return cs; + return csId; } s32 func_80C224D8(DmTag* this, PlayState* play) { s32 pad; Actor* sp30; Actor* sp2C; - s16 sp2A = this->actor.cutscene; + s16 csId = this->actor.csId; s32 ret = false; sp30 = func_80C22350(this, play, ACTORCAT_NPC, ACTOR_EN_AN); @@ -103,9 +103,9 @@ s32 func_80C224D8(DmTag* this, PlayState* play) { switch (this->unk_1A4) { case 0: - if (func_80C22400(this, sp2A)) { + if (func_80C22400(this, csId)) { if ((sp2C != NULL) && (sp2C->update != NULL)) { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), sp2C); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), sp2C); } this->unk_1A4++; ret = true; @@ -114,7 +114,7 @@ s32 func_80C224D8(DmTag* this, PlayState* play) { case 1: if ((sp30 != NULL) && (sp30->update != NULL)) { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(func_80C2247C(this, 0))), + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(func_80C2247C(this, 0))), sp30); } this->unk_1A4++; @@ -122,7 +122,7 @@ s32 func_80C224D8(DmTag* this, PlayState* play) { break; case 2: - ActorCutscene_Stop(func_80C2247C(this, 0)); + CutsceneManager_Stop(func_80C2247C(this, 0)); if (func_80C22400(this, func_80C2247C(this, 1))) { this->unk_1A4++; ret = true; @@ -130,7 +130,7 @@ s32 func_80C224D8(DmTag* this, PlayState* play) { break; case 3: - ActorCutscene_Stop(func_80C2247C(this, 1)); + CutsceneManager_Stop(func_80C2247C(this, 1)); if (func_80C22400(this, func_80C2247C(this, 2))) { this->unk_1A4++; ret = true; @@ -138,7 +138,7 @@ s32 func_80C224D8(DmTag* this, PlayState* play) { break; case 4: - ActorCutscene_Stop(func_80C2247C(this, 2)); + CutsceneManager_Stop(func_80C2247C(this, 2)); if (func_80C22400(this, func_80C2247C(this, 3))) { this->unk_1A4++; ret = true; @@ -146,7 +146,7 @@ s32 func_80C224D8(DmTag* this, PlayState* play) { break; case 5: - ActorCutscene_Stop(func_80C2247C(this, 3)); + CutsceneManager_Stop(func_80C2247C(this, 3)); if (func_80C22400(this, func_80C2247C(this, 4))) { this->unk_1A4++; ret = true; diff --git a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c index a671fe3f26..4d2b4a54a4 100644 --- a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c +++ b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c @@ -131,14 +131,14 @@ void DmZl_DoNothing(DmZl* this, PlayState* play) { } void DmZl_UpdateCutscene(DmZl* this, PlayState* play) { - s32 actionIndex; + s32 cueChannel; // reused as animIndex - if (Cutscene_CheckActorAction(play, 0x66)) { - actionIndex = Cutscene_GetActorActionIndex(play, 0x66); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_102)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_102); + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { s16 nextAnimIndex = ZELDA_ANIM_FACING_AWAY; - switch (play->csCtx.actorActions[actionIndex]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { default: case 1: break; @@ -159,14 +159,14 @@ void DmZl_UpdateCutscene(DmZl* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - actionIndex = this->animIndex; + cueChannel = this->animIndex; - if ((actionIndex == ZELDA_ANIM_TURNING_TOWARD_PLAYER) || (actionIndex == ZELDA_ANIM_GIVING_OCARINA_START) || - (actionIndex == ZELDA_ANIM_PLAYING_OCARINA_START)) { + if ((cueChannel == ZELDA_ANIM_TURNING_TOWARD_PLAYER) || (cueChannel == ZELDA_ANIM_GIVING_OCARINA_START) || + (cueChannel == ZELDA_ANIM_PLAYING_OCARINA_START)) { // these animations don't loop at the end, they lead into the next animation this->animIndex++; DmZl_ChangeAnimation(&this->skelAnime, &sAnimationInfo[this->animIndex], 0); diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 1e2a59b76f..c889de1583 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -100,7 +100,7 @@ void DoorAna_WaitClosed(DoorAna* this, PlayState* play) { if (grottoType == DOORANA_TYPE_HIDDEN_STORMS) { //! @bug Implementation from OoT is not updated for MM, grotto does not open on Song of Storms - if (this->actor.xyzDistToPlayerSq < SQ(200.0f) && EnvFlags_Get(play, 5)) { + if (this->actor.xyzDistToPlayerSq < SQ(200.0f) && CutsceneFlags_Get(play, 5)) { grottoIsOpen = true; this->actor.flags &= ~ACTOR_FLAG_10; // always update OFF } @@ -176,11 +176,11 @@ void DoorAna_GrabLink(DoorAna* this, PlayState* play) { Player* player; s8 pad[2]; - if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_GetCurrentCsId() != this->actor.csId) { + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index a0eefb83a1..f8fef514d8 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -310,20 +310,20 @@ s32 func_808A0E28(DoorShutter* this, PlayState* play) { void func_808A0F88(DoorShutter* this, PlayState* play) { if (Flags_GetClear(play, this->actor.room) || Flags_GetClearTemp(play, this->actor.room)) { - this->unk_160 = this->actor.cutscene; + this->csId = this->actor.csId; if (this->doorType == 7) { - if (this->unk_160 != -1) { - this->unk_160 = ActorCutscene_GetAdditionalCutscene(this->unk_160); + if (this->csId != CS_ID_NONE) { + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); } } - if (ActorCutscene_GetCanPlayNext(this->unk_160)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_160, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); Flags_SetClear(play, this->actor.room); DoorShutter_SetupAction(this, func_808A1784); this->unk_167 = -1; } else { - ActorCutscene_SetIntentToPlay(this->unk_160); + CutsceneManager_Queue(this->csId); } } else if (func_808A0E28(this, play)) { Player* player = GET_PLAYER(play); @@ -454,7 +454,7 @@ s32 func_808A1478(DoorShutter* this, PlayState* play, f32 arg2) { Actor_PlaySfx(&this->actor, NA_SE_EV_METALDOOR_OPEN); } - if ((this->unk_160 != -1) && (ActorCutscene_GetCurrentIndex() == this->unk_160)) { + if ((this->csId != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() == this->csId)) { func_800B724C(play, &this->actor, PLAYER_CSMODE_1); } } @@ -468,13 +468,13 @@ s32 func_808A1478(DoorShutter* this, PlayState* play, f32 arg2) { void func_808A1548(DoorShutter* this, PlayState* play) { if (func_808A1478(this, play, 1.0f)) { if (Flags_GetSwitch(play, DOORSHUTTER_GET_7F(&this->actor))) { - this->unk_160 = this->actor.cutscene; - if (ActorCutscene_GetCanPlayNext(this->unk_160)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_160, &this->actor); + this->csId = this->actor.csId; + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); DoorShutter_SetupAction(this, func_808A1784); this->unk_167 = -1; } else { - ActorCutscene_SetIntentToPlay(this->unk_160); + CutsceneManager_Queue(this->csId); } } else if (func_808A0E28(this, play)) { Player* player = GET_PLAYER(play); @@ -521,7 +521,7 @@ void func_808A1684(DoorShutter* this, PlayState* play) { void func_808A1784(DoorShutter* this, PlayState* play) { if (this->unk_167 != 0) { - if (func_800F22C4(this->unk_160, &this->actor)) { + if (func_800F22C4(this->csId, &this->actor) != 0) { if (this->unk_167 < 0) { if ((play->state.frames % 2) != 0) { this->unk_167++; @@ -569,9 +569,9 @@ void func_808A1884(DoorShutter* this, PlayState* play) { if (DoorShutter_SetupDoor(this, play) && !(player->stateFlags1 & PLAYER_STATE1_800)) { DoorShutter_SetupAction(this, func_808A1C50); - if (ActorCutscene_GetCurrentIndex() == 0x7D) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_DOOR) { func_801226E0(play, ((void)0, gSaveContext.respawn[RESPAWN_MODE_DOWN].data)); - player->unk_A86 = -1; + player->csId = CS_ID_NONE; func_800B7298(play, NULL, PLAYER_CSMODE_115); } } @@ -624,7 +624,7 @@ void func_808A1B48(DoorShutter* this, PlayState* play) { void func_808A1C50(DoorShutter* this, PlayState* play) { if (this->unk_167++ > 30) { if (GET_PLAYER(play)->csMode == PLAYER_CSMODE_115) { - func_800B7298(play, NULL, PLAYER_CSMODE_6); + func_800B7298(play, NULL, PLAYER_CSMODE_END); } DoorShutter_SetupDoor(this, play); } diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index c64d3d523c..7f18e05460 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -17,7 +17,7 @@ typedef struct DoorShutter { /* 0x0144 */ UNK_TYPE1 unk144[0x18]; /* 0x015C */ s16 unk_15C; /* 0x015E */ s16 unk_15E; - /* 0x0160 */ s16 unk_160; + /* 0x0160 */ s16 csId; /* 0x0162 */ u8 doorType; /* 0x0163 */ u8 unk_163; /* 0x0164 */ u8 unk_164; diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index d942903a18..0b4b59f1c5 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -280,15 +280,15 @@ void func_808B8E78(DoorWarp1* this, PlayState* play) { } s32 func_808B900C(DoorWarp1* this, PlayState* play) { - s32 index; + s32 cueChannel; u8 ret = false; - if (Cutscene_CheckActorAction(play, 569)) { - index = Cutscene_GetActorActionIndex(play, 569); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_569)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_569); - if (this->unk_208 != play->csCtx.actorActions[index]->action) { - this->unk_208 = play->csCtx.actorActions[index]->action; - if (play->csCtx.actorActions[index]->action == 2) { + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + if (play->csCtx.actorCues[cueChannel]->id == 2) { ret = true; } } @@ -345,7 +345,7 @@ void func_808B921C(DoorWarp1* this, PlayState* play) { } if (func_808B866C(this, play) && !Play_InCsMode(play)) { - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT); Message_StartTextbox(play, 0xF2, &this->dyna.actor); DoorWarp1_SetupAction(this, func_808B93A0); } @@ -368,7 +368,7 @@ void func_808B93A0(DoorWarp1* this, PlayState* play) { DoorWarp1_SetupAction(this, func_808B9524); } else { func_8019F230(); - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END); DoorWarp1_SetupAction(this, func_808B94A4); } } @@ -377,7 +377,7 @@ void func_808B93A0(DoorWarp1* this, PlayState* play) { } void func_808B94A4(DoorWarp1* this, PlayState* play) { - if (!func_808B866C(this, play) && (ActorCutscene_GetCurrentIndex() != play->playerActorCsIds[8])) { + if (!func_808B866C(this, play) && (CutsceneManager_GetCurrentCsId() != play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) { DoorWarp1_SetupAction(this, func_808B921C); } func_808BB8D4(this, play, 1); @@ -385,10 +385,10 @@ void func_808B94A4(DoorWarp1* this, PlayState* play) { } void func_808B9524(DoorWarp1* this, PlayState* play) { - if (!ActorCutscene_GetCanPlayNext(play->playerActorCsIds[9])) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[9]); + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE]); } else { - ActorCutscene_Start(play->playerActorCsIds[9], NULL); + CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE], NULL); DoorWarp1_SetupAction(this, func_808B958C); } } @@ -458,10 +458,10 @@ void func_808B977C(DoorWarp1* this, PlayState* play) { } void func_808B9840(DoorWarp1* this, PlayState* play) { - if (!ActorCutscene_GetCanPlayNext(play->playerActorCsIds[9])) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[9]); + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE]); } else { - ActorCutscene_Start(play->playerActorCsIds[9], NULL); + CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE], NULL); DoorWarp1_SetupAction(this, func_808B98A8); } } @@ -617,10 +617,10 @@ void func_808B9FD0(DoorWarp1* this, PlayState* play) { return; } - if (!ActorCutscene_GetCanPlayNext(play->playerActorCsIds[9])) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[9]); + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE]); } else { - ActorCutscene_Start(play->playerActorCsIds[9], NULL); + CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_ENTRANCE], NULL); AudioSfx_PlaySfx(NA_SE_EV_LINK_WARP, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Animation_ChangeImpl(&this->skelAnime, &gWarpCrystalAnim, 1.0f, Animation_GetLastFrame(&gWarpCrystalAnim), @@ -638,7 +638,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) { if ((play->sceneId == SCENE_MITURIN_BS) || (play->sceneId == SCENE_HAKUGIN_BS) || (play->sceneId == SCENE_INISIE_BS) || (play->sceneId == SCENE_SEA_BS)) { - D_801F4DE2 = play->sceneId; + gDungeonBossWarpSceneId = play->sceneId; if (play->sceneId == SCENE_MITURIN_BS) { phi_v0_2 = 0; } else if (play->sceneId == SCENE_HAKUGIN_BS) { @@ -711,7 +711,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) { } else { switch (phi_v0_2) { case 0: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { // Skips the entrance cutscene as this flag is attached to `ENTRANCE(WOODFALL_TEMPLE, 1)` SET_WEEKEVENTREG(WEEKEVENTREG_ENTERED_WOODFALL_TEMPLE_PRISON); play->nextEntrance = ENTRANCE(WOODFALL_TEMPLE, 1); @@ -728,7 +728,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) { break; case 1: - SET_WEEKEVENTREG(WEEKEVENTREG_33_80); + SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE); play->nextEntrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 7); play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; @@ -736,14 +736,14 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) { break; case 3: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { play->nextEntrance = ENTRANCE(ZORA_CAPE, 9); gSaveContext.nextCutsceneIndex = 0xFFF0; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_WHITE; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; } else { - SET_WEEKEVENTREG(WEEKEVENTREG_55_80); + SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE); play->nextEntrance = ENTRANCE(ZORA_CAPE, 8); gSaveContext.nextCutsceneIndex = 0xFFF0; play->transitionTrigger = TRANS_TRIGGER_START; @@ -753,7 +753,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) { break; case 2: - SET_WEEKEVENTREG(WEEKEVENTREG_52_20); + SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE); play->nextEntrance = ENTRANCE(IKANA_CANYON, 15); gSaveContext.nextCutsceneIndex = 0xFFF2; play->transitionTrigger = TRANS_TRIGGER_START; @@ -880,7 +880,7 @@ void func_808BA550(DoorWarp1* this, PlayState* play) { void func_808BAAF4(DoorWarp1* this, PlayState* play) { Player* player = GET_PLAYER(play); - s16 cutscene; + s16 csId; f32 phi_f2; phi_f2 = 200.0f; @@ -891,14 +891,14 @@ void func_808BAAF4(DoorWarp1* this, PlayState* play) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_86_80) && (fabsf(this->dyna.actor.xzDistToPlayer) < phi_f2) && ((player->actor.world.pos.y - 20.0f) < this->dyna.actor.world.pos.y) && (this->dyna.actor.world.pos.y < (player->actor.world.pos.y + 20.0f))) { - cutscene = this->dyna.actor.cutscene; + csId = this->dyna.actor.csId; - if (ActorCutscene_GetCanPlayNext(cutscene)) { - ActorCutscene_Start(cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_Start(csId, &this->dyna.actor); SET_WEEKEVENTREG(WEEKEVENTREG_86_80); DoorWarp1_SetupAction(this, func_808BABF4); } else { - ActorCutscene_SetIntentToPlay(cutscene); + CutsceneManager_Queue(csId); } } } diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h index 076999e576..1bc7e13bcc 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h @@ -53,7 +53,7 @@ typedef struct DoorWarp1 { /* 0x202 */ u8 unk_202; /* 0x203 */ u8 unk_203; /* 0x204 */ f32 unk_204; - /* 0x208 */ u8 unk_208; + /* 0x208 */ u8 cueId; } DoorWarp1; // size = 0x20C #endif // Z_DOOR_WARP1_H diff --git a/src/overlays/actors/ovl_Eff_Change/z_eff_change.c b/src/overlays/actors/ovl_Eff_Change/z_eff_change.c index 9174fafc00..65fb8da2f2 100644 --- a/src/overlays/actors/ovl_Eff_Change/z_eff_change.c +++ b/src/overlays/actors/ovl_Eff_Change/z_eff_change.c @@ -56,7 +56,7 @@ void EffChange_Init(Actor* thisx, PlayState* play) { this->step = 0; this->actor.shape.rot.y = 0; this->skeletonInfo.frameCtrl.unk_C = (2.0f / 3.0f); - ActorCutscene_SetIntentToPlay(0x7B); + CutsceneManager_Queue(CS_ID_GLOBAL_ELEGY); } void EffChange_Destroy(Actor* thisx, PlayState* play) { @@ -80,7 +80,7 @@ void func_80A4C5CC(EffChange* this, PlayState* play) { if (func_80183DE0(&this->skeletonInfo)) { Actor_Kill(&this->actor); - ActorCutscene_Stop(0x7B); + CutsceneManager_Stop(CS_ID_GLOBAL_ELEGY); func_800FD2B4(play, 0.0f, 850.0f, 0.2f, 0.0f); return; } @@ -109,11 +109,11 @@ void func_80A4C5CC(EffChange* this, PlayState* play) { phi_fv0 = 0.0f; } func_800FD2B4(play, phi_fv0, 850.0f, 0.2f, 0.0f); - if (ActorCutscene_GetCurrentIndex() != 0x7B) { - if (ActorCutscene_GetCanPlayNext(0x7B)) { - ActorCutscene_Start(0x7B, &this->actor); + if (CutsceneManager_GetCurrentCsId() != CS_ID_GLOBAL_ELEGY) { + if (CutsceneManager_IsNext(CS_ID_GLOBAL_ELEGY)) { + CutsceneManager_Start(CS_ID_GLOBAL_ELEGY, &this->actor); } else { - ActorCutscene_SetIntentToPlay(0x7B); + CutsceneManager_Queue(CS_ID_GLOBAL_ELEGY); } } } diff --git a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c index 0ebb5139dc..fbe4c27cf6 100644 --- a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c +++ b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c @@ -82,9 +82,9 @@ void func_80BCEBC0(EffKamejimaWave* this, PlayState* play) { } void func_80BCEC6C(EffKamejimaWave* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x1E0)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 0x1E0)); - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x1E0)]->action == 2) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_480)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_480)); + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_480)]->id == 2) { this->scaleOffset = 0.05f; this->actionFunc = func_80BCEBC0; this->actor.draw = EffKamejimaWave_Draw; @@ -117,9 +117,9 @@ void func_80BCED34(EffKamejimaWave* this, PlayState* play) { } void func_80BCEDE0(EffKamejimaWave* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x1F6)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 0x1F6)); - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x1F6)]->action == 2) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_502)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_502)); + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_502)]->id == 2) { this->scaleOffset = 0.03f; this->actor.scale.x = 0.35f; this->actionFunc = func_80BCED34; diff --git a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c index 015e9e715d..a37f4ec07b 100644 --- a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c +++ b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c @@ -49,7 +49,7 @@ void EffLastday_Init(Actor* thisx, PlayState* play2) { case EFFLASTDAY_PARAMS_1: this->dList = object_lastday_DL_000510; this->matAnim = Lib_SegmentedToVirtual(object_lastday_Matanimheader_000608); - this->csActionCmd = 0x1FC; + this->cueType = CS_CMD_ACTOR_CUE_508; this->actionFunc = func_80BEBDF8; Actor_SetScale(&this->actor, 1.0f); break; @@ -57,7 +57,7 @@ void EffLastday_Init(Actor* thisx, PlayState* play2) { case EFFLASTDAY_PARAMS_2: this->dList = object_lastday_DL_000210; this->matAnim = Lib_SegmentedToVirtual(object_lastday_Matanimheader_000308); - this->csActionCmd = 0x1FD; + this->cueType = CS_CMD_ACTOR_CUE_509; this->actionFunc = func_80BEBEB8; Actor_SetScale(&this->actor, 0.5f); break; @@ -65,7 +65,7 @@ void EffLastday_Init(Actor* thisx, PlayState* play2) { case EFFLASTDAY_PARAMS_3: this->dList = object_lastday_DL_000060; this->matAnim = Lib_SegmentedToVirtual(object_lastday_Matanimheader_000148); - this->csActionCmd = 0x1FE; + this->cueType = CS_CMD_ACTOR_CUE_510; this->actionFunc = func_80BEBF78; Actor_SetScale(&this->actor, 0.2f); this->actor.home.rot.z = 0; @@ -74,7 +74,7 @@ void EffLastday_Init(Actor* thisx, PlayState* play2) { default: this->dList = object_lastday_DL_000370; this->matAnim = Lib_SegmentedToVirtual(object_lastday_Matanimheader_000448); - this->csActionCmd = 0x1FB; + this->cueType = CS_CMD_ACTOR_CUE_507; this->actionFunc = func_80BEBD0C; Actor_SetScale(&this->actor, 1.0f); Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EFF_LASTDAY, this->actor.world.pos.x, @@ -94,12 +94,12 @@ void EffLastday_Destroy(Actor* thisx, PlayState* play) { } void func_80BEBD0C(EffLastday* this, PlayState* play) { - u16 csAction; + u16 cueId; - if ((Cutscene_CheckActorAction(play, this->csActionCmd))) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csActionCmd)); - csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csActionCmd)]->action; - switch (csAction) { + if ((Cutscene_IsCueInChannel(play, this->cueType))) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + switch (cueId) { default: this->actor.draw = NULL; this->alpha = 0; @@ -128,12 +128,12 @@ void func_80BEBD0C(EffLastday* this, PlayState* play) { } void func_80BEBDF8(EffLastday* this, PlayState* play) { - u16 csAction; + u16 cueId; - if (Cutscene_CheckActorAction(play, this->csActionCmd)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csActionCmd)); - csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csActionCmd)]->action; - switch (csAction) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + switch (cueId) { default: this->actor.draw = NULL; this->step = 0; @@ -154,12 +154,12 @@ void func_80BEBDF8(EffLastday* this, PlayState* play) { } void func_80BEBEB8(EffLastday* this, PlayState* play) { - u16 csAction; + u16 cueId; - if (Cutscene_CheckActorAction(play, this->csActionCmd)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csActionCmd)); - csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csActionCmd)]->action; - switch (csAction) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + switch (cueId) { default: this->actor.draw = NULL; this->step = 0; @@ -180,12 +180,12 @@ void func_80BEBEB8(EffLastday* this, PlayState* play) { } void func_80BEBF78(EffLastday* this, PlayState* play) { - u16 csAction; + u16 cueId; - if (Cutscene_CheckActorAction(play, this->csActionCmd)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csActionCmd)); - csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csActionCmd)]->action; - switch (csAction) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + switch (cueId) { default: this->actor.draw = NULL; this->alpha = 0; diff --git a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.h b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.h index 89266d7443..0b50028637 100644 --- a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.h +++ b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.h @@ -15,7 +15,7 @@ typedef struct EffLastday { /* 0x148 */ AnimatedMaterial* matAnim; /* 0x14C */ s16 step; /* 0x14E */ s16 alpha; - /* 0x150 */ s16 csActionCmd; + /* 0x150 */ s16 cueType; /* 0x154 */ EffLastdayActionFunc actionFunc; } EffLastday; // size = 0x158 diff --git a/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c b/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c index 842ae4b9ec..2b1c01c591 100644 --- a/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c +++ b/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c @@ -43,12 +43,12 @@ void EffZoraband_Destroy(Actor* thisx, PlayState* play) { } void EffZoraband_MikauFadeOut(EffZoraband* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x20F)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_527)) { if ((EFFZORABAND_GET_F(&this->actor) + 2) == - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x20F)]->action) { + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_527)]->id) { this->stateFlags |= 2; } - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x20F)]->action == 7) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_527)]->id == 7) { this->actor.draw = NULL; } else { this->actor.draw = EffZoraband_Draw; diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 3d7df7c278..c888353733 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -111,21 +111,21 @@ void func_8092E284(ElfMsg* this, PlayState* play) { if ((player->tatlActor != NULL) && ((func_8092E1FC(this)))) { player->tatlTextId = func_8092E1D0(this); - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); tatl->elfMsg = &this->actor; - if (this->actor.cutscene == -1) { - this->actor.cutscene = 0x7C; + if (this->actor.csId == CS_ID_NONE) { + this->actor.csId = CS_ID_GLOBAL_TALK; } if ((player->tatlTextId < 0) && (this->actor.home.rot.x < 0)) { - if (ActorCutscene_GetCurrentIndex() == 0x7D) { - ActorCutscene_Stop(0x7D); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_DOOR) { + CutsceneManager_Stop(CS_ID_GLOBAL_DOOR); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { this->actor.home.rot.x = 0; - ActorCutscene_Start(this->actor.cutscene, &this->actor); + CutsceneManager_Start(this->actor.csId, &this->actor); func_800E0348(play->cameraPtrs[CAM_ID_MAIN]); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index a29b226b0f..8244c7fb63 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -100,9 +100,9 @@ s32 func_8096EE50(ElfMsg2* this) { void func_8096EE64(ElfMsg2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - if (this->actor.cutscene != -1) { - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { - ActorCutscene_Stop(this->actor.cutscene); + if (this->actor.csId != CS_ID_NONE) { + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { + CutsceneManager_Stop(this->actor.csId); } } @@ -115,14 +115,14 @@ void func_8096EE64(ElfMsg2* this, PlayState* play) { } ElfMsg2_SetupAction(this, func_8096EF98); - } else if ((this->actor.cutscene != -1) && (ActorCutscene_GetCurrentIndex() != this->actor.cutscene)) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + } else if ((this->actor.csId != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() != this->actor.csId)) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } diff --git a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c index da6b291804..e3e8b7bc53 100644 --- a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c +++ b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c @@ -110,20 +110,20 @@ void func_80A2CF7C(ElfMsg3* this, PlayState* play) { ((player->actor.world.pos.y - this->actor.world.pos.y) < (100.0f * this->actor.scale.y))) && (fabsf(player->actor.world.pos.z - this->actor.world.pos.z) < (100.0f * this->actor.scale.z))) { player->tatlTextId = func_80A2CF50(this); - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); tatl->elfMsg = &this->actor; - if (this->actor.cutscene == -1) { - this->actor.cutscene = 0x7C; + if (this->actor.csId == CS_ID_NONE) { + this->actor.csId = CS_ID_GLOBAL_TALK; } if ((player->tatlTextId < 0) && (this->actor.home.rot.x < 0)) { - if (ActorCutscene_GetCurrentIndex() == 0x7D) { - ActorCutscene_Stop(0x7D); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_DOOR) { + CutsceneManager_Stop(CS_ID_GLOBAL_DOOR); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); func_800E0348(play->cameraPtrs[CAM_ID_MAIN]); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } diff --git a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c index 7fbf402fa8..c917f01a77 100644 --- a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c +++ b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c @@ -115,20 +115,20 @@ void func_80AFD668(ElfMsg4* this, PlayState* play) { if ((player->tatlActor != NULL) && func_80AFD5E0(this)) { player->tatlTextId = ElfMsg4_GetTextId(this); - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); tatl->elfMsg = this->elfMsg5; - if (this->actor.cutscene == -1) { - this->actor.cutscene = 0x7C; + if (this->actor.csId == CS_ID_NONE) { + this->actor.csId = CS_ID_GLOBAL_TALK; } if ((player->tatlTextId < 0) && (this->actor.home.rot.x < 0)) { - if (ActorCutscene_GetCurrentIndex() == 0x7D) { - ActorCutscene_Stop(0x7D); - ActorCutscene_SetIntentToPlay((s16)this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext((s16)this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_DOOR) { + CutsceneManager_Stop(CS_ID_GLOBAL_DOOR); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); func_800E0348(play->cameraPtrs[CAM_ID_MAIN]); } else { - ActorCutscene_SetIntentToPlay((s16)this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } @@ -139,7 +139,7 @@ void func_80AFD770(ElfMsg4* this, PlayState* play) { while (bgActor != NULL) { if ((bgActor->id != ACTOR_ELF_MSG5) || (ELFMSG4_GET_TEXT(&this->actor) != ELFMSG5_GET_FF(bgActor)) || - (this->actor.cutscene != bgActor->cutscene)) { + (this->actor.csId != bgActor->csId)) { bgActor = bgActor->next; } else { this->elfMsg5 = bgActor; diff --git a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c index d05c099e90..89fbd9f6b3 100644 --- a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c +++ b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c @@ -154,8 +154,8 @@ void ElfMsg6_Init(Actor* thisx, PlayState* play) { case 1: this->actionFunc = func_80BA1F80; - if ((this->actor.cutscene == -1) || ((ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) && - Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)))) { + if ((this->actor.csId == CS_ID_NONE) || ((ELFMSG6_SWITCHFLAG(&this->actor) != 0x7F) && + Flags_GetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)))) { Actor_Kill(&this->actor); return; } @@ -246,10 +246,10 @@ void func_80BA1C88(ElfMsg6* this, PlayState* play, s16 arg2) { if (player->tatlActor != NULL) { player->tatlTextId = arg2; - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); sp20->elfMsg = &this->actor; - if (this->actor.cutscene == -1) { - this->actor.cutscene = 0x7C; + if (this->actor.csId == CS_ID_NONE) { + this->actor.csId = CS_ID_GLOBAL_TALK; } } } @@ -280,10 +280,10 @@ void func_80BA1CF8(ElfMsg6* this, PlayState* play) { this->actor.textId = 0x25B; } else if (func_80BA1C00(this) && (player->actor.speed > 1.0f)) { player->tatlTextId = -this->actor.textId; - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); sp20->elfMsg = &this->actor; - if (this->actor.cutscene == -1) { - this->actor.cutscene = 0x7C; + if (this->actor.csId == CS_ID_NONE) { + this->actor.csId = CS_ID_GLOBAL_TALK; } } } @@ -321,10 +321,10 @@ void func_80BA1E30(ElfMsg6* this, PlayState* play) { if (func_80BA1C00(this) && (player->actor.speed > 1.0f)) { player->tatlTextId = -this->actor.textId; - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); sp20->elfMsg = &this->actor; - if (this->actor.cutscene == -1) { - this->actor.cutscene = 0x7C; + if (this->actor.csId == CS_ID_NONE) { + this->actor.csId = CS_ID_GLOBAL_TALK; } } } @@ -336,14 +336,14 @@ void func_80BA1F80(ElfMsg6* this, PlayState* play) { } if (func_80BA1C00(this)) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, NULL); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, NULL); Flags_SetSwitch(play, ELFMSG6_SWITCHFLAG(&this->actor)); Actor_Kill(&this->actor); return; } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index 99779f20b3..41dba0aab5 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -1417,14 +1417,14 @@ void func_80BEF518(EnAkindonuts* this, PlayState* play) { } if (this->unk_35E == 0) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_35E = 1; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); return; } } @@ -1546,14 +1546,14 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) { if (func_80BECD10(this, this->path, this->unk_334) && (sp34 < 10.0f)) { if (this->unk_334 >= (this->path->count - 1)) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->actionFunc = func_80BEFD74; } else { this->unk_334++; } } } else if (this->actor.playerHeightRel > 500.0f) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->actionFunc = func_80BEFD74; } @@ -1569,17 +1569,17 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) { func_80BECBE0(this, sp32); if (this->unk_35E == 2) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_35E = 3; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); return; } } else if ((this->unk_35E == 1) && (this->unk_356 == 20)) { - ActorCutscene_Stop(this->cutscene); - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene); - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); + CutsceneManager_Queue(this->csId); this->unk_35E = 2; } this->unk_356++; @@ -1617,7 +1617,7 @@ void EnAkindonuts_Init(Actor* thisx, PlayState* play) { this->unk_32C |= 0x2; this->unk_32C |= 0x4; this->unk_338 = 4; - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; func_80BEE938(this, play); this->actionFunc = func_80BEEB20; } diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.h b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.h index 72c932d0c0..180d73ed46 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.h +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.h @@ -43,7 +43,7 @@ typedef struct EnAkindonuts { /* 0x358 */ f32 unk_358; /* 0x35C */ s16 unk_35C; /* 0x35E */ s16 unk_35E; - /* 0x360 */ s16 cutscene; + /* 0x360 */ s16 csId; /* 0x362 */ s16 unk_362; /* 0x364 */ s16 unk_364; /* 0x366 */ s8 unk_366; diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c index 4430656334..87b83e6707 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -219,30 +219,30 @@ Actor* func_80BDE384(EnAl* this, PlayState* play) { return actor; } -s32 func_80BDE408(EnAl* this, s16 arg1) { +s32 func_80BDE408(EnAl* this, s16 csId) { s32 ret = false; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(arg1); - } else if (ActorCutscene_GetCanPlayNext(arg1)) { - ActorCutscene_StartAndSetUnkLinkFields(arg1, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(csId); + } else if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); ret = true; } else { - ActorCutscene_SetIntentToPlay(arg1); + CutsceneManager_Queue(csId); } return ret; } -s16 func_80BDE484(EnAl* this, s32 arg1) { - s16 cs = this->actor.cutscene; +s16 func_80BDE484(EnAl* this, s32 numCutscenes) { + s16 csId = this->actor.csId; s32 i; - for (i = 0; i < arg1; i++) { - cs = ActorCutscene_GetAdditionalCutscene(cs); + for (i = 0; i < numCutscenes; i++) { + csId = CutsceneManager_GetAdditionalCsId(csId); } - return cs; + return csId; } s32 func_80BDE4E0(EnAl* this, s16* arg1, s16 arg2) { @@ -317,13 +317,13 @@ s32 func_80BDE678(EnAl* this, s16* arg1, s16 arg2) { s32 func_80BDE7FC(EnAl* this, PlayState* play) { s32 pad; - s16 sp2A = func_80BDE484(this, 0); + s16 csId = func_80BDE484(this, 0); s32 pad2; s32 sp20 = false; switch (this->unk_4E6) { case 0: - if (!func_80BDE408(this, sp2A)) { + if (!func_80BDE408(this, csId)) { break; } @@ -332,7 +332,8 @@ s32 func_80BDE7FC(EnAl* this, PlayState* play) { case 6: case 8: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), this->actor.child); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), + this->actor.child); } this->unk_4E6++; sp20 = true; @@ -342,13 +343,13 @@ s32 func_80BDE7FC(EnAl* this, PlayState* play) { case 3: case 5: case 7: - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), &this->actor); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), &this->actor); this->unk_4E6++; sp20 = true; break; case 9: - ActorCutscene_Stop(sp2A); + CutsceneManager_Stop(csId); this->unk_4E6++; sp20 = true; break; diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 6d64883830..d4c9800558 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -305,15 +305,15 @@ void EnAni_Update(Actor* thisx, PlayState* play) { this->blinkFunc(this); if (this->stateFlags & ANI_STATE_FALLING) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { this->stateFlags &= ~ANI_STATE_FALLING; - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); - this->actor.cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); - Camera_SetToTrackActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(this->actor.cutscene)), + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); + this->actor.csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); + Camera_SetToTrackActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->actor.csId)), &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c index 0f66d5cf4d..5aa7462983 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c @@ -130,7 +130,7 @@ void func_809C11EC(EnAob01* this, PlayState* play) { this->unk_3F8[i] = Actor_SpawnAsChildAndCutscene( &play->actorCtx, play, ACTOR_EN_DG, D_809C384C[i].unk_00.x, D_809C384C[i].unk_00.y, D_809C384C[i].unk_00.z, - 0, DEG_TO_BINANG(D_809C384C[i].unk_04), 0, enDgParams, 0xFFFF, this->actor.halfDaysBits, NULL); + 0, DEG_TO_BINANG(D_809C384C[i].unk_04), 0, enDgParams, (u16)CS_ID_NONE, this->actor.halfDaysBits, NULL); } } @@ -140,7 +140,7 @@ void func_809C1304(EnAob01* this, PlayState* play) { for (i = 0; i < ARRAY_COUNT(this->unk_3F8); i++) { this->unk_3F8[i] = Actor_SpawnAsChildAndCutscene( &play->actorCtx, play, ACTOR_EN_RACEDOG, (i * 15.0f) + -3897.0f, 130.0f, 1290.0f - (i * 10.0f), 0, 0x1555, - 0, (i << 5) | ENAOB01_GET_7E00_1(&this->actor), 0xFFFF, this->actor.halfDaysBits, NULL); + 0, (i << 5) | ENAOB01_GET_7E00_1(&this->actor), (u16)CS_ID_NONE, this->actor.halfDaysBits, NULL); } } @@ -394,7 +394,7 @@ void func_809C16DC(EnAob01* this, PlayState* play) { if (this->unk_2D2 & 2) { this->unk_2D2 &= ~2; Rupees_ChangeBy(-this->unk_434); - func_800B7298(play, NULL, PLAYER_CSMODE_7); + func_800B7298(play, NULL, PLAYER_CSMODE_WAIT); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->actionFunc = func_809C1C9C; @@ -602,10 +602,11 @@ s32 func_809C2504(EnAob01* this, PlayState* play) { Actor* npc = play->actorCtx.actorLists[ACTORCAT_NPC].first; while (npc != NULL) { - if ((npc->id == ACTOR_EN_RACEDOG) && (func_800F2178(this->unk_430) == ((EnRacedog*)npc)->currentPoint)) { - ActorCutscene_Stop(this->unk_430); + if ((npc->id == ACTOR_EN_RACEDOG) && + (CutsceneManager_GetCutsceneCustomValue(this->csId) == ((EnRacedog*)npc)->currentPoint)) { + CutsceneManager_Stop(this->csId); this->unk_3F4 = npc; - this->unk_430 = ActorCutscene_GetAdditionalCutscene(this->unk_430); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); return true; } npc = npc->next; @@ -650,22 +651,22 @@ s32 func_809C25E4(EnAob01* this, PlayState* play) { } s32 func_809C2680(EnAob01* this) { - if ((ActorCutscene_GetLength(this->unk_430) > 0) && (ActorCutscene_GetCurrentIndex() != this->unk_430)) { - this->unk_430 = ActorCutscene_GetAdditionalCutscene(this->unk_430); + if ((CutsceneManager_GetLength(this->csId) > 0) && (CutsceneManager_GetCurrentCsId() != this->csId)) { + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); return true; } return false; } void func_809C26E4(EnAob01* this, PlayState* play) { - ActorCutscene_Stop(this->unk_430); - this->unk_430 = ActorCutscene_GetAdditionalCutscene(this->unk_430); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); this->actionFunc = func_809C2824; } void func_809C2730(EnAob01* this, PlayState* play) { if (func_809C2504(this, play) || func_809C2680(this)) { - ActorCutscene_SetIntentToPlay(this->unk_430); + CutsceneManager_Queue(this->csId); this->actionFunc = func_809C2824; } } @@ -684,9 +685,9 @@ void func_809C2788(EnAob01* this, PlayState* play) { } void func_809C2824(EnAob01* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_430)) { - ActorCutscene_Start(this->unk_430, this->unk_3F4); - switch (func_800F2178(this->unk_430)) { + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, this->unk_3F4); + switch (CutsceneManager_GetCutsceneCustomValue(this->csId)) { case 255: this->actionFunc = func_809C26E4; break; @@ -699,7 +700,7 @@ void func_809C2824(EnAob01* this, PlayState* play) { this->actionFunc = func_809C2730; } } else { - ActorCutscene_SetIntentToPlay(this->unk_430); + CutsceneManager_Queue(this->csId); } } @@ -947,9 +948,9 @@ void EnAob01_Init(Actor* thisx, PlayState* play) { this->unk_440 = 500; func_809C1304(this, play); this->actor.draw = NULL; - this->unk_430 = this->actor.cutscene; + this->csId = this->actor.csId; func_809C2594(this, play); - ActorCutscene_SetIntentToPlay(this->unk_430); + CutsceneManager_Queue(this->csId); this->actor.flags &= ~ACTOR_FLAG_1; func_809C2F34(this, play); this->actionFunc = func_809C2824; diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.h b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.h index 2507b1728e..5432f74ae4 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.h +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.h @@ -34,7 +34,7 @@ typedef struct EnAob01 { /* 0x3F0 */ s16 blinkTimer; /* 0x3F4 */ Actor* unk_3F4; /* 0x3F8 */ Actor* unk_3F8[14]; - /* 0x430 */ s16 unk_430; + /* 0x430 */ s16 csId; /* 0x432 */ s16 unk_432; /* 0x434 */ s32 unk_434; /* 0x438 */ UNK_TYPE1 unk438[4]; diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.c b/src/overlays/actors/ovl_En_Az/z_en_az.c index 2878d1fc6c..1c2cdf533f 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -253,7 +253,7 @@ void EnAz_Init(Actor* thisx, PlayState* play2) { if (this->unk_2F8 == 0) { this->unk_374 |= 2; } - SubS_FillCutscenesList(&this->actor, this->unk_3D0, ARRAY_COUNT(this->unk_3D0)); + SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList)); if (D_80A9913C == NULL) { D_80A9913C = THIS; this->unk_374 |= 1; @@ -595,7 +595,7 @@ void func_80A95CEC(EnAz* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_DOWN); } - if (SubS_StartActorCutscene(&this->actor, 0x7C, this->unk_3D0[0], SUBS_CUTSCENE_NORMAL)) { + if (SubS_StartCutscene(&this->actor, CS_ID_GLOBAL_TALK, this->csIdList[0], SUBS_CUTSCENE_NORMAL)) { func_80A97C0C(this, play); } } @@ -649,10 +649,10 @@ void func_80A95F94(EnAz* this, PlayState* play) { void func_80A95FE8(EnAz* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (ActorCutscene_GetCanPlayNext(this->unk_3D0[0])) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_3D0[0], &this->actor); + if (CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->unk_3D0[0]); + CutsceneManager_Queue(this->csIdList[0]); } if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) > 20.0f) { func_800B9010(&this->actor, NA_SE_EV_BEAVER_SWIM_MOTOR - SFX_FLAG); @@ -672,7 +672,7 @@ void func_80A95FE8(EnAz* this, PlayState* play) { this->actor.shape.rot.x = 0; this->actor.gravity = 0.0f; func_80A97C0C(this, play); - ActorCutscene_Stop(this->unk_3D0[0]); + CutsceneManager_Stop(this->csIdList[0]); } Actor_MoveWithGravity(&this->actor); } @@ -688,7 +688,8 @@ s32 func_80A9617C(EnAz* this, PlayState* play) { case TEXT_STATE_5: case TEXT_STATE_DONE: if ((play->msgCtx.currentTextId == 0x10DD) && (this->unk_374 & 0x8000)) { - if (SubS_StartActorCutscene(&brother->actor, brother->unk_3D0[0], 0x7C, SUBS_CUTSCENE_NORMAL)) { + if (SubS_StartCutscene(&brother->actor, brother->csIdList[0], CS_ID_GLOBAL_TALK, + SUBS_CUTSCENE_NORMAL)) { brother->unk_374 |= 0x8000; play->msgCtx.msgMode = 0x44; ret = 0; @@ -1398,7 +1399,7 @@ void func_80A97A28(EnAz* this, PlayState* play) { } void func_80A97A40(EnAz* this, PlayState* play) { - if (SubS_StartActorCutscene(&this->actor, 0, -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->actor, 0, CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { play->msgCtx.msgMode = 0; play->msgCtx.msgLength = 0; func_80A97A9C(this, play); diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.h b/src/overlays/actors/ovl_En_Az/z_en_az.h index 2a219eb24e..a4c1785fe7 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.h +++ b/src/overlays/actors/ovl_En_Az/z_en_az.h @@ -45,7 +45,7 @@ typedef struct EnAz { /* 0x3C4 */ s16 unk_3C4; /* 0x3C6 */ UNK_TYPE1 unk3C6[6]; /* 0x3CC */ s32 getItemId; - /* 0x3D0 */ s16 unk_3D0[1]; + /* 0x3D0 */ s16 csIdList[1]; /* 0x3D2 */ u16 unk_3D2; /* 0x3D4 */ s16 unk_3D4; /* 0x3D6 */ s16 unk_3D6; diff --git a/src/overlays/actors/ovl_En_Bat/z_en_bat.c b/src/overlays/actors/ovl_En_Bat/z_en_bat.c index 9e2d8abe20..963bc41046 100644 --- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c +++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c @@ -165,7 +165,7 @@ void EnBat_Init(Actor* thisx, PlayState* play) { &play->actorCtx, play, ACTOR_EN_BAT, thisx->world.pos.x + randPlusMinusPoint5Scaled(200.0f), thisx->world.pos.y + randPlusMinusPoint5Scaled(100.0f), thisx->world.pos.z + randPlusMinusPoint5Scaled(200.0f), randPlusMinusPoint5Scaled(0x2000), - 0xFFFF * Rand_ZeroOne(), 0, BAD_BAT_PARAMS(this->switchFlag, this->paramFlags, 0), -1, + 0xFFFF * Rand_ZeroOne(), 0, BAD_BAT_PARAMS(this->switchFlag, this->paramFlags, 0), CS_ID_NONE, thisx->halfDaysBits, NULL); BAD_BAT_GET_NUMBER_TO_SPAWN(thisx)--; } diff --git a/src/overlays/actors/ovl_En_Bee/z_en_bee.c b/src/overlays/actors/ovl_En_Bee/z_en_bee.c index 80ad3e7a21..f93d18bf5c 100644 --- a/src/overlays/actors/ovl_En_Bee/z_en_bee.c +++ b/src/overlays/actors/ovl_En_Bee/z_en_bee.c @@ -104,7 +104,7 @@ void EnBee_Init(Actor* thisx, PlayState* play) { sNumLoadedBees++; this->actor.shape.shadowScale = 12.0f; - if (ActorCutscene_GetCurrentIndex() != -1) { + if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) { func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ITEMACTION); } @@ -149,7 +149,7 @@ void EnBee_FlyIdle(EnBee* this, PlayState* play) { Vec3f nextPos; s32 pad[2]; - if ((this->actor.category != ACTORCAT_ENEMY) && (ActorCutscene_GetCurrentIndex() == -1)) { + if ((this->actor.category != ACTORCAT_ENEMY) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE)) { func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY); } diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 2ffe6c8ef3..f331666d36 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -102,9 +102,9 @@ void EnBigokuta_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->shellCollider, &this->picto.actor, &sShellCylinderInit); Collider_InitAndSetCylinder(play, &this->bodyCollider, &this->picto.actor, &sBodyCylinderInit); CollisionCheck_SetInfo(&this->picto.actor.colChkInfo, NULL, &sColChkInfoInit); - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->picto.actor.cutscene); + this->csId = CutsceneManager_GetAdditionalCsId(this->picto.actor.csId); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02) || + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE) || ((this->picto.actor.params != 0xFF) && Flags_GetSwitch(play, this->picto.actor.params))) { Actor_Kill(&this->picto.actor); } else { @@ -129,8 +129,8 @@ void EnBigokuta_Destroy(Actor* thisx, PlayState* play) { void EnBigokuta_SetupCutsceneCamera(EnBigokuta* this, PlayState* play, Vec3f* subCamAt, Vec3f* subCamEye) { s16 angle; - ActorCutscene_Start(this->picto.actor.cutscene, &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_Start(this->picto.actor.csId, &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); Play_SetCameraAtEye(play, this->subCamId, subCamAt, subCamEye); angle = BINANG_SUB(Actor_WorldYawTowardPoint(&this->picto.actor, subCamEye), this->picto.actor.home.rot.y); @@ -160,7 +160,7 @@ void EnBigokuta_ResetCamera(EnBigokuta* this, PlayState* play) { subCam = Play_GetCamera(play, this->subCamId); Play_SetCameraAtEye(play, CAM_ID_MAIN, &subCam->at, &subCam->eye); this->subCamId = SUB_CAM_ID_DONE; - ActorCutscene_Stop(this->picto.actor.cutscene); + CutsceneManager_Stop(this->picto.actor.csId); } } @@ -267,15 +267,15 @@ void EnBigokuta_IdleAboveWater(EnBigokuta* this, PlayState* play) { } void EnBigokuta_UpdateOrSetupCam(EnBigokuta* this, PlayState* play) { - if (this->picto.actor.cutscene != -1) { + if (this->picto.actor.csId != CS_ID_NONE) { if (this->subCamId != SUB_CAM_ID_DONE) { EnBigokuta_MoveCamera(this, play); - } else if (ActorCutscene_GetCanPlayNext(this->picto.actor.cutscene)) { + } else if (CutsceneManager_IsNext(this->picto.actor.csId)) { Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN); EnBigokuta_SetupCutsceneCamera(this, play, &mainCam->at, &mainCam->eye); } else { - ActorCutscene_SetIntentToPlay(this->picto.actor.cutscene); + CutsceneManager_Queue(this->picto.actor.csId); } } } @@ -289,7 +289,7 @@ void EnBigokuta_SetupSuckInPlayer(EnBigokuta* this, PlayState* play) { this->timer = 0; Animation_Change(&this->skelAnime, &gBigOctoIdleAnim, 1.0f, 12.0f, 12.0f, ANIMMODE_ONCE, -3.0f); - ActorCutscene_SetIntentToPlay(this->picto.actor.cutscene); + CutsceneManager_Queue(this->picto.actor.csId); this->playerHoldPos.x = (Math_SinS(this->picto.actor.shape.rot.y) * 66.0f) + this->picto.actor.world.pos.x; this->playerHoldPos.y = (this->picto.actor.home.pos.y - 49.5f) + 42.899998f; @@ -355,7 +355,7 @@ void EnBigokuta_HoldPlayer(EnBigokuta* this, PlayState* play) { } void EnBigokuta_SetupDeathCutscene(EnBigokuta* this) { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); this->timer = 0; this->bodyCollider.base.acFlags &= ~AC_ON; this->actionFunc = EnBigokuta_PlayDeathCutscene; @@ -374,11 +374,11 @@ void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, PlayState* play) { Actor_SpawnIceEffects(play, &this->picto.actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.5f, 0.35f); EnBigokuta_SetupDeathEffects(this); } - } else if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_Start(this->cutscene, &this->picto.actor); + } else if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, &this->picto.actor); if (!CHECK_EVENTINF(EVENTINF_41) && !CHECK_EVENTINF(EVENTINF_35)) { - func_800B724C(play, &this->picto.actor, PLAYER_CSMODE_7); + func_800B724C(play, &this->picto.actor, PLAYER_CSMODE_WAIT); } else { player = GET_PLAYER(play); player->stateFlags1 |= PLAYER_STATE1_20; @@ -390,7 +390,7 @@ void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, PlayState* play) { EnBigokuta_SetupDeathEffects(this); } } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } @@ -450,11 +450,11 @@ void EnBigokuta_PlayDeathEffects(EnBigokuta* this, PlayState* play) { Flags_SetSwitch(play, this->picto.actor.params); } - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); Actor_Kill(&this->picto.actor); if (!CHECK_EVENTINF(EVENTINF_41) && !CHECK_EVENTINF(EVENTINF_35)) { - func_800B724C(play, &this->picto.actor, PLAYER_CSMODE_6); + func_800B724C(play, &this->picto.actor, PLAYER_CSMODE_END); } else { Player* player = GET_PLAYER(play); diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h index 6bcfa79fbe..41ae325e07 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h @@ -16,7 +16,7 @@ typedef struct EnBigokuta { /* 0x190 */ u8 drawDmgEffType; /* 0x192 */ s16 timer; /* 0x194 */ s16 subCamId; - /* 0x196 */ s16 cutscene; + /* 0x196 */ s16 csId; /* 0x198 */ Vec3s jointTable[BIGOKUTA_LIMB_MAX]; /* 0x210 */ Vec3s morphTable[BIGOKUTA_LIMB_MAX]; /* 0x288 */ f32 drawDmgEffAlpha; diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index 30f857a896..c360681e89 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -293,22 +293,22 @@ void EnBigpo_WellWaitForProximity(EnBigpo* this, PlayState* play) { } void EnBigpo_SetupSpawnCutscene(EnBigpo* this) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = EnBigpo_WaitCutsceneQueue; } void EnBigpo_WaitCutsceneQueue(EnBigpo* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); - func_800B724C(play, &this->actor, PLAYER_CSMODE_7); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); + func_800B724C(play, &this->actor, PLAYER_CSMODE_WAIT); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); if (this->actor.params == ENBIGPO_REGULAR) { // and SUMMONED, got switched earlier EnBigpo_SpawnCutsceneStage1(this, play); } else { // ENBIGPO_REVEALEDFIRE EnBigpo_SetupFlameCirclePositions(this, play); } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -464,14 +464,14 @@ void EnBigpo_SpawnCutsceneStage8(EnBigpo* this, PlayState* play) { dampe = SubS_FindActor(play, NULL, ACTORCAT_NPC, ACTOR_EN_TK); if (dampe != NULL) { // if dampe exists, switch to viewing his running away cutscene - dampe->params = this->actor.cutscene; + dampe->params = this->actor.csId; } else { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); } } else { // ENBIGPO_REGULAR - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); } - func_800B724C(play, &this->actor, PLAYER_CSMODE_6); + func_800B724C(play, &this->actor, PLAYER_CSMODE_END); EnBigpo_SetupIdleFlying(this); // setup idle flying } } diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c index 47df4b75b6..c9b31571f5 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -347,7 +347,7 @@ void EnBigslime_Init(Actor* thisx, PlayState* play2) { return; } - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; this->actor.scale.x = this->actor.scale.z = 0.15f; this->actor.scale.y = 0.075f; this->vtxScaleX = this->vtxScaleZ = 0.015000001f; @@ -847,9 +847,9 @@ void EnBigslime_EndCutscene(EnBigslime* this, PlayState* play) { subCam = Play_GetCamera(play, this->subCamId); Play_SetCameraAtEye(play, CAM_ID_MAIN, &subCam->at, &subCam->eye); this->subCamId = SUB_CAM_ID_DONE; - ActorCutscene_Stop(this->cutscene); - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); - func_800B724C(play, &this->actor, PLAYER_CSMODE_6); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); + func_800B724C(play, &this->actor, PLAYER_CSMODE_END); } } @@ -986,7 +986,7 @@ void EnBigslime_SetupCallMinislime(EnBigslime* this, PlayState* play) { Animation_MorphToPlayOnce(&this->skelAnime, &gGekkoCallAnim, 5.0f); EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_GREET); this->callTimer = 0; - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); this->actionFunc = EnBigslime_CallMinislime; } @@ -2523,31 +2523,31 @@ void EnBigslime_InitEntrance(EnBigslime* this, PlayState* play) { } void EnBigslime_SetupCutscene(EnBigslime* this) { - if (ActorCutscene_GetCurrentIndex() == 0x7D) { - ActorCutscene_Stop(0x7D); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_DOOR) { + CutsceneManager_Stop(CS_ID_GLOBAL_DOOR); } if (this->actor.colChkInfo.health == 0) { - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); this->actionFuncStored = this->actionFunc; this->actionFunc = EnBigslime_PlayCutscene; this->actor.speed = 0.0f; } void EnBigslime_PlayCutscene(EnBigslime* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() == 0x7D) { - ActorCutscene_Stop(0x7D); - ActorCutscene_SetIntentToPlay(this->cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_Start(this->cutscene, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_DOOR) { + CutsceneManager_Stop(CS_ID_GLOBAL_DOOR); + CutsceneManager_Queue(this->csId); + } else if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, &this->actor); if (this->actionFuncStored != EnBigslime_SquishFlat) { - func_800B724C(play, &this->actor, PLAYER_CSMODE_7); + func_800B724C(play, &this->actor, PLAYER_CSMODE_WAIT); } - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->cutscene); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->csId); if (this->actor.colChkInfo.health == 0) { EnBigslime_SetupCutsceneDefeat(this, play); } else if ((this->actionFuncStored == EnBigslime_DamageGekko) || @@ -2560,7 +2560,7 @@ void EnBigslime_PlayCutscene(EnBigslime* this, PlayState* play) { EnBigslime_SetupCutsceneStartBattle(this, play); } } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h index 52a29013cf..f10938b37d 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.h @@ -66,7 +66,7 @@ typedef struct EnBigslime { /* 0x02B4 */ u8 shockwaveAlpha; /* 0x02B5 */ u8 gekkoDrawDmgEffType; /* 0x02B6 */ s16 gekkoYaw; - /* 0x02B8 */ s16 cutscene; + /* 0x02B8 */ s16 csId; /* 0x02BA */ union { // multi-use timer s16 idleTimer; s16 noticeTimer; diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c index 6cdca73a73..43e87a90ac 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c @@ -337,7 +337,7 @@ void EnBji01_Init(Actor* thisx, PlayState* play) { this->animIndex = -1; Actor_SetScale(&this->actor, 0.01f); - SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList)); this->moonsTear = (ObjMoonStone*)SubS_FindActor(play, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE); switch (gSaveContext.save.entrance) { diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h index 29afaf5333..84c346a1c9 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h @@ -31,7 +31,7 @@ typedef struct EnBji01 { /* 0x2A6 */ s16 headZRotStep; /* 0x2A8 */ s16 headXRotStep; /* 0x2AA */ u16 textId; - /* 0x2AC */ s16 cutscenes[1]; + /* 0x2AC */ s16 csIdList[1]; /* 0x2B0 */ ObjMoonStone* moonsTear; } EnBji01; // size = 0x2B4 diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 6b54c387cf..ae45b0cc58 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -99,8 +99,8 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play) { if ((gSaveContext.save.entrance == ENTRANCE(EAST_CLOCK_TOWN, 2)) && CHECK_WEEKEVENTREG(WEEKEVENTREG_73_80) && !CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) { - this->unk_2D6 = this->actor.cutscene; - if (this->unk_2D6 == 0) { + this->csId3 = this->actor.csId; + if (this->csId3 == 0) { Actor_Kill(&this->actor); } func_809C52B4(this); @@ -192,11 +192,11 @@ void func_809C4BC4(EnBomBowlMan* this, PlayState* play) { } } - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_2D0); - } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D0)) { - ActorCutscene_SetIntentToPlay(this->unk_2D0); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId1); + } else if (!CutsceneManager_IsNext(this->csId1)) { + CutsceneManager_Queue(this->csId1); } func_809C493C(this, 3, 1.0f); @@ -214,18 +214,18 @@ void func_809C4DA4(EnBomBowlMan* this, PlayState* play) { if (this->unk_2B8 == 0) { Player* player = GET_PLAYER(play); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_2D0); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId1); return; } - if (!ActorCutscene_GetCanPlayNext(this->unk_2D0)) { - ActorCutscene_SetIntentToPlay(this->unk_2D0); + if (!CutsceneManager_IsNext(this->csId1)) { + CutsceneManager_Queue(this->csId1); return; } - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D0, &this->actor); + CutsceneManager_StartWithPlayerCs(this->csId1, &this->actor); this->unk_2B8 = 1; this->unk_2C0 = 0; this->unk_2D4 = this->actor.yawTowardsPlayer; @@ -248,7 +248,7 @@ void func_809C4DA4(EnBomBowlMan* this, PlayState* play) { case 0: this->unk_2C0 = 1; D_809C6104 = 1; - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(this->unk_2D0)), + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csId1)), &this->unk_2D8[0]->actor); this->unk_2D4 = 0; this->unk_2BC = 10; @@ -268,7 +268,7 @@ void func_809C4DA4(EnBomBowlMan* this, PlayState* play) { case 2: if (player->transformation == PLAYER_FORM_HUMAN) { this->unk_2B8 = 2; - ActorCutscene_Stop(this->unk_2D0); + CutsceneManager_Stop(this->csId1); func_809C59A4(this, play); sp28 = true; } else { @@ -276,13 +276,13 @@ void func_809C4DA4(EnBomBowlMan* this, PlayState* play) { play->msgCtx.msgLength = 0; func_809C493C(this, 1, 1.0f); D_809C6100 = 1; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_2D2); - } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D2)) { - ActorCutscene_SetIntentToPlay(this->unk_2D2); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId2); + } else if (!CutsceneManager_IsNext(this->csId2)) { + CutsceneManager_Queue(this->csId2); } - ActorCutscene_Stop(this->unk_2D0); + CutsceneManager_Stop(this->csId1); this->actionFunc = func_809C5B1C; sp28 = true; } @@ -299,7 +299,7 @@ void func_809C4DA4(EnBomBowlMan* this, PlayState* play) { case 4: if (this->unk_2B8 != 2) { - ActorCutscene_Stop(this->unk_2D0); + CutsceneManager_Stop(this->csId1); } play->msgCtx.msgLength = 0; func_809C493C(this, 1, 1.0f); @@ -365,7 +365,7 @@ void func_809C5310(EnBomBowlMan* this, PlayState* play) { if (player->actor.world.pos.x < 1510.0f) { if (player->transformation != PLAYER_FORM_DEKU) { if (this->actor.xzDistToPlayer < this->unk_2C8) { - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); func_809C53A4(this); } } else { @@ -423,7 +423,7 @@ void func_809C5598(EnBomBowlMan* this, PlayState* play) { } else if (this->actor.textId == 0x734) { this->actor.textId = 0x715; } else if (this->actor.textId == 0x715) { - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); func_809C493C(this, 17, 1.0f); func_809C59A4(this, play); return; @@ -435,7 +435,7 @@ void func_809C5598(EnBomBowlMan* this, PlayState* play) { func_80151BB4(play, 0x24); func_80151BB4(play, 0x25); func_80151BB4(play, 0); - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); this->actionFunc = func_809C5738; return; } @@ -452,25 +452,25 @@ void func_809C5738(EnBomBowlMan* this, PlayState* play) { ((play->msgCtx.msgMode == 0) || (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE))) { this->unk_2C2 = 1; func_809C4B6C(this); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_2D6); - } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) { - ActorCutscene_SetIntentToPlay(this->unk_2D6); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId3); + } else if (!CutsceneManager_IsNext(this->csId3)) { + CutsceneManager_Queue(this->csId3); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->actor); + CutsceneManager_StartWithPlayerCs(this->csId3, &this->actor); this->unk_2C2 = 2; func_809C493C(this, 18, 1.0f); } } } else if (this->unk_2C2 == 1) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_2D6); - } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) { - ActorCutscene_SetIntentToPlay(this->unk_2D6); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId3); + } else if (!CutsceneManager_IsNext(this->csId3)) { + CutsceneManager_Queue(this->csId3); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->actor); + CutsceneManager_StartWithPlayerCs(this->csId3, &this->actor); this->unk_2C2 = 2; func_809C493C(this, 18, 1.0f); } @@ -485,7 +485,7 @@ void func_809C5738(EnBomBowlMan* this, PlayState* play) { if (this->unk_298 >= this->path->count) { SET_WEEKEVENTREG(WEEKEVENTREG_84_80); CLEAR_WEEKEVENTREG(WEEKEVENTREG_83_04); - ActorCutscene_Stop(this->unk_2D6); + CutsceneManager_Stop(this->csId3); Actor_Kill(&this->actor); return; } @@ -530,13 +530,13 @@ void func_809C5AA4(EnBomBowlMan* this, PlayState* play) { } void func_809C5B1C(EnBomBowlMan* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_2D2); - } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D2)) { - ActorCutscene_SetIntentToPlay(this->unk_2D2); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId2); + } else if (!CutsceneManager_IsNext(this->csId2)) { + CutsceneManager_Queue(this->csId2); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D2, &this->actor); + CutsceneManager_StartWithPlayerCs(this->csId2, &this->actor); func_809C5BA0(this); } } @@ -574,7 +574,7 @@ void func_809C5BF4(EnBomBowlMan* this, PlayState* play) { } if (this->unk_2F4 == 0) { - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(this->unk_2D2)); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csId2)); if (D_809C6100 > 5) { Player* player = GET_PLAYER(play); diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h index fc911dd041..e958b84a12 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h @@ -17,44 +17,44 @@ typedef void (*EnBomBowlManActionFunc)(struct EnBomBowlMan*, PlayState*); #define ENBOMBOWLMAN_FF00_MINUS1 -1 typedef struct EnBomBowlMan { - /* 0x0000 */ Actor actor; - /* 0x0144 */ SkelAnime skelAnime; - /* 0x0188 */ Vec3s jointTable[21]; - /* 0x0206 */ Vec3s morphTable[21]; - /* 0x0284 */ EnBomBowlManActionFunc actionFunc; - /* 0x0288 */ s16 unk_288; - /* 0x028A */ s16 unk_28A; - /* 0x028C */ UNK_TYPE1 unk28C[2]; - /* 0x028E */ s16 unk_28E; - /* 0x0290 */ s16 unk_290; - /* 0x0292 */ UNK_TYPE1 unk292[2]; - /* 0x0294 */ Path* path; - /* 0x0298 */ s16 unk_298; - /* 0x029A */ s16 unk_29A; - /* 0x029C */ s16 unk_29C; - /* 0x029E */ s16 unk_29E; - /* 0x02A0 */ Vec3f unk_2A0; - /* 0x02AC */ UNK_TYPE1 unk2AC[0xC]; - /* 0x02B8 */ s16 unk_2B8; - /* 0x02BA */ s16 unk_2BA; - /* 0x02BC */ s16 unk_2BC; - /* 0x02BE */ UNK_TYPE1 unk2BE[2]; - /* 0x02C0 */ s16 unk_2C0; - /* 0x02C2 */ s16 unk_2C2; - /* 0x02C4 */ f32 unk_2C4; - /* 0x02C8 */ f32 unk_2C8; - /* 0x02CC */ s16 unk_2CC[2]; - /* 0x02D0 */ s16 unk_2D0; - /* 0x02D2 */ s16 unk_2D2; - /* 0x02D4 */ s16 unk_2D4; - /* 0x02D6 */ s16 unk_2D6; - /* 0x02D8 */ struct EnBomBowlMan* unk_2D8[5]; - /* 0x02EC */ UNK_TYPE1 unk2EC[0x4]; - /* 0x02F0 */ s16 unk_2F0; - /* 0x02F2 */ s16 unk_2F2; - /* 0x02F4 */ s16 unk_2F4; - /* 0x02F6 */ s16 unk_2F6; - /* 0x02F8 */ s32 unk_2F8; + /* 0x000 */ Actor actor; + /* 0x144 */ SkelAnime skelAnime; + /* 0x188 */ Vec3s jointTable[21]; + /* 0x206 */ Vec3s morphTable[21]; + /* 0x284 */ EnBomBowlManActionFunc actionFunc; + /* 0x288 */ s16 unk_288; + /* 0x28A */ s16 unk_28A; + /* 0x28C */ UNK_TYPE1 unk28C[2]; + /* 0x28E */ s16 unk_28E; + /* 0x290 */ s16 unk_290; + /* 0x292 */ UNK_TYPE1 unk292[2]; + /* 0x294 */ Path* path; + /* 0x298 */ s16 unk_298; + /* 0x29A */ s16 unk_29A; + /* 0x29C */ s16 unk_29C; + /* 0x29E */ s16 unk_29E; + /* 0x2A0 */ Vec3f unk_2A0; + /* 0x2AC */ UNK_TYPE1 unk2AC[0xC]; + /* 0x2B8 */ s16 unk_2B8; + /* 0x2BA */ s16 unk_2BA; + /* 0x2BC */ s16 unk_2BC; + /* 0x2BE */ UNK_TYPE1 unk2BE[2]; + /* 0x2C0 */ s16 unk_2C0; + /* 0x2C2 */ s16 unk_2C2; + /* 0x2C4 */ f32 unk_2C4; + /* 0x2C8 */ f32 unk_2C8; + /* 0x2CC */ s16 csIdList[2]; + /* 0x2D0 */ s16 csId1; + /* 0x2D2 */ s16 csId2; + /* 0x2D4 */ s16 unk_2D4; + /* 0x2D6 */ s16 csId3; + /* 0x2D8 */ struct EnBomBowlMan* unk_2D8[5]; + /* 0x2EC */ UNK_TYPE1 unk2EC[0x4]; + /* 0x2F0 */ s16 unk_2F0; + /* 0x2F2 */ s16 unk_2F2; + /* 0x2F4 */ s16 unk_2F4; + /* 0x2F6 */ s16 unk_2F6; + /* 0x2F8 */ s32 unk_2F8; } EnBomBowlMan; // size = 0x2FC #endif // Z_EN_BOM_BOWL_MAN_H diff --git a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c index c8c8b8ed3c..b67ca68208 100644 --- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c +++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c @@ -66,7 +66,7 @@ void EnBombal_Init(Actor* thisx, PlayState* play) { this->actor.targetMode = 6; this->actor.colChkInfo.health = 1; this->scale = 0.1f; - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; func_80C05B24(this); } @@ -109,16 +109,16 @@ void func_80C05C44(EnBombal* this, PlayState* play) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_75_40) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_73_10) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_85_02)) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->cutscene); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId); return; } - if (!ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_SetIntentToPlay(this->cutscene); + if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Queue(this->csId); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); phi_s0 = true; } } else { @@ -147,7 +147,7 @@ void func_80C05DE8(EnBombal* this, PlayState* play) { if (this->timer == 0) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_75_40) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_73_10) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_85_02)) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); } Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h index 7c72f3eea5..67550c59ba 100644 --- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h +++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.h @@ -23,7 +23,7 @@ typedef struct EnBombal { /* 0x144 */ EnBombalActionFunc actionFunc; /* 0x148 */ s16 timer; /* 0x14A */ s16 isPopped; - /* 0x14C */ s16 cutscene; + /* 0x14C */ s16 csId; /* 0x150 */ f32 scale; /* 0x154 */ f32 oscillationAngle; /* 0x158 */ ColliderCylinder collider; diff --git a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c index 5086513dbc..64f900f32d 100644 --- a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c +++ b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c @@ -124,11 +124,11 @@ void EnBombers_Init(Actor* thisx, PlayState* play) { this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, 0); if (bomBowlMan != NULL) { - s32 cs = this->actor.cutscene; + s32 csId = this->actor.csId; s32 i = 0; // clang-format off - while (cs != -1) { bomBowlMan->unk_2CC[i] = cs; cs = ActorCutscene_GetAdditionalCutscene(cs); i++; } + while (csId != CS_ID_NONE) { bomBowlMan->csIdList[i] = csId; csId = CutsceneManager_GetAdditionalCsId(csId); i++; } // clang-format on CLEAR_WEEKEVENTREG(WEEKEVENTREG_76_01); diff --git a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c index 9591fbbb94..b47a9630f1 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c @@ -101,8 +101,8 @@ void EnBombers2_Init(Actor* thisx, PlayState* play) { this->unk_2AC = 1; this->actor.world.pos.z += cos; } - this->cutscene = this->actor.cutscene; - if (this->cutscene == 0) { + this->csId = this->actor.csId; + if (this->csId == 0) { Actor_Kill(&this->actor); } func_80C04B40(this); @@ -309,13 +309,13 @@ void func_80C050B8(EnBombers2* this, PlayState* play) { void func_80C0520C(EnBombers2* this, PlayState* play) { if (this->unk_2A8 == 0) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->cutscene) == 0) { - ActorCutscene_SetIntentToPlay(this->cutscene); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId); + } else if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Queue(this->csId); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_2A8 = 1; } } else { @@ -332,7 +332,7 @@ void func_80C0520C(EnBombers2* this, PlayState* play) { this->unk_2A8 = 0; this->unk_2C0 = 1; SET_WEEKEVENTREG(WEEKEVENTREG_73_80); - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->unk_2AC = 1; this->actor.textId = sTextIds[this->textIdIndex]; Message_StartTextbox(play, this->actor.textId, &this->actor); diff --git a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h index 4a79e6615f..9e6f6b5776 100644 --- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h +++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.h @@ -27,7 +27,7 @@ typedef struct EnBombers2 { /* 0x2A8 */ s32 unk_2A8; /* 0x2AC */ u8 unk_2AC; /* 0x2AE */ s16 animIndex; - /* 0x2B0 */ s16 cutscene; + /* 0x2B0 */ s16 csId; /* 0x2B2 */ s16 unk_2B2; /* 0x2B4 */ s16 unk_2B4; /* 0x2B6 */ s16 unk_2B6; diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c index a1a1b0a321..aad6d9bc3f 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -119,7 +119,7 @@ s16 D_80C00AF8[] = { void EnBomjima_Init(Actor* thisx, PlayState* play) { EnBomjima* this = THIS; - s32 cs; + s32 csId; s32 i; this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -135,12 +135,12 @@ void EnBomjima_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); if (this->unk_2E6 == 0) { - cs = this->actor.cutscene; + csId = this->actor.csId; i = 0; - while (cs != -1) { + while (csId != CS_ID_NONE) { // clang-format off - this->cutscenes[i] = cs; cs = ActorCutscene_GetAdditionalCutscene(cs); + this->csIdList[i] = csId; csId = CutsceneManager_GetAdditionalCsId(csId); // clang-format on i++; } @@ -340,8 +340,8 @@ void func_80BFEA94(EnBomjima* this, PlayState* play) { this->bombal = (EnBombal*)actor; Math_Vec3f_Copy(&this->unk_2B0, &actor->world.pos); - if (this->bombalCutscene == 0) { - this->bombalCutscene = this->bombal->actor.cutscene; + if (this->bombalCsId == 0) { + this->bombalCsId = this->bombal->actor.csId; } func_80BFEB1C(this); break; @@ -389,7 +389,7 @@ void func_80BFEB64(EnBomjima* this, PlayState* play) { return; } - if (ActorCutscene_GetCurrentIndex() == -1) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) { func_800B8614(&this->actor, play, 70.0f); } @@ -465,17 +465,17 @@ void func_80BFEFF0(EnBomjima* this) { void func_80BFF03C(EnBomjima* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->cutscenes[0]); - } else if (!ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { - ActorCutscene_SetIntentToPlay(this->cutscenes[0]); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[0]); + } else if (!CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Queue(this->csIdList[0]); } else { player->stateFlags1 &= ~PLAYER_STATE1_20; CLEAR_WEEKEVENTREG(WEEKEVENTREG_83_04); this->actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); this->unk_2DC = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)); - ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[0], &this->actor); + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->actor); func_80BFF120(this); } } @@ -494,7 +494,7 @@ void func_80BFF174(EnBomjima* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->cutsceneTimer == 1) { - ActorCutscene_Stop(this->cutscenes[0]); + CutsceneManager_Stop(this->csIdList[0]); this->cutsceneEnded = true; } @@ -576,7 +576,7 @@ void func_80BFF430(EnBomjima* this, PlayState* play) { if (bombal != NULL) { bombal->scale = 0.0f; - bombal->cutscene = this->bombalCutscene; + bombal->csId = this->bombalCsId; Actor_ChangeFocus(&this->actor, play, &bombal->actor); CLEAR_WEEKEVENTREG(WEEKEVENTREG_83_04); func_80BFE65C(this); @@ -653,14 +653,14 @@ void func_80BFF754(EnBomjima* this, PlayState* play) { f32 y; f32 z; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->cutscenes[1]); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[1]); return; } - if (!ActorCutscene_GetCanPlayNext(this->cutscenes[1])) { - ActorCutscene_SetIntentToPlay(this->cutscenes[1]); + if (!CutsceneManager_IsNext(this->csIdList[1])) { + CutsceneManager_Queue(this->csIdList[1]); return; } @@ -690,7 +690,7 @@ void func_80BFF754(EnBomjima* this, PlayState* play) { } D_80C009F0 = 0; - ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[1], &this->actor); + CutsceneManager_StartWithPlayerCs(this->csIdList[1], &this->actor); this->actionFunc = func_80BFF9B0; } @@ -774,7 +774,7 @@ void func_80BFFBC4(EnBomjima* this, PlayState* play) { play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_86; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; - ActorCutscene_Stop(this->cutscenes[1]); + CutsceneManager_Stop(this->csIdList[1]); } } diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.h b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.h index 6a434be42d..b8196b3448 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.h +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.h @@ -40,7 +40,7 @@ typedef struct EnBomjima { /* 0x2CA */ s16 unk_2CA; /* 0x2CC */ f32 animLastFrame; /* 0x2D0 */ f32 unk_2D0; - /* 0x2D4 */ s16 cutscenes[2]; + /* 0x2D4 */ s16 csIdList[2]; /* 0x2D8 */ UNK_TYPE1 unk2D8[4]; // maybe a part of the above? /* 0x2DC */ s16 unk_2DC; /* 0x2DE */ s16 cutsceneEnded; @@ -52,7 +52,7 @@ typedef struct EnBomjima { /* 0x2EA */ s16 unk_2EA; /* 0x2EC */ s32 animIndex; /* 0x2F0 */ EnBombal* bombal; - /* 0x2F4 */ s16 bombalCutscene; + /* 0x2F4 */ s16 bombalCsId; /* 0x2F8 */ ColliderCylinder collider; } EnBomjima; // size = 0x344 diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index dbe25cdf42..302547c265 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -187,7 +187,7 @@ void EnBox_ClipToGround(EnBox* this, PlayState* play) { void EnBox_Init(Actor* thisx, PlayState* play) { s32 pad; EnBox* this = THIS; - s16 cutsceneIdx; + s16 csId; CollisionHeader* colHeader; f32 animFrame; f32 animFrameEnd; @@ -290,17 +290,17 @@ void EnBox_Init(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->dyna.actor, 40.0f); } - this->cutsceneIdxA = -1; - this->cutsceneIdxB = -1; - cutsceneIdx = this->dyna.actor.cutscene; + this->csId1 = CS_ID_NONE; + this->csId2 = CS_ID_NONE; + csId = this->dyna.actor.csId; - while (cutsceneIdx != -1) { - if (func_800F2178(cutsceneIdx) == 1) { - this->cutsceneIdxB = cutsceneIdx; + while (csId != CS_ID_NONE) { + if (CutsceneManager_GetCutsceneCustomValue(csId) == 1) { + this->csId2 = csId; } else { - this->cutsceneIdxA = cutsceneIdx; + this->csId1 = csId; } - cutsceneIdx = ActorCutscene_GetAdditionalCutscene(cutsceneIdx); + csId = CutsceneManager_GetAdditionalCsId(csId); } func_80867BDC(&this->unk_1F4, play, &this->dyna.actor.home.pos); } @@ -388,12 +388,12 @@ void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { void EnBox_AppearSwitchFlag(EnBox* this, PlayState* play) { Actor_SetClosestSecretDistance(&this->dyna.actor, play); if (Flags_GetSwitch(play, this->switchFlag)) { - if (ActorCutscene_GetCanPlayNext(this->cutsceneIdxA)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutsceneIdxA, &this->dyna.actor); + if (CutsceneManager_IsNext(this->csId1)) { + CutsceneManager_StartWithPlayerCs(this->csId1, &this->dyna.actor); EnBox_SetupAction(this, func_80868AFC); this->unk_1A0 = -30; } else { - ActorCutscene_SetIntentToPlay(this->cutsceneIdxA); + CutsceneManager_Queue(this->csId1); } } } @@ -401,19 +401,19 @@ void EnBox_AppearSwitchFlag(EnBox* this, PlayState* play) { void EnBox_AppearOnRoomClear(EnBox* this, PlayState* play) { Actor_SetClosestSecretDistance(&this->dyna.actor, play); if (Flags_GetClearTemp(play, this->dyna.actor.room)) { - if (ActorCutscene_GetCanPlayNext(this->cutsceneIdxA)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutsceneIdxA, &this->dyna.actor); + if (CutsceneManager_IsNext(this->csId1)) { + CutsceneManager_StartWithPlayerCs(this->csId1, &this->dyna.actor); Flags_SetClear(play, this->dyna.actor.room); EnBox_SetupAction(this, func_80868AFC); this->unk_1A0 = -30; } else { - ActorCutscene_SetIntentToPlay(this->cutsceneIdxA); + CutsceneManager_Queue(this->csId1); } } } void func_80868AFC(EnBox* this, PlayState* play) { - if ((func_800F22C4(this->cutsceneIdxA, &this->dyna.actor) != 0) || (this->unk_1A0 != 0)) { + if ((func_800F22C4(this->csId1, &this->dyna.actor) != 0) || (this->unk_1A0 != 0)) { EnBox_SetupAction(this, func_80868B74); this->unk_1A0 = 0; func_80867FBC(&this->unk_1F4, play, (this->movementFlags & ENBOX_MOVE_0x80) != 0); @@ -432,7 +432,7 @@ void func_80868B74(EnBox* this, PlayState* play) { this->dyna.actor.world.pos.y += 1.25f; } this->unk_1A0++; - if ((this->cutsceneIdxA != -1) && ActorCutscene_GetCurrentIndex() == this->cutsceneIdxA) { + if ((this->csId1 != -1) && CutsceneManager_GetCurrentCsId() == this->csId1) { if (this->unk_1A0 == 2) { func_800B724C(play, &this->dyna.actor, PLAYER_CSMODE_4); } else if (this->unk_1A0 == 22) { @@ -445,7 +445,7 @@ void func_80868B74(EnBox* this, PlayState* play) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { EnBox_SetupAction(this, EnBox_WaitOpen); - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } } @@ -460,8 +460,8 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { this->alpha = 255; this->movementFlags |= ENBOX_MOVE_IMMOBILE; - if ((this->unk_1EC != 0) && ((this->cutsceneIdxB < 0) || (ActorCutscene_GetCurrentIndex() == this->cutsceneIdxB) || - (ActorCutscene_GetCurrentIndex() == -1))) { + if ((this->unk_1EC != 0) && ((this->csId2 < 0) || (CutsceneManager_GetCurrentCsId() == this->csId2) || + (CutsceneManager_GetCurrentCsId() == CS_ID_NONE))) { if (this->unk_1EC < 0) { animHeader = &gBoxChestOpenAnim; playbackSpeed = 1.5f; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.h b/src/overlays/actors/ovl_En_Box/z_en_box.h index 9cb5af18db..75d9f09c9f 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.h +++ b/src/overlays/actors/ovl_En_Box/z_en_box.h @@ -60,8 +60,8 @@ typedef struct EnBox { /* 0x1F2 */ u8 iceSmokeTimer; /* 0x1F3 */ s8 unk_1F3; /* 0x1F4 */ struct_80867BDC_a0 unk_1F4; - /* 0x218 */ s16 cutsceneIdxA; - /* 0x21A */ s16 cutsceneIdxB; + /* 0x218 */ s16 csId1; + /* 0x21A */ s16 csId2; /* 0x21C */ s32 getItemId; /* 0x220 */ s32 collectableFlag; } EnBox; // size = 0x224 diff --git a/src/overlays/actors/ovl_En_Cha/z_en_cha.c b/src/overlays/actors/ovl_En_Cha/z_en_cha.c index 92030934f3..cbe96e0f03 100644 --- a/src/overlays/actors/ovl_En_Cha/z_en_cha.c +++ b/src/overlays/actors/ovl_En_Cha/z_en_cha.c @@ -72,13 +72,13 @@ void EnCha_Destroy(Actor* thisx, PlayState* play) { void EnCha_Ring(EnCha* this, PlayState* play) { EnCha_Idle(this, play); - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { this->actionFunc = EnCha_Idle; - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->actionFunc = EnCha_Idle; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 15d087ea76..21278af9fd 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -556,7 +556,7 @@ void EnClearTag_UpdateCamera(EnClearTag* this, PlayState* play) { } break; case 1: - Cutscene_Start(play, &play->csCtx); + Cutscene_StartManual(play, &play->csCtx); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); @@ -585,8 +585,8 @@ void EnClearTag_UpdateCamera(EnClearTag* this, PlayState* play) { mainCam->eyeNext = this->subCamEye; mainCam->at = this->subCamAt; func_80169AFC(play, this->subCamId, 0); - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); this->cameraState = 0; this->subCamId = SUB_CAM_ID_DONE; this->activeTimer = 20; diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c index fbd8292123..7b3f97dedc 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -176,13 +176,13 @@ s32 func_80B3E5DC(EnDai* this, s32 arg1) { s32 func_80B3E69C(EnDai* this, PlayState* play) { s32 ret = false; - if ((play->csCtx.state != CS_STATE_0) && (play->sceneId == SCENE_12HAKUGINMAE) && - (play->csCtx.currentCsIndex == 0) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_30_01)) { + if ((play->csCtx.state != CS_STATE_IDLE) && (play->sceneId == SCENE_12HAKUGINMAE) && + (play->csCtx.scriptIndex == 0) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_30_01)) { if (!(this->unk_1CE & 0x10)) { Flags_SetSwitch(play, 20); this->unk_1CE |= (0x80 | 0x10); this->unk_1CE &= ~(0x100 | 0x20); - this->unk_1CC = 0xFF; + this->cueId = 255; this->unk_1DC = 0; this->unk_1CD = 0; this->unk_1F0 = D_80B3FBF0; @@ -240,7 +240,7 @@ static s32 D_80B3FC8C[] = { 0x920C0F0C, 0x930C1211, 0x5520100E, 0x0C940C12, 0x10000000, }; -s16 func_80B3E8BC(EnDai* this, s32 arg1) { +s16 func_80B3E8BC(EnDai* this, s32 cueId) { static f32 D_80B3FCB4[] = { 1.0f, 6.0f, 16.0f, 19.0f, 46.0f, 48.0f, 50.0f, 52.0f, 54.0f, 1.0f, 6.0f, 36.0f, }; @@ -256,10 +256,10 @@ s16 func_80B3E8BC(EnDai* this, s32 arg1) { s32 i; s32 end; - if (arg1 == 3) { + if (cueId == 3) { end = 9; i = 0; - } else if (arg1 == 4) { + } else if (cueId == 4) { end = 12; i = 9; } else { @@ -402,12 +402,12 @@ s32 func_80B3ED88(EnDai* this) { } void func_80B3EE8C(EnDai* this, PlayState* play) { - s16 cutscene = this->actor.cutscene; + s16 csId = this->actor.csId; - if (ActorCutscene_GetCanPlayNext(cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(cutscene, &this->actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); } else { - ActorCutscene_SetIntentToPlay(cutscene); + CutsceneManager_Queue(csId); } } @@ -445,15 +445,15 @@ void func_80B3F044(EnDai* this, PlayState* play) { static s32 D_80B3FE38[] = { 0, 0, 6, 7, 8, }; - s32 sp2C = 0; - s32 sp28; + s32 cueChannel = 0; + s32 cueId; - if (Cutscene_CheckActorAction(play, 472)) { - sp2C = Cutscene_GetActorActionIndex(play, 472); - sp28 = play->csCtx.actorActions[sp2C]->action; - if (this->unk_1CC != (u8)sp28) { - func_80B3E5DC(this, D_80B3FE38[sp28]); - switch (sp28) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_472)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_472); + cueId = play->csCtx.actorCues[cueChannel]->id; + if (this->cueId != (u8)cueId) { + func_80B3E5DC(this, D_80B3FE38[cueId]); + switch (cueId) { case 1: this->unk_1E0 = 0.0f; break; @@ -467,10 +467,10 @@ void func_80B3F044(EnDai* this, PlayState* play) { break; } } - this->unk_1CC = sp28; + this->cueId = cueId; } - switch (this->unk_1CC) { + switch (this->cueId) { case 1: this->unk_1E0 += 1.0f; if (this->unk_1E0 < 30.0f) { @@ -481,20 +481,20 @@ void func_80B3F044(EnDai* this, PlayState* play) { break; case 2: - if (play->csCtx.frames == 360) { + if (play->csCtx.curFrame == 360) { Actor_PlaySfx(&this->actor, NA_SE_EN_DAIGOLON_SLEEP3 - SFX_FLAG); } if (Animation_OnFrame(&this->skelAnime, 43.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_BOUND_1); } - this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); + this->unk_1D6 = func_80B3E8BC(this, this->cueId); break; case 3: if (Animation_OnFrame(&this->skelAnime, 6.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EN_DAIGOLON_SLEEP1); } - this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); + this->unk_1D6 = func_80B3E8BC(this, this->cueId); break; case 4: @@ -504,11 +504,11 @@ void func_80B3F044(EnDai* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 35.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_BOUND_0); } - this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC); + this->unk_1D6 = func_80B3E8BC(this, this->cueId); break; } - Cutscene_ActorTranslateAndYaw(&this->actor, play, sp2C); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } void EnDai_Init(Actor* thisx, PlayState* play) { @@ -525,7 +525,7 @@ void EnDai_Init(Actor* thisx, PlayState* play) { this->unk_1CE = 0; this->unk_1D6 = 0; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { SubS_UpdateFlags(&this->unk_1CE, 3, 7); this->unk_1CE |= 0x80; this->unk_1CD = 0xFF; diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.h b/src/overlays/actors/ovl_En_Dai/z_en_dai.h index 4dc059c399..35928388f1 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.h +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.h @@ -26,7 +26,7 @@ typedef struct EnDai { /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnDaiActionFunc actionFunc; /* 0x18C */ MtxF unk_18C; - /* 0x1CC */ u8 unk_1CC; + /* 0x1CC */ u8 cueId; /* 0x1CD */ u8 unk_1CD; /* 0x1CE */ u16 unk_1CE; /* 0x1D0 */ s32 unk_1D0; diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c index 3ccf3fb6d1..535b0d65f3 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -248,7 +248,7 @@ static TexturePtr D_8089E33C[] = { object_dinofos_Tex_009030, }; -static s16 D_8089E34C = -1; +static s16 sCsId = CS_ID_NONE; static s32 D_8089E350 = 0; static InitChainEntry sInitChain[] = { @@ -291,13 +291,13 @@ void EnDinofos_Init(Actor* thisx, PlayState* play) { } this->unk_28B = 0; - if (thisx->cutscene == -1) { + if (thisx->csId == CS_ID_NONE) { func_8089B7B0(this); } else { this->actor.flags |= ACTOR_FLAG_100000; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; - D_8089E34C = thisx->cutscene; + sCsId = thisx->csId; func_8089D2E0(this); } @@ -367,9 +367,9 @@ void func_8089ABF4(EnDinofos* this, PlayState* play) { Play_SetCameraAtEye(play, CAM_ID_MAIN, &subCam->at, &subCam->eye); this->subCamId = SUB_CAM_ID_DONE; - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); if (this->actor.colChkInfo.health == 0) { - func_800B724C(play, &this->actor, PLAYER_CSMODE_6); + func_800B724C(play, &this->actor, PLAYER_CSMODE_END); } } } @@ -584,7 +584,7 @@ void func_8089B72C(EnDinofos* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { func_8089ABF4(this, play); this->actor.flags &= ~ACTOR_FLAG_100000; - this->actor.cutscene = -1; + this->actor.csId = CS_ID_NONE; func_8089B7B0(this); } } @@ -972,7 +972,7 @@ void func_8089C7B8(EnDinofos* this, PlayState* play) { if (this->unk_290 == 0) { func_8089ACEC(this, play); if (this->actor.colChkInfo.health == 0) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { func_8089CFAC(this); } else { func_8089D2E0(this); @@ -1004,7 +1004,7 @@ void func_8089C938(EnDinofos* this, PlayState* play) { Math_StepToF(&this->actor.speed, 0.0f, 0.5f); if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health == 0) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { func_8089CFAC(this); } else { func_8089D2E0(this); @@ -1196,21 +1196,21 @@ void func_8089D1E0(EnDinofos* this, PlayState* play) { } void func_8089D2E0(EnDinofos* this) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = func_8089D318; } void func_8089D318(EnDinofos* this, PlayState* play) { Vec3f subCamEye; - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + if (CutsceneManager_IsNext(this->actor.csId)) { if (this->actor.colChkInfo.health == 0) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); - func_800B724C(play, &this->actor, PLAYER_CSMODE_7); + CutsceneManager_Start(this->actor.csId, &this->actor); + func_800B724C(play, &this->actor, PLAYER_CSMODE_WAIT); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); } - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); if (this->actor.colChkInfo.health == 0) { subCamEye.x = (Math_SinS(this->actor.shape.rot.y) * 150.0f) + this->actor.focus.pos.x; subCamEye.y = this->actor.focus.pos.y; @@ -1221,7 +1221,7 @@ void func_8089D318(EnDinofos* this, PlayState* play) { func_8089B100(this, play); } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -1273,12 +1273,12 @@ s32 func_8089D60C(EnDinofos* this, PlayState* play) { Enemy_StartFinishingBlow(play, &this->actor); D_8089E350--; if (D_8089E350 == 0) { - if (D_8089E34C != -1) { - this->actor.cutscene = D_8089E34C; + if (sCsId != CS_ID_NONE) { + this->actor.csId = sCsId; } } - if (this->actor.cutscene != -1) { + if (this->actor.csId != CS_ID_NONE) { Audio_RestorePrevBgm(); } } diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index fd60eca757..427e206aa9 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -213,8 +213,8 @@ void func_80A51648(EnDnk* this, PlayState* play) { } void func_80A51890(EnDnk* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 126)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 126)); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_126)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_126)); } } @@ -423,7 +423,7 @@ void func_80A52018(Actor* thisx, PlayState* play) { } void func_80A52074(EnDnk* this, PlayState* play) { - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 80: func_8019F128(NA_SE_EN_DEKNUTS_DANCE1); break; @@ -441,7 +441,7 @@ void func_80A52074(EnDnk* this, PlayState* play) { break; } - if ((play->csCtx.frames >= 198) && (play->csCtx.frames < 438)) { + if ((play->csCtx.curFrame >= 198) && (play->csCtx.curFrame < 438)) { func_8019F128(NA_SE_EN_DEKNUTS_DANCE - SFX_FLAG); } } diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/src/overlays/actors/ovl_En_Dno/z_en_dno.c index d42e2e2339..a9128b1bd3 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -243,7 +243,7 @@ void EnDno_Init(Actor* thisx, PlayState* play) { this->unk_3BE = 0x3E93; this->unk_3C0 = 60.0f; this->unk_3B0 = 0; - this->unk_468 = 99; + this->cueId = 99; this->skelAnime.playSpeed = 0.0f; switch (EN_DNO_GET_C000(thisx)) { @@ -916,12 +916,12 @@ void func_80A732C8(EnDno* this, PlayState* play) { void func_80A73408(EnDno* this, PlayState* play) { s32 phi_a2; u8 sp33 = true; - s32 temp_v0; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 475)) { - temp_v0 = Cutscene_GetActorActionIndex(play, 475); - if (this->unk_468 != play->csCtx.actorActions[temp_v0]->action) { - switch (play->csCtx.actorActions[temp_v0]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_475)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_475); + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: phi_a2 = 13; break; @@ -940,7 +940,7 @@ void func_80A73408(EnDno* this, PlayState* play) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, phi_a2, &this->animIndex); } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.h b/src/overlays/actors/ovl_En_Dno/z_en_dno.h index 470c82ee8d..f9a55cd4e5 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.h +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.h @@ -47,7 +47,7 @@ typedef struct EnDno { /* 0x460 */ Actor* unk_460; /* 0x464 */ u16 textId; /* 0x466 */ s16 unk_466; - /* 0x468 */ u8 unk_468; + /* 0x468 */ u8 cueId; } EnDno; // size = 0x46C #endif // Z_EN_DNO_H diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index 7459873444..dedbe30b4f 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -269,7 +269,7 @@ s32 func_80B3D044(EnDnp* this, PlayState* play) { if (!(this->unk_322 & 0x200)) { this->unk_322 |= (0x200 | 0x10); this->actor.flags &= ~ACTOR_FLAG_1; - this->unk_324 = 0xFF; + this->cueId = 255; } SubS_UpdateFlags(&this->unk_322, 0, 7); this->actionFunc = func_80B3D11C; @@ -292,20 +292,19 @@ void func_80B3D11C(EnDnp* this, PlayState* play) { EN_DNP_ANIM_ANGRY_START, EN_DNP_ANIM_JUMP, EN_DNP_ANIM_BOUNCE_START, EN_DNP_ANIM_GLARE_START, EN_DNP_ANIM_BOW, }; - s32 temp_v0; - s32 val; + s32 cueChannel; + s32 cueId; - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_29_40) && (play->sceneId == SCENE_MITURIN) && - (play->csCtx.currentCsIndex == 0)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_29_40) && (play->sceneId == SCENE_MITURIN) && (play->csCtx.scriptIndex == 0)) { this->unk_322 |= 0x20; SET_WEEKEVENTREG(WEEKEVENTREG_29_40); } - if (Cutscene_CheckActorAction(play, 101)) { - temp_v0 = Cutscene_GetActorActionIndex(play, 101); - val = play->csCtx.actorActions[temp_v0]->action; - if (this->unk_324 != (u8)val) { - EnDnp_ChangeAnim(this, sCsAnimations[val]); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_101)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_101); + cueId = play->csCtx.actorCues[cueChannel]->id; + if (this->cueId != (u8)cueId) { + EnDnp_ChangeAnim(this, sCsAnimations[cueId]); if (this->animIndex == EN_DNP_ANIM_CUTSCENE_IDLE) { this->unk_322 |= 8; } else { @@ -323,14 +322,14 @@ void func_80B3D11C(EnDnp* this, PlayState* play) { } } - this->unk_324 = val; + this->cueId = cueId; if (((this->animIndex == EN_DNP_ANIM_THINK_START) || (this->animIndex == EN_DNP_ANIM_ARMS_TOGETHER_START) || (this->animIndex == EN_DNP_ANIM_LAUGH_START) || (this->animIndex == EN_DNP_ANIM_ANGRY_START) || (this->animIndex == EN_DNP_ANIM_BOUNCE_START) || (this->animIndex == EN_DNP_ANIM_GLARE_START)) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { EnDnp_ChangeAnim(this, this->animIndex + 1); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } @@ -387,11 +386,11 @@ void func_80B3D47C(EnDnp* this, PlayState* play) { } void func_80B3D558(EnDnp* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); SET_WEEKEVENTREG(WEEKEVENTREG_23_20); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -415,7 +414,7 @@ void EnDnp_Init(Actor* thisx, PlayState* play) { SubS_UpdateFlags(&this->unk_322, 0, 7); this->actor.shape.rot.x = 0; this->actor.world.rot.x = this->actor.shape.rot.x; - this->actor.cutscene = 0x10; + this->actor.csId = 16; this->actionFunc = func_80B3D47C; } else if (((EN_DNP_GET_TYPE(&this->actor) == EN_DNP_TYPE_WOODFALL_TEMPLE) && !Inventory_HasItemInBottle(ITEM_DEKU_PRINCESS) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_23_20)) || diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h index a41a636151..64f0baf93a 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.h @@ -26,7 +26,7 @@ typedef struct EnDnp { /* 0x1EA */ Vec3s jointTable[DEKU_PRINCESS_LIMB_MAX]; /* 0x286 */ Vec3s morphTable[DEKU_PRINCESS_LIMB_MAX]; /* 0x322 */ u16 unk_322; - /* 0x324 */ u8 unk_324; + /* 0x324 */ u8 cueId; /* 0x328 */ s32 unk_328; /* 0x32C */ UNK_TYPE1 unk_32C[0x2]; /* 0x32E */ s16 unk_32E; diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c index 0c5227bd48..ea5bd4e94e 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -124,7 +124,7 @@ s32 func_80A52648(EnDnq* this, PlayState* play) { if (play->csCtx.state != 0) { if (!(this->unk_37C & 0x20)) { this->picto.actor.flags &= ~ACTOR_FLAG_1; - this->unk_1DC = 0xFF; + this->cueId = 255; this->unk_37C |= 0x20; } SubS_UpdateFlags(&this->unk_37C, 0, 7); @@ -132,7 +132,7 @@ s32 func_80A52648(EnDnq* this, PlayState* play) { } else { if (this->unk_37C & 0x20) { this->picto.actor.flags |= ACTOR_FLAG_1; - this->unk_1DC = 0xFF; + this->cueId = 255; this->unk_37C &= ~0x20; SubS_UpdateFlags(&this->unk_37C, 3, 7); } @@ -346,7 +346,7 @@ void func_80A52DC8(EnDnq* this, PlayState* play) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_23_20)) { this->unk_390 = 70.0f; if (Inventory_HasItemInBottle(ITEM_DEKU_PRINCESS) && !Play_InCsMode(play) && - (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) && (ActorCutscene_GetCurrentIndex() == -1)) { + (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE)) { if ((DECR(this->unk_384) == 0) && CHECK_WEEKEVENTREG(WEEKEVENTREG_29_40)) { Message_StartTextbox(play, 0x969, NULL); this->unk_384 = 200; @@ -391,15 +391,15 @@ void func_80A53038(EnDnq* this, PlayState* play) { static s32 D_80A535FC[] = { 0, 1, 2, 3, 5, 6, }; - s32 temp_v0; - u32 temp_v1; + s32 cueChannel; + u32 cueId; - if (Cutscene_CheckActorAction(play, 105)) { - temp_v0 = Cutscene_GetActorActionIndex(play, 105); - temp_v1 = play->csCtx.actorActions[temp_v0]->action; - if (this->unk_1DC != (u8)temp_v1) { - func_80A5257C(this, D_80A535FC[temp_v1]); - this->unk_1DC = temp_v1; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_105)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_105); + cueId = play->csCtx.actorCues[cueChannel]->id; + if (this->cueId != (u8)cueId) { + func_80A5257C(this, D_80A535FC[cueId]); + this->cueId = cueId; } if ((this->unk_398 == 4) && Animation_OnFrame(&this->skelAnime, 2.0f)) { @@ -411,7 +411,7 @@ void func_80A53038(EnDnq* this, PlayState* play) { func_80A5257C(this, this->unk_398 + 1); } - Cutscene_ActorTranslateAndYaw(&this->picto.actor, play, temp_v0); + Cutscene_ActorTranslateAndYaw(&this->picto.actor, play, cueChannel); } } diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h index 5afb8bdf80..6ede37a556 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.h @@ -14,7 +14,7 @@ typedef struct EnDnq { /* 0x148 */ SkelAnime skelAnime; /* 0x18C */ EnDnqActionFunc actionFunc; /* 0x190 */ ColliderCylinder collider; - /* 0x1DC */ u8 unk_1DC; + /* 0x1DC */ u8 cueId; /* 0x1E0 */ s32 unk_1E0; /* 0x1E4 */ Vec3s jointTable[DEKU_KING_LIMB_MAX]; /* 0x2AA */ Vec3s morphTable[DEKU_KING_LIMB_MAX]; diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 7a540ad49e..6837e5367e 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -205,19 +205,19 @@ s32* func_8092C9BC(EnDns* this, PlayState* play) { return 0; } -s32 func_8092CA74(EnDns* this) { +s32 EnDns_GetCueType(EnDns* this) { switch (ENDNS_GET_7(&this->actor)) { case ENDNS_GET_7_0: - return 465; + return CS_CMD_ACTOR_CUE_465; case ENDNS_GET_7_1: - return 466; + return CS_CMD_ACTOR_CUE_466; case ENDNS_GET_7_2: - return 467; + return CS_CMD_ACTOR_CUE_467; case ENDNS_GET_7_3: - return 468; + return CS_CMD_ACTOR_CUE_468; } return 0; @@ -251,11 +251,11 @@ s32 func_8092CB98(EnDns* this, PlayState* play) { if (play->csCtx.state != 0) { if (!(this->unk_2C6 & 0x80)) { - this->unk_2C8 = func_8092CA74(this); + this->cueType = EnDns_GetCueType(this); this->actor.flags &= ~ACTOR_FLAG_1; SubS_UpdateFlags(&this->unk_2C6, 0, 7); this->unk_2C6 |= 0x80; - this->unk_1D8 = 0xFF; + this->cueId = 255; } phi_v1 = 1; } else if (this->unk_2C6 & 0x80) { @@ -479,15 +479,15 @@ void func_8092D5E8(EnDns* this, PlayState* play) { EN_DNS_ANIM_SURPRISE_START, EN_DNS_ANIM_RUN_START, }; - s32 temp_v0; - u32 temp_v1; + s32 cueChannel; + u32 cueId; - if (Cutscene_CheckActorAction(play, this->unk_2C8)) { - temp_v0 = Cutscene_GetActorActionIndex(play, this->unk_2C8); - temp_v1 = play->csCtx.actorActions[temp_v0]->action; - if (this->unk_1D8 != (u8)temp_v1) { - func_8092C63C(this, D_8092DE0C[temp_v1]); - this->unk_1D8 = temp_v1; + if (Cutscene_IsCueInChannel(play, this->cueType)) { + cueChannel = Cutscene_GetCueChannel(play, this->cueType); + cueId = play->csCtx.actorCues[cueChannel]->id; + if (this->cueId != (u8)cueId) { + func_8092C63C(this, D_8092DE0C[cueId]); + this->cueId = cueId; } if (((this->animIndex == EN_DNS_ANIM_SURPRISE_START) || (this->animIndex == EN_DNS_ANIM_RUN_START)) && @@ -495,7 +495,7 @@ void func_8092D5E8(EnDns* this, PlayState* play) { func_8092C63C(this, this->animIndex + 1); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/src/overlays/actors/ovl_En_Dns/z_en_dns.h index b54e49a6a2..4b730abd35 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h @@ -25,8 +25,7 @@ typedef struct EnDns { /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ EnDnsActionFunc actionFunc; /* 0x18C */ ColliderCylinder collider; - /* 0x1D8 */ u8 unk_1D8; - /* 0x1D9 */ UNK_TYPE1 unk_1D9[0x3]; + /* 0x1D8 */ u8 cueId; /* 0x1DC */ s32 unk_1DC; /* 0x1E0 */ s32* unk_1E0; /* 0x1E4 */ Gfx* unk_1E4[13]; @@ -35,7 +34,7 @@ typedef struct EnDns { /* 0x22A */ Vec3s jointTable[KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX]; /* 0x278 */ Vec3s morphTable[KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX]; /* 0x2C6 */ u16 unk_2C6; - /* 0x2C8 */ u16 unk_2C8; + /* 0x2C8 */ u16 cueType; /* 0x2CA */ UNK_TYPE1 unk_2CA[0x2]; /* 0x2CC */ s16 unk_2CC; /* 0x2CE */ s16 unk_2CE; diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index aa9d9c89a0..e2b225e238 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -240,7 +240,7 @@ u8 D_80867744[] = { }; u8 D_8086775C[] = { - /* 0x00 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_52_20, 0x1B - 0x04), + /* 0x00 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE, 0x1B - 0x04), /* 0x04 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_75_20, 0x1B - 0x08), /* 0x08 */ SCHEDULE_CMD_CHECK_FLAG_S(WEEKEVENTREG_14_04, 0x0E - 0x0C), /* 0x0C */ SCHEDULE_CMD_RET_VAL_S(29), diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c index c5936c4e2a..605d0d8071 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c @@ -447,7 +447,7 @@ void EnDragon_Extend(EnDragon* this, PlayState* play) { } void EnDragon_SetSubCamEyeAt(EnDragon* this, PlayState* play, Vec3f subCamEye, Vec3f subCamAt) { - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); Math_Vec3f_Copy(&this->subCamEye, &subCamEye); Math_Vec3f_Copy(&this->subCamAt, &subCamAt); Play_SetCameraAtEye(play, this->subCamId, &this->subCamAt, &this->subCamEye); @@ -458,10 +458,10 @@ void EnDragon_SetupGrab(EnDragon* this, PlayState* play) { Vec3f extendedPos; s16 yaw; - if (!ActorCutscene_GetCanPlayNext(this->grabCutsceneIndex)) { - ActorCutscene_SetIntentToPlay(this->grabCutsceneIndex); + if (!CutsceneManager_IsNext(this->grabCsId)) { + CutsceneManager_Queue(this->grabCsId); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->grabCutsceneIndex, &this->actor); + CutsceneManager_StartWithPlayerCs(this->grabCsId, &this->actor); Math_Vec3f_Copy(&extendedPos, &this->burrowEntrancePos); extendedPos.x += Math_SinS(this->actor.world.rot.y) * -530.0f; extendedPos.z += Math_CosS(this->actor.world.rot.y) * -530.0f; @@ -496,7 +496,7 @@ void EnDragon_Grab(EnDragon* this, PlayState* play) { Vec3f pos; // used as both the extended position and the camera eye Vec3f subCamAt; - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); SkelAnime_Update(&this->skelAnime); if (this->grabTimer == 0) { @@ -535,7 +535,7 @@ void EnDragon_Grab(EnDragon* this, PlayState* play) { if (this->grabTimer > sMaxGrabTimerPerPython[this->pythonIndex]) { if (this->state == DEEP_PYTHON_GRAB_STATE_START) { - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); this->state = DEEP_PYTHON_GRAB_STATE_GRABBED; } @@ -617,7 +617,7 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) { (this->collider.elements[2].info.bumperFlags & BUMP_HIT)) { player->actor.parent = NULL; this->grabWaitTimer = 30; - ActorCutscene_Stop(this->grabCutsceneIndex); + CutsceneManager_Stop(this->grabCsId); if (player->stateFlags2 & PLAYER_STATE2_80) { player->unk_AE8 = 100; } @@ -634,10 +634,10 @@ void EnDragon_Attack(EnDragon* this, PlayState* play) { } void EnDragon_SetupDead(EnDragon* this, PlayState* play) { - if (!ActorCutscene_GetCanPlayNext(this->deathCutsceneIndex)) { - ActorCutscene_SetIntentToPlay(this->deathCutsceneIndex); + if (!CutsceneManager_IsNext(this->deathCsId)) { + CutsceneManager_Queue(this->deathCsId); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->deathCutsceneIndex, &this->actor); + CutsceneManager_StartWithPlayerCs(this->deathCsId, &this->actor); this->endFrame = Animation_GetLastFrame(&gDeepPythonSmallSideSwayAnim); Animation_Change(&this->skelAnime, &gDeepPythonSmallSideSwayAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); this->timer = 20; @@ -682,7 +682,7 @@ void EnDragon_Dead(EnDragon* this, PlayState* play) { seahorsePos.y += -100.0f + BREG(33); seahorsePos.z += (Math_CosS((this->actor.parent->world.rot.y + 0x8000)) * (500.0f + BREG(38))); if (Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_OT, seahorsePos.x, seahorsePos.y, - seahorsePos.z, 0, this->actor.shape.rot.y, 0, 0x4000, this->actor.cutscene, + seahorsePos.z, 0, this->actor.shape.rot.y, 0, 0x4000, this->actor.csId, this->actor.halfDaysBits, NULL)) { SET_WEEKEVENTREG(WEEKEVENTREG_13_01); switch (this->pythonIndex) { diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h index cb2ab94903..2d5f31b545 100644 --- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h +++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.h @@ -47,8 +47,8 @@ typedef struct EnDragon { /* 0x2BA */ s16 action; /* 0x2BC */ UNK_TYPE1 unk_2BC[0x2]; /* 0x2BE */ s16 state; - /* 0x2C0 */ s16 grabCutsceneIndex; - /* 0x2C2 */ s16 deathCutsceneIndex; + /* 0x2C0 */ s16 grabCsId; + /* 0x2C2 */ s16 deathCsId; /* 0x2C4 */ UNK_TYPE1 unk_2C4[0x4]; /* 0x2C8 */ s16 subCamId; /* 0x2CA */ s16 grabTimer; // Counts up from the time a grab starts until the time the actor begins attacking diff --git a/src/overlays/actors/ovl_En_Egol/z_en_egol.c b/src/overlays/actors/ovl_En_Egol/z_en_egol.c index 8172ded907..6f9c0e73a7 100644 --- a/src/overlays/actors/ovl_En_Egol/z_en_egol.c +++ b/src/overlays/actors/ovl_En_Egol/z_en_egol.c @@ -1043,11 +1043,11 @@ void EnEgol_Damaged(EnEgol* this, PlayState* play) { } void EnEgol_StartDeathCutscene(EnEgol* this, PlayState* play) { - if (!ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + if (!CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Queue(this->actor.csId); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); this->subCamFovTarget = 60.0f; EnEgol_ChangeAnim(this, EYEGORE_ANIM_DEATH); this->action = EYEGORE_ACTION_DYING; @@ -1075,7 +1075,7 @@ void EnEgol_Death(EnEgol* this, PlayState* play) { if (this->switchFlag > -1) { Flags_SetSwitch(play, this->switchFlag); } - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); Actor_Kill(&this->actor); } else { if (Animation_OnFrame(&this->skelAnime, 46.0f)) { diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 751c24aab7..f70b60b579 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -855,8 +855,8 @@ void func_8088E60C(EnElf* this, PlayState* play) { glowLightRadius = 0; } - if (Cutscene_CheckActorAction(play, 201)) { - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 201)]->action == 6) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_201)) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_201)]->id == 6) { glowLightRadius = 0; } } @@ -883,18 +883,18 @@ void func_8088E850(EnElf* this, PlayState* play) { Actor* arrowPointedActor; f32 xScale; f32 distFromLinksHead; - u32 sp38; + u32 cueChannel; func_8088F214(this, play); func_8088E5A8(this, play); xScale = 0.0f; - if (Cutscene_CheckActorAction(play, 201)) { - sp38 = Cutscene_GetActorActionIndex(play, 201); - func_808908D0(&nextPos, play, sp38); - this->actor.shape.rot.y = play->csCtx.actorActions[sp38]->urot.y; - this->actor.shape.rot.x = play->csCtx.actorActions[sp38]->urot.x; - if (play->csCtx.actorActions[sp38]->action == 5) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_201)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_201); + func_808908D0(&nextPos, play, cueChannel); + this->actor.shape.rot.y = play->csCtx.actorCues[cueChannel]->rot.y; + this->actor.shape.rot.x = play->csCtx.actorCues[cueChannel]->rot.x; + if (play->csCtx.actorCues[cueChannel]->id == 5) { func_8088F5F4(this, play, 16); } @@ -904,14 +904,13 @@ void func_8088E850(EnElf* this, PlayState* play) { func_8088D660(this, &nextPos, 0.2f); } - if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 0) && - (play->csCtx.currentCsIndex == 0) && - ((play->csCtx.frames == 149) || (play->csCtx.frames == 381) || (play->csCtx.frames == 591))) { + if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 0) && + ((play->csCtx.curFrame == 149) || (play->csCtx.curFrame == 381) || (play->csCtx.curFrame == 591))) { Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } - if ((play->sceneId == SCENE_SECOM) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 4) && - (play->csCtx.frames == 95)) { + if ((play->sceneId == SCENE_SECOM) && (gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 4) && + (play->csCtx.curFrame == 95)) { Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH); } } else { @@ -1016,7 +1015,7 @@ void func_8088E850(EnElf* this, PlayState* play) { func_8088E60C(this, play); - if (!Cutscene_CheckActorAction(play, 0xC9)) { + if (!Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_201)) { this->actor.shape.rot.y = this->unk_258; } } @@ -1107,8 +1106,8 @@ void func_8088F214(EnElf* this, PlayState* play) { s32 pad; if (play->csCtx.state != 0) { - if (Cutscene_CheckActorAction(play, 201)) { - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 201)]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_201)) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_201)]->id) { case 4: sp34 = 7; break; @@ -1325,19 +1324,19 @@ void func_8088FC34(EnElf* this, PlayState* play) { } void func_8088FD04(EnElf* this) { - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { this->unk_264 &= ~1; this->unk_264 |= 2; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); this->unk_264 |= 1; - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); this->unk_264 &= ~1; this->unk_264 |= 2; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->unk_264 |= 1; } } @@ -1348,8 +1347,8 @@ void func_8088FDCC(EnElf* this) { this->fairyFlags &= ~0x20; this->actor.focus.pos = this->actor.world.pos; this->unk_234 = NULL; - if ((this->unk_264 & 2) && (this->actor.cutscene != 0x7C)) { - ActorCutscene_Stop(this->actor.cutscene); + if ((this->unk_264 & 2) && (this->actor.csId != CS_ID_GLOBAL_TALK)) { + CutsceneManager_Stop(this->actor.csId); } this->unk_264 &= ~0x20; } @@ -1485,8 +1484,8 @@ void func_8089010C(Actor* thisx, PlayState* play) { func_8088C51C(this, 3); if (this->elfMsg != NULL) { this->elfMsg->flags |= ACTOR_FLAG_TALK_REQUESTED; - thisx->cutscene = this->elfMsg->cutscene; - if (thisx->cutscene != -1) { + thisx->csId = this->elfMsg->csId; + if (thisx->csId != CS_ID_NONE) { func_8088FD04(this); } if (this->elfMsg->home.rot.x == -0x961) { @@ -1494,7 +1493,7 @@ void func_8089010C(Actor* thisx, PlayState* play) { Actor_ChangeFocus(thisx, play, this->elfMsg); } } else { - thisx->cutscene = -1; + thisx->csId = CS_ID_NONE; } thisx->flags &= ~ACTOR_FLAG_10000; } else if (this->unk_264 & 4) { @@ -1580,8 +1579,8 @@ void EnElf_Draw(Actor* thisx, PlayState* play) { if (player->currentMask != PLAYER_MASK_GIANT) { if (!(this->fairyFlags & 8) && - (!Cutscene_CheckActorAction(play, 201) || - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 201)]->action != 6)) && + (!Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_201) || + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_201)]->id != 6)) && (!(player->stateFlags1 & PLAYER_STATE1_100000) || (kREG(90) < this->actor.projectedPos.z))) { Gfx* gfx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Gfx)); f32 alphaScale; @@ -1624,17 +1623,17 @@ void EnElf_Draw(Actor* thisx, PlayState* play) { void func_808908D0(Vec3f* vec, PlayState* play, u32 action) { Vec3f startPos; Vec3f endPos; - CsCmdActorAction* npcAction = play->csCtx.actorActions[action]; + CsCmdActorCue* cue = play->csCtx.actorCues[action]; f32 lerp; - startPos.x = npcAction->startPos.x; - startPos.y = npcAction->startPos.y; - startPos.z = npcAction->startPos.z; + startPos.x = cue->startPos.x; + startPos.y = cue->startPos.y; + startPos.z = cue->startPos.z; - endPos.x = npcAction->endPos.x; - endPos.y = npcAction->endPos.y; - endPos.z = npcAction->endPos.z; + endPos.x = cue->endPos.x; + endPos.y = cue->endPos.y; + endPos.z = cue->endPos.z; - lerp = Environment_LerpWeight(npcAction->endFrame, npcAction->startFrame, play->csCtx.frames); + lerp = Environment_LerpWeight(cue->endFrame, cue->startFrame, play->csCtx.curFrame); VEC3F_LERPIMPDST(vec, &startPos, &endPos, lerp); } diff --git a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c index 7f6067d9c2..a3f17f6059 100644 --- a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c +++ b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c @@ -47,14 +47,14 @@ ActorInit En_Elfgrp_InitVars = { (ActorFunc)NULL, }; -void func_80A396B0(EnElfgrp* this, s32 arg1) { - while (arg1 > 0) { - if (this->actor.cutscene == -1) { +void func_80A396B0(EnElfgrp* this, s32 numCutscenes) { + while (numCutscenes > 0) { + if (this->actor.csId == CS_ID_NONE) { break; } - this->actor.cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + this->actor.csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); - arg1--; + numCutscenes--; } } @@ -345,9 +345,9 @@ void func_80A3A044(PlayState* play) { } void func_80A3A0AC(EnElfgrp* this, PlayState* play) { - if (!Cutscene_CheckActorAction(play, 0x64)) { + if (!Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_100)) { this->actionFunc = func_80A3A600; - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); } } @@ -386,12 +386,12 @@ void func_80A3A210(EnElfgrp* this, PlayState* play) { } void func_80A3A274(EnElfgrp* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x64)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_100)) { if (this->unk_14A & 1) { func_800B9010(&this->actor, NA_SE_PL_CHIBI_FAIRY_HEAL - SFX_FLAG); } - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x64)]->action) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_100)]->id) { case 2: if (!(this->unk_14A & 1)) { if (this->unk_147 == ENELFGRP_0) { @@ -414,8 +414,8 @@ void func_80A3A274(EnElfgrp* this, PlayState* play) { } void func_80A3A398(EnElfgrp* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->actionFunc = func_80A3A274; Flags_UnsetSwitch(play, ENELFGRP_GET_FE00(&this->actor)); if (this->unk_14A & 2) { @@ -431,7 +431,7 @@ void func_80A3A398(EnElfgrp* this, PlayState* play) { } this->unk_14A &= ~8; } else if (this->actor.xzDistToPlayer < 350.0f) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -443,9 +443,10 @@ void func_80A3A484(EnElfgrp* this, PlayState* play) { } void func_80A3A4AC(EnElfgrp* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x64)) { - s32 temp = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x64)]->action; - if (temp == 3) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_100)) { + s32 cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_100)]->id; + + if (cueId == 3) { this->actionFunc = func_80A3A484; this->unk_144 = 90; } @@ -453,10 +454,10 @@ void func_80A3A4AC(EnElfgrp* this, PlayState* play) { } void func_80A3A520(EnElfgrp* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x67)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_103)) { this->actionFunc = func_80A3A600; - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->actionFunc = func_80A3A4AC; Flags_SetSwitch(play, ENELFGRP_GET_FE00(&this->actor)); @@ -468,7 +469,7 @@ void func_80A3A520(EnElfgrp* this, PlayState* play) { Flags_SetSwitch(play, this->actor.home.rot.z); } } else if (this->actor.xzDistToPlayer < 350.0f) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c index 542d739e61..871665cc6a 100644 --- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c +++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c @@ -431,16 +431,16 @@ void EnElforg_ClockTownFairyCollected(EnElforg* this, PlayState* play) { player->stateFlags1 &= ~PLAYER_STATE1_20000000; Actor_Kill(&this->actor); SET_WEEKEVENTREG(WEEKEVENTREG_08_80); - ActorCutscene_Stop(0x7C); + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); return; } func_800B9010(&this->actor, NA_SE_PL_CHIBI_FAIRY_HEAL - SFX_FLAG); - if (ActorCutscene_GetCurrentIndex() != 0x7C) { - if (ActorCutscene_GetCanPlayNext(0x7C)) { - ActorCutscene_Start(0x7C, &this->actor); + if (CutsceneManager_GetCurrentCsId() != CS_ID_GLOBAL_TALK) { + if (CutsceneManager_IsNext(CS_ID_GLOBAL_TALK)) { + CutsceneManager_Start(CS_ID_GLOBAL_TALK, &this->actor); } else { - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); } } } @@ -485,7 +485,7 @@ void EnElforg_FreeFloating(EnElforg* this, PlayState* play) { // Bring me back to North Clock Town! Message_StartTextbox(play, 0x579, NULL); this->actionFunc = EnElforg_ClockTownFairyCollected; - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); return; } diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c index b83799ea68..94087bfb15 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -315,7 +315,7 @@ void EnFall_Setup(EnFall* this, PlayState* play) { void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, PlayState* play) { static s32 sGiantsCutsceneState = 0; - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 1) && (play->csCtx.scriptIndex == 0)) { switch (sGiantsCutsceneState) { case 0: if (play->csCtx.state != 0) { @@ -327,20 +327,20 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, PlayState* play) { if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOLWA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_93_04)) { - if (ActorCutscene_GetCanPlayNext(0xC)) { - ActorCutscene_Start(0xC, &this->actor); + if (CutsceneManager_IsNext(12)) { + CutsceneManager_Start(12, &this->actor); sGiantsCutsceneState++; } else { - ActorCutscene_SetIntentToPlay(0xC); + CutsceneManager_Queue(12); } - } else if (ActorCutscene_GetCanPlayNext(0xB)) { - ActorCutscene_Start(0xB, &this->actor); + } else if (CutsceneManager_IsNext(11)) { + CutsceneManager_Start(11, &this->actor); SET_WEEKEVENTREG(WEEKEVENTREG_93_04); sGiantsCutsceneState++; } else { - ActorCutscene_SetIntentToPlay(0xB); + CutsceneManager_Queue(11); } - } else if (play->csCtx.frames > 1600) { + } else if (play->csCtx.curFrame > 1600) { play->nextEntrance = ENTRANCE(CLOCK_TOWER_ROOFTOP, 0); gSaveContext.nextCutsceneIndex = 0xFFF2; play->transitionTrigger = TRANS_TRIGGER_START; @@ -351,7 +351,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, PlayState* play) { break; case 9: - play->csCtx.frames--; + play->csCtx.curFrame--; break; } } @@ -359,15 +359,15 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, PlayState* play) { void EnFall_CrashingMoon_PerformCutsceneActions(EnFall* this, PlayState* play) { EnFall_CrashingMoon_HandleGiantsCutscene(this, play); - if (Cutscene_CheckActorAction(play, 0x85)) { - if (Cutscene_CheckActorAction(play, 133) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 133)]->action == 1) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_133)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_133) && + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)]->id == 1) { this->actor.draw = NULL; } else { this->actor.draw = EnFall_Moon_Draw; - if (Cutscene_CheckActorAction(play, 133) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 133)]->action == 2) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 133)); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_133) && + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)]->id == 2) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)); } } } else { @@ -376,8 +376,8 @@ void EnFall_CrashingMoon_PerformCutsceneActions(EnFall* this, PlayState* play) { } void EnFall_StoppedOpenMouthMoon_PerformCutsceneActions(EnFall* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 133)) { - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 133)]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_133)) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)]->id) { case 3: if (this->eyeGlowIntensity == 0.0f) { Actor_PlaySfx(&this->actor, NA_SE_EV_MOON_EYE_FLASH); @@ -396,10 +396,10 @@ void EnFall_StoppedOpenMouthMoon_PerformCutsceneActions(EnFall* this, PlayState* } void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 133)) { - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 133)]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_133)) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)]->id) { case 2: - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 133)); + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)); break; case 4: @@ -409,9 +409,9 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, PlayStat } if ((play->sceneId == SCENE_OKUJOU) && (gSaveContext.sceneLayer == 2)) { - switch (play->csCtx.currentCsIndex) { + switch (play->csCtx.scriptIndex) { case 0: - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 1060: Actor_PlaySfx(&this->actor, NA_SE_EN_MOON_SCREAM1); break; @@ -424,13 +424,13 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, PlayStat Actor_PlaySfx(&this->actor, NA_SE_EV_SLIP_MOON); break; } - if (play->csCtx.frames >= 1145) { + if (play->csCtx.curFrame >= 1145) { func_800B9010(&this->actor, NA_SE_EV_FALL_POWER - SFX_FLAG); } break; case 1: - switch (play->csCtx.frames) { + switch (play->csCtx.curFrame) { case 561: Actor_PlaySfx(&this->actor, NA_SE_EN_MOON_SCREAM1); break; @@ -443,7 +443,7 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, PlayStat Actor_PlaySfx(&this->actor, NA_SE_EV_SLIP_MOON); break; } - if (play->csCtx.frames >= 650) { + if (play->csCtx.curFrame >= 650) { func_800B9010(&this->actor, NA_SE_EV_FALL_POWER - SFX_FLAG); } break; @@ -463,16 +463,16 @@ void EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions(EnFall* this, Pla void EnFall_Moon_PerformDefaultActions(EnFall* this, PlayState* play) { u16 currentDay; - if (Cutscene_CheckActorAction(play, 133)) { - if (Cutscene_CheckActorAction(play, 133) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 133)]->action == 1) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_133)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_133) && + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)]->id == 1) { this->actor.draw = NULL; } else { Actor_SetScale(&this->actor, this->scale * 3.6f); this->actor.draw = EnFall_Moon_Draw; - if (Cutscene_CheckActorAction(play, 133) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 133)]->action == 2) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 133)); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_133) && + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)]->id == 2) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_133)); } } } else { @@ -510,8 +510,9 @@ void EnFall_MoonsTear_DoNothing(EnFall* this, PlayState* play) { void EnFall_MoonsTear_Fall(EnFall* this, PlayState* play) { s32 pad; - if (Cutscene_CheckActorAction(play, 517) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 517)]->action == 2 && this->actor.draw == NULL) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_517) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_517)]->id == 2) && + (this->actor.draw == NULL)) { EnFall_MoonsTear_Initialize(this); } @@ -574,11 +575,11 @@ void EnFall_Fireball_SetPerVertexAlpha(f32 fireballAlpha) { void EnFall_Fireball_Update(Actor* thisx, PlayState* play) { EnFall* this = THIS; - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 2)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 2)) { play->skyboxCtx.rot.y -= 0.05f; } - if (Cutscene_CheckActorAction(play, 450)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_450)) { this->actor.draw = EnFall_Fireball_Draw; if (this->flags & FLAG_FIRE_BALL_INTENSIFIES) { this->fireballIntensity += 0.01f; @@ -586,9 +587,9 @@ void EnFall_Fireball_Update(Actor* thisx, PlayState* play) { this->fireballIntensity = 1.0f; } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 450)); + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, 450)); - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 450)]->action) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, 450)]->id) { default: this->actor.draw = NULL; this->fireballAlpha = 0; @@ -625,7 +626,7 @@ void EnFall_Fireball_Update(Actor* thisx, PlayState* play) { this->actor.draw = NULL; } - if (Cutscene_CheckActorAction(play, 0x1C2) && this->fireballAlpha > 0) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_450) && (this->fireballAlpha > 0)) { func_8019F128(NA_SE_EV_MOON_FALL_LAST - SFX_FLAG); } Actor_SetScale(&this->actor, this->scale * 1.74f); @@ -682,9 +683,9 @@ s32 EnFall_RisingDebris_InitializeEffect(EnFall* this) { void EnFall_RisingDebris_Update(Actor* thisx, PlayState* play) { EnFall* this = THIS; - if (Cutscene_CheckActorAction(play, 451)) { - if (Cutscene_CheckActorAction(play, 451) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 451)]->action == 2) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_451)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_451) && + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_451)]->id == 2) { EnFall_RisingDebris_UpdateEffects(this); EnFall_RisingDebris_InitializeEffect(this); } else if (this->activeDebrisEffectCount != 0) { @@ -699,8 +700,8 @@ void EnFall_RisingDebris_Update(Actor* thisx, PlayState* play) { void EnFall_FireRing_Update(Actor* thisx, PlayState* play) { EnFall* this = THIS; - if (Cutscene_CheckActorAction(play, 450) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 450)]->action == 5) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_450) && + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_450)]->id == 5) { if (!(this->flags & FLAG_FIRE_RING_APPEARS)) { Actor_PlaySfx(&this->actor, NA_SE_IT_DM_RING_EXPLOSION); } diff --git a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c index 33cf9a64df..28a6cc74c6 100644 --- a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c +++ b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c @@ -44,7 +44,7 @@ void EnFall2_Init(Actor* thisx, PlayState* play) { this->unk2DC = Lib_SegmentedToVirtual(object_fall2_Matanimheader_008840); Actor_SetScale(&this->actor, 0.02f); this->actionFunc = func_80C1B9D4; - this->csActionIndex = 0x231; + this->cueType = CS_CMD_ACTOR_CUE_561; this->alphaLevel = 0.0f; } @@ -92,13 +92,13 @@ void EnFall2_DoNothing(EnFall2* this, PlayState* play) { void func_80C1B8B4(EnFall2* this) { this->actor.draw = EnFall2_Draw; - if (this->csActorAction == 1) { + if (this->cueId == 1) { Actor_SetScale(&this->actor, 0.02f); } } void func_80C1B8F0(EnFall2* this) { - switch (this->csActorAction) { + switch (this->cueId) { case 1: if (this->alphaLevel < 1.0f) { this->alphaLevel += 1.0f / 30.0f; @@ -125,12 +125,10 @@ void func_80C1B8F0(EnFall2* this) { void func_80C1B9D4(EnFall2* this, PlayState* play) { func_80183DE0(&this->skeletonInfo); - if (Cutscene_CheckActorAction(play, this->csActionIndex)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csActionIndex)); - if (this->csActorAction != - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csActionIndex)]->action) { - this->csActorAction = - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csActionIndex)]->action; + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + if (this->cueId != play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) { + this->cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; func_80C1B8B4(this); } func_80C1B8F0(this); diff --git a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.h b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.h index 41f0644983..3555595f33 100644 --- a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.h +++ b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.h @@ -15,8 +15,8 @@ typedef struct EnFall2 { /* 0x228 */ Vec3s unk228[30]; /* 0x2DC */ AnimatedMaterial* unk2DC; /* 0x2E0 */ f32 alphaLevel; - /* 0x2E4 */ s16 csActorAction; - /* 0x2E6 */ u16 csActionIndex; + /* 0x2E4 */ s16 cueId; + /* 0x2E6 */ u16 cueType; /* 0x2E8 */ EnFall2ActionFunc actionFunc; } EnFall2; // size = 0x2EC diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c index 47244f9d37..b7952c1bc4 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -151,7 +151,7 @@ s32 func_80B28478(EnFish2* this) { void EnFish2_Init(Actor* thisx, PlayState* play) { EnFish2* this = THIS; s32 i; - s32 cs; + s32 csId; Math_Vec3f_Copy(&this->unk_324, &this->actor.home.pos); this->unk_344 = D_80B2B2F0; @@ -187,12 +187,12 @@ void EnFish2_Init(Actor* thisx, PlayState* play) { this->unk_2C0 = 3; } } - cs = this->actor.cutscene; + csId = this->actor.csId; this->unk_330 = D_80B2B370[this->unk_2C0]; i = 0; // clang-format off - while (cs != -1) { this->unk_2BA[i] = cs; cs = ActorCutscene_GetAdditionalCutscene(cs); i++; } + while (csId != CS_ID_NONE) { this->csIdList[i] = csId; csId = CutsceneManager_GetAdditionalCsId(csId); i++; } // clang-format on Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); @@ -416,7 +416,7 @@ void func_80B28C14(EnFish2* this, PlayState* play) { if (this->unk_354 != NULL) { D_80B2B2E4 = 0; D_80B2B2E0 = 1; - fish->unk_2BA[0] = this->unk_2BA[0]; + fish->csIdList[0] = this->csIdList[0]; fish->unk_350 = this->unk_350; } } @@ -784,11 +784,11 @@ void func_80B29EE4(EnFish2* this, PlayState* play) { void func_80B2A01C(EnFish2* this, PlayState* play) { if (this->unk_2B4 == 0) { - if (!ActorCutscene_GetCanPlayNext(this->unk_2BA[0])) { - ActorCutscene_SetIntentToPlay(this->unk_2BA[0]); + if (!CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Queue(this->csIdList[0]); } else { this->unk_2B4 = 15; - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2BA[0], &this->actor); + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->actor); this->actionFunc = func_80B2A094; } } @@ -801,13 +801,13 @@ void func_80B2A094(EnFish2* this, PlayState* play) { D_80B2B2E4 = 1; } - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->unk_2BA[0]); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->csIdList[0]); if (D_80B2B2EC != 0) { D_80B2B2EC++; if (D_80B2B2EC > 200) { Actor_Kill(&this->actor); - ActorCutscene_Stop(this->unk_2BA[0]); + CutsceneManager_Stop(this->csIdList[0]); return; } } @@ -862,7 +862,7 @@ void func_80B2A23C(EnFish2* this, PlayState* play) { if ((this->unk_2B4 == 0) && (D_80B2B2E4 == 3)) { D_80B2B2E0 = D_80B2B2EC = D_80B2B2E4 = 0; D_80B2B2F4 = NULL; - ActorCutscene_Stop(this->unk_2BA[0]); + CutsceneManager_Stop(this->csIdList[0]); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h index 49941d67ed..20b1ff21b0 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.h @@ -28,7 +28,7 @@ typedef struct EnFish2 { /* 0x02B4 */ s16 unk_2B4; /* 0x02B6 */ s16 unk_2B6; /* 0x02B8 */ s16 unk_2B8; - /* 0x02BA */ s16 unk_2BA[3]; + /* 0x02BA */ s16 csIdList[3]; /* 0x02C0 */ s32 unk_2C0; /* 0x02C4 */ s32 unk_2C4; /* 0x02C8 */ u8 unk_2C8; diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index 4bbd4b5cc3..306f1d94dc 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -3,7 +3,7 @@ * Overlay: ovl_En_Fishing * Description: Fishing Pond Elements (Owner, Fish, Props, Effects...) */ - +#include "prevent_bss_reordering.h" #include "z_en_fishing.h" #include "z64rumble.h" #include "z64shrink_window.h" @@ -3776,7 +3776,7 @@ void EnFishing_UpdateFish(Actor* thisx, PlayState* play2) { player->unk_B28 = 3; Rumble_Override(0.0f, 1, 3, 1); D_809171D8++; - Cutscene_Start(play, &play->csCtx); + Cutscene_StartManual(play, &play->csCtx); D_8090CD4C = 100; D_80911F48 = 45.0f; D_8090CD14 = 5; @@ -5278,7 +5278,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { mainCam->at = sSubCamAt; } func_80169AFC(play, sSubCamId, 0); - Cutscene_End(play, &play->csCtx); + Cutscene_StopManual(play, &play->csCtx); D_8090CD4C = 0; sSubCamId = SUB_CAM_ID_DONE; func_800F6834(play, 0); @@ -5288,7 +5288,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { break; case 10: - Cutscene_Start(play, &play->csCtx); + Cutscene_StartManual(play, &play->csCtx); sSubCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, sSubCamId, CAM_STATUS_ACTIVE); @@ -5318,8 +5318,8 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { mainCam->at = sSubCamAt; func_80169AFC(play, sSubCamId, 0); - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); D_8090CD4C = 0; sSubCamId = SUB_CAM_ID_DONE; D_8090CD50 = 30; @@ -5329,7 +5329,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { break; case 20: - Cutscene_Start(play, &play->csCtx); + Cutscene_StartManual(play, &play->csCtx); sSubCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, sSubCamId, CAM_STATUS_ACTIVE); @@ -5419,9 +5419,8 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { mainCam->eyeNext = sSubCamEye; mainCam->at = sSubCamAt; func_80169AFC(play, sSubCamId, 0); - Cutscene_End(play, &play->csCtx); - func_800B7298(play, &this->actor, - PLAYER_CSMODE_6); // arg2 changed from PLAYER_CSMODE_7 to PLAYER_CSMODE_6 in MM + Cutscene_StopManual(play, &play->csCtx); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); D_8090CD4C = 0; sSubCamId = SUB_CAM_ID_DONE; player->unk_B28 = -5; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 680f4f8307..ffd456af43 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -176,7 +176,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { this->actor.parent = Actor_SpawnAsChildAndCutscene( &play->actorCtx, play, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, this->actor.world.pos.y, - this->actor.world.pos.z, 0, 0, 0, params + 0x10, -1, this->actor.halfDaysBits, NULL); + this->actor.world.pos.z, 0, 0, 0, params + 0x10, CS_ID_NONE, this->actor.halfDaysBits, NULL); if (this->actor.parent == NULL) { Actor_Kill(&this->actor); return; @@ -184,7 +184,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { this->actor.child = Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, - params + 0x10, -1, this->actor.halfDaysBits, NULL); + params + 0x10, CS_ID_NONE, this->actor.halfDaysBits, NULL); if (this->actor.child == NULL) { Actor_Kill(this->actor.parent); Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index 81e261a005..8130f3cc92 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -228,21 +228,21 @@ void EnFsn_UpdateCollider(EnFsn* this, PlayState* play) { } void EnFsn_HandleLookToShopkeeperBuyingCutscene(EnFsn* this) { - if ((this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) && - (this->lookToShopkeeperBuyingCutscene != this->cutscene) && (this->actor.textId == 0x29CE)) { - ActorCutscene_Stop(this->cutscene); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if ((this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) && (this->lookToShopkeeperBuyingCsId != this->csId) && + (this->actor.textId == 0x29CE)) { + CutsceneManager_Stop(this->csId); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperBuyingCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperBuyingCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENFSN_CUTSCENESTATE_WAITING; } else if (this->cutsceneState == ENFSN_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_Start(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, &this->actor); this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -387,7 +387,7 @@ void EnFsn_SpawnShopItems(EnFsn* this, PlayState* play) { void EnFsn_EndInteraction(EnFsn* this, PlayState* play) { if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENFSN_CUTSCENESTATE_STOPPED; } Actor_ProcessTalkRequest(&this->actor, &play->state); @@ -737,11 +737,11 @@ void EnFsn_Idle(EnFsn* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENFSN_CUTSCENESTATE_WAITING; } this->actor.textId = EnFsn_GetWelcome(play); @@ -797,8 +797,8 @@ void EnFsn_Haggle(EnFsn* this, PlayState* play) { void EnFsn_BeginInteraction(EnFsn* this, PlayState* play) { if (this->cutsceneState == ENFSN_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; if (Player_GetMask(play) == PLAYER_MASK_NONE) { func_8011552C(play, DO_ACTION_NEXT); @@ -812,7 +812,7 @@ void EnFsn_BeginInteraction(EnFsn* this, PlayState* play) { this->actionFunc = EnFsn_SetupEndInteractionImmediately; } } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -958,7 +958,7 @@ void EnFsn_MakeOffer(EnFsn* this, PlayState* play) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENFSN_CUTSCENESTATE_STOPPED; } switch (this->price) { @@ -1021,17 +1021,17 @@ void EnFsn_ResumeInteraction(EnFsn* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (ENFSN_IS_SHOP(&this->actor)) { if (!this->isSelling) { - this->cutscene = this->lookToShopkeeperBuyingCutscene; + this->csId = this->lookToShopkeeperBuyingCsId; this->actor.textId = 0x29D0; } else { - this->cutscene = this->lookToShopkeeperCutscene; + this->csId = this->lookToShopkeeperCsId; this->actor.textId = (this->numSellingItems <= 0) ? 0x29DE : 0x29D6; } Message_StartTextbox(play, this->actor.textId, &this->actor); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); this->actionFunc = EnFsn_ResumeShoppingInteraction; } else { EnFsn_HandleConversationBackroom(this, play); @@ -1044,8 +1044,8 @@ void EnFsn_ResumeInteraction(EnFsn* this, PlayState* play) { void EnFsn_ResumeShoppingInteraction(EnFsn* this, PlayState* play) { if (this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; if (!this->isSelling) { this->actionFunc = EnFsn_AskCanBuyMore; @@ -1058,33 +1058,33 @@ void EnFsn_ResumeShoppingInteraction(EnFsn* this, PlayState* play) { this->actionFunc = EnFsn_FaceShopkeeperSelling; } } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = !this->isSelling ? this->lookToShopkeeperBuyingCutscene : this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = !this->isSelling ? this->lookToShopkeeperBuyingCsId : this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } } } void EnFsn_LookToShelf(EnFsn* this, PlayState* play) { if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + CutsceneManager_Stop(this->csId); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShelfCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShelfCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENFSN_CUTSCENESTATE_WAITING; } else if (this->cutsceneState == ENFSN_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene) != 0) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; EnFsn_UpdateCursorPos(this, play); this->actionFunc = EnFsn_BrowseShelf; Message_ContinueTextbox(play, this->items[this->cursorIndex]->actor.textId); } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -1117,16 +1117,16 @@ void EnFsn_BrowseShelf(EnFsn* this, PlayState* play) { void EnFsn_LookToShopkeeperFromShelf(EnFsn* this, PlayState* play) { if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + CutsceneManager_Stop(this->csId); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperFromShelfCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperFromShelfCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENFSN_CUTSCENESTATE_WAITING; } else if (this->cutsceneState == ENFSN_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; @@ -1134,7 +1134,7 @@ void EnFsn_LookToShopkeeperFromShelf(EnFsn* this, PlayState* play) { Message_ContinueTextbox(play, this->actor.textId); this->actionFunc = EnFsn_FaceShopkeeperSelling; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -1148,7 +1148,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_33_04); case CANBUY_RESULT_SUCCESS_1: if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENFSN_CUTSCENESTATE_STOPPED; } func_8019F208(); @@ -1231,15 +1231,15 @@ void EnFsn_AskCanBuyMore(EnFsn* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if (this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } } if (talkState == TEXT_STATE_CHOICE) { @@ -1277,15 +1277,15 @@ void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if (this->cutsceneState == ENFSN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } } if (talkState == TEXT_STATE_CHOICE) { @@ -1380,10 +1380,10 @@ void EnFsn_ConverseBackroom(EnFsn* this, PlayState* play) { } void EnFsn_GetCutscenes(EnFsn* this) { - this->lookToShopkeeperCutscene = this->actor.cutscene; - this->lookToShelfCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToShopkeeperCutscene); - this->lookToShopkeeperFromShelfCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToShelfCutscene); - this->lookToShopkeeperBuyingCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToShopkeeperFromShelfCutscene); + this->lookToShopkeeperCsId = this->actor.csId; + this->lookToShelfCsId = CutsceneManager_GetAdditionalCsId(this->lookToShopkeeperCsId); + this->lookToShopkeeperFromShelfCsId = CutsceneManager_GetAdditionalCsId(this->lookToShelfCsId); + this->lookToShopkeeperBuyingCsId = CutsceneManager_GetAdditionalCsId(this->lookToShopkeeperFromShelfCsId); } void EnFsn_Blink(EnFsn* this) { diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h index 35b654c3db..f214dcbd90 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.h @@ -33,11 +33,11 @@ typedef struct EnFsn { /* 0x364 */ s16 eyeTexIndex; /* 0x366 */ s16 blinkTimer; /* 0x368 */ s16 cutsceneState; - /* 0x36A */ s16 cutscene; - /* 0x36C */ s16 lookToShopkeeperCutscene; - /* 0x36E */ s16 lookToShelfCutscene; - /* 0x370 */ s16 lookToShopkeeperFromShelfCutscene; - /* 0x372 */ s16 lookToShopkeeperBuyingCutscene; + /* 0x36A */ s16 csId; + /* 0x36C */ s16 lookToShopkeeperCsId; + /* 0x36E */ s16 lookToShelfCsId; + /* 0x370 */ s16 lookToShopkeeperFromShelfCsId; + /* 0x372 */ s16 lookToShopkeeperBuyingCsId; /* 0x374 */ s16 price; /* 0x376 */ u16 textId; /* 0x378 */ u8 isSelling; diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 2626d1cbdb..7435d0ddc6 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -727,9 +727,9 @@ void func_80962D60(EnFu* this, PlayState* play) { void func_80962EBC(EnFu* this, PlayState* play) { if (this->unk_542 != 0) { - if (this->actor.cutscene != -1) { + if (this->actor.csId != CS_ID_NONE) { Camera_ChangeDataIdx(play->cameraPtrs[CAM_ID_MAIN], - ActorCutscene_GetCutscene(this->actor.cutscene)->csCamSceneDataId); + CutsceneManager_GetCutsceneEntry(this->actor.csId)->csCamId); } } } diff --git a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c index b4542956c9..add0814bdd 100644 --- a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c +++ b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c @@ -219,13 +219,13 @@ void EnGakufu_GiveReward(EnGakufu* this, PlayState* play) { } void EnGakufu_PlayRewardCutscene(EnGakufu* this, PlayState* play) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { EnGakufu_GiveReward(this, play); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); EnGakufu_GiveReward(this, play); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c index 0575494c8e..14afe3270d 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c @@ -241,9 +241,9 @@ u16 func_80B0F97C(EnGb2* this) { } void func_80B0FA04(EnGb2* this) { - this->unk_282[0] = this->actor.cutscene; - this->unk_282[1] = ActorCutscene_GetAdditionalCutscene(this->unk_282[0]); - this->unk_282[2] = ActorCutscene_GetAdditionalCutscene(this->unk_282[1]); + this->csIdList[0] = this->actor.csId; + this->csIdList[1] = CutsceneManager_GetAdditionalCsId(this->csIdList[0]); + this->csIdList[2] = CutsceneManager_GetAdditionalCsId(this->csIdList[1]); } s32 func_80B0FA48(EnGb2* this, PlayState* play) { @@ -433,7 +433,7 @@ void func_80B0FFA8(EnGb2* this, PlayState* play) { Rupees_ChangeBy(-this->unk_288); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - func_800B7298(play, NULL, PLAYER_CSMODE_7); + func_800B7298(play, NULL, PLAYER_CSMODE_WAIT); this->actionFunc = func_80B11344; break; @@ -451,10 +451,10 @@ void func_80B0FFA8(EnGb2* this, PlayState* play) { void func_80B10240(EnGb2* this, PlayState* play) { this->unk_27C = D_80B119B0[this->unk_280].unk_00; this->unk_27E = D_80B119B0[this->unk_280].unk_10; - this->unk_282[0] = this->actor.cutscene; + this->csIdList[0] = this->actor.csId; this->unk_268 = NULL; - if (ActorCutscene_GetCanPlayNext(this->unk_282[0])) { - ActorCutscene_Start(this->unk_282[0], &this->actor); + if (CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Start(this->csIdList[0], &this->actor); Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, this->unk_27C, D_80B119B0[this->unk_280].unk_04.x, D_80B119B0[this->unk_280].unk_04.y, D_80B119B0[this->unk_280].unk_04.z, 0, 0, 0, this->unk_27E); @@ -463,7 +463,7 @@ void func_80B10240(EnGb2* this, PlayState* play) { } this->actionFunc = func_80B10344; } else { - ActorCutscene_SetIntentToPlay(this->unk_282[0]); + CutsceneManager_Queue(this->csIdList[0]); } } @@ -585,7 +585,7 @@ void func_80B10634(EnGb2* this, PlayState* play) { Rupees_ChangeBy(-this->unk_288); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - func_800B7298(play, NULL, PLAYER_CSMODE_7); + func_800B7298(play, NULL, PLAYER_CSMODE_WAIT); this->actionFunc = func_80B11344; } break; @@ -601,16 +601,16 @@ void func_80B10634(EnGb2* this, PlayState* play) { } void func_80B10868(EnGb2* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() != this->unk_282[2]) { - if (ActorCutscene_GetCanPlayNext(this->unk_282[this->unk_290])) { + if (CutsceneManager_GetCurrentCsId() != this->csIdList[2]) { + if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { this->actionFunc = func_80B10A48; - ActorCutscene_StartAndSetFlag(this->unk_282[this->unk_290], &this->actor); + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csIdList[this->csIdIndex], &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->unk_282[this->unk_290]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } else { - this->unk_290 = 1; - ActorCutscene_SetIntentToPlay(this->unk_282[this->unk_290]); + this->csIdIndex = 1; + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } @@ -656,12 +656,12 @@ void func_80B10A48(EnGb2* this, PlayState* play) { break; case ENGB2_7_1: - ActorCutscene_Stop(this->unk_282[this->unk_290]); + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); Actor_Kill(&this->actor); break; case ENGB2_7_2: - ActorCutscene_Stop(this->unk_282[this->unk_290]); + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); if (this->unk_26E == 0x14FB) { Flags_SetSwitch(play, ENGB2_GET_7F8(&this->actor)); Actor_Kill(&this->actor); @@ -694,7 +694,7 @@ void func_80B10B5C(EnGb2* this, PlayState* play) { this->unk_26C |= 2; } Message_StartTextbox(play, this->unk_26E, &this->actor); - this->unk_290 = 1; + this->csIdIndex = 1; this->unk_26C &= ~0x40; this->actionFunc = func_80B10DAC; } else if ((this->actor.xzDistToPlayer < 300.0f) && this->actor.isTargeted) { @@ -712,7 +712,7 @@ void func_80B10B5C(EnGb2* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_80_20); } this->unk_26C &= ~0x20; - this->unk_290 = 0; + this->csIdIndex = 0; this->unk_26C |= 0x80; this->actionFunc = func_80B10DAC; } else if (this->actor.xzDistToPlayer < 300.0f) { @@ -726,9 +726,9 @@ void func_80B10B5C(EnGb2* this, PlayState* play) { } void func_80B10DAC(EnGb2* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_282[this->unk_290])) { + if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { if (ENGB2_GET_7(&this->actor) == ENGB2_7_1) { - if (this->unk_290 != 2) { + if (this->csIdIndex != 2) { this->actionFunc = func_80B10E98; } else { Flags_SetSwitch(play, ENGB2_GET_7F8(&this->actor)); @@ -737,12 +737,12 @@ void func_80B10DAC(EnGb2* this, PlayState* play) { } else { this->actionFunc = func_80B110F8; } - ActorCutscene_StartAndSetFlag(this->unk_282[this->unk_290], &this->actor); + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csIdList[this->csIdIndex], &this->actor); } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->unk_282[this->unk_290]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } @@ -753,14 +753,14 @@ void func_80B10E98(EnGb2* this, PlayState* play) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; if ((this->unk_26E != 0x14E8) && (this->unk_26E != 0x14EA)) { - ActorCutscene_Stop(this->unk_282[this->unk_290]); + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); this->actionFunc = func_80B10B5C; } else if (Flags_GetSwitch(play, ENGB2_GET_7F8(&this->actor))) { this->actionFunc = func_80B10A48; } else { - ActorCutscene_Stop(this->unk_282[this->unk_290]); - this->unk_290 = 2; - ActorCutscene_SetIntentToPlay(this->unk_282[this->unk_290]); + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 2; + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); this->actionFunc = func_80B10DAC; } } else { @@ -770,9 +770,9 @@ void func_80B10E98(EnGb2* this, PlayState* play) { Message_StartTextbox(play, this->unk_26E, &this->actor); temp = this->unk_26E; if ((temp == 0x14E7) || (temp == 0x14E9) || (temp == 0x14EC) || (temp == 0x14F0)) { - ActorCutscene_Stop(this->unk_282[this->unk_290]); - this->unk_290 = 1; - ActorCutscene_SetIntentToPlay(this->unk_282[this->unk_290]); + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 1; + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); this->actionFunc = func_80B10DAC; } } @@ -839,8 +839,8 @@ void func_80B111AC(EnGb2* this, PlayState* play) { void func_80B11268(EnGb2* this, PlayState* play) { if (play->roomCtx.curRoom.num == 1) { - this->unk_290 = 0; - this->unk_282[0] = this->actor.cutscene; + this->csIdIndex = 0; + this->csIdList[0] = this->actor.csId; if (Flags_GetClear(play, 2) && Flags_GetClear(play, 3) && Flags_GetClear(play, 4) && Flags_GetClear(play, 5)) { this->unk_28A = 0xFF; this->unk_26C &= ~0x100; @@ -887,7 +887,7 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { case ENGB2_7_0: if (CHECK_WEEKEVENTREG(WEEKEVENTREG_54_80)) { Actor_Kill(&this->actor); - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20)) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) { Actor_Kill(&this->actor); } @@ -927,8 +927,8 @@ void EnGb2_Init(Actor* thisx, PlayState* play) { break; case ENGB2_7_2: - this->unk_290 = 0; - this->unk_282[0] = this->actor.cutscene; + this->csIdIndex = 0; + this->csIdList[0] = this->actor.csId; if (Flags_GetSwitch(play, ENGB2_GET_7F8(thisx))) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h index ec3b379a15..87cee9e994 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.h @@ -31,11 +31,11 @@ typedef struct EnGb2 { /* 0x27C */ s16 unk_27C; /* 0x27E */ s16 unk_27E; /* 0x280 */ s16 unk_280; - /* 0x282 */ s16 unk_282[3]; + /* 0x282 */ s16 csIdList[3]; /* 0x288 */ s16 unk_288; /* 0x28A */ u8 unk_28A; /* 0x28C */ s32 unk_28C; - /* 0x290 */ s16 unk_290; + /* 0x290 */ s16 csIdIndex; } EnGb2; // size = 0x294 #endif // Z_EN_GB2_H diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index dd53d9ea82..6cfbb4718e 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -88,7 +88,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { this->picto.actor.colChkInfo.mass = MASS_IMMOVABLE; this->picto.actor.targetMode = 6; Actor_SetScale(&this->picto.actor, 0.01f); - this->animIndex = this->csAction = -1; // GERUDO_WHITE_ANIM_NONE + this->animIndex = this->cueId = -1; // GERUDO_WHITE_ANIM_NONE this->stateFlags = 0; EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f); this->actionFunc = EnGe1_Wait; @@ -255,16 +255,16 @@ void EnGe1_Wait(EnGe1* this, PlayState* play) { } void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { - s16 csAction; + s16 cueId; - if (SkelAnime_Update(&this->skelAnime) && (this->csAction == 3)) { + if (SkelAnime_Update(&this->skelAnime) && (this->cueId == 3)) { EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_STIFF_SHIVERING, ANIMMODE_LOOP, 0.0f); } - if (Cutscene_CheckActorAction(play, 121)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_121)) { this->picto.actor.draw = EnGe1_Draw; - csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 121)]->action; - switch (csAction) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_121)]->id; + switch (cueId) { case 8: this->stateFlags &= ~GERUDO_WHITE_STATE_DISABLE_MOVEMENT; break; @@ -275,14 +275,15 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { default: this->stateFlags &= ~GERUDO_WHITE_STATE_DISABLE_MOVEMENT; - Cutscene_ActorTranslateAndYaw(&this->picto.actor, play, Cutscene_GetActorActionIndex(play, 0x79)); + Cutscene_ActorTranslateAndYaw(&this->picto.actor, play, + Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_121)); break; } - if (this->csAction != csAction) { - this->csAction = csAction; + if (this->cueId != cueId) { + this->cueId = cueId; - switch (this->csAction) { + switch (this->cueId) { // Aveil cutscene case 1: EnGe1_ChangeAnim(this, GERUDO_WHITE_ANIM_ARMS_FOLDED, ANIMMODE_LOOP, 0.0f); @@ -340,7 +341,7 @@ void EnGe1_PerformCutsceneActions(EnGe1* this, PlayState* play) { this->picto.actor.draw = NULL; } - switch (this->csAction) { + switch (this->cueId) { case 9: if ((this->curPointIndex < this->path->count) && EnGe1_FollowPath(this)) { this->curPointIndex++; diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index 1cf716b0f6..63a2a3c7fc 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -34,7 +34,7 @@ typedef struct EnGe1 { /* 0x2BA */ s16 blinkTimer; /* 0x2BC */ u16 stateFlags; /* 0x2BE */ s16 animIndex; - /* 0x2C0 */ s16 csAction; + /* 0x2C0 */ s16 cueId; /* 0x2C2 */ s16 screamTimer; /* 0x2C4 */ u8 hairstyle; /* 0x2C8 */ EnGe1ActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 3753ccf5cf..922472f9a9 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -100,7 +100,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->picto.actor.targetMode = 6; this->stateFlags = 0; this->detectedStatus = GERUDO_PURPLE_DETECTION_UNDETECTED; - this->csAction = -1; + this->cueId = -1; this->picto.actor.terminalVelocity = -9.0f; this->picto.actor.gravity = -1.0f; @@ -592,33 +592,34 @@ void EnGe2_Walk(EnGe2* this, PlayState* play) { void EnGe2_PerformCutsceneActions(EnGe2* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Cutscene_CheckActorAction(play, 476)) { - s16 csAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 476)]->action; - if (this->csAction != csAction) { - this->csAction = csAction; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_476)) { + s16 cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_476)]->id; - switch (csAction) { - case ENGE2_CSACTION_BEEHIVE_PATROL: + if (this->cueId != cueId) { + this->cueId = cueId; + + switch (cueId) { + case ENGE2_CUEID_BEEHIVE_PATROL: Animation_Change(&this->skelAnime, &gGerudoPurpleLookingAboutAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleLookingAboutAnim), 0, -8.0f); EnGe2_GetNextPath(this, play); break; - case ENGE2_CSACTION_BEEHIVE_RUN_AWAY: + case ENGE2_CUEID_BEEHIVE_RUN_AWAY: Animation_Change(&this->skelAnime, &gGerudoPurpleRunningAwayCutsceneAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGerudoPurpleRunningAwayCutsceneAnim), 0, -5.0f); this->screamTimer = (s32)(Rand_ZeroFloat(10.0f) + 20.0f); break; - case ENGE2_CSACTION_BEEHIVE_EXIT: + case ENGE2_CUEID_BEEHIVE_EXIT: Actor_Kill(&this->picto.actor); break; - case ENGE2_CSACTION_GBT_ENTR_STAND_STILL: + case ENGE2_CUEID_GBT_ENTR_STAND_STILL: Animation_Change(&this->skelAnime, &gGerudoPurpleGreatBayCutsceneAnim, 0.0f, 0.0f, 0.0f, 2, 0.0f); break; - case ENGE2_CSACTION_GBT_ENTR_BLOWN_AWAY: + case ENGE2_CUEID_GBT_ENTR_BLOWN_AWAY: Animation_Change(&this->skelAnime, &gGerudoPurpleGreatBayCutsceneAnim, 0.0f, 1.0f, 1.0f, 2, 0.0f); EnGe2_SetupBlownAwayPath(this, play); this->stateFlags |= GERUDO_PURPLE_STATE_DISABLE_MOVEMENT; @@ -631,8 +632,8 @@ void EnGe2_PerformCutsceneActions(EnGe2* this, PlayState* play) { } } - switch (this->csAction) { - case ENGE2_CSACTION_BEEHIVE_RUN_AWAY: + switch (this->cueId) { + case ENGE2_CUEID_BEEHIVE_RUN_AWAY: EnGe2_FollowPath(this); this->picto.actor.speed = 5.0f; @@ -648,7 +649,7 @@ void EnGe2_PerformCutsceneActions(EnGe2* this, PlayState* play) { } break; - case ENGE2_CSACTION_GBT_ENTR_BLOWN_AWAY: + case ENGE2_CUEID_GBT_ENTR_BLOWN_AWAY: if ((this->curPointIndex < this->path->count) && EnGe2_FollowPathWithoutGravity(this)) { this->curPointIndex++; } @@ -704,7 +705,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->picto.actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - if (Cutscene_CheckActorAction(play, 476)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_476)) { this->actionFunc = EnGe2_PerformCutsceneActions; this->stateFlags &= ~GERUDO_PURPLE_STATE_KO; this->stateFlags &= ~GERUDO_PURPLE_STATE_PATH_REVERSE; diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h index 739e942775..0a85e3bfe4 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h @@ -27,11 +27,11 @@ typedef enum { //! TODO: work out where to put this typedef enum { - /* 1 */ ENGE2_CSACTION_BEEHIVE_PATROL = 1, - /* 2 */ ENGE2_CSACTION_BEEHIVE_RUN_AWAY, - /* 3 */ ENGE2_CSACTION_BEEHIVE_EXIT, - /* 4 */ ENGE2_CSACTION_GBT_ENTR_STAND_STILL, - /* 5 */ ENGE2_CSACTION_GBT_ENTR_BLOWN_AWAY + /* 1 */ ENGE2_CUEID_BEEHIVE_PATROL = 1, + /* 2 */ ENGE2_CUEID_BEEHIVE_RUN_AWAY, + /* 3 */ ENGE2_CUEID_BEEHIVE_EXIT, + /* 4 */ ENGE2_CUEID_GBT_ENTR_STAND_STILL, + /* 5 */ ENGE2_CUEID_GBT_ENTR_BLOWN_AWAY } EnGe2CsAction; typedef struct EnGe2 { @@ -51,7 +51,7 @@ typedef struct EnGe2 { /* 0x2FC */ f32 verticalDetectRange; //!< vertical range to look for the player within /* 0x300 */ u8 timer; /* 0x301 */ u8 detectedStatus; - /* 0x302 */ s16 csAction; + /* 0x302 */ s16 cueId; /* 0x304 */ s16 unk304; // unused /* 0x306 */ s16 screamTimer; /* 0x308 */ EnGe2ActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index 44cf5215e0..4b5e8e3114 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -304,10 +304,10 @@ u8 func_80BB1B14(EnGeg* this, PlayState* play) { void func_80BB1C1C(EnGeg* this) { u16 i; - this->unk_49C[0] = this->actor.cutscene; + this->csIdList[0] = this->actor.csId; - for (i = 1; i < ARRAY_COUNT(this->unk_49C); i++) { - this->unk_49C[i] = ActorCutscene_GetAdditionalCutscene(this->unk_49C[i - 1]); + for (i = 1; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = CutsceneManager_GetAdditionalCsId(this->csIdList[i - 1]); } } @@ -432,15 +432,15 @@ void func_80BB221C(EnGeg* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state) && (this->unk_230 & 4)) { if (sp27 == 1) { this->unk_496 = 0xD66; - this->unk_49A = this->unk_49C[3]; + this->nextCsId = this->csIdList[3]; } else if (sp27 == 2) { this->unk_496 = 0xD64; - this->unk_49A = this->unk_49C[2]; + this->nextCsId = this->csIdList[2]; this->unk_230 &= ~4; } else if (sp27 == 3) { this->unk_230 |= 0x200; this->unk_496 = 0xD64; - this->unk_49A = this->unk_49C[2]; + this->nextCsId = this->csIdList[2]; this->unk_230 &= ~4; } Message_StartTextbox(play, this->unk_496, &this->actor); @@ -466,7 +466,7 @@ void func_80BB221C(EnGeg* this, PlayState* play) { } else if (Actor_ProcessTalkRequest(&this->actor, &play->state) && (this->unk_230 & 8)) { SET_WEEKEVENTREG(WEEKEVENTREG_35_40); this->unk_496 = 0xD5E; - this->unk_49A = this->unk_49C[0]; + this->nextCsId = this->csIdList[0]; Message_StartTextbox(play, this->unk_496, &this->actor); this->actionFunc = func_80BB2520; this->unk_230 &= ~8; @@ -481,18 +481,18 @@ void func_80BB221C(EnGeg* this, PlayState* play) { void func_80BB2520(EnGeg* this, PlayState* play) { if (this->unk_230 & 0x10) { - ActorCutscene_Stop(this->unk_498); + CutsceneManager_Stop(this->csId); this->unk_230 &= ~0x10; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->unk_498 = this->unk_49A; - ActorCutscene_SetIntentToPlay(this->unk_498); + this->csId = this->nextCsId; + CutsceneManager_Queue(this->csId); return; } - if (ActorCutscene_GetCanPlayNext(this->unk_498)) { - ActorCutscene_StartAndSetFlag(this->unk_498, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->unk_230 |= 0x10; switch (this->unk_496) { @@ -517,7 +517,7 @@ void func_80BB2520(EnGeg* this, PlayState* play) { break; case 0xD67: - this->unk_498 = this->unk_49C[5]; + this->csId = this->csIdList[5]; this->actionFunc = func_80BB2B1C; break; @@ -534,11 +534,11 @@ void func_80BB2520(EnGeg* this, PlayState* play) { break; } } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->unk_498 = this->unk_49A; - ActorCutscene_SetIntentToPlay(this->unk_498); + this->csId = this->nextCsId; + CutsceneManager_Queue(this->csId); } } @@ -546,12 +546,12 @@ void func_80BB26EC(EnGeg* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { switch (this->unk_496) { case 0xD5E: - this->unk_49A = this->unk_49C[1]; + this->nextCsId = this->csIdList[1]; this->actionFunc = func_80BB2520; break; case 0xD61: - ActorCutscene_Stop(this->unk_498); + CutsceneManager_Stop(this->csId); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->unk_230 &= ~0x10; @@ -574,7 +574,7 @@ void func_80BB27D4(EnGeg* this, PlayState* play) { break; case 0xD69: - this->unk_49A = this->unk_49C[6]; + this->nextCsId = this->csIdList[6]; play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->actionFunc = func_80BB2520; @@ -594,7 +594,7 @@ void func_80BB27D4(EnGeg* this, PlayState* play) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->unk_230 &= ~0x10; - this->unk_49A = this->unk_49C[7]; + this->nextCsId = this->csIdList[7]; this->actionFunc = func_80BB2520; break; @@ -620,7 +620,7 @@ void func_80BB2944(EnGeg* this, PlayState* play) { if (this->unk_496 == 0xD67) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; - this->unk_49A = this->unk_49C[4]; + this->nextCsId = this->csIdList[4]; this->actionFunc = func_80BB2520; } else { this->unk_496 = func_80BB16D0(this); @@ -632,7 +632,7 @@ void func_80BB2944(EnGeg* this, PlayState* play) { void func_80BB2A54(EnGeg* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { if (this->unk_496 == 0xD65) { - ActorCutscene_Stop(this->unk_498); + CutsceneManager_Stop(this->csId); this->unk_230 &= ~0x10; this->unk_244 = 65; play->msgCtx.msgMode = 0x43; @@ -654,14 +654,14 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) { this->actor.child->world.pos = this->unk_4B4; this->actor.child->shape.rot = this->actor.shape.rot; - if (ActorCutscene_GetCurrentIndex() != this->unk_49C[4]) { - if (ActorCutscene_GetCanPlayNext(this->unk_498)) { + if (CutsceneManager_GetCurrentCsId() != this->csIdList[4]) { + if (CutsceneManager_IsNext(this->csId)) { SET_WEEKEVENTREG(WEEKEVENTREG_37_08); if (this->actor.child != NULL) { Actor_Kill(this->actor.child); } this->unk_230 |= 0x10; - ActorCutscene_StartAndSetFlag(this->unk_498, &this->actor); + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->unk_496 = 0xD68; Message_ContinueTextbox(play, this->unk_496); this->unk_248 = Object_GetIndex(&play->objectCtx, OBJECT_TAISOU); @@ -671,10 +671,10 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) { } this->actionFunc = func_80BB27D4; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->unk_498); + CutsceneManager_Queue(this->csId); } } else { temp_f20 = this->unk_4E0 * 0.005f; @@ -711,7 +711,7 @@ void func_80BB2E00(EnGeg* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100); this->actor.world.rot.y = this->actor.shape.rot.y; if (sp2E == sp2C) { - ActorCutscene_Stop(this->unk_498); + CutsceneManager_Stop(this->csId); this->unk_4AC = 20; func_80BB2020(this, play); this->actionFunc = func_80BB30B4; @@ -837,7 +837,7 @@ void func_80BB3318(EnGeg* this, PlayState* play) { this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); } - if (ActorCutscene_GetCurrentIndex() != this->unk_49C[7]) { + if (CutsceneManager_GetCurrentCsId() != this->csIdList[7]) { func_800AEF44(Effect_GetByIndex(this->unk_4DC)); Actor_Kill(&this->actor); } else { diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.h b/src/overlays/actors/ovl_En_Geg/z_en_geg.h index ea29fd6cfd..71639bdace 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.h +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.h @@ -33,9 +33,9 @@ typedef struct EnGeg { /* 0x484 */ Vec3f unk_484; /* 0x490 */ Vec3s unk_490; /* 0x496 */ u16 unk_496; - /* 0x498 */ s16 unk_498; - /* 0x49A */ s16 unk_49A; - /* 0x49C */ s16 unk_49C[8]; + /* 0x498 */ s16 csId; + /* 0x49A */ s16 nextCsId; + /* 0x49C */ s16 csIdList[8]; /* 0x4AC */ s32 unk_4AC; /* 0x4B0 */ s16 unk_4B0; /* 0x4B4 */ Vec3f unk_4B4; diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c index b27d603022..ed10fd51a2 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c @@ -265,15 +265,15 @@ void func_80B3556C(EnGg* this, PlayState* play) { void func_80B35634(EnGg* this, PlayState* play) { s32 pad; - s32 actionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 119)) { - actionIndex = Cutscene_GetActorActionIndex(play, 119); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_119)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_119); - if (this->unk_2DB != play->csCtx.actorActions[actionIndex]->action) { - this->unk_2DB = play->csCtx.actorActions[actionIndex]->action; + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; - switch (play->csCtx.actorActions[actionIndex]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->unk_2DA = 0; this->unk_2E6 = 0; @@ -334,10 +334,10 @@ void func_80B35634(EnGg* this, PlayState* play) { func_80B358D8(this, play); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); this->actor.shape.yOffset = 0.0f; } else { - this->unk_2DB = 99; + this->cueId = 99; } } @@ -407,16 +407,16 @@ void func_80B359DC(EnGg* this, PlayState* play) { this->unk_307 = true; } - if (ActorCutscene_GetCanPlayNext(this->unk_2DC)) { - ActorCutscene_Start(this->unk_2DC, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, &this->actor); this->unk_307 = false; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } if (this->unk_307) { - ActorCutscene_SetIntentToPlay(this->unk_2DC); + CutsceneManager_Queue(this->csId); } } } else { @@ -666,7 +666,7 @@ void EnGg_Init(Actor* thisx, PlayState* play) { CLEAR_WEEKEVENTREG(WEEKEVENTREG_20_10); this->actor.flags &= ~ACTOR_FLAG_REACT_TO_LENS; this->unk_310 = this->actor.home.pos.y; - this->unk_2DC = this->actor.cutscene; + this->csId = this->actor.csId; this->actor.flags |= ACTOR_FLAG_2000000; this->unk_308 = 0; this->unk_309 = 0; diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.h b/src/overlays/actors/ovl_En_Gg/z_en_gg.h index cb9f9e7cb8..cc744cffaf 100644 --- a/src/overlays/actors/ovl_En_Gg/z_en_gg.h +++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.h @@ -34,8 +34,8 @@ typedef struct EnGg { /* 0x25C */ Vec3s morphTable[20]; /* 0x2D4 */ UNK_TYPE1 unk_2D4[0x6]; /* 0x2DA */ u8 unk_2DA; - /* 0x2DB */ u8 unk_2DB; - /* 0x2DC */ s16 unk_2DC; + /* 0x2DB */ u8 cueId; + /* 0x2DC */ s16 csId; /* 0x2DE */ UNK_TYPE1 unk2DE[4]; /* 0x2E2 */ s16 unk_2E2; /* 0x2E4 */ s16 unk_2E4; diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c index 2ae04a6ec5..fdd099fff7 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c @@ -204,7 +204,7 @@ void func_80B3B120(EnGg2* this, PlayState* play) { void func_80B3B21C(EnGg2* this, PlayState* play) { this->actor.speed = 0.0f; if ((this->actor.xzDistToPlayer < 100.0f) && CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { - this->unk_2E4 = ActorCutscene_GetAdditionalCutscene(this->unk_2E4); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); this->actionFunc = func_80B3B5D4; } } @@ -274,14 +274,14 @@ void func_80B3B4B0(EnGg2* this, PlayState* play) { } void func_80B3B5D4(EnGg2* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_2E4)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2E4, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->actionFunc = func_80B3AE60; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->unk_2E4); + CutsceneManager_Queue(this->csId); } } @@ -376,7 +376,7 @@ void EnGg2_Init(Actor* thisx, PlayState* play2) { this->unk_2F2 = 0; this->unk_2F4 = 0; this->unk_2F6 = 0; - this->unk_2E4 = this->actor.cutscene; + this->csId = this->actor.csId; this->unk_2EC = 20; this->unk_2EA = 0; diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h index f913107751..ff7aec4a6d 100644 --- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h +++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.h @@ -21,7 +21,7 @@ typedef struct EnGg2 { /* 0x1EC */ Vec3s jointTable[20]; /* 0x264 */ Vec3s morphTable[20]; /* 0x2DC */ UNK_TYPE1 unk2DC[0x8]; - /* 0x2E4 */ s16 unk_2E4; + /* 0x2E4 */ s16 csId; /* 0x2E6 */ UNK_TYPE1 unk2E6[4]; /* 0x2EA */ s16 unk_2EA; /* 0x2EC */ s16 unk_2EC; diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.c b/src/overlays/actors/ovl_En_Giant/z_en_giant.c index d62f9e6df4..07c01b2880 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c @@ -51,26 +51,26 @@ typedef enum { } GiantAnimation; /** - * Used as values for csAction. The UNKNOWN ones are never used in-game. + * Used as values for cueId. The UNKNOWN ones are never used in-game. */ typedef enum { - /* 0 */ GIANT_CS_ACTION_NONE, - /* 1 */ GIANT_CS_ACTION_IDLE, - /* 2 */ GIANT_CS_ACTION_WALKING, - /* 3 */ GIANT_CS_ACTION_LOOKING_UP, - /* 4 */ GIANT_CS_ACTION_RAISING_ARMS, - /* 5 */ GIANT_CS_ACTION_STRUGGLING, - /* 6 */ GIANT_CS_ACTION_FALLING_OVER, - /* 7 */ GIANT_CS_ACTION_IDLE_FADE_IN, - /* 8 */ GIANT_CS_ACTION_TALKING, - /* 9 */ GIANT_CS_ACTION_DONE_TALKING, - /* 10 */ GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER, - /* 11 */ GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER, - /* 12 */ GIANT_CS_ACTION_UNKNOWN_12, - /* 13 */ GIANT_CS_ACTION_UNKNOWN_13, - /* 14 */ GIANT_CS_ACTION_UNKNOWN_14, - /* 15 */ GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER -} GiantCsActionIndex; + /* 0 */ GIANT_CUE_ID_NONE, + /* 1 */ GIANT_CUE_ID_IDLE, + /* 2 */ GIANT_CUE_ID_WALKING, + /* 3 */ GIANT_CUE_ID_LOOKING_UP, + /* 4 */ GIANT_CUE_ID_RAISING_ARMS, + /* 5 */ GIANT_CUE_ID_STRUGGLING, + /* 6 */ GIANT_CUE_ID_FALLING_OVER, + /* 7 */ GIANT_CUE_ID_IDLE_FADE_IN, + /* 8 */ GIANT_CUE_ID_TALKING, + /* 9 */ GIANT_CUE_ID_DONE_TALKING, + /* 10 */ GIANT_CUE_ID_TEACHING_OATH_TO_ORDER, + /* 11 */ GIANT_CUE_ID_PLAYER_LEARNED_OATH_TO_ORDER, + /* 12 */ GIANT_CUE_ID_UNKNOWN_12, + /* 13 */ GIANT_CUE_ID_UNKNOWN_13, + /* 14 */ GIANT_CUE_ID_UNKNOWN_14, + /* 15 */ GIANT_CUE_ID_HOLDING_UP_MOON_IN_CLOCK_TOWER +} GiantCueId; ActorInit En_Giant_InitVars = { ACTOR_EN_GIANT, @@ -154,31 +154,35 @@ void EnGiant_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gGiantSkel, &gGiantLargeStrideAnim, this->jointTable, this->morphTable, GIANT_LIMB_MAX); EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); - this->csAction = GIANT_CS_ACTION_NONE; + this->cueId = GIANT_CUE_ID_NONE; this->actionFunc = EnGiant_PerformCutsceneActions; this->actor.draw = NULL; this->alpha = 0; this->actor.velocity.y = -10.0f; this->actor.terminalVelocity = -10.0f; this->actor.gravity = -5.0f; + switch (type) { case GIANT_TYPE_CANYON_TERMINA_FIELD: case GIANT_TYPE_CANYON_CLOCK_TOWER_SUCCESS: case GIANT_TYPE_CANYON_GIANTS_CHAMBER_AND_ENDING: - this->actorActionCommand = 454; + this->cueType = CS_CMD_ACTOR_CUE_454; break; + case GIANT_TYPE_SWAMP_TERMINA_FIELD: case GIANT_TYPE_SWAMP_CLOCK_TOWER_SUCCESS: case GIANT_TYPE_SWAMP_GIANTS_CHAMBER_AND_ENDING: - this->actorActionCommand = 455; + this->cueType = CS_CMD_ACTOR_CUE_455; break; + case GIANT_TYPE_OCEAN_TERMINA_FIELD: case GIANT_TYPE_OCEAN_CLOCK_TOWER_SUCCESS: case GIANT_TYPE_OCEAN_GIANTS_CHAMBER_AND_ENDING: - this->actorActionCommand = 456; + this->cueType = CS_CMD_ACTOR_CUE_456; break; + default: - this->actorActionCommand = 453; + this->cueType = CS_CMD_ACTOR_CUE_453; break; } @@ -188,7 +192,7 @@ void EnGiant_Init(Actor* thisx, PlayState* play) { return; } - this->actorActionCommand = 0x1C5; + this->cueType = CS_CMD_ACTOR_CUE_453; Actor_SetScale(&this->actor, 0.32f); this->actionFunc = EnGiant_PerformClockTowerSuccessActions; Animation_Change(&this->skelAnime, &gGiantRaisedArmsStartAnim, 0.0f, @@ -259,65 +263,80 @@ void EnGiant_ChangeToStartOrLoopAnimation(EnGiant* this, s16 requestedAnimIndex) } /** - * Immediately switches to the specified animation for this cutscene action. + * Immediately switches to the specified animation for this cueId. */ -void EnGiant_ChangeAnimBasedOnCsAction(EnGiant* this) { - switch (this->csAction) { - case GIANT_CS_ACTION_IDLE: +void EnGiant_ChangeAnimBasedOnCueId(EnGiant* this) { + switch (this->cueId) { + case GIANT_CUE_ID_IDLE: EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); break; - case GIANT_CS_ACTION_WALKING: + + case GIANT_CUE_ID_WALKING: EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP); break; - case GIANT_CS_ACTION_STRUGGLING: + + case GIANT_CUE_ID_STRUGGLING: EnGiant_ChangeAnim(this, GIANT_ANIM_STRUGGLE_START); break; - case GIANT_CS_ACTION_FALLING_OVER: + + case GIANT_CUE_ID_FALLING_OVER: EnGiant_ChangeAnim(this, GIANT_ANIM_FALLING_OVER); break; - case GIANT_CS_ACTION_IDLE_FADE_IN: + + case GIANT_CUE_ID_IDLE_FADE_IN: EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); this->alpha = 0; break; - case GIANT_CS_ACTION_TALKING: + + case GIANT_CUE_ID_TALKING: EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_START); break; - case GIANT_CS_ACTION_DONE_TALKING: + + case GIANT_CUE_ID_DONE_TALKING: EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_END); break; - case GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER: + + case GIANT_CUE_ID_TEACHING_OATH_TO_ORDER: EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_START); break; - case GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER: + + case GIANT_CUE_ID_PLAYER_LEARNED_OATH_TO_ORDER: EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_END); break; - case GIANT_CS_ACTION_UNKNOWN_12: + + case GIANT_CUE_ID_UNKNOWN_12: EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); break; - case GIANT_CS_ACTION_UNKNOWN_13: + + case GIANT_CUE_ID_UNKNOWN_13: EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP); break; - case GIANT_CS_ACTION_UNKNOWN_14: + + case GIANT_CUE_ID_UNKNOWN_14: if (this->animIndex != GIANT_ANIM_WALKING_LOOP) { EnGiant_ChangeAnim(this, GIANT_ANIM_WALKING_LOOP); } break; - case GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER: + + case GIANT_CUE_ID_HOLDING_UP_MOON_IN_CLOCK_TOWER: Animation_Change(&this->skelAnime, &gGiantRaisedArmsStartAnim, 0.0f, Animation_GetLastFrame(&gGiantRaisedArmsStartAnim) - 1.0f, Animation_GetLastFrame(&gGiantRaisedArmsStartAnim), ANIMMODE_ONCE, 0.0f); break; + + default: + break; } } void EnGiant_UpdateAlpha(EnGiant* this) { - switch (this->csAction) { - case GIANT_CS_ACTION_FALLING_OVER: + switch (this->cueId) { + case GIANT_CUE_ID_FALLING_OVER: if (this->skelAnime.curFrame >= 90.0f && this->alpha > 0) { this->alpha -= 12; } break; - case GIANT_CS_ACTION_UNKNOWN_14: + case GIANT_CUE_ID_UNKNOWN_14: this->alpha -= 12; break; default: @@ -336,30 +355,30 @@ void EnGiant_UpdateAlpha(EnGiant* this) { */ void EnGiant_PlayAndUpdateAnimation(EnGiant* this) { if (SkelAnime_Update(&this->skelAnime) && - (this->animIndex != GIANT_ANIM_FALLING_OVER || this->csAction != GIANT_CS_ACTION_FALLING_OVER)) { + (this->animIndex != GIANT_ANIM_FALLING_OVER || this->cueId != GIANT_CUE_ID_FALLING_OVER)) { EnGiant_ChangeAnim(this, this->animIndex); - switch (this->csAction) { - case GIANT_CS_ACTION_LOOKING_UP: + switch (this->cueId) { + case GIANT_CUE_ID_LOOKING_UP: EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_LOOK_UP_START); break; - case GIANT_CS_ACTION_RAISING_ARMS: + case GIANT_CUE_ID_RAISING_ARMS: EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_RAISED_ARMS_START); break; - case GIANT_CS_ACTION_STRUGGLING: + case GIANT_CUE_ID_STRUGGLING: EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_STRUGGLE_START); break; - case GIANT_CS_ACTION_FALLING_OVER: + case GIANT_CUE_ID_FALLING_OVER: // Unused EnGiant_ChangeToStartOrLoopAnimation(this, GIANT_ANIM_FALLING_OVER); break; - case GIANT_CS_ACTION_TALKING: + case GIANT_CUE_ID_TALKING: EnGiant_ChangeAnim(this, GIANT_ANIM_BIG_CALL_LOOP); break; - case GIANT_CS_ACTION_DONE_TALKING: - case GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER: + case GIANT_CUE_ID_DONE_TALKING: + case GIANT_CUE_ID_PLAYER_LEARNED_OATH_TO_ORDER: EnGiant_ChangeAnim(this, GIANT_ANIM_IDLE_LOOP); break; - case GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER: + case GIANT_CUE_ID_TEACHING_OATH_TO_ORDER: EnGiant_ChangeAnim(this, GIANT_ANIM_SMALL_CALL_LOOP); break; } @@ -388,30 +407,28 @@ void EnGiant_PlaySound(EnGiant* this) { } } -void EnGiant_UpdatePosition(EnGiant* this, PlayState* play, u32 actionIndex) { - CsCmdActorAction* actorAction = play->csCtx.actorActions[actionIndex]; - f32 startPosY = actorAction->startPos.y; +void EnGiant_UpdatePosition(EnGiant* this, PlayState* play, u32 cueChannel) { + CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel]; + f32 startPosY = cue->startPos.y; s32 pad[2]; - f32 endPosY = actorAction->endPos.y; - f32 scale = Environment_LerpWeight(actorAction->endFrame, actorAction->startFrame, play->csCtx.frames); + f32 endPosY = cue->endPos.y; + f32 scale = Environment_LerpWeight(cue->endFrame, cue->startFrame, play->csCtx.curFrame); this->actor.world.pos.y = ((endPosY - startPosY) * scale) + startPosY; } void EnGiant_PerformClockTowerSuccessActions(EnGiant* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, this->actorActionCommand)) { - EnGiant_UpdatePosition(this, play, Cutscene_GetActorActionIndex(play, this->actorActionCommand)); - if (this->csAction != - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action) { - this->csAction = - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action; - EnGiant_ChangeAnimBasedOnCsAction(this); + if (Cutscene_IsCueInChannel(play, this->cueType)) { + EnGiant_UpdatePosition(this, play, Cutscene_GetCueChannel(play, this->cueType)); + if (this->cueId != play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) { + this->cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + EnGiant_ChangeAnimBasedOnCueId(this); } EnGiant_UpdateAlpha(this); } EnGiant_PlaySound(this); - if (this->csAction == GIANT_CS_ACTION_STRUGGLING) { + if (this->cueId == GIANT_CUE_ID_STRUGGLING) { func_800B9010(&this->actor, NA_SE_IT_KYOJIN_BEARING - SFX_FLAG); } EnGiant_PlayAndUpdateAnimation(this); @@ -424,13 +441,11 @@ void EnGiant_PlayClockTowerFailureAnimation(EnGiant* this, PlayState* play) { void EnGiant_PerformCutsceneActions(EnGiant* this, PlayState* play) { this->actor.draw = EnGiant_Draw; - if (Cutscene_CheckActorAction(play, this->actorActionCommand)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCommand)); - if (this->csAction != - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action) { - this->csAction = - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCommand)]->action; - EnGiant_ChangeAnimBasedOnCsAction(this); + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + if (this->cueId != play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) { + this->cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + EnGiant_ChangeAnimBasedOnCueId(this); } EnGiant_UpdateAlpha(this); } diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.h b/src/overlays/actors/ovl_En_Giant/z_en_giant.h index 9ce182a98d..45e89dd553 100644 --- a/src/overlays/actors/ovl_En_Giant/z_en_giant.h +++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.h @@ -48,8 +48,8 @@ typedef struct EnGiant { /* 0x188 */ Vec3s jointTable[GIANT_LIMB_MAX]; /* 0x1E8 */ Vec3s morphTable[GIANT_LIMB_MAX]; /* 0x248 */ s16 animIndex; - /* 0x24A */ u16 actorActionCommand; - /* 0x24C */ u16 csAction; + /* 0x24A */ u16 cueType; + /* 0x24C */ u16 cueId; /* 0x24E */ s16 alpha; /* 0x250 */ u16 sfxId; /* 0x254 */ MtxF headDrawMtxF; diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c index 45dd9f749b..38e6ad9763 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c @@ -511,19 +511,19 @@ void func_80B51410(EnGk* this, PlayState* play) { this->unk_1E4 |= 0x20; } - if (ActorCutscene_GetCanPlayNext(this->unk_318)) { + if (CutsceneManager_IsNext(this->csId)) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLONKID_SOB_TALK); - ActorCutscene_Start(this->unk_318, &this->actor); + CutsceneManager_Start(this->csId, &this->actor); this->unk_1E4 &= ~0x20; return; } - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } if (this->unk_1E4 & 0x20) { - ActorCutscene_SetIntentToPlay(this->unk_318); + CutsceneManager_Queue(this->csId); } } else { this->unk_1E4 &= ~0x20; @@ -532,16 +532,16 @@ void func_80B51410(EnGk* this, PlayState* play) { void func_80B51510(EnGk* this, PlayState* play) { s32 pad; - s32 actionIndex; + s32 cueChannel; if (this) {} - if (Cutscene_CheckActorAction(play, 479)) { - actionIndex = Cutscene_GetActorActionIndex(play, 479); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_479)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_479); - if (play->csCtx.actorActions[actionIndex]->action != this->unk_31B) { - this->unk_31B = play->csCtx.actorActions[actionIndex]->action; - switch (play->csCtx.actorActions[actionIndex]->action) { + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->unk_31A = 0; this->unk_2E4 = 0; @@ -585,10 +585,10 @@ void func_80B51510(EnGk* this, PlayState* play) { func_80B51308(this, play); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); this->actor.shape.yOffset = 0.0f; } else { - this->unk_31B = 0x63; + this->cueId = 99; } } @@ -662,9 +662,9 @@ void func_80B51970(EnGk* this, PlayState* play) { if (((talkState == TEXT_STATE_DONE) || (talkState == TEXT_STATE_5)) && Message_ShouldAdvance(play)) { if ((this->unk_31C == 0xE84) || (this->unk_31C == 0xE99)) { - ActorCutscene_Stop(this->unk_318); - this->unk_318 = ActorCutscene_GetAdditionalCutscene(this->unk_318); - ActorCutscene_SetIntentToPlay(this->unk_318); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); + CutsceneManager_Queue(this->csId); this->actionFunc = func_80B51D9C; return; } @@ -773,8 +773,8 @@ void func_80B51B40(EnGk* this, PlayState* play) { void func_80B51D9C(EnGk* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (ActorCutscene_GetCanPlayNext(this->unk_318)) { - ActorCutscene_StartAndSetFlag(this->unk_318, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); if (this->unk_1E4 & 4) { this->unk_1E4 &= ~4; this->unk_2E4 = 6; @@ -791,10 +791,10 @@ void func_80B51D9C(EnGk* this, PlayState* play) { this->actionFunc = func_80B51970; } } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->unk_318); + CutsceneManager_Queue(this->csId); } func_80B50954(this); } @@ -810,7 +810,7 @@ void func_80B51EA4(EnGk* this, PlayState* play) { sp36 = this->actor.shape.rot.y - sp38.y; if (func_80B50C78(this, this->path, this->unk_1EC)) { if (this->unk_1EC >= (this->path->count - 1)) { - ActorCutscene_Stop(this->unk_318); + CutsceneManager_Stop(this->csId); Actor_Kill(&this->actor); } else { this->unk_1EC++; @@ -985,7 +985,7 @@ void func_80B525E0(EnGk* this, PlayState* play) { void func_80B52654(EnGk* this, PlayState* play) { this->unk_350 += 0x400; - if ((this->unk_1E4 & 0x80) && (play->csCtx.frames == 250)) { + if ((this->unk_1E4 & 0x80) && (play->csCtx.curFrame == 250)) { SET_WEEKEVENTREG(WEEKEVENTREG_22_04); } @@ -1023,12 +1023,12 @@ void EnGk_Init(Actor* thisx, PlayState* play) { if (Flags_GetSwitch(play, ENGK_GET_3F00(&this->actor))) { Actor_Kill(&this->actor); } else { - this->unk_318 = this->actor.cutscene; + this->csId = this->actor.csId; this->path = SubS_GetPathByIndex(play, ENGK_GET_F0(&this->actor), 0xF); this->actionFunc = func_80B51760; } } else if (play->sceneId == SCENE_GORONRACE) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { if (gSaveContext.save.entrance == ENTRANCE(GORON_RACETRACK, 1)) { this->actionFunc = func_80B51760; } else if (gSaveContext.save.entrance == ENTRANCE(GORON_RACETRACK, 2)) { @@ -1053,7 +1053,7 @@ void EnGk_Init(Actor* thisx, PlayState* play) { } } else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_04)) { this->unk_2E4 = 0; - this->unk_318 = this->actor.cutscene; + this->csId = this->actor.csId; this->actor.flags |= ACTOR_FLAG_10; this->actor.flags |= ACTOR_FLAG_2000000; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.h b/src/overlays/actors/ovl_En_Gk/z_en_gk.h index bebe6c6c94..0f74c1d658 100644 --- a/src/overlays/actors/ovl_En_Gk/z_en_gk.h +++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.h @@ -39,9 +39,9 @@ typedef struct EnGk { /* 0x2F4 */ Vec3f unk_2F4; /* 0x300 */ Vec3f unk_300; /* 0x30C */ Vec3f unk_30C; - /* 0x318 */ s16 unk_318; + /* 0x318 */ s16 csId; /* 0x31A */ u8 unk_31A; - /* 0x31B */ u8 unk_31B; + /* 0x31B */ u8 cueId; /* 0x31C */ u16 unk_31C; /* 0x31E */ s16 unk_31E; /* 0x320 */ s16 unk_320; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 86dcead70c..b76ed70662 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -425,48 +425,48 @@ void func_8094E2D0(EnGm* this) { } } -s32 func_8094E454(EnGm* this, s16 arg1) { +s32 func_8094E454(EnGm* this, s16 csId) { s32 ret = false; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(arg1); - } else if (ActorCutscene_GetCanPlayNext(arg1)) { - ActorCutscene_StartAndSetUnkLinkFields(arg1, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(csId); + } else if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); ret = true; } else { - ActorCutscene_SetIntentToPlay(arg1); + CutsceneManager_Queue(csId); } return ret; } -s16 func_8094E4D0(EnGm* this, s32 arg1) { +s16 func_8094E4D0(EnGm* this, s32 numCutscenes) { s32 i; - s16 cutscene = this->actor.cutscene; + s16 csId = this->actor.csId; - for (i = 0; i < arg1; i++) { - cutscene = ActorCutscene_GetAdditionalCutscene(cutscene); + for (i = 0; i < numCutscenes; i++) { + csId = CutsceneManager_GetAdditionalCsId(csId); } - return cutscene; + return csId; } s32 func_8094E52C(EnGm* this, PlayState* play) { s32 pad; - s16 sp2A = func_8094E4D0(this, 0); + s16 csId = func_8094E4D0(this, 0); s32 ret = false; switch (this->unk_3E0) { case 0: - if (!func_8094E454(this, sp2A)) { + if (!func_8094E454(this, csId)) { break; } case 2: if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_86_40) && (this->unk_3E0 == 2)) { - ActorCutscene_Stop(sp2A); + CutsceneManager_Stop(csId); } else { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), &this->actor); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), &this->actor); } this->unk_3E0++; ret = true; @@ -474,14 +474,15 @@ s32 func_8094E52C(EnGm* this, PlayState* play) { case 1: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), this->actor.child); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), + this->actor.child); } this->unk_3E0++; ret = true; break; case 3: - ActorCutscene_Stop(sp2A); + CutsceneManager_Stop(csId); this->unk_3E0++; ret = true; break; @@ -492,7 +493,7 @@ s32 func_8094E52C(EnGm* this, PlayState* play) { s32 func_8094E69C(EnGm* this, PlayState* play) { Camera* subCam; - s16 sp4A = func_8094E4D0(this, 0); + s16 csId = func_8094E4D0(this, 0); s16 sp48; Vec3f sp3C; Vec3f sp30; @@ -530,10 +531,10 @@ s32 func_8094E69C(EnGm* this, PlayState* play) { break; case 2: - if (func_8094E454(this, sp4A)) { + if (func_8094E454(this, csId)) { case 4: case 6: - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp4A)); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)); Camera_SetTargetActor(subCam, &this->actor); this->unk_3E0++; ret = true; @@ -544,7 +545,7 @@ s32 func_8094E69C(EnGm* this, PlayState* play) { case 5: case 7: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp4A)); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)); Camera_SetTargetActor(subCam, this->actor.child); } this->unk_3E0++; @@ -553,7 +554,7 @@ s32 func_8094E69C(EnGm* this, PlayState* play) { case 8: Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); - ActorCutscene_Stop(sp4A); + CutsceneManager_Stop(csId); this->unk_3E2 = 0; this->unk_3E0++; break; @@ -766,7 +767,7 @@ s32 func_8094EFC4(EnGm* this, PlayState* play) { func_8094E054(this, play, 0); this->unk_258 = 255; } - this->unk_259 = 255; + this->cueId = 255; this->unk_3F8 = 1; } ret = true; @@ -1634,20 +1635,20 @@ void func_80950F2C(EnGm* this, PlayState* play) { s32 pad; Vec3f sp3C; Vec3f sp30; - s32 sp2C; + s32 cueId; s16 yaw; - if (Cutscene_CheckActorAction(play, 526)) { - sp2C = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 526)]->action; - if (this->unk_259 != (sp2C & 0xFF)) { - if (sp2C == 3) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_526)) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_526)]->id; + if (this->cueId != (u8)cueId) { + if (cueId == 3) { Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); } - this->unk_259 = sp2C; - func_8094E054(this, play, sp50[sp2C]); + this->cueId = cueId; + func_8094E054(this, play, sp50[cueId]); } - if ((this->unk_259 == 3) && (this->unk_268 != NULL) && (this->unk_268->update != NULL)) { + if ((this->cueId == 3) && (this->unk_268 != NULL) && (this->unk_268->update != NULL)) { Math_Vec3f_Copy(&sp3C, &player->actor.world.pos); Math_Vec3f_Copy(&sp30, &this->actor.world.pos); yaw = Math_Vec3f_Yaw(&sp30, &sp3C); @@ -1763,7 +1764,7 @@ void EnGm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Vec3f sp30; s32 pad2; - if ((ActorCutscene_GetCurrentIndex() == -1) && (limbIndex == 16)) { + if ((CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && (limbIndex == 16)) { Matrix_MultVec3f(&D_80951E24, &this->actor.focus.pos); Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot); } diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.h b/src/overlays/actors/ovl_En_Gm/z_en_gm.h index 3bed5335a0..6eede07441 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.h +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.h @@ -26,7 +26,7 @@ typedef struct EnGm { /* 0x250 */ s32 timePathWaypoint; /* 0x254 */ s32 timePathElapsedTime; /* 0x258 */ u8 unk_258; - /* 0x259 */ u8 unk_259; + /* 0x259 */ u8 cueId; /* 0x25C */ s32 unk_25C; /* 0x260 */ s8 unk_260; /* 0x261 */ s8 unk_261; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 02ee6d3423..12a98228f3 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -539,7 +539,7 @@ s32 func_80A1222C(EnGo* this, PlayState* play) { (play->msgCtx.lastPlayedSong == OCARINA_SONG_GORON_LULLABY) && (this->unk_3EC == 0) && (this->actor.xzDistToPlayer < 400.0f)) || (!CHECK_WEEKEVENTREG(WEEKEVENTREG_22_04) && (play->sceneId == SCENE_16GORON_HOUSE) && - (gSaveContext.sceneLayer == 0) && (this->unk_3EC == 0) && (play->csCtx.currentCsIndex == 1))) { + (gSaveContext.sceneLayer == 0) && (this->unk_3EC == 0) && (play->csCtx.scriptIndex == 1))) { ret = true; } return ret; @@ -712,10 +712,10 @@ s32 func_80A12868(EnGo* this, PlayState* play) { s32 func_80A12954(EnGo* this, PlayState* play) { if ((ENGO_GET_F(&this->actor) == ENGO_F_4) && (play->csCtx.state != 0) && (this->actor.draw != NULL) && (play->sceneId == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneLayer == 1) && - (play->csCtx.currentCsIndex == 0)) { + (play->csCtx.scriptIndex == 0)) { if (this->unk_3F0 == 0) { this->actor.flags &= ~ACTOR_FLAG_1; - this->unk_394 = 255; + this->cueId = 255; this->unk_3F0 = 1; this->unk_18C = this->actionFunc; } @@ -723,7 +723,7 @@ s32 func_80A12954(EnGo* this, PlayState* play) { this->actionFunc = func_80A14FC8; } else if (this->unk_3F0 != 0) { this->actor.flags |= ACTOR_FLAG_1; - this->unk_394 = 255; + this->cueId = 255; this->unk_3F0 = 0; SubS_UpdateFlags(&this->unk_390, 3, 7); this->actionFunc = this->unk_18C; @@ -995,14 +995,14 @@ void func_80A134B0(EnGo* this, PlayState* play, s32 arg2) { } } -s32 func_80A134F4(EnGo* this, s16 arg1) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - } else if (ActorCutscene_GetCanPlayNext(arg1)) { - ActorCutscene_StartAndSetUnkLinkFields(arg1, &this->actor); +s32 func_80A134F4(EnGo* this, s16 csId) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + } else if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); return true; } - ActorCutscene_SetIntentToPlay(arg1); + CutsceneManager_Queue(csId); return false; } @@ -1112,8 +1112,8 @@ s32 func_80A13B1C(EnGo* this, PlayState* play) { switch (this->unk_3C0) { case 0: - this->unk_3B8 = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); - if (func_80A134F4(this, this->unk_3B8)) { + this->csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); + if (func_80A134F4(this, this->csId)) { this->unk_3C4 = 1; this->unk_3C0 = 1; } else { @@ -1121,26 +1121,26 @@ s32 func_80A13B1C(EnGo* this, PlayState* play) { } case 1: - if (ActorCutscene_GetCurrentIndex() != this->unk_3B8) { - this->unk_3B8 = ActorCutscene_GetAdditionalCutscene(this->unk_3B8); + if (CutsceneManager_GetCurrentCsId() != this->csId) { + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); this->unk_3C0 = 2; } else { break; } case 2: - if (func_80A134F4(this, this->unk_3B8)) { + if (func_80A134F4(this, this->csId)) { this->unk_3C0 = 3; } else { break; } case 3: - if (ActorCutscene_GetCanPlayNext(0x7C)) { - ActorCutscene_StartAndSetUnkLinkFields(0x7C, NULL); + if (CutsceneManager_IsNext(CS_ID_GLOBAL_TALK)) { + CutsceneManager_StartWithPlayerCs(CS_ID_GLOBAL_TALK, NULL); this->unk_3C0 = 4; - } else if (ActorCutscene_GetCurrentIndex() == this->unk_3B8) { - ActorCutscene_SetIntentToPlay(0x7C); + } else if (CutsceneManager_GetCurrentCsId() == this->csId) { + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); } } @@ -1230,8 +1230,8 @@ s32 func_80A13E80(EnGo* this, PlayState* play) { switch (this->unk_3C0) { case 0: - this->unk_3B8 = this->actor.cutscene; - if (func_80A134F4(this, this->unk_3B8)) { + this->csId = this->actor.csId; + if (func_80A134F4(this, this->csId)) { this->unk_3C0++; } break; @@ -1258,7 +1258,7 @@ s32 func_80A13E80(EnGo* this, PlayState* play) { case 3: if (this->unk_3C2 >= 60) { - ActorCutscene_Stop(this->unk_3B8); + CutsceneManager_Stop(this->csId); this->unk_3C2 = 0; this->unk_3C0 = 0; ret = true; @@ -1376,7 +1376,7 @@ void func_80A143A8(EnGo* this, PlayState* play) { void func_80A14430(EnGo* this, PlayState* play) { if (((gSaveContext.save.entrance == ENTRANCE(GORON_RACETRACK, 0)) || (gSaveContext.save.entrance == ENTRANCE(GORON_RACETRACK, 2))) && - (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80))) { + (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE))) { func_80A14018(this, play); this->actionFunc = func_80A149B0; } else { @@ -1413,7 +1413,7 @@ void func_80A144F4(EnGo* this, PlayState* play) { void func_80A145AC(EnGo* this, PlayState* play) { if ((ENGO_GET_70(&this->actor) == ENGO_70_1) && (((play->sceneId == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneLayer == 1) && - (play->csCtx.currentCsIndex == 0)) || + (play->csCtx.scriptIndex == 0)) || !CHECK_WEEKEVENTREG(WEEKEVENTREG_21_08))) { this->actor.child = func_80A13400(this, play); this->actor.child->child = &this->actor; @@ -1611,7 +1611,7 @@ void func_80A14E14(EnGo* this, PlayState* play) { } void func_80A14E74(EnGo* this, PlayState* play) { - if (func_80A134F4(this, this->actor.cutscene)) { + if (func_80A134F4(this, this->actor.csId)) { this->actionFunc = func_80A14EB0; } } @@ -1625,7 +1625,7 @@ void func_80A14EB0(EnGo* this, PlayState* play) { this->unk_3A0 = (this->unk_39C / 0.9f) * 100.0f; func_80A139E4(this); } else { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); func_80A143A8(this, play); if ((ENGO_GET_F(&this->actor) == ENGO_F_4) && (ENGO_GET_70(&this->actor) == ENGO_70_1)) { SubS_UpdateFlags(&this->unk_390, 4, 7); @@ -1640,35 +1640,35 @@ void func_80A14FC8(EnGo* this, PlayState* play) { s32 sp38[] = { 0, 2, 6, 20, 18, 5, 5, 15, }; - u16 actorActionCmd = 0; - s32 sp30; - s32 actionIndex; + u16 cueType = 0; + s32 cueId; + s32 cueChannel; switch (ENGO_GET_70(&this->actor)) { case ENGO_70_0: - actorActionCmd = 128; + cueType = CS_CMD_ACTOR_CUE_128; break; case ENGO_70_1: - actorActionCmd = 129; + cueType = CS_CMD_ACTOR_CUE_129; break; } - if ((actorActionCmd == 128) || (actorActionCmd == 129)) { - if (Cutscene_CheckActorAction(play, actorActionCmd)) { - actionIndex = Cutscene_GetActorActionIndex(play, actorActionCmd); - sp30 = play->csCtx.actorActions[actionIndex]->action; + if ((cueType == CS_CMD_ACTOR_CUE_128) || (cueType == CS_CMD_ACTOR_CUE_129)) { + if (Cutscene_IsCueInChannel(play, cueType)) { + cueChannel = Cutscene_GetCueChannel(play, cueType); + cueId = play->csCtx.actorCues[cueChannel]->id; - if (this->unk_394 != (u8)sp30) { - this->unk_394 = sp30; - func_80A12C48(this, play, sp38[sp30]); + if (this->cueId != (u8)cueId) { + this->cueId = cueId; + func_80A12C48(this, play, sp38[cueId]); this->unk_390 = 0; this->unk_390 |= 0x20; this->unk_3BE = 0; this->unk_39C = 0.0f; this->unk_3A0 = 0.0f; - switch (sp30) { + switch (cueId) { case 1: this->unk_390 |= 0x80; this->skelAnime.curFrame = this->skelAnime.endFrame; @@ -1681,7 +1681,7 @@ void func_80A14FC8(EnGo* this, PlayState* play) { } } - switch (this->unk_394) { + switch (this->cueId) { case 3: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (this->unk_3DC == 20)) { func_80A12C48(this, play, 21); @@ -1706,8 +1706,8 @@ void func_80A14FC8(EnGo* this, PlayState* play) { break; } - if (actorActionCmd == 128) { - switch (play->csCtx.frames) { + if (cueType == 128) { + switch (play->csCtx.curFrame) { case 55: case 100: case 130: @@ -1730,8 +1730,8 @@ void func_80A14FC8(EnGo* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL); break; } - } else if (actorActionCmd == 129) { - switch (play->csCtx.frames) { + } else if (cueType == 129) { + switch (play->csCtx.curFrame) { case 360: case 390: Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_COLD); @@ -1752,7 +1752,7 @@ void func_80A14FC8(EnGo* this, PlayState* play) { } SubS_FillLimbRotTables(play, this->unk_3CE, this->unk_3C8, ARRAY_COUNT(this->unk_3CE)); - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } } } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h index fd4876430a..9d12dfdce8 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -67,7 +67,7 @@ typedef struct EnGo { /* 0x38C */ Actor* unk_38C; /* 0x390 */ u16 unk_390; /* 0x392 */ u16 unk_392; - /* 0x394 */ u8 unk_394; + /* 0x394 */ u8 cueId; /* 0x398 */ f32 unk_398; /* 0x39C */ f32 unk_39C; /* 0x3A0 */ f32 unk_3A0; @@ -79,7 +79,7 @@ typedef struct EnGo { /* 0x3B2 */ s16 unk_3B2; /* 0x3B4 */ s16 unk_3B4; /* 0x3B6 */ s16 unk_3B6; - /* 0x3B8 */ s16 unk_3B8; + /* 0x3B8 */ s16 csId; /* 0x3BA */ s16 unk_3BA; /* 0x3BC */ s16 unk_3BC; /* 0x3BE */ s16 unk_3BE; diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 003ac43e09..2f4257347a 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -156,7 +156,7 @@ void EnGs_Init(Actor* thisx, PlayState* play) { this->unk_1F4 = this->unk_1FA; Math_Vec3f_Copy(&this->unk_1B0[0], &gOneVec3f); Math_Vec3f_Copy(&this->unk_1B0[1], &gOneVec3f); - SubS_FillCutscenesList(&this->actor, this->unk_212, ARRAY_COUNT(this->unk_212)); + SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList)); func_801A5080(0); if (this->actor.params == ENGS_1) { Actor_SetScale(&this->actor, 0.15f); @@ -262,7 +262,8 @@ void func_80997E4C(EnGs* this, PlayState* play) { } void func_80997FF0(EnGs* this, PlayState* play) { - if (SubS_StartActorCutscene(&this->actor, play->playerActorCsIds[0], -1, SUBS_CUTSCENE_NORMAL)) { + if (SubS_StartCutscene(&this->actor, play->playerCsIds[PLAYER_CS_ID_ITEM_OCARINA], CS_ID_NONE, + SUBS_CUTSCENE_NORMAL)) { func_80998040(this, play); } } @@ -338,8 +339,8 @@ void func_8099807C(EnGs* this, PlayState* play) { } void func_80998300(EnGs* this, PlayState* play) { - if (this->actor.cutscene != -1) { - ActorCutscene_Stop(play->playerActorCsIds[0]); + if (this->actor.csId != CS_ID_NONE) { + CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_ITEM_OCARINA]); } } @@ -372,7 +373,7 @@ void func_809984F4(EnGs* this, PlayState* play) { } } while (gossipStone != NULL); - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); this->actionFunc = func_809985B8; } @@ -380,7 +381,7 @@ void func_809985B8(EnGs* this, PlayState* play) { EnGs* gossipStone; Vec3f sp38; - if (SubS_StartActorCutscene(&this->actor, this->unk_212[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->actor, this->csIdList[0], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { Player* player = GET_PLAYER(play); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW); @@ -446,7 +447,7 @@ void func_8099874C(EnGs* this, PlayState* play) { if ((this->unk_19C == 5) && (this->unk_194 != 0)) { s32 i; - ActorCutscene_Stop(this->unk_212[0]); + CutsceneManager_Stop(this->csIdList[0]); phi_v0 = 1; for (i = 0; i < 4; i++) { @@ -1012,7 +1013,7 @@ void EnGs_Update(Actor* thisx, PlayState* play) { } else if (func_800B8718(&this->actor, &play->state)) { this->unk_19A |= 0x200; this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.cutscene != -1) { + if (this->actor.csId != CS_ID_NONE) { this->actionFunc = func_80997FF0; } else { func_80998040(this, play); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/src/overlays/actors/ovl_En_Gs/z_en_gs.h index 51e899fccd..fb2d62816a 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h @@ -49,7 +49,7 @@ typedef struct EnGs { /* 0x208 */ s32 unk_208; /* 0x20C */ s32 unk_20C; /* 0x210 */ u16 unk_210; - /* 0x212 */ s16 unk_212[2]; + /* 0x212 */ s16 csIdList[2]; /* 0x216 */ s16 unk_216; /* 0x218 */ s16 unk_218; /* 0x21A */ s16 unk_21A; diff --git a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c index 8eaa6b4448..c54703ef99 100644 --- a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c +++ b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c @@ -324,14 +324,14 @@ void func_80B23910(EnHanabi* this, PlayState* play) { void func_80B23934(EnHanabi* this, PlayState* play) { if ((gSaveContext.save.entrance == ENTRANCE(TERMINA_FIELD, 1)) && (gSaveContext.sceneLayer == 7)) { - if (play->csCtx.frames > 1650) { + if (play->csCtx.curFrame > 1650) { func_80B236C8(this, play); func_800B8FE8(&this->actor, NA_SE_EV_FIREWORKS_LAUNCH - SFX_FLAG); } } - if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 7) && (play->csCtx.currentCsIndex == 0) && - (play->csCtx.frames == 610)) { + if ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 7) && (play->csCtx.scriptIndex == 0) && + (play->csCtx.curFrame == 610)) { Actor_PlaySfx(&this->actor, NA_SE_EV_KYOJIN_GROAN); } } diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c index 4b610de8fa..b5ad5fa400 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -133,7 +133,7 @@ static u32 sHasSoundPlayed = false; void EnHg_Init(Actor* thisx, PlayState* play) { EnHg* this = THIS; - s16 currentCutscene = this->actor.cutscene; + s16 csId = this->actor.csId; s32 i; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 36.0f); @@ -142,18 +142,18 @@ void EnHg_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) { Actor_Kill(&this->actor); } this->actor.targetMode = 1; this->actor.colChkInfo.health = 0; this->actor.gravity = -1.0f; - for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) { - if (currentCutscene == -1) { + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + if (csId == CS_ID_NONE) { break; } - this->cutscenes[i] = currentCutscene; - currentCutscene = ActorCutscene_GetAdditionalCutscene(currentCutscene); + this->csIdList[i] = csId; + csId = CutsceneManager_GetAdditionalCsId(csId); } EnHg_SetupWait(this); } @@ -171,12 +171,12 @@ void EnHg_SetupWait(EnHg* this) { void EnHg_Wait(EnHg* this, PlayState* play) { if (this->actor.colChkInfo.health == 1) { - if ((this->actor.xzDistToPlayer < 200.0f && this->actor.playerHeightRel < 40.0f) && - !Cutscene_CheckActorAction(play, 0x1E3)) { + if (((this->actor.xzDistToPlayer < 200.0f) && (this->actor.playerHeightRel < 40.0f)) && + !Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_483)) { EnHg_SetupChasePlayer(this); } - if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0) && - ((play->csCtx.frames == 20) || (play->csCtx.frames == 60))) { + if ((gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 0) && + ((play->csCtx.curFrame == 20) || (play->csCtx.curFrame == 60))) { Actor_PlaySfx(&this->actor, NA_SE_EN_HALF_REDEAD_SURPRISE); } } @@ -270,51 +270,51 @@ void EnHg_SetupCutscene(EnHg* this) { } void EnHg_PlayCutscene(EnHg* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->cutsceneIndex])) { - ActorCutscene_Start(this->cutscenes[this->cutsceneIndex], &this->actor); + if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + CutsceneManager_Start(this->csIdList[this->csIdIndex], &this->actor); EnHg_SetupCsAction(this); } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } void EnHg_SetupCsAction(EnHg* this) { - this->cutscenes[3] = 0x63; - this->cutscenes[2] = 0; + this->csIdList[3] = 99; + this->csIdList[2] = 0; this->actionFunc = EnHg_HandleCsAction; } void EnHg_HandleCsAction(EnHg* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 484)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 484); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_484)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_484); - if (this->cutscenes[3] != play->csCtx.actorActions[actionIndex]->action) { - this->cutscenes[3] = play->csCtx.actorActions[actionIndex]->action; - switch (play->csCtx.actorActions[actionIndex]->action) { + if (this->csIdList[3] != play->csCtx.actorCues[cueChannel]->id) { + this->csIdList[3] = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->animIndex = 0; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_IDLE); break; case 2: - this->cutscenes[2] = 0; + this->csIdList[2] = 0; this->animIndex = HG_ANIM_LEAN_FORWARD; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_LEAN_FORWARD); break; case 3: - this->cutscenes[2] = 0; + this->csIdList[2] = 0; this->animIndex = HG_ANIM_CURL_UP; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_CURL_UP); break; case 4: - this->cutscenes[2] = 0; + this->csIdList[2] = 0; this->animIndex = HG_ANIM_PANIC; - if ((this->cutsceneIndex == HG_CS_GET_MASK) || (this->cutsceneIndex == HG_CS_SONG_OF_HEALING)) { + if ((this->csIdIndex == HG_CS_GET_MASK) || (this->csIdIndex == HG_CS_SONG_OF_HEALING)) { func_8019F128(NA_SE_EN_HALF_REDEAD_TRANS); } Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, HG_ANIM_PANIC); @@ -356,21 +356,20 @@ void EnHg_HandleCsAction(EnHg* this, PlayState* play) { break; case HG_ANIM_PANIC: - if ((this->cutsceneIndex == HG_CS_FIRST_ENCOUNTER) || - (this->cutsceneIndex == HG_CS_SUBSEQUENT_ENCOUNTER)) { + if ((this->csIdIndex == HG_CS_FIRST_ENCOUNTER) || (this->csIdIndex == HG_CS_SUBSEQUENT_ENCOUNTER)) { func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_SCREAME - SFX_FLAG); } break; } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); return; } else if (play->csCtx.state == 0) { EnHg_SetupWait(this); } - this->cutscenes[3] = 0x63; + this->csIdList[3] = 99; } void EnHg_WaitForPlayerAction(EnHg* this, PlayState* play) { @@ -394,9 +393,9 @@ void EnHg_WaitForPlayerAction(EnHg* this, PlayState* play) { if ((play->msgCtx.lastPlayedSong == OCARINA_SONG_HEALING) && (gSaveContext.save.playerForm == PLAYER_FORM_HUMAN)) { if (INV_CONTENT(ITEM_MASK_GIBDO) == ITEM_MASK_GIBDO) { - this->cutsceneIndex = HG_CS_SONG_OF_HEALING; + this->csIdIndex = HG_CS_SONG_OF_HEALING; } else { - this->cutsceneIndex = HG_CS_GET_MASK; + this->csIdIndex = HG_CS_GET_MASK; } EnHg_SetupCutscene(this); @@ -407,9 +406,9 @@ void EnHg_WaitForPlayerAction(EnHg* this, PlayState* play) { if ((this->actionFunc != EnHg_PlayCutscene) && (this->actionFunc != EnHg_HandleCsAction)) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_61_02)) { SET_WEEKEVENTREG(WEEKEVENTREG_61_02); - this->cutsceneIndex = HG_CS_FIRST_ENCOUNTER; + this->csIdIndex = HG_CS_FIRST_ENCOUNTER; } else { - this->cutsceneIndex = HG_CS_SUBSEQUENT_ENCOUNTER; + this->csIdIndex = HG_CS_SUBSEQUENT_ENCOUNTER; } EnHg_SetupCutscene(this); diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.h b/src/overlays/actors/ovl_En_Hg/z_en_hg.h index 1211a4cf37..b79269e9be 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.h +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.h @@ -15,12 +15,12 @@ typedef struct EnHg { /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnHgActionFunc actionFunc; /* 0x1D8 */ MtxF mf; - /* 0x218 */ s32 cutsceneIndex; + /* 0x218 */ s32 csIdIndex; /* 0x21C */ s32 animIndex; /* 0x220 */ Vec3s jointTable[PAMELAS_FATHER_GIBDO_LIMB_MAX]; /* 0x292 */ Vec3s morphTable[PAMELAS_FATHER_GIBDO_LIMB_MAX]; /* 0x304 */ UNK_TYPE1 pad304[0xC]; - /* 0x310 */ u16 cutscenes[4]; + /* 0x310 */ u16 csIdList[4]; } EnHg; // size = 0x318 #endif // Z_EN_HG_H diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c index af801ebd40..bbef58b1a3 100644 --- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c +++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c @@ -109,7 +109,7 @@ void EnHgo_Init(Actor* thisx, PlayState* play) { this->textId = 0; this->talkFlags = TALK_FLAG_NONE; this->isInCutscene = false; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) { EnHgo_SetupTalk(this); } else { thisx->draw = NULL; @@ -276,13 +276,13 @@ void EnHgo_HandlePlayerChoice(EnHgo* this, PlayState* play) { } s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play) { - s32 actionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 486)) { - actionIndex = Cutscene_GetActorActionIndex(play, 486); - if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { - this->csAction = play->csCtx.actorActions[actionIndex]->action; - switch (play->csCtx.actorActions[actionIndex]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_486)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_486); + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->animIndex = HGO_ANIM_ARMS_FOLDED; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0); @@ -321,7 +321,7 @@ s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play) { (this->isInCutscene == false)) { this->isInCutscene = true; if ((gSaveContext.sceneLayer == 0) && - ((play->csCtx.currentCsIndex == 2) || (play->csCtx.currentCsIndex == 4))) { + ((play->csCtx.scriptIndex == 2) || (play->csCtx.scriptIndex == 4))) { Actor_PlaySfx(&this->actor, NA_SE_VO_GBVO02); } } @@ -338,11 +338,11 @@ s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); return true; } - if ((play->csCtx.state == CS_STATE_0) && CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) && + if ((play->csCtx.state == CS_STATE_IDLE) && CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) && (this->actionFunc == EnHgo_DoNothing)) { this->actor.shape.rot.y = this->actor.world.rot.y; Actor_Spawn(&play->actorCtx, play, ACTOR_ELF_MSG2, this->actor.focus.pos.x, this->actor.focus.pos.y, @@ -350,7 +350,7 @@ s32 EnHgo_HandleCsAction(EnHgo* this, PlayState* play) { EnHgo_SetupInitCollision(this); } - this->csAction = 0x63; + this->cueId = 99; return false; } diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h index 6882c11277..da7b7c40e6 100644 --- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h +++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h @@ -24,7 +24,7 @@ typedef struct EnHgo { /* 0x310 */ s16 talkFlags; /* 0x312 */ s16 isInCutscene; /* 0x314 */ u16 textId; - /* 0x316 */ u16 csAction; + /* 0x316 */ u16 cueId; } EnHgo; // size = 0x318 #endif // Z_EN_HGO_H diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c index c3052e80f9..29a7c6a8ee 100644 --- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c +++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c @@ -105,7 +105,7 @@ void EnHiddenNuts_Init(Actor* thisx, PlayState* play) { } this->path = SubS_GetPathByIndex(play, this->unk_21E, 0x3F); - this->unk_226 = this->actor.cutscene; + this->csId = this->actor.csId; func_801A5080(2); func_80BDB268(this); } @@ -243,18 +243,18 @@ void func_80BDB788(EnHiddenNuts* this) { void func_80BDB7E8(EnHiddenNuts* this, PlayState* play) { Vec3f sp3C; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_226); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId); return; } - if (!ActorCutscene_GetCanPlayNext(this->unk_226)) { - ActorCutscene_SetIntentToPlay(this->unk_226); + if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Queue(this->csId); return; } - ActorCutscene_StartAndSetUnkLinkFields(this->unk_226, &this->actor); + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_228 = -1200.0f; Math_Vec3f_Copy(&sp3C, &this->actor.world.pos); diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h index e40a89193e..435e4662cd 100644 --- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h +++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h @@ -26,7 +26,7 @@ typedef struct EnHiddenNuts { /* 0x21E */ s16 unk_21E; /* 0x220 */ s32 unk_220; /* 0x224 */ s16 unk_224; - /* 0x226 */ s16 unk_226; + /* 0x226 */ s16 csId; /* 0x228 */ f32 unk_228; /* 0x22C */ f32 unk_22C; /* 0x230 */ UNK_TYPE1 unk230[4]; diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 4b5878110e..df4f17d4c3 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -50,40 +50,40 @@ void func_80881290(EnHorse* this, PlayState* play); void func_8088159C(EnHorse* this, PlayState* play); void func_80881634(EnHorse* this); void func_8088168C(EnHorse* this); -void EnHorse_CsMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void EnHorse_CsMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* action); +void EnHorse_CsMoveInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void EnHorse_CsMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorCue* cue); void EnHorse_CsPlayHighJumpAnim(EnHorse* this, PlayState* play); -void EnHorse_CsJumpInit(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void EnHorse_WarpMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void EnHorse_CsWarpMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action); +void EnHorse_CsJumpInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void EnHorse_WarpMoveInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void EnHorse_CsWarpMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorCue* cue); void EnHorse_InitCutscene(EnHorse* this, PlayState* play); void EnHorse_InitHorsebackArchery(EnHorse* this); void EnHorse_UpdateHbaAnim(EnHorse* this); -void func_80883BEC(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80883CB0(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80883D64(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80883DE0(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80883E10(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80883EA0(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80883F18(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80883F98(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80884010(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_808840C4(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80884194(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_8088424C(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80884314(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_808843B4(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80884444(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_808844E0(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80884564(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_80884604(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_808846B4(EnHorse* this, PlayState* play, CsCmdActorAction* action); -void func_808846DC(EnHorse* this, PlayState* play, CsCmdActorAction* action); +void func_80883BEC(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80883CB0(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80883D64(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80883DE0(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80883E10(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80883EA0(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80883F18(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80883F98(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80884010(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_808840C4(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80884194(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_8088424C(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80884314(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_808843B4(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80884444(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_808844E0(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80884564(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_80884604(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_808846B4(EnHorse* this, PlayState* play, CsCmdActorCue* cue); +void func_808846DC(EnHorse* this, PlayState* play, CsCmdActorCue* cue); void func_808846F0(EnHorse* this, PlayState* play); void func_80884994(EnHorse* this); void func_80884D04(EnHorse* this, PlayState* play); @@ -91,7 +91,7 @@ void EnHorse_StickDirection(Vec2f* curStick, f32* stickMag, s16* angle); s32 EnHorse_GetMountSide(EnHorse* this, PlayState* play); typedef struct { - s32 csAction; + s32 cueId; s32 csFuncIdx; } CsActionEntry; @@ -673,7 +673,7 @@ s32 EnHorse_PlayerCanMove(EnHorse* this, PlayState* play) { (player->stateFlags1 & PLAYER_STATE1_100000) || (((this->stateFlags & ENHORSE_FLAG_19) || (this->stateFlags & ENHORSE_FLAG_29)) && !this->inRace) || (this->action == ENHORSE_ACTION_HBA) || (player->actor.flags & ACTOR_FLAG_TALK_REQUESTED) || - (play->csCtx.state != CS_STATE_0) || (ActorCutscene_GetCurrentIndex() != -1) || + (play->csCtx.state != CS_STATE_IDLE) || (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) || (player->stateFlags1 & PLAYER_STATE1_20) || (player->csMode != PLAYER_CSMODE_0)) { return false; } @@ -1001,7 +1001,7 @@ void EnHorse_Frozen(EnHorse* this, PlayState* play) { EnHorse_StartMountedIdleResetAnim(this); } else if (this->actor.params == ENHORSE_11) { this->actor.params = ENHORSE_7; - if (play->csCtx.state != CS_STATE_0) { + if (play->csCtx.state != CS_STATE_IDLE) { EnHorse_StartMountedIdle(this); } else { this->actor.speed = 8.0f; @@ -1642,8 +1642,8 @@ void EnHorse_Reverse(EnHorse* this, PlayState* play) { } else if (stickMag < 10.0f) { stickAngle = -0x7FFF; } - } else if ((player->actor.flags & ACTOR_FLAG_TALK_REQUESTED) || (play->csCtx.state != CS_STATE_0) || - (ActorCutscene_GetCurrentIndex() != -1) || (player->stateFlags1 & PLAYER_STATE1_20)) { + } else if ((player->actor.flags & ACTOR_FLAG_TALK_REQUESTED) || (play->csCtx.state != CS_STATE_IDLE) || + (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) || (player->stateFlags1 & PLAYER_STATE1_20)) { EnHorse_StartMountedIdleResetAnim(this); this->actor.speed = 0.0f; return; @@ -2479,20 +2479,20 @@ void func_808819D8(EnHorse* this, PlayState* play) { } } -void EnHorse_CsMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void EnHorse_CsMoveInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { this->animIndex = ENHORSE_ANIM_GALLOP; this->cutsceneAction = 1; Animation_PlayOnceSetSpeed(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], this->actor.speed * 0.2f * 1.5f); } -void EnHorse_CsMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void EnHorse_CsMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { Vec3f endPos; s32 pad; - endPos.x = action->endPos.x; - endPos.y = action->endPos.y; - endPos.z = action->endPos.z; + endPos.x = cue->endPos.x; + endPos.y = cue->endPos.y; + endPos.z = cue->endPos.z; if (Math3D_Distance(&endPos, &this->actor.world.pos) > 8.0f) { EnHorse_RotateToPoint(this, play, &endPos, 0x320); @@ -2543,20 +2543,20 @@ void EnHorse_CsPlayHighJumpAnim(EnHorse* this, PlayState* play) { Rumble_Request(0.0f, 170, 10, 10); } -void EnHorse_CsJumpInit(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void EnHorse_CsJumpInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { EnHorse_CsSetAnimHighJump(this, play); this->cutsceneAction = 2; this->cutsceneFlags &= ~1; } -void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { f32 curFrame; f32 y; Vec3s* jointTable; s32 pad[2]; if (this->cutsceneFlags & 1) { - EnHorse_CsMoveToPoint(this, play, action); + EnHorse_CsMoveToPoint(this, play, cue); return; } @@ -2608,7 +2608,7 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } } -void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { this->animIndex = ENHORSE_ANIM_REARING; this->cutsceneAction = 3; this->cutsceneFlags &= ~4; @@ -2624,7 +2624,7 @@ void EnHorse_CsRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* act Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } -void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { this->actor.speed = 0.0f; if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { @@ -2652,13 +2652,13 @@ void EnHorse_CsRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action) } } -void EnHorse_WarpMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - this->actor.world.pos.x = action->startPos.x; - this->actor.world.pos.y = action->startPos.y; - this->actor.world.pos.z = action->startPos.z; +void EnHorse_WarpMoveInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + this->actor.world.pos.x = cue->startPos.x; + this->actor.world.pos.y = cue->startPos.y; + this->actor.world.pos.z = cue->startPos.z; this->actor.prevPos = this->actor.world.pos; - this->actor.world.rot.y = action->urot.y; + this->actor.world.rot.y = cue->rot.y; this->actor.shape.rot = this->actor.world.rot; this->animIndex = ENHORSE_ANIM_GALLOP; @@ -2667,13 +2667,13 @@ void EnHorse_WarpMoveInit(EnHorse* this, PlayState* play, CsCmdActorAction* acti this->actor.speed * 0.3f); } -void EnHorse_CsWarpMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void EnHorse_CsWarpMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { Vec3f endPos; s32 pad; - endPos.x = action->endPos.x; - endPos.y = action->endPos.y; - endPos.z = action->endPos.z; + endPos.x = cue->endPos.x; + endPos.y = cue->endPos.y; + endPos.z = cue->endPos.z; if (Math3D_Distance(&endPos, &this->actor.world.pos) > 8.0f) { EnHorse_RotateToPoint(this, play, &endPos, 0x320); @@ -2692,13 +2692,13 @@ void EnHorse_CsWarpMoveToPoint(EnHorse* this, PlayState* play, CsCmdActorAction* } } -void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - this->actor.world.pos.x = action->startPos.x; - this->actor.world.pos.y = action->startPos.y; - this->actor.world.pos.z = action->startPos.z; +void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + this->actor.world.pos.x = cue->startPos.x; + this->actor.world.pos.y = cue->startPos.y; + this->actor.world.pos.z = cue->startPos.z; this->actor.prevPos = this->actor.world.pos; - this->actor.world.rot.y = action->urot.y; + this->actor.world.rot.y = cue->rot.y; this->actor.shape.rot = this->actor.world.rot; this->animIndex = ENHORSE_ANIM_REARING; @@ -2717,7 +2717,7 @@ void EnHorse_CsWarpRearingInit(EnHorse* this, PlayState* play, CsCmdActorAction* Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } -void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void EnHorse_CsWarpRearing(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { this->actor.speed = 0.0f; if (this->curFrame > 25.0f) { if (!(this->stateFlags & ENHORSE_LAND2_SOUND)) { @@ -2752,16 +2752,16 @@ void EnHorse_InitCutscene(EnHorse* this, PlayState* play) { this->actor.speed = 0.0f; } -s32 EnHorse_GetCutsceneFunctionIndex(s32 csAction) { +s32 EnHorse_GetCutsceneFunctionIndex(s32 cueId) { s32 numActions = ARRAY_COUNT(sCsActionTable); // prevents unrolling s32 i; for (i = 0; i < numActions; i++) { - if (csAction == sCsActionTable[i].csAction) { + if (cueId == sCsActionTable[i].cueId) { return sCsActionTable[i].csFuncIdx; } - if (csAction < sCsActionTable[i].csAction) { + if (cueId < sCsActionTable[i].cueId) { return 0; } } @@ -2770,9 +2770,9 @@ s32 EnHorse_GetCutsceneFunctionIndex(s32 csAction) { void EnHorse_CutsceneUpdate(EnHorse* this, PlayState* play) { s32 csFunctionIdx; - CsCmdActorAction* playerAction = play->csCtx.playerAction; + CsCmdActorCue* playerCue = play->csCtx.playerCue; - if (play->csCtx.state == CS_STATE_3) { + if (play->csCtx.state == CS_STATE_STOP) { this->playerControlled = true; this->actor.params = ENHORSE_12; this->action = ENHORSE_ACTION_IDLE; @@ -2780,23 +2780,23 @@ void EnHorse_CutsceneUpdate(EnHorse* this, PlayState* play) { return; } - if (playerAction != NULL) { - csFunctionIdx = EnHorse_GetCutsceneFunctionIndex(playerAction->action); + if (playerCue != NULL) { + csFunctionIdx = EnHorse_GetCutsceneFunctionIndex(playerCue->id); if (csFunctionIdx != 0) { if (csFunctionIdx != this->cutsceneAction) { if (this->cutsceneAction == 0) { - this->actor.world.pos.x = playerAction->startPos.x; - this->actor.world.pos.y = playerAction->startPos.y; - this->actor.world.pos.z = playerAction->startPos.z; + this->actor.world.pos.x = playerCue->startPos.x; + this->actor.world.pos.y = playerCue->startPos.y; + this->actor.world.pos.z = playerCue->startPos.z; - this->actor.world.rot.y = playerAction->urot.y; + this->actor.world.rot.y = playerCue->rot.y; this->actor.shape.rot = this->actor.world.rot; this->actor.prevPos = this->actor.world.pos; } this->cutsceneAction = csFunctionIdx; - sCutsceneInitFuncs[csFunctionIdx](this, play, playerAction); + sCutsceneInitFuncs[csFunctionIdx](this, play, playerCue); } - sCutsceneActionFuncs[this->cutsceneAction](this, play, playerAction); + sCutsceneActionFuncs[this->cutsceneAction](this, play, playerCue); } } } @@ -2925,7 +2925,7 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) { if (((this->hbaFlags & 1) || (this->hbaTimer > 45)) && (sp28 != 1) && (gSaveContext.minigameStatus != MINIGAME_STATUS_END)) { - gSaveContext.save.cutscene = 0; + gSaveContext.save.cutsceneIndex = 0; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_64; } @@ -3108,28 +3108,28 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) { } } -void func_80883B70(EnHorse* this, CsCmdActorAction* action) { - this->actor.world.pos.x = action->startPos.x; - this->actor.world.pos.y = action->startPos.y; - this->actor.world.pos.z = action->startPos.z; +void func_80883B70(EnHorse* this, CsCmdActorCue* cue) { + this->actor.world.pos.x = cue->startPos.x; + this->actor.world.pos.y = cue->startPos.y; + this->actor.world.pos.z = cue->startPos.z; - this->actor.world.rot.y = action->urot.y; + this->actor.world.rot.y = cue->rot.y; this->actor.shape.rot = this->actor.world.rot; this->actor.prevPos = this->actor.world.pos; } -void func_80883BEC(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - func_80883B70(this, action); +void func_80883BEC(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + func_80883B70(this, cue); this->animIndex = ENHORSE_ANIM_IDLE; - this->unk_3E0 = 1; + this->cueId = 1; this->stateFlags &= ~ENHORSE_SANDDUST_SOUND; Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); this->stateFlags |= ENHORSE_SANDDUST_SOUND; } -void func_80883CB0(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_80883CB0(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { EnHorse_IdleAnimSounds(this, play); if (SkelAnime_Update(&this->skin.skelAnime)) { this->animIndex = ENHORSE_ANIM_IDLE; @@ -3138,74 +3138,74 @@ void func_80883CB0(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } } -void func_80883D64(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - func_80883B70(this, action); - this->unk_3E0 = 2; +void func_80883D64(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + func_80883B70(this, cue); + this->cueId = 2; Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00A8DC, 0.0f, 0.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00A8DC), ANIMMODE_ONCE, 0.0f); } -void func_80883DE0(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_80883DE0(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { SkelAnime_Update(&this->skin.skelAnime); } -void func_80883E10(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - func_80883B70(this, action); - this->unk_3E0 = 3; +void func_80883E10(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + func_80883B70(this, cue); + this->cueId = 3; Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00A8DC, 1.0f, 0.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00A8DC), ANIMMODE_ONCE, -3.0f); Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_KID_HORSE_NEIGH); } -void func_80883EA0(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_80883EA0(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { if (SkelAnime_Update(&this->skin.skelAnime)) { Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00B3E0, 1.0f, 11.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00B3E0), ANIMMODE_ONCE, 0.0f); } } -void func_80883F18(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - func_80883B70(this, action); - this->unk_3E0 = 4; +void func_80883F18(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + func_80883B70(this, cue); + this->cueId = 4; Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00AD08, 1.0f, 0.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00AD08), ANIMMODE_ONCE, -3.0f); } -void func_80883F98(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_80883F98(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { if (Animation_OnFrame(&this->skin.skelAnime, Animation_GetLastFrame(&object_horse_link_child_Anim_00AD08) - 1.0f)) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_KID_HORSE_LAND2); } SkelAnime_Update(&this->skin.skelAnime); } -void func_80884010(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - func_80883B70(this, action); - this->unk_3E0 = 5; +void func_80884010(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + func_80883B70(this, cue); + this->cueId = 5; this->animIndex = ENHORSE_ANIM_WALK; Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); } -void func_808840C4(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_808840C4(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { EnHorse_PlayWalkingSound(this); - Cutscene_ActorTranslateAndYaw(&this->actor, play, this->unk_530); + Cutscene_ActorTranslateAndYaw(&this->actor, play, this->cueChannel); if (SkelAnime_Update(&this->skin.skelAnime)) { Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); } } -void func_80884194(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - func_80883B70(this, action); - this->unk_3E0 = 6; +void func_80884194(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + func_80883B70(this, cue); + this->cueId = 6; this->animIndex = ENHORSE_ANIM_GALLOP; Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, -3.0f); func_8087C1C0(this); } -void func_8088424C(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, this->unk_530); +void func_8088424C(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, this->cueChannel); if (SkelAnime_Update(&this->skin.skelAnime)) { Animation_Change(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex], 1.0f, 0.0f, Animation_GetLastFrame(sAnimationHeaders[this->type][this->animIndex]), ANIMMODE_ONCE, 0.0f); @@ -3213,36 +3213,36 @@ void func_8088424C(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } } -void func_80884314(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_80884314(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 20.0f); - func_80883B70(this, action); - this->unk_3E0 = 7; + func_80883B70(this, cue); + this->cueId = 7; Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00D178, 1.0f, 0.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00D178), ANIMMODE_ONCE, 0.0f); Audio_PlaySfxAtPos(&this->unk_218, NA_SE_EV_KID_HORSE_NEIGH); } -void func_808843B4(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_808843B4(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { SkelAnime_Update(&this->skin.skelAnime); if (this->curFrame > 42.0f) { if (((s32)this->curFrame % 11) == 0) { func_8087C1C0(this); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, this->unk_530); + Cutscene_ActorTranslateAndYaw(&this->actor, play, this->cueChannel); } } -void func_80884444(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_80884444(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 20.0f); - func_80883B70(this, action); + func_80883B70(this, cue); this->cutsceneAction = 8; Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00D4E8, 1.0f, 0.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00D4E8), ANIMMODE_ONCE, 0.0f); func_8087C1C0(this); } -void func_808844E0(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, this->unk_530); +void func_808844E0(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, this->cueChannel); if (SkelAnime_Update(&this->skin.skelAnime)) { Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00D4E8, 1.0f, 0.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00D4E8), ANIMMODE_ONCE, 0.0f); @@ -3250,17 +3250,17 @@ void func_808844E0(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } } -void func_80884564(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_80884564(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 20.0f); - func_80883B70(this, action); + func_80883B70(this, cue); this->cutsceneAction = 8; Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00BDE0, 1.0f, 0.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00BDE0), ANIMMODE_ONCE, -3.0f); func_8087C1C0(this); } -void func_80884604(EnHorse* this, PlayState* play, CsCmdActorAction* action) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, this->unk_530); +void func_80884604(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, this->cueChannel); if (SkelAnime_Update(&this->skin.skelAnime)) { Animation_Change(&this->skin.skelAnime, &object_horse_link_child_Anim_00BDE0, 1.0f, 0.0f, Animation_GetLastFrame(&object_horse_link_child_Anim_00BDE0), ANIMMODE_ONCE, 0.0f); @@ -3271,48 +3271,48 @@ void func_80884604(EnHorse* this, PlayState* play, CsCmdActorAction* action) { } } -void func_808846B4(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_808846B4(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { Actor_Kill(&this->actor); } -void func_808846DC(EnHorse* this, PlayState* play, CsCmdActorAction* action) { +void func_808846DC(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { } void func_808846F0(EnHorse* this, PlayState* play) { this->playerControlled = false; this->action = ENHORSE_ACTION_21; - this->unk_3E0 = -1; + this->cueId = -1; this->actor.speed = 0.0f; } void func_80884718(EnHorse* this, PlayState* play) { - CsCmdActorAction* action; + CsCmdActorCue* cue; - if (Cutscene_CheckActorAction(play, 0x70)) { - this->unk_530 = Cutscene_GetActorActionIndex(play, 0x70); - action = play->csCtx.actorActions[this->unk_530]; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_112)) { + this->cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_112); + cue = play->csCtx.actorCues[this->cueChannel]; this->unk_1EC |= 0x20; - if (this->unk_3E0 != action->action) { - if (this->unk_3E0 == -1) { - this->actor.world.pos.x = action->startPos.x; - this->actor.world.pos.y = action->startPos.y; - this->actor.world.pos.z = action->startPos.z; + if (this->cueId != cue->id) { + if (this->cueId == -1) { + this->actor.world.pos.x = cue->startPos.x; + this->actor.world.pos.y = cue->startPos.y; + this->actor.world.pos.z = cue->startPos.z; - this->actor.world.rot.y = action->urot.y; + this->actor.world.rot.y = cue->rot.y; this->actor.shape.rot = this->actor.world.rot; this->actor.prevPos = this->actor.world.pos; } - this->unk_3E0 = action->action; - if (D_808890F0[this->unk_3E0] != NULL) { - D_808890F0[this->unk_3E0](this, play, action); + this->cueId = cue->id; + if (D_808890F0[this->cueId] != NULL) { + D_808890F0[this->cueId](this, play, cue); } } - if (D_8088911C[this->unk_3E0] != NULL) { - D_8088911C[this->unk_3E0](this, play, action); + if (D_8088911C[this->cueId] != NULL) { + D_8088911C[this->cueId](this, play, cue); } } } @@ -4227,7 +4227,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) { EnHorse_RegenBoost(this, play); } - if (ActorCutscene_GetCurrentIndex() != -1) { + if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) { thisx->speed = 0.0f; } diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/src/overlays/actors/ovl_En_Horse/z_en_horse.h index 97ab2c898c..b2c58bcadb 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -11,7 +11,7 @@ struct EnIn; typedef void (*EnHorseActionFunc)(struct EnHorse*, PlayState*); typedef void (*EnHorsePostdrawFunc)(struct EnHorse*, PlayState*); -typedef void (*EnHorseCsFunc)(struct EnHorse*, PlayState*, CsCmdActorAction*); +typedef void (*EnHorseCsFunc)(struct EnHorse*, PlayState*, CsCmdActorCue*); #define ENHORSE_BOOST (1 << 0) /* 0x1 */ #define ENHORSE_BOOST_DECEL (1 << 1) /* 0x2 */ @@ -190,7 +190,7 @@ typedef struct EnHorse { /* 0x3BC */ Vec3f frontLeftHoof; /* 0x3C8 */ Vec3f backRightHoof; /* 0x3D4 */ Vec3f backLeftHoof; - /* 0x3E0 */ s32 unk_3E0; + /* 0x3E0 */ s32 cueId; /* 0x3E4 */ UNK_TYPE1 unk_3E4[0x4]; /* 0x3E8 */ f32 unk_3E8; /* 0x3EC */ s16 unk_3EC; @@ -198,7 +198,7 @@ typedef struct EnHorse { /* 0x48A */ Vec3s morphTable[OBJECT_HA_1_LIMB_MAX]; /* 0x528 */ f32 unk_528; /* 0x52C */ s32 unk_52C; - /* 0x530 */ s32 unk_530; + /* 0x530 */ s32 cueChannel; /* 0x534 */ s32 unk_534; /* 0x538 */ s32 unk_538; /* 0x53C */ s32 unk_53C; diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index 8ecc26857b..4d535292f3 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -225,7 +225,7 @@ void EnHs_SceneTransitToBunnyHoodDialogue(EnHs* this, PlayState* play) { void func_80953354(EnHs* this, PlayState* play) { if (!Play_InCsMode(play)) { - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); this->actionFunc = EnHs_SceneTransitToBunnyHoodDialogue; } } diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c index fde467ddcc..e053a85289 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -320,49 +320,49 @@ void func_80BF15EC(EnIg* this) { } } -s32 func_80BF16C8(EnIg* this, s16 arg1) { +s32 func_80BF16C8(EnIg* this, s16 csId) { s32 ret = false; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(arg1); - } else if (ActorCutscene_GetCanPlayNext(arg1)) { - ActorCutscene_StartAndSetUnkLinkFields(arg1, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(csId); + } else if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); ret = true; } else { - ActorCutscene_SetIntentToPlay(arg1); + CutsceneManager_Queue(csId); } return ret; } -s16 func_80BF1744(EnIg* this, s32 arg1) { - s16 cs = -1; +s16 func_80BF1744(EnIg* this, s32 numCutscenes) { + s16 csId = CS_ID_NONE; s32 i; if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - cs = this->actor.child->cutscene; - for (i = 0; i < arg1; i++) { - cs = ActorCutscene_GetAdditionalCutscene(cs); + csId = this->actor.child->csId; + for (i = 0; i < numCutscenes; i++) { + csId = CutsceneManager_GetAdditionalCsId(csId); } } - return cs; + return csId; } s32 func_80BF17BC(EnIg* this, PlayState* play) { s32 pad; - s16 sp2A; + s16 csId; s32 ret; - sp2A = func_80BF1744(this, 0); + csId = func_80BF1744(this, 0); ret = false; switch (this->unk_3F6) { case 0: - if (func_80BF16C8(this, sp2A)) { + if (func_80BF16C8(this, csId)) { case 2: case 4: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), this->actor.child); } this->unk_3F6++; @@ -373,17 +373,17 @@ s32 func_80BF17BC(EnIg* this, PlayState* play) { case 1: case 3: if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_75_10) && (this->unk_3F6 == 3)) { - ActorCutscene_Stop(sp2A); + CutsceneManager_Stop(csId); this->unk_3F6 = 5; } else { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), &this->actor); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), &this->actor); } this->unk_3F6++; ret = true; break; case 5: - ActorCutscene_Stop(sp2A); + CutsceneManager_Stop(csId); this->unk_3F6++; ret = true; break; diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 5c1244faa0..fc7fafdcfd 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -651,7 +651,7 @@ void EnIk_ReactToAttack(EnIk* this, PlayState* play) { } if (SkelAnime_Update(&this->skelAnime)) { if (this->subCamId != SUB_CAM_ID_DONE) { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); this->subCamId = SUB_CAM_ID_DONE; EnIk_SetupIdle(this); } else { @@ -693,7 +693,7 @@ void EnIk_Die(EnIk* this, PlayState* play) { } if (this->timer == 0) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); Actor_Kill(&this->actor); } } @@ -723,7 +723,7 @@ void EnIk_Frozen(EnIk* this, PlayState* play) { } void EnIk_SetupCutscene(EnIk* this) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actor.speed = 0.0f; if (this->actor.colChkInfo.health != 0) { func_800BE504(&this->actor, &this->colliderCylinder); @@ -735,10 +735,10 @@ void EnIk_PlayCutscene(EnIk* this, PlayState* play) { Vec3f subCamEye; this->invincibilityFrames = 12; - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - if (this->actor.cutscene != -1) { - ActorCutscene_StartAndSetFlag(this->actor.cutscene, &this->actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene); + if (CutsceneManager_IsNext(this->actor.csId)) { + if (this->actor.csId != CS_ID_NONE) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->actor.csId, &this->actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); subCamEye.x = (Math_SinS((this->actor.shape.rot.y - 0x2000)) * 120.0f) + this->actor.focus.pos.x; subCamEye.y = this->actor.focus.pos.y + 20.0f; subCamEye.z = (Math_CosS((this->actor.shape.rot.y - 0x2000)) * 120.0f) + this->actor.focus.pos.z; @@ -750,7 +750,7 @@ void EnIk_PlayCutscene(EnIk* this, PlayState* play) { EnIk_SetupDie(this); } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index e90ddcafd6..84ed7a6053 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -354,7 +354,7 @@ void func_8095E204(EnIshi* this, PlayState* play) { for (i = 0; i < 3; i++) { if (Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_INSECT, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1, - this->actor.cutscene, this->actor.halfDaysBits, NULL) == NULL) { + this->actor.csId, this->actor.halfDaysBits, NULL) == NULL) { break; } } @@ -660,7 +660,7 @@ void func_8095EBDC(EnIshi* this, PlayState* play) { void func_8095F060(EnIshi* this) { this->actor.flags |= ACTOR_FLAG_10; - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = func_8095F0A4; } @@ -668,15 +668,15 @@ void func_8095F0A4(EnIshi* this, PlayState* play) { s32 pad; s32 sp28 = ENISHI_GET_1(&this->actor); - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, D_8095F6D4[sp28], D_8095F6D0[sp28]); D_8095F6D8[sp28](&this->actor, play); D_8095F6E0[sp28](this, play); this->actor.draw = NULL; func_8095F180(this); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -685,9 +685,9 @@ void func_8095F180(EnIshi* this) { } void func_8095F194(EnIshi* this, PlayState* play) { - if (this->actor.cutscene < 0) { + if (this->actor.csId < 0) { Actor_Kill(&this->actor); - } else if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { + } else if (CutsceneManager_GetCurrentCsId() != this->actor.csId) { Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c index 4ef7ee42a4..451b9e553e 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c @@ -251,32 +251,32 @@ s32 EnJg_ReachedPoint(EnJg* this, Path* path, s32 pointIndex) { return reached; } -s16 EnJg_GetCutsceneForTeachingLullabyIntro(EnJg* this) { +s16 EnJg_GetCsIdForTeachingLullabyIntro(EnJg* this) { s16 temp = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (temp > 0) { - return this->actor.cutscene; + return this->actor.csId; } - return ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + return CutsceneManager_GetAdditionalCsId(this->actor.csId); } void EnJg_SetupGoronShrineCheer(EnJg* this) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); if (this->focusedShrineGoronParam == 10) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { this->actionFunc = EnJg_GoronShrineTalk; } else { - this->cutscene = 0x7C; + this->csId = CS_ID_GLOBAL_TALK; } } else { - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); this->actionFunc = EnJg_GoronShrineCheer; switch (this->textId) { @@ -374,7 +374,7 @@ void EnJg_GoronShrineTalk(EnJg* this, PlayState* play) { } void EnJg_GoronShrineCheer(EnJg* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { + if (CutsceneManager_IsNext(this->csId)) { switch (this->textId) { case 0xDD0: // The greatest Goron hero of all? case 0xDD2: // The immortal Goron? @@ -383,26 +383,26 @@ void EnJg_GoronShrineCheer(EnJg* this, PlayState* play) { case 0xDD6: // Darmani, greatest in the world! // Focus on a specifc Goron for these lines this->shrineGoron = EnJg_GetShrineGoronToFocusOn(play, this->focusedShrineGoronParam); - ActorCutscene_Start(this->cutscene, this->shrineGoron); + CutsceneManager_Start(this->csId, this->shrineGoron); Camera_SetTargetActor(play->cameraPtrs[CAM_ID_MAIN], this->shrineGoron); break; default: // Focus on the whole group for these lines - ActorCutscene_Start(this->cutscene, &this->actor); + CutsceneManager_Start(this->csId, &this->actor); Camera_SetTargetActor(play->cameraPtrs[CAM_ID_MAIN], this->shrineGoron); break; } this->actionFunc = EnJg_GoronShrineTalk; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { if (this->focusedShrineGoronParam == 10) { this->actionFunc = EnJg_GoronShrineTalk; } else { - ActorCutscene_Stop(0x7C); + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } @@ -514,11 +514,11 @@ void EnJg_Talk(EnJg* this, PlayState* play) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->flags &= ~FLAG_LOOKING_AT_PLAYER; - this->cutscene = EnJg_GetCutsceneForTeachingLullabyIntro(this); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + this->csId = EnJg_GetCsIdForTeachingLullabyIntro(this); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); this->actionFunc = EnJg_TeachLullabyIntro; } } else { @@ -609,27 +609,27 @@ void EnJg_EndFrozenInteraction(EnJg* this, PlayState* play) { } void EnJg_TeachLullabyIntro(EnJg* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_Start(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, &this->actor); this->actionFunc = EnJg_LullabyIntroCutsceneAction; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) { s32 pad; - if (Cutscene_CheckActorAction(play, 470)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 470); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_470)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_470); - if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { - this->csAction = play->csCtx.actorActions[actionIndex]->action; + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; - switch (play->csCtx.actorActions[actionIndex]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->cutsceneAnimIndex = EN_JG_ANIM_CUTSCENE_IDLE; if (this->drum != NULL) { @@ -688,7 +688,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) { this->drum = Actor_SpawnAsChildAndCutscene( &play->actorCtx, play, ACTOR_OBJ_JG_GAKKI, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, - this->actor.params, this->actor.cutscene, this->actor.halfDaysBits, NULL); + this->actor.params, this->actor.csId, this->actor.halfDaysBits, NULL); } if (this->cutsceneAnimIndex == EN_JG_ANIM_TAKING_OUT_DRUM) { @@ -699,7 +699,7 @@ void EnJg_LullabyIntroCutsceneAction(EnJg* this, PlayState* play) { } } } else { - this->csAction = 99; + this->cueId = 99; this->freezeTimer = 1000; SET_WEEKEVENTREG(WEEKEVENTREG_24_40); this->actionFunc = EnJg_Idle; @@ -758,10 +758,10 @@ s32 EnJg_GetNextTextId(EnJg* this) { case 0xDCF: // Spring has come thanks to you this->focusedShrineGoronParam = 3; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); this->actionFunc = EnJg_GoronShrineCheer; return 0xDD0; // The greatest Goron hero of all? @@ -949,7 +949,7 @@ void EnJg_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); if (!EN_JG_IS_IN_GORON_SHRINE(thisx)) { - if ((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 7) && (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 7) && (play->csCtx.scriptIndex == 0)) { // This is the elder that appears in the cutscene for learning the full Goron Lullaby. this->animIndex = EN_JG_ANIM_IDLE; this->action = EN_JG_ACTION_LULLABY_INTRO_CS; @@ -968,7 +968,7 @@ void EnJg_Init(Actor* thisx, PlayState* play) { } else { // This is the elder that appears in Goron Shrine in spring. this->animIndex = EN_JG_ANIM_IDLE; - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); this->actionFunc = EnJg_GoronShrineIdle; } diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.h b/src/overlays/actors/ovl_En_Jg/z_en_jg.h index 757a8bd864..ad8eee0a89 100644 --- a/src/overlays/actors/ovl_En_Jg/z_en_jg.h +++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.h @@ -32,9 +32,9 @@ typedef struct EnJg { /* 0x3A4 */ Vec3f breathPos; /* 0x3B0 */ Vec3f breathVelocity; /* 0x3BC */ Vec3f breathAccel; - /* 0x3C8 */ s16 cutscene; + /* 0x3C8 */ s16 csId; /* 0x3CA */ u8 cutsceneAnimIndex; - /* 0x3CB */ u8 csAction; + /* 0x3CB */ u8 cueId; /* 0x3CC */ u16 flags; /* 0x3CE */ u16 textId; /* 0x3D0 */ u8 focusedShrineGoronParam; diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c index 263b4fab49..5efca1bcd8 100644 --- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c +++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c @@ -231,15 +231,15 @@ void func_80C13F88(EnJgameTsn* this) { } void func_80C13F9C(EnJgameTsn* this, PlayState* play) { - if (this->actor.cutscene != -1) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (this->actor.csId != CS_ID_NONE) { + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); func_80C14030(this); } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } else { func_80C14030(this); @@ -268,8 +268,8 @@ void func_80C14044(EnJgameTsn* this, PlayState* play) { case TEXT_STATE_DONE: if (Message_ShouldAdvance(play)) { - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { - ActorCutscene_Stop(this->actor.cutscene); + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { + CutsceneManager_Stop(this->actor.csId); } func_80C13B74(this); } @@ -468,8 +468,8 @@ void func_80C147B4(EnJgameTsn* this, PlayState* play) { break; case 0x109E: - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { - ActorCutscene_Stop(this->actor.cutscene); + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { + CutsceneManager_Stop(this->actor.csId); } Message_CloseTextbox(play); func_80C1476C(this, play); diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index f6056664f9..8f48622c85 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -76,7 +76,7 @@ Vec3f D_8096AC30 = { 500.0f, -500.0f, 0.0f }; void EnJs_Init(Actor* thisx, PlayState* play) { s32 pad; - s16 cs; + s16 csId; s32 i; EnJs* this = THIS; @@ -92,17 +92,17 @@ void EnJs_Init(Actor* thisx, PlayState* play) { this->actor.terminalVelocity = -9.0f; this->actor.gravity = -1.0f; - cs = this->actor.cutscene; + csId = this->actor.csId; - for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) { - this->cutscenes[i] = cs; - if (cs != -1) { - this->actor.cutscene = cs; - cs = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = csId; + if (csId != CS_ID_NONE) { + this->actor.csId = csId; + csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } } - this->cutsceneIndex = -1; + this->csIdIndex = -1; switch (ENJS_GET_TYPE(&this->actor)) { case 0: @@ -511,17 +511,17 @@ s32 func_809695FC(EnJs* this, PlayState* play) { } void func_80969688(EnJs* this) { - if (this->cutsceneIndex != -1) { - if (ActorCutscene_GetCurrentIndex() == this->cutscenes[this->cutsceneIndex]) { - ActorCutscene_Stop(this->cutscenes[this->cutsceneIndex]); + if (this->csIdIndex != -1) { + if (CutsceneManager_GetCurrentCsId() == this->csIdList[this->csIdIndex]) { + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); } - this->cutsceneIndex = -1; + this->csIdIndex = -1; } } -void func_809696EC(EnJs* this, s16 arg1) { +void func_809696EC(EnJs* this, s16 csIdIndex) { func_80969688(this); - this->cutsceneIndex = arg1; + this->csIdIndex = csIdIndex; } void func_8096971C(EnJs* this, PlayState* play) { @@ -1019,14 +1019,14 @@ void EnJs_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if ((this->cutsceneIndex != -1) && (ActorCutscene_GetCurrentIndex() != this->cutscenes[this->cutsceneIndex])) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]); - } else if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->cutsceneIndex])) { - ActorCutscene_Start(this->cutscenes[this->cutsceneIndex], &this->actor); + if ((this->csIdIndex != -1) && (CutsceneManager_GetCurrentCsId() != this->csIdList[this->csIdIndex])) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); + } else if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + CutsceneManager_Start(this->csIdList[this->csIdIndex], &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } } diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.h b/src/overlays/actors/ovl_En_Js/z_en_js.h index 4508e4944d..c4dd3e3a2c 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.h +++ b/src/overlays/actors/ovl_En_Js/z_en_js.h @@ -24,8 +24,8 @@ typedef struct EnJs { /* 0x2B8 */ u16 unk_2B8; /* 0x2BA */ s16 maskType; /* 0x2BC */ s16 unk_2BC; - /* 0x2BE */ s16 cutscenes[2]; - /* 0x2C2 */ s16 cutsceneIndex; + /* 0x2BE */ s16 csIdList[2]; + /* 0x2C2 */ s16 csIdIndex; /* 0x2C4 */ EnJsActionFunc actionFunc; } EnJs; // size = 0x2C8 diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c index e4e01467fe..7d8f46f91e 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -298,7 +298,7 @@ void EnKaizoku_Init(Actor* thisx, PlayState* play) { this->bodyCollider.dim.radius = 20; this->bodyCollider.dim.height = 65; this->bodyCollider.dim.yShift = 0; - this->unk_2D6 = this->picto.actor.cutscene; + this->csId = this->picto.actor.csId; this->picto.actor.world.pos.y = player->actor.world.pos.y + 160.0f; this->picto.validationFunc = EnKaizoku_ValidatePictograph; this->picto.actor.flags |= ACTOR_FLAG_400; @@ -474,14 +474,14 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) { break; } - if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) { - ActorCutscene_SetIntentToPlay(this->unk_2D6); + if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Queue(this->csId); return; } - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->picto.actor); + CutsceneManager_StartWithPlayerCs(this->csId, &this->picto.actor); func_800B7298(play, &this->picto.actor, 0x15); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); this->picto.actor.shape.rot.y = this->picto.actor.world.rot.y = this->picto.actor.yawTowardsPlayer; sp54 = (this->unk_2CA * 4) + this->unk_2C8; @@ -609,7 +609,7 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) { case 7: if (this->unk_598 == 0) { func_800B7298(play, &this->picto.actor, 6); - ActorCutscene_Stop(this->unk_2D6); + CutsceneManager_Stop(this->csId); this->unk_59C = 0; this->subCamId = 0; this->picto.actor.flags &= ~ACTOR_FLAG_100000; @@ -666,15 +666,15 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) { void func_80B86804(EnKaizoku* this, PlayState* play) { if (this->subCamId == 0) { - if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) { - ActorCutscene_SetIntentToPlay(this->unk_2D6); + if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Queue(this->csId); return; } - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->picto.actor); + CutsceneManager_StartWithPlayerCs(this->csId, &this->picto.actor); } func_800B7298(play, &this->picto.actor, 0x60); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); this->unk_2B2 = 30; this->picto.actor.flags &= ~ACTOR_FLAG_1; this->unk_598 = 0; @@ -724,7 +724,7 @@ void func_80B868B8(EnKaizoku* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); func_800B7298(play, &this->picto.actor, 6); - ActorCutscene_Stop(this->unk_2D6); + CutsceneManager_Stop(this->csId); this->subCamId = 0; play->nextEntrance = play->setupExitList[this->exitIndex]; gSaveContext.nextCutsceneIndex = 0; @@ -863,7 +863,7 @@ void func_80B86B74(EnKaizoku* this, PlayState* play) { this->unk_59C = 0; this->subCamId = 0; func_800B7298(play, &this->picto.actor, 6); - ActorCutscene_Stop(this->unk_2D6); + CutsceneManager_Stop(this->csId); if (this->switchFlag >= 0) { Flags_SetSwitch(play, this->switchFlag); } @@ -1716,12 +1716,12 @@ void func_80B8971C(EnKaizoku* this, PlayState* play) { if (curFrame >= 25.0f) { player = GET_PLAYER(play); if (this->subCamId == 0) { - if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) { - ActorCutscene_SetIntentToPlay(this->unk_2D6); + if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Queue(this->csId); return; } - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->csId, &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); } Math_Vec3f_Copy(&this->unk_3C4, &gZeroVec3f); @@ -1776,12 +1776,12 @@ void func_80B89A08(EnKaizoku* this, PlayState* play) { this->subCamId = 0; this->picto.actor.flags |= ACTOR_FLAG_100000; - if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) { - ActorCutscene_SetIntentToPlay(this->unk_2D6); + if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Queue(this->csId); this->actionFunc = func_80B86804; } else { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->csId, &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); this->actionFunc = func_80B86804; } return; @@ -1794,12 +1794,12 @@ void func_80B89A08(EnKaizoku* this, PlayState* play) { this->subCamId = 0; this->picto.actor.flags |= ACTOR_FLAG_100000; - if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) { - ActorCutscene_SetIntentToPlay(this->unk_2D6); + if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Queue(this->csId); this->actionFunc = func_80B86804; } else { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->csId, &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); this->actionFunc = func_80B86804; } return; diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h index ad161088e8..6366c4f7fd 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h @@ -58,7 +58,7 @@ typedef struct EnKaizoku { /* 0x2D0 */ s16 unk_2D0; /* 0x2D2 */ s16 swordState; /* 0x2D4 */ s16 exitIndex; - /* 0x2D6 */ s16 unk_2D6; + /* 0x2D6 */ s16 csId; /* 0x2D8 */ u8 unk_2D8; /* 0x2D9 */ u8 unk_2D9; /* 0x2DC */ f32 frameCount; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 7af84b5e43..19fd2c19f6 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -143,7 +143,7 @@ void EnKakasi_Destroy(Actor* thisx, PlayState* play) { void EnKakasi_Init(Actor* thisx, PlayState* play) { EnKakasi* this = THIS; - s32 tempCutscene; + s32 csId; s32 i; Collider_InitAndSetCylinder(play, &this->collider, &this->picto.actor, &D_80971D80); @@ -169,10 +169,10 @@ void EnKakasi_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->picto.actor, 0.01f); i = 0; - tempCutscene = this->picto.actor.cutscene; - while (tempCutscene != -1) { + csId = this->picto.actor.csId; + while (csId != CS_ID_NONE) { //! FAKE: - tempCutscene = ActorCutscene_GetAdditionalCutscene(this->actorCutscenes[i] = tempCutscene); + csId = CutsceneManager_GetAdditionalCsId(this->csIdList[i] = csId); i++; } @@ -418,7 +418,7 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { if (this->talkState == TEXT_STATE_5) { // bad song input if (this->unkState196 == 2 && this->picto.actor.textId == 0x1647) { - func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_END); } // after timeskip @@ -446,17 +446,17 @@ void EnKakasi_RegularDialogue(EnKakasi* this, PlayState* play) { } else if (this->picto.actor.textId == 0x165D || this->picto.actor.textId == 0x165F || this->picto.actor.textId == 0x1660 || this->picto.actor.textId == 0x1652) { func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_4); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[0]); this->actionFunc = EnKakasi_DancingRemark; } else { - if (!ActorCutscene_GetCanPlayNext(this->actorCutscenes[0])) { - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + if (!CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Queue(this->csIdList[0]); this->actionFunc = EnKakasi_DancingRemark; } else { - ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[0], &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); this->actionFunc = EnKakasi_DancingRemark; } } @@ -561,19 +561,19 @@ void EnKakasi_OcarinaRemark(EnKakasi* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { func_80152434(play, 0x35); this->unkState1A8 = 0; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[0]); this->actionFunc = EnKakasi_TeachingSong; - } else if (ActorCutscene_GetCanPlayNext(this->actorCutscenes[0]) == 0) { - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + } else if (!CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Queue(this->csIdList[0]); this->actionFunc = EnKakasi_TeachingSong; } else { this->unkState1A8 = 1; - ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[0], &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); Math_Vec3f_Copy(&this->unk22C, &this->picto.actor.home.pos); this->actionFunc = EnKakasi_TeachingSong; } @@ -586,17 +586,17 @@ void EnKakasi_TeachingSong(EnKakasi* this, PlayState* play) { EnKakasi_CheckPlayerPosition(this, play); Math_SmoothStepToS(&this->picto.actor.shape.rot.y, this->picto.actor.home.rot.y, 1, 3000, 0); if (this->unkState1A8 == 0) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[0]); return; } - if (ActorCutscene_GetCanPlayNext(this->actorCutscenes[0]) == 0) { - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + if (!CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Queue(this->csIdList[0]); return; } - ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[0], &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); Math_Vec3f_Copy(&this->unk22C, &this->picto.actor.home.pos); this->unkState1A8 = 1; this->unkState1A8 = 1; @@ -619,7 +619,7 @@ void EnKakasi_TeachingSong(EnKakasi* this, PlayState* play) { if (play->msgCtx.ocarinaMode == 4) { // song failed this->unk190 = 0; this->unkCounter1A4 = 0; - ActorCutscene_Stop(this->actorCutscenes[0]); + CutsceneManager_Stop(this->csIdList[0]); Actor_PlaySfx(&this->picto.actor, NA_SE_EN_YASE_DEAD); if (this) {} this->unkState196 = 2; @@ -652,7 +652,7 @@ void EnKakasi_PostSongLearnTwirl(EnKakasi* this, PlayState* play) { } void EnKakasi_SetupPostSongLearnDialogue(EnKakasi* this, PlayState* play) { - ActorCutscene_Stop(this->actorCutscenes[0]); + CutsceneManager_Stop(this->csIdList[0]); play->msgCtx.ocarinaMode = 4; this->unk190 = 0; this->unkCounter1A4 = 0; @@ -699,18 +699,18 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) { } if (this->unkState1A8 == 0) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[0]); return; } - if (ActorCutscene_GetCanPlayNext(this->actorCutscenes[0]) == 0) { - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + if (!CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Queue(this->csIdList[0]); return; } Math_Vec3f_Copy(&this->unk22C, &this->picto.actor.home.pos); - ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[0], &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_86); this->unkState1A8 = 1; } @@ -744,7 +744,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, PlayState* play) { } if (this->picto.actor.textId == 0x1648) { - func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_WAIT); this->picto.actor.textId = 0x1649; if (this->animIndex != ENKAKASI_ANIM_ARMS_CROSSED_ROCKING) { EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING); @@ -789,14 +789,14 @@ void EnKakasi_DancingRemark(EnKakasi* this, PlayState* play) { u32 currentDay = gSaveContext.save.day; this->unkState196 = 3; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); - } else if (ActorCutscene_GetCanPlayNext(this->actorCutscenes[0]) == 0) { - ActorCutscene_SetIntentToPlay(this->actorCutscenes[0]); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[0]); + } else if (!CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Queue(this->csIdList[0]); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[0], &this->picto.actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene); + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->picto.actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->picto.actor.csId); if (currentDay == 3 && gSaveContext.save.isNight) { EnKakasi_SetupDigAway(this); } else { @@ -1014,8 +1014,8 @@ void EnKakasi_DiggingAway(EnKakasi* this, PlayState* play) { Math_ApproachF(&this->picto.actor.shape.yOffset, -6000.0f, 0.5f, 200.0f); if (fabsf(this->picto.actor.shape.yOffset + 6000.0f) < 10.0f) { SET_WEEKEVENTREG(WEEKEVENTREG_79_08); - func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_6); - ActorCutscene_Stop(this->actorCutscenes[0]); + func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_END); + CutsceneManager_Stop(this->csIdList[0]); this->aboveGroundStatus = ENKAKASI_ABOVE_GROUND_TYPE; this->songSummonDist = 80.0f; EnKakasi_SetupIdleUnderground(this); @@ -1040,22 +1040,20 @@ void EnKakasi_IdleUnderground(EnKakasi* this, PlayState* play) { } void EnKakasi_SetupRiseOutOfGround(EnKakasi* this, PlayState* play) { - s32 cutsceneIndex; + s32 csIdIndex; - cutsceneIndex = 0; + csIdIndex = 0; if (this->aboveGroundStatus == ENKAKASI_ABOVE_GROUND_TYPE) { - cutsceneIndex = 1; + csIdIndex = 1; } - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actorCutscenes[cutsceneIndex]); - - } else if (ActorCutscene_GetCanPlayNext(this->actorCutscenes[cutsceneIndex]) == 0) { - ActorCutscene_SetIntentToPlay(this->actorCutscenes[cutsceneIndex]); - + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[csIdIndex]); + } else if (!CutsceneManager_IsNext(this->csIdList[csIdIndex])) { + CutsceneManager_Queue(this->csIdList[csIdIndex]); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->actorCutscenes[cutsceneIndex], &this->picto.actor); + CutsceneManager_StartWithPlayerCs(this->csIdList[csIdIndex], &this->picto.actor); Actor_PlaySfx(&this->picto.actor, NA_SE_EN_AKINDONUTS_HIDE); this->picto.actor.draw = EnKakasi_Draw; this->unkState196 = 6; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h index c278ef050a..cff35d1830 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h @@ -21,7 +21,7 @@ typedef struct EnKakasi { /* 0x1A4 */ s32 unkCounter1A4; // counter, counts up to F while he digs away, reused elsewhere /* 0x1A8 */ s32 unkState1A8; /* 0x1AC */ s16 talkState; - /* 0x1AE */ s16 actorCutscenes[3]; + /* 0x1AE */ s16 csIdList[3]; /* 0x1B4 */ f32 animeFrameCount; /* 0x1B8 */ f32 unkHeight; /* 0x1BC */ Vec3f unk1BC; // set by post limbdraw func for one limb diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index eceaac242c..c72aa9f5fb 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -680,9 +680,9 @@ void func_80B27774(EnKendoJs* this, PlayState* play) { } void func_80B2783C(EnKendoJs* this, PlayState* play) { - if (this->actor.cutscene != -1) { + if (this->actor.csId != CS_ID_NONE) { Camera_ChangeDataIdx(play->cameraPtrs[CAM_ID_MAIN], - ActorCutscene_GetCutscene(this->actor.cutscene)->csCamSceneDataId); + CutsceneManager_GetCutsceneEntry(this->actor.csId)->csCamId); } } diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index d85924b14e..f30f55a339 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -45,7 +45,7 @@ ActorInit En_Kgy_InitVars = { void EnKgy_Init(Actor* thisx, PlayState* play) { EnKgy* this = THIS; - s16 cs; + s16 csId; s32 i; Actor_SetScale(&this->actor, 0.01f); @@ -58,7 +58,8 @@ void EnKgy_Init(Actor* thisx, PlayState* play) { this->zubora = EnKgy_FindZubora(play); this->iceBlock = EnKgy_FindIceBlock(play); Flags_UnsetSwitch(play, ENKGY_GET_FE00(&this->actor) + 1); - if (Flags_GetSwitch(play, ENKGY_GET_FE00(&this->actor)) || CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + if (Flags_GetSwitch(play, ENKGY_GET_FE00(&this->actor)) || + CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { Flags_SetSwitch(play, ENKGY_GET_FE00(&this->actor) + 1); play->envCtx.lightSettingOverride = 1; SET_WEEKEVENTREG(WEEKEVENTREG_21_01); @@ -86,12 +87,12 @@ void EnKgy_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80B42D28; } - cs = this->actor.cutscene; - for (i = 0; i < ARRAY_COUNT(this->unk_2D4); i++) { - this->unk_2D4[i] = cs; - if (cs != -1) { - this->actor.cutscene = cs; - cs = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + csId = this->actor.csId; + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = csId; + if (csId != CS_ID_NONE) { + this->actor.csId = csId; + csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } } @@ -227,14 +228,14 @@ void func_80B40EE8(EnKgy* this, PlayState* play) { } } - if ((this->unk_2E0 != -1) && (ActorCutscene_GetCurrentIndex() != this->unk_2D4[this->unk_2E0])) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_2D4[this->unk_2E0]); - } else if (ActorCutscene_GetCanPlayNext(this->unk_2D4[this->unk_2E0])) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D4[this->unk_2E0], &this->actor); + if ((this->csIdIndex != -1) && (CutsceneManager_GetCurrentCsId() != this->csIdList[this->csIdIndex])) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); + } else if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + CutsceneManager_StartWithPlayerCs(this->csIdList[this->csIdIndex], &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->unk_2D4[this->unk_2E0]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } @@ -304,7 +305,7 @@ void func_80B411DC(EnKgy* this, PlayState* play, s32 arg2) { case 0: this->unk_2B4 = this->unk_2A8; this->actor.focus.pos = this->unk_2A8; - this->unk_2E0 = 0; + this->csIdIndex = 0; break; case 1: @@ -312,7 +313,7 @@ void func_80B411DC(EnKgy* this, PlayState* play, s32 arg2) { this->unk_2B4 = this->zubora->actor.focus.pos; this->actor.focus.pos = this->zubora->actor.focus.pos; } - this->unk_2E0 = 1; + this->csIdIndex = 1; break; case 2: @@ -320,7 +321,7 @@ void func_80B411DC(EnKgy* this, PlayState* play, s32 arg2) { this->unk_2B4 = this->iceBlock->actor.world.pos; this->actor.focus.pos = this->iceBlock->actor.focus.pos; } - this->unk_2E0 = 2; + this->csIdIndex = 2; break; case 3: @@ -328,7 +329,7 @@ void func_80B411DC(EnKgy* this, PlayState* play, s32 arg2) { if (this->zubora != NULL) { this->actor.focus.pos = this->zubora->actor.focus.pos; } - this->unk_2E0 = 3; + this->csIdIndex = 3; break; case 4: @@ -336,13 +337,13 @@ void func_80B411DC(EnKgy* this, PlayState* play, s32 arg2) { this->unk_2B4 = this->zubora->actor.focus.pos; this->actor.focus.pos = this->zubora->actor.focus.pos; } - this->unk_2E0 = 4; + this->csIdIndex = 4; break; } } void func_80B41368(EnKgy* this, PlayState* play, s32 arg2) { - ActorCutscene_Stop(this->unk_2D4[this->unk_2E0]); + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); func_80B411DC(this, play, arg2); this->unk_2E6 = 20; this->unk_29C |= 2; @@ -353,8 +354,8 @@ void func_80B413C8(EnKgy* this) { this->unk_2B4 = sp1C; this->actor.focus.pos = sp1C; - ActorCutscene_Stop(this->unk_2D4[this->unk_2E0]); - this->unk_2E0 = -1; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = -1; this->unk_2E6 = 0; this->unk_29C &= ~2; } @@ -467,12 +468,12 @@ void func_80B417B8(EnKgy* this, PlayState* play) { void func_80B41858(EnKgy* this, PlayState* play) { func_80B4163C(this, play); - if (ActorCutscene_GetCanPlayNext(this->unk_2D4[5])) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D4[5], &this->actor); + if (CutsceneManager_IsNext(this->csIdList[5])) { + CutsceneManager_StartWithPlayerCs(this->csIdList[5], &this->actor); this->actionFunc = func_80B419B0; func_80B40E18(this, 7); } else { - ActorCutscene_SetIntentToPlay(this->unk_2D4[5]); + CutsceneManager_Queue(this->csIdList[5]); } } @@ -484,7 +485,7 @@ void func_80B418C4(EnKgy* this, PlayState* play) { Message_CloseTextbox(play); this->actor.textId = 0xC4F; func_80B413C8(this); - ActorCutscene_SetIntentToPlay(this->unk_2D4[5]); + CutsceneManager_Queue(this->csIdList[5]); this->actionFunc = func_80B41858; this->actor.flags &= ~ACTOR_FLAG_TALK_REQUESTED; } diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h index d9423783d2..8207678fd2 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.h @@ -25,8 +25,8 @@ typedef struct EnKgy { /* 0x2C0 */ Vec3f unk_2C0; /* 0x2CC */ Vec3s unk_2CC; /* 0x2D2 */ s16 unk_2D2; - /* 0x2D4 */ s16 unk_2D4[6]; - /* 0x2E0 */ s16 unk_2E0; + /* 0x2D4 */ s16 csIdList[6]; + /* 0x2E0 */ s16 csIdIndex; /* 0x2E2 */ s16 unk_2E2; /* 0x2E4 */ s16 unk_2E4; /* 0x2E6 */ s16 unk_2E6; diff --git a/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c b/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c index 3e54fd0f92..f3005ca05f 100644 --- a/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c +++ b/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c @@ -296,18 +296,18 @@ void EnKujiya_SetupTurnToOpen(EnKujiya* this) { } void EnKujiya_TurnToOpen(EnKujiya* this, PlayState* play) { - if (this->actor.cutscene != -1) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (this->actor.csId != CS_ID_NONE) { + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } if (!Math_SmoothStepToS(&this->actor.shape.rot.y, 0x7555, 0xA, 0x16C, 0x16C)) { if (this->timer > 20) { - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { - ActorCutscene_Stop(this->actor.cutscene); + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { + CutsceneManager_Stop(this->actor.csId); } EnKujiya_SetupWait(this); } else { @@ -324,18 +324,18 @@ void EnKujiya_SetupTurnToClosed(EnKujiya* this) { } void EnKujiya_TurnToClosed(EnKujiya* this, PlayState* play) { - if (this->actor.cutscene != -1) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (this->actor.csId != CS_ID_NONE) { + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } if (!Math_SmoothStepToS(&this->actor.shape.rot.y, 0, 0xA, 0x16C, 0x16C)) { if (this->timer > 20) { - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { - ActorCutscene_Stop(this->actor.cutscene); + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { + CutsceneManager_Stop(this->actor.csId); } EnKujiya_SetupWait(this); } else { diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 4432fcf6db..b858fc5029 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -329,7 +329,7 @@ void EnKusa_SpawnBugs(EnKusa* this, PlayState* play) { for (numBugs = 0; numBugs < 3; numBugs++) { Actor* bug = Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_INSECT, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1, - this->actor.cutscene, this->actor.halfDaysBits, 0); + this->actor.csId, this->actor.halfDaysBits, 0); if (bug == NULL) { break; diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index e178e7a4ec..8e2d194a69 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -100,10 +100,9 @@ void func_80A5B160(EnKusa2* this, PlayState* play) { if (this->unk_194[0] == NULL) { ptr = this->unk_194; - actor = (EnKusa2*)Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_KUSA2, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, - Rand_Next() >> 0x10, 0, 1, this->actor.cutscene, - this->actor.halfDaysBits, NULL); + actor = (EnKusa2*)Actor_SpawnAsChildAndCutscene( + &play->actorCtx, play, ACTOR_EN_KUSA2, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, Rand_Next() >> 0x10, 0, 1, this->actor.csId, this->actor.halfDaysBits, NULL); *ptr = actor; if (*ptr != NULL) { @@ -119,7 +118,7 @@ void func_80A5B160(EnKusa2* this, PlayState* play) { actor = (EnKusa2*)Actor_SpawnAsChildAndCutscene( &play->actorCtx, play, ACTOR_EN_KUSA2, (Math_SinS(temp_s1) * 80.0f) + this->actor.world.pos.x, this->actor.world.pos.y, (Math_CosS(temp_s1) * 80.0f) + this->actor.world.pos.z, 0, Rand_Next() >> 0x10, - 0, 1, this->actor.cutscene, this->actor.halfDaysBits, NULL); + 0, 1, this->actor.csId, this->actor.halfDaysBits, NULL); *ptr = actor; if (*ptr != NULL) { (*ptr)->actor.room = this->actor.room; @@ -160,7 +159,7 @@ void func_80A5B3BC(EnKusa2* this) { void func_80A5B490(EnKusa2* this, PlayState* play) { Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_KITAN, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, - ENKUSA2_GET_7F00(&this->actor) << 9, this->actor.cutscene, this->actor.halfDaysBits, + ENKUSA2_GET_7F00(&this->actor) << 9, this->actor.csId, this->actor.halfDaysBits, NULL); } diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 0bbbce26a2..1242de4baa 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -780,16 +780,16 @@ void EnMa4_SetupBeginEponasSongCs(EnMa4* this) { // Epona's Song cutscene is an ActorCutscene void EnMa4_BeginEponasSongCs(EnMa4* this, PlayState* play) { - s16 cutsceneIndex = this->actor.cutscene; + s16 csId = this->actor.csId; - if (ActorCutscene_GetCanPlayNext(cutsceneIndex) != 0) { - ActorCutscene_Start(cutsceneIndex, &this->actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_Start(csId, &this->actor); EnMa4_SetupEponasSongCs(this); } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(cutsceneIndex); + CutsceneManager_Queue(csId); } } @@ -798,17 +798,17 @@ void EnMa4_SetupEponasSongCs(EnMa4* this) { this->actionFunc = EnMa4_EponasSongCs; } -static u16 D_80AC0260 = 99; +static u16 sCueId = 99; void EnMa4_EponasSongCs(EnMa4* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 120)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 120); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_120)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_120); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - if (play->csCtx.actorActions[actionIndex]->action != D_80AC0260) { - D_80AC0260 = play->csCtx.actorActions[actionIndex]->action; + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + if (sCueId != play->csCtx.actorCues[cueChannel]->id) { + sCueId = play->csCtx.actorCues[cueChannel]->id; this->animTimer = 0; - switch (play->csCtx.actorActions[actionIndex]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->hasBow = true; EnMa4_ChangeAnim(this, 1); @@ -822,8 +822,8 @@ void EnMa4_EponasSongCs(EnMa4* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); - if (D_80AC0260 == 2 && this->animTimer == 0 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); + if (sCueId == 2 && this->animTimer == 0 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { EnMa4_ChangeAnim(this, 7); } } else { @@ -831,7 +831,7 @@ void EnMa4_EponasSongCs(EnMa4* this, PlayState* play) { player->stateFlags1 |= PLAYER_STATE1_20; func_800B85E0(&this->actor, play, 200.0f, PLAYER_IA_MINUS1); - D_80AC0260 = 99; + sCueId = 99; this->hasBow = true; EnMa4_SetupEndEponasSongCs(this); } diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index 89f1582ba2..6d0b027ebc 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -1005,14 +1005,14 @@ void EnMaYto_SetupBeginWarmFuzzyFeelingCs(EnMaYto* this) { } void EnMaYto_BeginWarmFuzzyFeelingCs(EnMaYto* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); EnMaYto_SetupWarmFuzzyFeelingCs(this); } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -1021,20 +1021,20 @@ void EnMaYto_SetupWarmFuzzyFeelingCs(EnMaYto* this) { this->actionFunc = EnMaYto_WarmFuzzyFeelingCs; } -static u16 D_80B915F0 = 99; +static u16 sCueId = 99; void EnMaYto_WarmFuzzyFeelingCs(EnMaYto* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 556)) { - s32 csActionIndex = Cutscene_GetActorActionIndex(play, 556); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_556)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_556); - if (play->csCtx.frames == play->csCtx.actorActions[csActionIndex]->startFrame) { - u16 action = play->csCtx.actorActions[csActionIndex]->action; + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + u16 cueId = play->csCtx.actorCues[cueChannel]->id; if (1) {} - if (action != D_80B915F0) { - D_80B915F0 = action; - switch (action) { + if (cueId != sCueId) { + sCueId = cueId; + switch (cueId) { case 1: EnMaYto_ChangeAnim(this, 0); break; @@ -1051,13 +1051,13 @@ void EnMaYto_WarmFuzzyFeelingCs(EnMaYto* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, csActionIndex); - if (D_80B915F0 == 2 && this->skelAnime.animation == &gCremiaHugStartAnim && + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); + if (sCueId == 2 && this->skelAnime.animation == &gCremiaHugStartAnim && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { EnMaYto_ChangeAnim(this, 20); } } else { - D_80B915F0 = 99; + sCueId = 99; } } @@ -1068,7 +1068,7 @@ void EnMaYto_SetupPostMilkRunWaitDialogueEnd(EnMaYto* this) { void EnMaYto_PostMilkRunWaitDialogueEnd(EnMaYto* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE || Message_GetState(&play->msgCtx) == TEXT_STATE_5) { if (Message_ShouldAdvance(play) && Message_GetState(&play->msgCtx) == TEXT_STATE_5) { - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); Message_CloseTextbox(play); } } diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c index 1987fa72a0..edf0e41f2c 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c @@ -377,16 +377,16 @@ void EnMaYts_SetupEndCreditsHandler(EnMaYts* this) { this->actionFunc = EnMaYts_EndCreditsHandler; } -static u16 D_80B8E32C = 99; +static u16 sCueId = 99; void EnMaYts_EndCreditsHandler(EnMaYts* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 120)) { - s32 actionIndex = Cutscene_GetActorActionIndex(play, 120); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_120)) { + s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_120); - if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) { - if (play->csCtx.actorActions[actionIndex]->action != D_80B8E32C) { - D_80B8E32C = play->csCtx.actorActions[actionIndex]->action; + if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) { + if (sCueId != play->csCtx.actorCues[cueChannel]->id) { + sCueId = play->csCtx.actorCues[cueChannel]->id; this->endCreditsFlag = 0; - switch (play->csCtx.actorActions[actionIndex]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->hasBow = true; EnMaYts_ChangeAnim(this, 0); @@ -410,14 +410,14 @@ void EnMaYts_EndCreditsHandler(EnMaYts* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); - if ((D_80B8E32C == 2) && (this->endCreditsFlag == 0) && + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); + if ((sCueId == 2) && (this->endCreditsFlag == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->endCreditsFlag++; EnMaYts_ChangeAnim(this, 5); } } else { - D_80B8E32C = 99; + sCueId = 99; this->hasBow = true; } } diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 513964338f..15aa42bda4 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -239,7 +239,7 @@ void EnMag_Update(Actor* thisx, PlayState* play) { CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) || CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_B)) { - if (!EnvFlags_Get(play, 4)) { + if (!CutsceneFlags_Get(play, 4)) { play_sound(NA_SE_SY_PIECE_OF_HEART); this->state = MAG_STATE_CALLED; this->unk11F00 = 0; @@ -383,16 +383,16 @@ void EnMag_Update(Actor* thisx, PlayState* play) { CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_B)) { if (play->transitionTrigger != TRANS_TRIGGER_START) { Audio_SetCutsceneFlag(false); - D_801BB12C++; - if (D_801BB12C >= 2) { - D_801BB12C = 0; + gOpeningEntranceIndex++; + if (gOpeningEntranceIndex >= 2) { + gOpeningEntranceIndex = 0; } play_sound(NA_SE_SY_PIECE_OF_HEART); gSaveContext.gameMode = GAMEMODE_FILE_SELECT; play->transitionTrigger = TRANS_TRIGGER_START; play->transitionType = TRANS_TYPE_FADE_BLACK; play->nextEntrance = ENTRANCE(CUTSCENE, 0); - gSaveContext.save.cutscene = 0; + gSaveContext.save.cutsceneIndex = 0; gSaveContext.sceneLayer = 0; } this->unk11F54 = 15; @@ -438,12 +438,12 @@ void EnMag_Update(Actor* thisx, PlayState* play) { } if (this->state == MAG_STATE_INITIAL) { - if (EnvFlags_Get(play, 3)) { + if (CutsceneFlags_Get(play, 3)) { this->unk11F02 = 40; this->state = MAG_STATE_FADE_IN_MASK_EFFECTS; } } else if (this->state < MAG_STATE_FADE_OUT) { - if (EnvFlags_Get(play, 4)) { + if (CutsceneFlags_Get(play, 4)) { this->state = MAG_STATE_FADE_OUT; } } diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c index 2a81da5837..7ac16e1b0f 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -263,7 +263,7 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, PlayState* play) { break; case 0xD82: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { Message_ContinueTextbox(play, 0xD83); } else { Message_ContinueTextbox(play, 0xD86); @@ -277,9 +277,9 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, PlayState* play) { Message_CloseTextbox(play); EnMinifrog_SpawnDust(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EN_NPC_FADEAWAY); - if (this->actor.cutscene != -1) { - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { - ActorCutscene_Stop(this->actor.cutscene); + if (this->actor.csId != CS_ID_NONE) { + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { + CutsceneManager_Stop(this->actor.csId); } } @@ -289,14 +289,14 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, PlayState* play) { } if (this->flags & 1) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); this->flags &= ~1; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } @@ -319,7 +319,7 @@ void EnMinifrog_Idle(EnMinifrog* this, PlayState* play) { EnMinifrog_JumpTimer(this); if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = EnMinifrog_ReturnFrogCutscene; - if (this->actor.cutscene != -1) { + if (this->actor.csId != CS_ID_NONE) { this->flags |= 1; } } else if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, play) && @@ -366,19 +366,19 @@ void EnMinifrog_CheckChoirSuccess(EnMinifrog* this, PlayState* play) { void EnMinifrog_ContinueChoirCutscene(EnMinifrog* this, PlayState* play) { EnMinifrog_Jump(this); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { EnMinifrog_CheckChoirSuccess(this, play); return; // necessary to match - } else if (ActorCutscene_GetCanPlayNext(0x7C)) { - ActorCutscene_Start(0x7C, NULL); + } else if (CutsceneManager_IsNext(CS_ID_GLOBAL_TALK)) { + CutsceneManager_Start(CS_ID_GLOBAL_TALK, NULL); EnMinifrog_CheckChoirSuccess(this, play); return; // necessary to match - } else if (this->actor.cutscene != -1 && ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { - ActorCutscene_Stop(this->actor.cutscene); - ActorCutscene_SetIntentToPlay(0x7C); + } else if ((this->actor.csId != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() == this->actor.csId)) { + CutsceneManager_Stop(this->actor.csId); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); return; // necessary to match } else { - ActorCutscene_SetIntentToPlay(0x7C); + CutsceneManager_Queue(CS_ID_GLOBAL_TALK); } } @@ -440,20 +440,20 @@ void EnMinifrog_SetupNextFrogChoir(EnMinifrog* this, PlayState* play) { void EnMinifrog_BeginChoirCutscene(EnMinifrog* this, PlayState* play) { EnMinifrog_Jump(this); - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { this->actionFunc = EnMinifrog_SetupNextFrogChoir; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); this->actionFunc = EnMinifrog_SetupNextFrogChoir; this->timer = 5; func_801A1F00(3, NA_BGM_FROG_SONG); this->flags |= 0x100; play->setPlayerTalkAnim(play, &gPlayerAnim_pn_gakkiplay, ANIMMODE_LOOP); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 930fb13d56..616481d852 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -76,7 +76,7 @@ s32 func_809592E0(EnMk* this, s16 index) { void EnMk_Init(Actor* thisx, PlayState* play) { EnMk* this = THIS; - s16 cs; + s16 csId; s32 i; this->actor.terminalVelocity = -4.0f; @@ -101,16 +101,16 @@ void EnMk_Init(Actor* thisx, PlayState* play) { this->unk_27A |= 2; } - cs = this->actor.cutscene; - for (i = 0; i < ARRAY_COUNT(this->unk_276); i++) { - this->unk_276[i] = cs; - if (cs != -1) { - this->actor.cutscene = cs; - cs = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + csId = this->actor.csId; + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = csId; + if (csId != CS_ID_NONE) { + this->actor.csId = csId; + csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } } - this->actor.cutscene = this->unk_276[0]; + this->actor.csId = this->csIdList[0]; } void EnMk_Destroy(Actor* thisx, PlayState* play) { @@ -124,16 +124,16 @@ s32 func_80959524(PlayState* play) { } void func_8095954C(EnMk* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 0x7F)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 0x7F)); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_127)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_127)); - switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x7F)]->action) { + switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_127)]->id) { case 1: case 2: case 3: case 4: case 5: - func_809592E0(this, play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x7F)]->action - 1); + func_809592E0(this, play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_127)]->id - 1); break; } } else { @@ -147,7 +147,7 @@ void func_80959624(EnMk* this, PlayState* play) { if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA) { if (this->unk_27A & 4) { textId = 0xFB9; - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { textId = 0xFBC; } else { textId = 0xFBB; @@ -212,7 +212,7 @@ void func_80959844(EnMk* this, PlayState* play) { switch (gSaveContext.save.playerForm) { case PLAYER_FORM_DEKU: if (CHECK_WEEKEVENTREG(WEEKEVENTREG_19_10)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { textId = 0xFAF; } else { textId = 0xFAE; @@ -224,7 +224,7 @@ void func_80959844(EnMk* this, PlayState* play) { case PLAYER_FORM_GORON: if (CHECK_WEEKEVENTREG(WEEKEVENTREG_19_08)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { textId = 0xFAB; } else { textId = 0xFAA; @@ -239,7 +239,7 @@ void func_80959844(EnMk* this, PlayState* play) { if (func_80959524(play) > 0) { textId = 0xFA7; } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_19_04)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { textId = 0xFBF; } else { textId = 0xFA6; @@ -283,7 +283,7 @@ void func_80959A24(EnMk* this, PlayState* play) { break; case 0xFA2: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Message_CloseTextbox(play); this->actionFunc = func_80959E18; } else { @@ -314,7 +314,7 @@ void func_80959A24(EnMk* this, PlayState* play) { case 0xFA8: SET_WEEKEVENTREG(WEEKEVENTREG_19_08); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Message_ContinueTextbox(play, 0xFBD); } else { Message_ContinueTextbox(play, 0xFA9); @@ -323,7 +323,7 @@ void func_80959A24(EnMk* this, PlayState* play) { case 0xFAC: SET_WEEKEVENTREG(WEEKEVENTREG_19_10); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Message_ContinueTextbox(play, 0xFBE); } else { Message_ContinueTextbox(play, 0xFAD); @@ -372,7 +372,7 @@ void func_80959C94(EnMk* this, PlayState* play) { void func_80959D28(EnMk* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if ((play->csCtx.state == 0) && (this->actor.cutscene == -1)) { + if ((play->csCtx.state == 0) && (this->actor.csId == CS_ID_NONE)) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_40)) { this->unk_27A &= ~1; this->actionFunc = func_80959774; @@ -381,14 +381,14 @@ void func_80959D28(EnMk* this, PlayState* play) { } else { this->actionFunc = func_80959E18; } - this->actor.cutscene = this->unk_276[0]; + this->actor.csId = this->csIdList[0]; } else { - if (this->actor.cutscene != -1) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); - this->actor.cutscene = -1; + if (this->actor.csId != CS_ID_NONE) { + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); + this->actor.csId = CS_ID_NONE; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } func_8095954C(this, play); @@ -412,13 +412,13 @@ void func_80959E18(EnMk* this, PlayState* play) { play->msgCtx.ocarinaMode = 4; this->actionFunc = func_80959D28; if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA) { - this->actor.cutscene = this->unk_276[0]; + this->actor.csId = this->csIdList[0]; SET_WEEKEVENTREG(WEEKEVENTREG_20_40); Item_Give(play, ITEM_SONG_NOVA); } else { - this->actor.cutscene = this->unk_276[1]; + this->actor.csId = this->csIdList[1]; } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } else if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { func_80959844(this, play); this->actionFunc = func_80959A24; @@ -449,7 +449,7 @@ void EnMk_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if ((this->unk_27A & 1) && !Cutscene_CheckActorAction(play, 0x7F)) { + if ((this->unk_27A & 1) && !Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_127)) { Actor_TrackPlayer(play, &this->actor, &this->unk_270, &sp38, this->actor.focus.pos); } else { Math_SmoothStepToS(&this->unk_270.x, 0, 6, 0x1838, 0x64); diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.h b/src/overlays/actors/ovl_En_Mk/z_en_mk.h index bbf126f4ee..518b0406dc 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.h +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.h @@ -15,7 +15,7 @@ typedef struct EnMk { /* 0x1D4 */ Vec3s jointTable[OBJECT_MK_LIMB_MAX]; /* 0x222 */ Vec3s morphTable[OBJECT_MK_LIMB_MAX]; /* 0x270 */ Vec3s unk_270; - /* 0x276 */ s16 unk_276[2]; + /* 0x276 */ s16 csIdList[2]; /* 0x27A */ u16 unk_27A; /* 0x27C */ s16 unk_27C; /* 0x280 */ EnMkActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 3aef8341a0..67a0a1e774 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -87,7 +87,7 @@ void EnMm_Init(Actor* thisx, PlayState* play) { func_80965BBC(this); return; } - if (this->actor.cutscene >= 0) { + if (this->actor.csId >= 0) { action = func_80965D3C; } else { action = func_80965DB4; @@ -102,13 +102,13 @@ void EnMm_Destroy(Actor* thisx, PlayState* play) { } void func_80965D3C(EnMm* this, PlayState* play) { - s16 cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + s16 csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); - if (ActorCutscene_GetCanPlayNext(cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(cutscene, &this->actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); EnMm_SetupAction(this, func_80965DB4); } else { - ActorCutscene_SetIntentToPlay(cutscene); + CutsceneManager_Queue(csId); } } diff --git a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c index e772e12fa0..c94a94b124 100644 --- a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c +++ b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c @@ -235,7 +235,7 @@ s32 EnMttag_UpdateCheckpoints(EnMttag* this, PlayState* play) { s32 EnMttag_ExitRace(PlayState* play, s32 transitionType, s32 nextTransitionType) { CUR_FORM_EQUIP(EQUIP_SLOT_B) = ITEM_SWORD_KOKIRI; play->nextEntrance = ENTRANCE(GORON_RACETRACK, 2); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { // Spring gSaveContext.nextCutsceneIndex = 0xFFF0; } else { @@ -256,7 +256,7 @@ s32 EnMttag_ExitRace(PlayState* play, s32 transitionType, s32 nextTransitionType void EnMttag_ShowFalseStartMessage(EnMttag* this, PlayState* play) { gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_OFF; Message_StartTextbox(play, 0xE95, NULL); // An entrant made a false start - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 20); this->actionFunc = EnMttag_PotentiallyRestartRace; } @@ -267,7 +267,7 @@ void EnMttag_ShowFalseStartMessage(EnMttag* this, PlayState* play) { */ void EnMttag_ShowCantWinMessage(EnMttag* this, PlayState* play) { Message_StartTextbox(play, 0xE97, NULL); // You can't win now... - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); this->actionFunc = EnMttag_HandleCantWinChoice; } @@ -275,11 +275,11 @@ void EnMttag_ShowCantWinMessage(EnMttag* this, PlayState* play) { * Shows the cutscene that pans over the race track and shows all five race entrants. */ void EnMttag_ShowIntroCutscene(EnMttag* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->actionFunc = EnMttag_WaitForIntroCutsceneToEnd; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -288,7 +288,7 @@ void EnMttag_ShowIntroCutscene(EnMttag* this, PlayState* play) { * from showing again and starts the race. */ void EnMttag_WaitForIntroCutsceneToEnd(EnMttag* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() != this->actor.csId) { SET_WEEKEVENTREG(WEEKEVENTREG_12_02); this->actionFunc = EnMttag_RaceStart; } @@ -421,7 +421,7 @@ void EnMttag_PotentiallyRestartRace(EnMttag* this, PlayState* play) { if (this->shouldRestartRace) { play->nextEntrance = ENTRANCE(GORON_RACETRACK, 1); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { // Spring gSaveContext.nextCutsceneIndex = 0xFFF0; } else { @@ -433,7 +433,7 @@ void EnMttag_PotentiallyRestartRace(EnMttag* this, PlayState* play) { play->transitionType = TRANS_TYPE_FADE_BLACK; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK; Message_CloseTextbox(play); - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); Magic_Add(play, MAGIC_FILL_TO_CAPACITY); CLEAR_EVENTINF(EVENTINF_10); @@ -468,7 +468,7 @@ void EnMttag_HandleCantWinChoice(EnMttag* this, PlayState* play) { // Keep racing func_8019F208(); Message_CloseTextbox(play); - func_800B7298(play, &this->actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->actor, PLAYER_CSMODE_END); CLEAR_EVENTINF(EVENTINF_13); this->timer = 100; this->actionFunc = EnMttag_Race; diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c index 2d77519bdd..4bf4db0e04 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -178,7 +178,7 @@ void func_80A68A78(EnMushi2* this, PlayState* play) { Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_MUSHI2, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y + (D_80A6B998 + i)->unk_02, this->actor.shape.rot.z, - (D_80A6B998 + i)->unk_00, this->actor.cutscene, this->actor.halfDaysBits, NULL); + (D_80A6B998 + i)->unk_00, this->actor.csId, this->actor.halfDaysBits, NULL); } } diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index b5d558a711..c5a8b24980 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -227,31 +227,31 @@ Actor* func_80BBFF90(EnNb* this, PlayState* play) { return actor; } -s32 func_80BBFFD4(EnNb* this, s16 index) { +s32 func_80BBFFD4(EnNb* this, s16 csId) { s32 ret = false; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(index); - } else if (ActorCutscene_GetCanPlayNext(index)) { - ActorCutscene_StartAndSetUnkLinkFields(index, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(csId); + } else if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); ret = true; } else { - ActorCutscene_SetIntentToPlay(index); + CutsceneManager_Queue(csId); } return ret; } -s16 func_80BC0050(EnNb* this, s32 arg1) { - s16 cutscene = this->actor.cutscene; +s16 func_80BC0050(EnNb* this, s32 numCutscenes) { + s16 csId = this->actor.csId; s32 i; - for (i = 0; i < arg1; i++) { - cutscene = ActorCutscene_GetAdditionalCutscene(cutscene); + for (i = 0; i < numCutscenes; i++) { + csId = CutsceneManager_GetAdditionalCsId(csId); } - return cutscene; + return csId; } typedef enum EnNbBehaviour { @@ -269,12 +269,12 @@ typedef enum EnNbBehaviour { s32 func_80BC00AC(Actor* thisx, PlayState* play) { EnNb* this = THIS; - s16 cutscene = func_80BC0050(this, 0); + s16 csId = func_80BC0050(this, 0); s32 ret = false; switch (this->behaviour) { case ENNB_BEHAVIOUR_0: - if (!func_80BBFFD4(this, cutscene)) { + if (!func_80BBFFD4(this, csId)) { break; } // fallthrough @@ -282,7 +282,7 @@ s32 func_80BC00AC(Actor* thisx, PlayState* play) { case ENNB_BEHAVIOUR_4: case ENNB_BEHAVIOUR_6: case ENNB_BEHAVIOUR_8: - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(cutscene)), &this->actor); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), &this->actor); this->behaviour++; ret = true; break; @@ -292,7 +292,7 @@ s32 func_80BC00AC(Actor* thisx, PlayState* play) { case ENNB_BEHAVIOUR_5: case ENNB_BEHAVIOUR_7: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(cutscene)), + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), this->actor.child); } this->behaviour++; @@ -300,7 +300,7 @@ s32 func_80BC00AC(Actor* thisx, PlayState* play) { break; case ENNB_BEHAVIOUR_9: - ActorCutscene_Stop(cutscene); + CutsceneManager_Stop(csId); this->behaviour++; ret = true; break; @@ -745,7 +745,7 @@ void EnNb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, EnNb* this = THIS; Vec3f focusTarget; - if ((ActorCutscene_GetCurrentIndex() == -1) && (limbIndex == NB_LIMB_HEAD)) { + if ((CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && (limbIndex == NB_LIMB_HEAD)) { Matrix_MultVec3f(&gZeroVec3f, &focusTarget); Math_ApproachF(&thisx->focus.pos.x, focusTarget.x, 0.6f, 10000.0f); Math_ApproachF(&thisx->focus.pos.y, focusTarget.y, 0.6f, 10000.0f); diff --git a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c index 929a3c90dc..cd20f489c5 100644 --- a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c +++ b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c @@ -86,14 +86,14 @@ Actor* func_80B11F44(PlayState* play) { void func_80B11F78(EnOnpuman* this, PlayState* play) { if (play->msgCtx.ocarinaMode == 4) { this->actionFunc = func_80B121D8; - if (this->actor.cutscene != -1) { - ActorCutscene_Stop(this->actor.cutscene); + if (this->actor.csId != CS_ID_NONE) { + CutsceneManager_Stop(this->actor.csId); } } else if (play->msgCtx.ocarinaMode == 3) { play_sound(NA_SE_SY_CORRECT_CHIME); play->msgCtx.ocarinaMode = 4; - if (this->actor.cutscene != -1) { - ActorCutscene_Stop(this->actor.cutscene); + if (this->actor.csId != CS_ID_NONE) { + CutsceneManager_Stop(this->actor.csId); } this->actionFunc = func_80B121D8; } @@ -126,13 +126,13 @@ void func_80B1202C(EnOnpuman* this, PlayState* play2) { } } if (this->unk_2A4 & 1) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { this->unk_2A4 &= ~1; - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + } else if (CutsceneManager_IsNext(this->actor.csId)) { this->unk_2A4 &= ~1; - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } diff --git a/src/overlays/actors/ovl_En_Osk/z_en_osk.c b/src/overlays/actors/ovl_En_Osk/z_en_osk.c index 2b938a35f2..3f10f6771c 100644 --- a/src/overlays/actors/ovl_En_Osk/z_en_osk.c +++ b/src/overlays/actors/ovl_En_Osk/z_en_osk.c @@ -66,7 +66,7 @@ void EnOsk_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BF5F60; this->unk_254 = -1; - this->unk_256 = -1; + this->cueId = -1; this->actor.flags &= ~ACTOR_FLAG_1; switch (ENOSK_GET_F(&this->actor)) { @@ -75,7 +75,7 @@ void EnOsk_Init(Actor* thisx, PlayState* play) { this->jointTable, this->morphTable, 7); Animation_PlayLoop(&this->skelAnime, &object_ikn_demo_Anim_006808); this->actionFunc = func_80BF656C; - this->unk_258 = 0x210; + this->cueType = CS_CMD_ACTOR_CUE_528; break; case ENOSK_2: @@ -83,7 +83,7 @@ void EnOsk_Init(Actor* thisx, PlayState* play) { this->jointTable, this->morphTable, 7); Animation_PlayLoop(&this->skelAnime, &object_ikn_demo_Anim_006808); this->actionFunc = func_80BF6A20; - this->unk_258 = 0x211; + this->cueType = CS_CMD_ACTOR_CUE_529; break; default: @@ -92,7 +92,7 @@ void EnOsk_Init(Actor* thisx, PlayState* play) { this->jointTable, this->morphTable, 17); Animation_PlayLoop(&this->skelAnime, &object_ikn_demo_Anim_0000B8); this->actionFunc = func_80BF61EC; - this->unk_258 = 0x212; + this->cueType = CS_CMD_ACTOR_CUE_530; this->actor.home.rot.z = 0; this->unk_25C = 0.0f; break; @@ -129,12 +129,12 @@ void func_80BF5F60(EnOsk* this, PlayState* play) { } void func_80BF5F70(EnOsk* this) { - if ((this->unk_256 != 1) && (this->unk_256 != 6)) { + if ((this->cueId != 1) && (this->cueId != 6)) { this->actor.draw = EnOsk_Draw; Actor_SetScale(&this->actor, 0.017f); } - switch (this->unk_256) { + switch (this->cueId) { case 1: this->actor.draw = NULL; break; @@ -205,10 +205,10 @@ void func_80BF609C(EnOsk* this, PlayState* play) { void func_80BF61EC(EnOsk* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Cutscene_CheckActorAction(play, this->unk_258)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->unk_258)); - if (this->unk_256 != play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_258)]->action) { - this->unk_256 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_258)]->action; + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + if (this->cueId != play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) { + this->cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; func_80BF5F70(this); } func_80BF609C(this, play); @@ -216,7 +216,7 @@ void func_80BF61EC(EnOsk* this, PlayState* play) { this->actor.draw = NULL; } - if (this->unk_256 == 6) { + if (this->cueId == 6) { if (this->actor.scale.x > 0.85f * 0.001f) { this->actor.scale.x -= 0.85f * 0.001f; Actor_SetScale(&this->actor, this->actor.scale.x); @@ -229,12 +229,12 @@ void func_80BF61EC(EnOsk* this, PlayState* play) { } void func_80BF6314(EnOsk* this) { - if ((this->unk_256 != 1) && (this->unk_256 != 9)) { + if ((this->cueId != 1) && (this->cueId != 9)) { this->actor.draw = EnOsk_Draw; Actor_SetScale(&this->actor, 0.013f); } - switch (this->unk_256) { + switch (this->cueId) { case 1: this->actor.draw = NULL; break; @@ -329,10 +329,10 @@ void func_80BF656C(EnOsk* this, PlayState* play) { } } - if (Cutscene_CheckActorAction(play, this->unk_258)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->unk_258)); - if (this->unk_256 != play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_258)]->action) { - this->unk_256 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_258)]->action; + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + if (this->cueId != play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) { + this->cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; func_80BF6314(this); } func_80BF6478(this); @@ -340,12 +340,12 @@ void func_80BF656C(EnOsk* this, PlayState* play) { this->actor.draw = NULL; } - if ((this->unk_256 == 2) && (this->actor.scale.x < 13.0f * 0.001f)) { + if ((this->cueId == 2) && (this->actor.scale.x < 13.0f * 0.001f)) { this->actor.scale.x += 0.65f * 0.001f; Actor_SetScale(&this->actor, this->actor.scale.x); } - if (this->unk_256 == 9) { + if (this->cueId == 9) { if (this->actor.scale.x > 0.65f * 0.001f) { this->actor.scale.x -= 0.65f * 0.001f; Actor_SetScale(&this->actor, this->actor.scale.x); @@ -358,12 +358,12 @@ void func_80BF656C(EnOsk* this, PlayState* play) { } void func_80BF67A8(EnOsk* this) { - if ((this->unk_256 != 1) && (this->unk_256 != 8)) { + if ((this->cueId != 1) && (this->cueId != 8)) { this->actor.draw = EnOsk_Draw; Actor_SetScale(&this->actor, 0.013f); } - switch (this->unk_256) { + switch (this->cueId) { case 1: this->actor.draw = NULL; break; @@ -466,10 +466,10 @@ void func_80BF6A20(EnOsk* this, PlayState* play) { } } - if (Cutscene_CheckActorAction(play, this->unk_258)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->unk_258)); - if (this->unk_256 != play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_258)]->action) { - this->unk_256 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_258)]->action; + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + if (this->cueId != play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) { + this->cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; func_80BF67A8(this); } func_80BF68E0(this); @@ -477,7 +477,7 @@ void func_80BF6A20(EnOsk* this, PlayState* play) { this->actor.draw = NULL; } - if (this->unk_256 == 8) { + if (this->cueId == 8) { if (this->actor.scale.x > 0.65f * 0.001f) { this->actor.scale.x -= 0.65f * 0.001f; Actor_SetScale(&this->actor, this->actor.scale.x); diff --git a/src/overlays/actors/ovl_En_Osk/z_en_osk.h b/src/overlays/actors/ovl_En_Osk/z_en_osk.h index 0358911d36..c83cc5d914 100644 --- a/src/overlays/actors/ovl_En_Osk/z_en_osk.h +++ b/src/overlays/actors/ovl_En_Osk/z_en_osk.h @@ -18,8 +18,8 @@ typedef struct EnOsk { /* 0x188 */ Vec3s jointTable[17]; /* 0x1EE */ Vec3s morphTable[17]; /* 0x254 */ s16 unk_254; - /* 0x256 */ s16 unk_256; - /* 0x258 */ u16 unk_258; + /* 0x256 */ s16 cueId; + /* 0x258 */ u16 cueType; /* 0x25C */ f32 unk_25C; /* 0x260 */ EnOskActionFunc actionFunc; } EnOsk; // size = 0x264 diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.c b/src/overlays/actors/ovl_En_Osn/z_en_osn.c index e5540a2927..6cc29578a1 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.c +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.c @@ -692,14 +692,14 @@ void EnOsn_HandleConversation(EnOsn* this, PlayState* play) { } void EnOsn_InitCutscene(EnOsn* this) { - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; if ((gSaveContext.save.saveInfo.inventory.items[SLOT_OCARINA] == ITEM_NONE) || (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU)) { - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); if ((gSaveContext.save.saveInfo.inventory.items[SLOT_OCARINA] != ITEM_NONE) || (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU)) { - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); } } } @@ -707,7 +707,7 @@ void EnOsn_InitCutscene(EnOsn* this) { void EnOsn_ChooseAction(EnOsn* this, PlayState* play) { u32 isFlagSet = Flags_GetSwitch(play, 0); - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, OSN_ANIM_IDLE); if (!isFlagSet) { @@ -739,27 +739,27 @@ void EnOsn_Idle(EnOsn* this, PlayState* play) { } void EnOsn_StartCutscene(EnOsn* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_Start(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, &this->actor); this->actionFunc = EnOsn_HandleCsAction; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } void EnOsn_HandleCsAction(EnOsn* this, PlayState* play) { u8 pad; - s32 actionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 130)) { - actionIndex = Cutscene_GetActorActionIndex(play, 130); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_130)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_130); this->shouldRotateHead = false; - if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { - this->csAction = play->csCtx.actorActions[actionIndex]->action; - switch (play->csCtx.actorActions[actionIndex]->action) { + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->animIndex = OSN_ANIM_BOWING; break; @@ -852,7 +852,7 @@ void EnOsn_HandleCsAction(EnOsn* this, PlayState* play) { } if ((this->animIndex == OSN_ANIM_BELIEVE) && (play->sceneId == SCENE_SPOT00) && - (gSaveContext.sceneLayer == 0xB) && (play->csCtx.frames == 400)) { + (gSaveContext.sceneLayer == 0xB) && (play->csCtx.curFrame == 400)) { Actor_PlaySfx(&this->actor, NA_SE_VO_OMVO00); } @@ -874,10 +874,10 @@ void EnOsn_HandleCsAction(EnOsn* this, PlayState* play) { (Animation_OnFrame(&this->skelAnime, 57.0f)) || (Animation_OnFrame(&this->skelAnime, 67.0f)))) { Actor_PlaySfx(&this->actor, NA_SE_EV_OMENYA_WALK); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); } else { this->shouldRotateHead = true; - this->csAction = 0x63; + this->cueId = 99; EnOsn_ChooseAction(this, play); } } diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.h b/src/overlays/actors/ovl_En_Osn/z_en_osn.h index 638f31e4e0..906c0b6c9b 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.h +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.h @@ -26,8 +26,8 @@ typedef struct EnOsn { /* 0x1E4 */ UNK_TYPE1 unk_1E4[0x6]; /* 0x1EA */ u16 stateFlags; /* 0x1EC */ u8 animIndex; - /* 0x1ED */ u8 csAction; - /* 0x1EE */ s16 cutscene; + /* 0x1ED */ u8 cueId; + /* 0x1EE */ s16 csId; /* 0x1F0 */ u8 shouldRotateHead; /* 0x1F1 */ UNK_TYPE1 unk_1F1[0x3]; /* 0x1F4 */ u16 textId; diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index c26a1a2c7e..2444acca53 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -310,7 +310,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) { play->interfaceCtx.unk_222 = 0; play->interfaceCtx.unk_224 = 0; if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED; } if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) { @@ -369,11 +369,11 @@ void EnOssan_Idle(EnOssan* this, PlayState* play) { player->stateFlags2 |= PLAYER_STATE2_20000000; EnOssan_SetupAction(this, EnOssan_BeginInteraction); if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING; } } else { @@ -397,11 +397,11 @@ void EnOssan_BeginInteraction(EnOssan* this, PlayState* play) { frameCount = 0; } if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENOSSAN_CUTSCENESTATE_PLAYING; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } if (this->actor.params == ENOSSAN_CURIOSITY_SHOP_MAN) { @@ -622,11 +622,11 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) { u8 cursorIndex; if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING; } else { if (talkState == TEXT_STATE_CHOICE) { @@ -676,26 +676,26 @@ void EnOssan_TalkToShopkeeper(EnOssan* this, PlayState* play) { void EnOssan_LookToLeftShelf(EnOssan* this, PlayState* play) { if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED; } if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToLeftShelfCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToLeftShelfCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING; } else { if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENOSSAN_CUTSCENESTATE_PLAYING; EnOssan_UpdateCursorPos(play, this); EnOssan_SetupAction(this, EnOssan_BrowseLeftShelf); Message_ContinueTextbox(play, this->items[this->cursorIndex]->actor.textId); } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } this->stickAccumX = 0; @@ -704,26 +704,26 @@ void EnOssan_LookToLeftShelf(EnOssan* this, PlayState* play) { void EnOssan_LookToRightShelf(EnOssan* this, PlayState* play) { if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED; } if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToRightShelfCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToRightShelfCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING; } else { if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENOSSAN_CUTSCENESTATE_PLAYING; EnOssan_UpdateCursorPos(play, this); EnOssan_SetupAction(this, EnOssan_BrowseRightShelf); Message_ContinueTextbox(play, this->items[this->cursorIndex]->actor.textId); } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } this->stickAccumX = 0; @@ -956,24 +956,24 @@ void EnOssan_BrowseRightShelf(EnOssan* this, PlayState* play) { void EnOssan_LookToShopkeeperFromShelf(EnOssan* this, PlayState* play) { if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED; } if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopKeeperFromShelfCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopKeeperFromShelfCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING; } else if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENOSSAN_CUTSCENESTATE_PLAYING; EnOssan_UpdateCursorPos(play, this); EnOssan_StartShopping(play, this); } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -1006,7 +1006,7 @@ void EnOssan_HandleCanBuyItem(PlayState* play, EnOssan* this) { switch (item->canBuyFunc(play, item)) { case CANBUY_RESULT_SUCCESS_1: if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED; } func_8019F208(); @@ -1103,11 +1103,11 @@ void EnOssan_SetupItemPurchased(EnOssan* this, PlayState* play) { play->msgCtx.stateTimer = 4; EnOssan_SetupAction(this, EnOssan_ItemPurchased); if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } @@ -1158,17 +1158,17 @@ void EnOssan_ItemPurchased(EnOssan* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); player->stateFlags2 |= PLAYER_STATE2_20000000; EnOssan_SetupAction(this, EnOssan_ContinueShopping); this->cutsceneState = ENOSSAN_CUTSCENESTATE_PLAYING; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } } if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { @@ -1474,7 +1474,7 @@ void EnOssan_InitShop(EnOssan* this, PlayState* play) { this->cursorPos.y = this->cursorPos.x = 100.0f; this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED; - this->cutscene = this->lookToShopkeeperCutscene; + this->csId = this->lookToShopkeeperCsId; this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.cylRadius = 50; this->stickAccumX = this->stickAccumY = 0; @@ -1538,10 +1538,10 @@ void EnOssan_InitShop(EnOssan* this, PlayState* play) { } void EnOssan_GetCutscenes(EnOssan* this, PlayState* play) { - this->lookToShopkeeperCutscene = this->actor.cutscene; - this->lookToLeftShelfCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToShopkeeperCutscene); - this->lookToRightShelfCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToLeftShelfCutscene); - this->lookToShopKeeperFromShelfCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToRightShelfCutscene); + this->lookToShopkeeperCsId = this->actor.csId; + this->lookToLeftShelfCsId = CutsceneManager_GetAdditionalCsId(this->lookToShopkeeperCsId); + this->lookToRightShelfCsId = CutsceneManager_GetAdditionalCsId(this->lookToLeftShelfCsId); + this->lookToShopKeeperFromShelfCsId = CutsceneManager_GetAdditionalCsId(this->lookToRightShelfCsId); } void EnOssan_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index a4787cc148..c5de183d55 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -43,11 +43,11 @@ typedef struct EnOssan { /* 0x2B0 */ u8 arrowAnimState; /* 0x2B1 */ u8 stickAnimState; /* 0x2B4 */ f32 shopItemSelectedTween; - /* 0x2B8 */ s16 lookToShopkeeperCutscene; - /* 0x2BA */ s16 lookToLeftShelfCutscene; - /* 0x2BC */ s16 lookToRightShelfCutscene; - /* 0x2BE */ s16 lookToShopKeeperFromShelfCutscene; - /* 0x2C0 */ s16 cutscene; + /* 0x2B8 */ s16 lookToShopkeeperCsId; + /* 0x2BA */ s16 lookToLeftShelfCsId; + /* 0x2BC */ s16 lookToRightShelfCsId; + /* 0x2BE */ s16 lookToShopKeeperFromShelfCsId; + /* 0x2C0 */ s16 csId; /* 0x2C2 */ s16 cutsceneState; /* 0x2C4 */ u16 textId; /* 0x2C6 */ Vec3s headRot; diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index b98fb89713..a4d8203645 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -161,7 +161,7 @@ void EnOt_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.z = 0; this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.gravity = 0.0f; - SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList)); SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIndex); this->skelAnime.curFrame = Rand_ZeroOne() * this->skelAnime.endFrame; this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); @@ -300,20 +300,20 @@ void func_80B5BB38(Color_RGB8* arg0, Color_RGB8* arg1, f32 arg2) { void func_80B5BDA8(EnOt* this, PlayState* play) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIndex); - SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList)); this->actionFunc = func_80B5BE04; } void func_80B5BE04(EnOt* this, PlayState* play) { switch (this->unk_388) { case 0: - if (SubS_StartActorCutscene(&this->actor, this->cutscenes[2], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->actor, this->csIdList[2], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { func_80B5BF60(this, play); } break; case 1: - if (SubS_StartActorCutscene(&this->actor, this->cutscenes[3], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->actor, this->csIdList[3], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { func_80B5BF60(this, play); } break; @@ -508,11 +508,11 @@ void func_80B5C6DC(EnOt* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_84_10); switch (this->unk_388) { case 0: - ActorCutscene_Stop(this->cutscenes[2]); + CutsceneManager_Stop(this->csIdList[2]); break; case 1: - ActorCutscene_Stop(this->cutscenes[3]); + CutsceneManager_Stop(this->csIdList[3]); break; } this->unk_73C = -1; @@ -591,7 +591,7 @@ void func_80B5CA30(EnOt* this, PlayState* play) { } void func_80B5CAD0(EnOt* this, PlayState* play) { - SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes) / 2); + SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList) / 2); this->actionFunc = func_80B5CB0C; } @@ -626,7 +626,7 @@ void func_80B5CC88(EnOt* this, PlayState* play) { } void func_80B5CCA0(EnOt* this, PlayState* play) { - if (SubS_StartActorCutscene(&this->actor, this->cutscenes[0], 0x7C, SUBS_CUTSCENE_NORMAL)) { + if (SubS_StartCutscene(&this->actor, this->csIdList[0], CS_ID_GLOBAL_TALK, SUBS_CUTSCENE_NORMAL)) { Player* player = GET_PLAYER(play); player->stateFlags2 |= PLAYER_STATE2_20000000; @@ -665,7 +665,7 @@ void func_80B5CD40(EnOt* this, PlayState* play) { case TEXT_STATE_DONE: if (Message_ShouldAdvance(play) && (play->msgCtx.currentTextId == 0x1069)) { this->unk_32C |= 4; - ActorCutscene_Stop(this->cutscenes[0]); + CutsceneManager_Stop(this->csIdList[0]); player->stateFlags2 &= ~PLAYER_STATE2_20000000; func_80B5CE6C(this, play); } @@ -993,7 +993,7 @@ void func_80B5DB6C(Actor* thisx, PlayState* play) { func_80B5B2E0(play, &this->actor.world.pos, ENOT_GET_7F(&this->actor), &sp50, &this->unk_340); if (Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_OT, sp50.x, sp50.y, sp50.z, 0, this->actor.shape.rot.y, 1, ENOT_GET_3FFF(&this->actor) | 0x8000, - this->actor.cutscene, this->actor.halfDaysBits, NULL) != NULL) { + this->actor.csId, this->actor.halfDaysBits, NULL) != NULL) { this->unk_32C |= 8; } } else if (D_80B5E888 != NULL) { @@ -1011,7 +1011,7 @@ void func_80B5DB6C(Actor* thisx, PlayState* play) { temp->unk_32C |= 8; temp->unk_346 = ENOT_GET_7F(&this->actor); temp->actor.params = this->actor.params; - temp->actor.cutscene = this->actor.cutscene; + temp->actor.csId = this->actor.csId; this->unk_32C |= 8; } } else if (SurfaceType_IsHorseBlocked(&play->colCtx, player->actor.floorPoly, player->actor.floorBgId)) { diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.h b/src/overlays/actors/ovl_En_Ot/z_en_ot.h index 7e8d7f651c..8b01c66548 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.h +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.h @@ -45,7 +45,7 @@ typedef struct EnOt { /* 0x346 */ s16 unk_346; /* 0x348 */ Vec3f unk_348; /* 0x354 */ s16 unk_354; - /* 0x356 */ s16 cutscenes[4]; + /* 0x356 */ s16 csIdList[4]; /* 0x360 */ struct EnOt* unk_360; /* 0x364 */ LightNode* lightNode; /* 0x368 */ LightInfo lightInfo; diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index a5bb03a72a..f71d227f60 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -102,19 +102,19 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { s32 pad; EnOwl* this = THIS; s32 i; - s16 cutscene = this->actor.cutscene; + s16 csId = this->actor.csId; s32 owlType; s32 switchFlag; - for (i = 0; i < ARRAY_COUNT(this->unk_400); i++) { - this->unk_400[i] = cutscene; - if (cutscene != -1) { - this->actor.cutscene = cutscene; - cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = csId; + if (csId != CS_ID_NONE) { + this->actor.csId = csId; + csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } } - this->actor.cutscene = this->unk_400[0]; + this->actor.csId = this->csIdList[0]; Actor_ProcessInitChain(&this->actor, sInitChain); if (ENOWL_GET_TYPE(&this->actor) == ENOWL_GET_TYPE_30) { Actor_SetScale(&this->actor, 0.1f); @@ -144,7 +144,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { this->unk_409 = 4; this->unk_40B = this->unk_408 = 0; this->unk_40C = 4; - this->unk_406 = -1; + this->csIdIndex = -1; owlType = ENOWL_GET_TYPE(&this->actor); switchFlag = ENOWL_GET_SWITCHFLAG(&this->actor); @@ -315,11 +315,11 @@ void func_8095AC50(EnOwl* this, PlayState* play) { void func_8095ACEC(EnOwl* this) { this->actionFlags &= ~0x40; - if (this->unk_406 >= 0) { - if (ActorCutscene_GetCurrentIndex() == this->unk_400[this->unk_406]) { - ActorCutscene_Stop(this->unk_400[this->unk_406]); + if (this->csIdIndex >= 0) { + if (CutsceneManager_GetCurrentCsId() == this->csIdList[this->csIdIndex]) { + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); } - this->unk_406 = -1; + this->csIdIndex = -1; } } @@ -387,7 +387,7 @@ void func_8095AFEC(EnOwl* this, PlayState* play) { if (func_8095A978(this, play, 0xBF6, 200.0f, 100.0f)) { Audio_PlayFanfare(NA_BGM_OWL); this->actionFunc = func_8095AF2C; - this->unk_406 = 0; + this->csIdIndex = 0; this->actionFlags |= 0x40; } } @@ -502,7 +502,7 @@ void func_8095B574(EnOwl* this, PlayState* play) { this->actionFunc = func_8095BA84; Audio_PlayFanfare(NA_BGM_OWL); this->actionFlags |= 0x40; - this->unk_406 = 2; + this->csIdIndex = 2; } else if (this->actor.xzDistToPlayer < 200.0f) { this->actor.flags |= ACTOR_FLAG_10000; func_800B8500(&this->actor, play, 200.0f, 400.0f, PLAYER_IA_NONE); @@ -674,7 +674,7 @@ void func_8095BA84(EnOwl* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_10000; this->actor.home.rot.x = 0; func_8095ACEC(this); - this->unk_406 = 0; + this->csIdIndex = 0; this->actionFlags |= 0x40; break; @@ -714,7 +714,7 @@ void func_8095BE0C(EnOwl* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_8095BA84; Audio_PlayFanfare(NA_BGM_OWL); - this->unk_406 = 1; + this->csIdIndex = 1; this->actionFlags |= 0x40; } else if (this->actor.textId == 0xBF0) { if (this->actor.isTargeted) { @@ -865,16 +865,16 @@ s32 func_8095C510(EnOwl* this) { void func_8095C568(EnOwl* this) { if (this->actionFlags & 0x40) { - if ((this->unk_406 < 0) || (this->unk_400[this->unk_406] < 0)) { + if ((this->csIdIndex < 0) || (this->csIdList[this->csIdIndex] < 0)) { this->actionFlags &= ~0x40; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_400[this->unk_406]); - } else if (ActorCutscene_GetCanPlayNext(this->unk_400[this->unk_406])) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_400[this->unk_406], &this->actor); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); + } else if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + CutsceneManager_StartWithPlayerCs(this->csIdList[this->csIdIndex], &this->actor); this->actionFlags &= ~0x40; } else { - ActorCutscene_SetIntentToPlay(this->unk_400[this->unk_406]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } } diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.h b/src/overlays/actors/ovl_En_Owl/z_en_owl.h index 0338578868..5e02aba941 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.h +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.h @@ -44,8 +44,8 @@ typedef struct EnOwl { /* 0x3F4 */ Path* path; /* 0x3F8 */ s32 unk_3F8; /* 0x3FC */ s32 unk_3FC; - /* 0x400 */ s16 unk_400[3]; - /* 0x406 */ s16 unk_406; + /* 0x400 */ s16 csIdList[3]; + /* 0x406 */ s16 csIdIndex; /* 0x408 */ u8 unk_408; /* 0x409 */ u8 unk_409; /* 0x40A */ u8 unk_40A; diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c index 966f21354b..a4158e2c70 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -156,7 +156,7 @@ void EnPamera_Init(Actor* thisx, PlayState* play) { if (1) {} - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) || + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) || CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || (gSaveContext.save.entrance == ENTRANCE(IKANA_CANYON, 9))) { Actor_Kill(&this->actor); } @@ -216,14 +216,14 @@ void func_80BD8588(EnPamera* this, PlayState* play) { void func_80BD8658(EnPamera* this) { s32 i; - s16 nextCutscene = this->actor.cutscene; + s16 csId = this->actor.csId; - for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) { - if (nextCutscene == -1) { + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + if (csId == CS_ID_NONE) { break; } - this->cutscenes[i] = nextCutscene; - nextCutscene = ActorCutscene_GetAdditionalCutscene(nextCutscene); + this->csIdList[i] = csId; + csId = CutsceneManager_GetAdditionalCsId(csId); } } @@ -242,9 +242,9 @@ void func_80BD8700(EnPamera* this) { void func_80BD8758(EnPamera* this, PlayState* play) { if (this->hideInisdeTimer++ > 1800) { - if (ActorCutscene_GetCanPlayNext(this->cutscenes[0]) && (this->cutscenes[0] != -1)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[0], &this->actor); - Camera_SetToTrackActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(this->cutscenes[0])), + if (CutsceneManager_IsNext(this->csIdList[0]) && (this->csIdList[0] != -1)) { + CutsceneManager_StartWithPlayerCs(this->csIdList[0], &this->actor); + Camera_SetToTrackActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csIdList[0])), &this->actor); this->actor.speed = 1.5f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); @@ -252,8 +252,8 @@ void func_80BD8758(EnPamera* this, PlayState* play) { this->actor.world.rot.y = this->actor.home.rot.y; func_80BD9338(this, play); func_80BD8908(this); - } else if ((this->cutscenes[0] != -1) && (this->actor.xzDistToPlayer < 1000.0f)) { - ActorCutscene_SetIntentToPlay(this->cutscenes[0]); + } else if ((this->csIdList[0] != -1) && (this->actor.xzDistToPlayer < 1000.0f)) { + CutsceneManager_Queue(this->csIdList[0]); } else { this->actor.speed = 1.5f; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 1); @@ -429,13 +429,13 @@ void func_80BD90AC(EnPamera* this, PlayState* play) { ((this->actor.xzDistToPlayer < 150.0f) || ((this->actionFunc == func_80BD909C) && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f)))) { - if ((ActorCutscene_GetCanPlayNext(this->cutscenes[1])) && ((this->cutscenes[1] != -1))) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[1], &this->actor); - Camera_SetToTrackActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(this->cutscenes[1])), + if ((CutsceneManager_IsNext(this->csIdList[1])) && ((this->csIdList[1] != -1))) { + CutsceneManager_StartWithPlayerCs(this->csIdList[1], &this->actor); + Camera_SetToTrackActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(this->csIdList[1])), &this->actor); EnPamera_LookDownWell(this); - } else if (this->cutscenes[1] != -1) { - ActorCutscene_SetIntentToPlay(this->cutscenes[1]); + } else if (this->csIdList[1] != -1) { + CutsceneManager_Queue(this->csIdList[1]); } else { EnPamera_LookDownWell(this); } @@ -569,7 +569,7 @@ void func_80BD9840(EnPamera* this, PlayState* play) { this->actor.update = func_80BDA344; this->actor.flags |= ACTOR_FLAG_2000000; this->actor.flags |= ACTOR_FLAG_100000; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) { func_80BD9E60(this); func_80BD9938(this); } else { @@ -605,7 +605,8 @@ void func_80BD994C(EnPamera* this, PlayState* play) { this->unk_324 = 0x15A8; } else if ((gSaveContext.save.playerForm != PLAYER_FORM_HUMAN) || - (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20))) { + (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) && + !CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20))) { func_80BD93CC(this, 1, 0); Message_StartTextbox(play, 0x158E, &this->actor); this->unk_324 = 0x158E; @@ -695,14 +696,14 @@ void func_80BD9C70(EnPamera* this, PlayState* play) { } s32 func_80BD9CB8(EnPamera* this, PlayState* play) { - s32 actionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 0x1E5)) { - actionIndex = Cutscene_GetActorActionIndex(play, 0x1E5); - if (this->unk_326 != play->csCtx.actorActions[actionIndex]->action) { - this->unk_326 = play->csCtx.actorActions[actionIndex]->action; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_485)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_485); + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; - switch (play->csCtx.actorActions[actionIndex]->action) { + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: func_80BD9E88(this); break; @@ -727,7 +728,7 @@ s32 func_80BD9CB8(EnPamera* this, PlayState* play) { break; } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); this->setupFunc(this, play); return 1; } @@ -738,7 +739,7 @@ s32 func_80BD9CB8(EnPamera* this, PlayState* play) { func_80BD9E60(this); } } - this->unk_326 = 0x63; + this->cueId = 99; return 0; } diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.h b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.h index 34f18e8153..59bf40e09e 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.h +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.h @@ -28,13 +28,13 @@ typedef struct EnPamera { /* 0x312 */ s16 unk_312; /* 0x314 */ s16 unk_314; /* 0x316 */ s16 unk_316; - /* 0x318 */ s16 cutscenes[2]; + /* 0x318 */ s16 csIdList[2]; /* 0x31C */ s16 hideInisdeTimer; /* 0x31E */ s16 unk_31E; /* 0x320 */ UNK_TYPE1 unk_320[0x2]; /* 0x322 */ s16 unk_322; /* 0x324 */ u16 unk_324; - /* 0x326 */ u16 unk_326; + /* 0x326 */ u16 cueId; } EnPamera; // size = 0x328 #endif // Z_EN_PAMERA_H diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c index 4172457f1b..62dff4188e 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -341,8 +341,8 @@ void EnPametfrog_StopCutscene(EnPametfrog* this, PlayState* play) { subCam = Play_GetCamera(play, this->subCamId); Play_SetCameraAtEye(play, CAM_ID_MAIN, &subCam->at, &subCam->eye); this->subCamId = SUB_CAM_ID_DONE; - ActorCutscene_Stop(this->cutscene); - func_800B724C(play, &this->actor, PLAYER_CSMODE_6); + CutsceneManager_Stop(this->csId); + func_800B724C(play, &this->actor, PLAYER_CSMODE_END); } } @@ -991,22 +991,22 @@ void EnPametfrog_SpawnFrog(EnPametfrog* this, PlayState* play) { void EnPametfrog_SetupCutscene(EnPametfrog* this) { if (this->actor.colChkInfo.health == 0) { - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; } else { - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + this->csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); this->actionFunc = EnPametfrog_PlayCutscene; this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; } void EnPametfrog_PlayCutscene(EnPametfrog* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_Start(this->cutscene, &this->actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->cutscene); - func_800B724C(play, &this->actor, PLAYER_CSMODE_7); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, &this->actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->csId); + func_800B724C(play, &this->actor, PLAYER_CSMODE_WAIT); if (this->actor.colChkInfo.health == 0) { if (this->actor.params == GEKKO_PRE_SNAPPER) { EnPametfrog_SetupCallSnapper(this, play); @@ -1017,7 +1017,7 @@ void EnPametfrog_PlayCutscene(EnPametfrog* this, PlayState* play) { EnPametfrog_SetupFallOffSnapper(this, play); } } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h index 9ae2f76df0..90bc0cb1b7 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h @@ -30,7 +30,7 @@ typedef struct EnPametfrog { /* 0x2AC */ u8 drawDmgEffType; /* 0x2AD */ u8 wallPauseTimer; // Gekko stops 10 times along wall/ceiling after being blown off of Snapper /* 0x2AE */ u8 unk_2AE; // True/False - /* 0x2B0 */ s16 cutscene; + /* 0x2B0 */ s16 csId; /* 0x2B2 */ s16 params; /* 0x2B4 */ s16 quakeIndex; /* 0x2B6 */ s16 timer; diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index 81f6c8b09f..d10f0884b5 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -789,43 +789,43 @@ Actor* func_80AF8040(EnPm* this, PlayState* play) { return actor; } -s32 func_80AF80F4(EnPm* this, s16 arg1) { +s32 func_80AF80F4(EnPm* this, s16 csId) { s32 ret = false; - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(arg1); - } else if (ActorCutscene_GetCanPlayNext(arg1)) { - ActorCutscene_StartAndSetUnkLinkFields(arg1, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(csId); + } else if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->actor); ret = true; } else { - ActorCutscene_SetIntentToPlay(arg1); + CutsceneManager_Queue(csId); } return ret; } -s16 func_80AF8170(EnPm* this, s32 arg1) { +s16 func_80AF8170(EnPm* this, s32 numCutscenes) { s32 i; - s16 cs = -1; + s16 csId = CS_ID_NONE; if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - cs = this->actor.child->cutscene; + csId = this->actor.child->csId; - for (i = 0; i < arg1; i++) { - cs = ActorCutscene_GetAdditionalCutscene(cs); + for (i = 0; i < numCutscenes; i++) { + csId = CutsceneManager_GetAdditionalCsId(csId); } } - return cs; + return csId; } s32 func_80AF81E8(EnPm* this, PlayState* play) { s32 pad; - s16 sp2A = func_80AF8170(this, 0); + s16 csId = func_80AF8170(this, 0); s32 ret = false; switch (this->unk_378) { case 0: - if (!func_80AF80F4(this, sp2A)) { + if (!func_80AF80F4(this, csId)) { break; } @@ -833,7 +833,8 @@ s32 func_80AF81E8(EnPm* this, PlayState* play) { case 4: case 6: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), this->actor.child); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), + this->actor.child); } this->unk_378++; ret = true; @@ -843,16 +844,16 @@ s32 func_80AF81E8(EnPm* this, PlayState* play) { case 3: case 5: if (CHECK_WEEKEVENTREG(WEEKEVENTREG_86_08) && (this->unk_378 == 3)) { - ActorCutscene_Stop(sp2A); + CutsceneManager_Stop(csId); } else { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), &this->actor); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), &this->actor); } this->unk_378++; ret = true; break; case 7: - ActorCutscene_Stop(sp2A); + CutsceneManager_Stop(csId); this->unk_378++; ret = true; break; @@ -862,12 +863,12 @@ s32 func_80AF81E8(EnPm* this, PlayState* play) { s32 func_80AF8348(EnPm* this, PlayState* play) { s32 pad; - s16 sp2A = func_80AF8170(this, 0); + s16 csId = func_80AF8170(this, 0); s32 ret = false; switch (this->unk_378) { case 0: - if (!func_80AF80F4(this, sp2A)) { + if (!func_80AF80F4(this, csId)) { break; } @@ -875,7 +876,7 @@ s32 func_80AF8348(EnPm* this, PlayState* play) { case 4: case 6: case 8: - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), &this->actor); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), &this->actor); this->unk_378++; ret = true; break; @@ -885,14 +886,15 @@ s32 func_80AF8348(EnPm* this, PlayState* play) { case 5: case 7: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { - Camera_SetTargetActor(Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(sp2A)), this->actor.child); + Camera_SetTargetActor(Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(csId)), + this->actor.child); } this->unk_378++; ret = true; break; case 9: - ActorCutscene_Stop(sp2A); + CutsceneManager_Stop(csId); this->unk_378++; ret = true; break; @@ -2112,7 +2114,7 @@ void EnPm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, switch (limbIndex) { case 15: - if (ActorCutscene_GetCurrentIndex() == -1) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) { Matrix_MultVec3f(&gZeroVec3f, &this->actor.focus.pos); Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot); } diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c index 405ed1838f..10d654cc79 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c @@ -296,7 +296,7 @@ void EnRailSkb_Init(Actor* thisx, PlayState* play) { this->unk_3F8 = 0; } - if ((play->sceneId == SCENE_BOTI) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_BOTI) && (gSaveContext.sceneLayer == 1) && (play->csCtx.scriptIndex == 0)) { this->actor.flags |= ACTOR_FLAG_100000; } diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index 2e85f081dd..853dbfd612 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -44,7 +44,7 @@ s32 EnRailgibud_MoveToIdealGrabPositionAndRotation(EnRailgibud* this, PlayState* void EnRailgibud_CheckIfTalkingToPlayer(EnRailgibud* this, PlayState* play); void EnRailgibud_MainGibdo_DeadUpdate(Actor* thisx, PlayState* play); void EnRailgibud_InitCutsceneGibdo(EnRailgibud* this, PlayState* play); -void EnRailgibud_InitActorActionCommand(EnRailgibud* this); +void EnRailgibud_InitCueType(EnRailgibud* this); void EnRailgibud_SetupDoNothing(EnRailgibud* this); void EnRailgibud_DoNothing(EnRailgibud* this, PlayState* play); void EnRailgibud_SinkIntoGround(EnRailgibud* this, PlayState* play); @@ -1106,8 +1106,8 @@ void EnRailgibud_Draw(Actor* thisx, PlayState* play) { void EnRailgibud_InitCutsceneGibdo(EnRailgibud* this, PlayState* play) { s32 pad[2]; - EnRailgibud_InitActorActionCommand(this); - this->csAction = 99; + EnRailgibud_InitCueType(this); + this->cueId = 99; this->actor.flags |= ACTOR_FLAG_100000; this->actor.flags |= ACTOR_FLAG_10; @@ -1126,30 +1126,30 @@ void EnRailgibud_InitCutsceneGibdo(EnRailgibud* this, PlayState* play) { this->actor.update = EnRailgibud_Cutscene_Update; } -void EnRailgibud_InitActorActionCommand(EnRailgibud* this) { +void EnRailgibud_InitCueType(EnRailgibud* this) { switch (ENRAILGIBUD_GET_CUTSCENE_TYPE(&this->actor)) { case 1: - this->actorActionCommand = 519; + this->cueType = CS_CMD_ACTOR_CUE_519; break; case 2: - this->actorActionCommand = 520; + this->cueType = CS_CMD_ACTOR_CUE_520; break; case 3: - this->actorActionCommand = 521; + this->cueType = CS_CMD_ACTOR_CUE_521; break; case 4: - this->actorActionCommand = 522; + this->cueType = CS_CMD_ACTOR_CUE_522; break; case 5: - this->actorActionCommand = 523; + this->cueType = CS_CMD_ACTOR_CUE_523; break; default: - this->actorActionCommand = 519; + this->cueType = CS_CMD_ACTOR_CUE_519; break; } } @@ -1177,13 +1177,13 @@ void EnRailgibud_SinkIntoGround(EnRailgibud* this, PlayState* play) { } s32 EnRailgibud_PerformCutsceneActions(EnRailgibud* this, PlayState* play) { - s32 actionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, this->actorActionCommand)) { - actionIndex = Cutscene_GetActorActionIndex(play, this->actorActionCommand); - if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { - this->csAction = play->csCtx.actorActions[actionIndex]->action; - switch (play->csCtx.actorActions[actionIndex]->action) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + cueChannel = Cutscene_GetCueChannel(play, this->cueType); + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: this->cutsceneAnimIndex = EN_RAILGIBUD_ANIM_IDLE; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, EN_RAILGIBUD_ANIM_IDLE); @@ -1221,7 +1221,7 @@ s32 EnRailgibud_PerformCutsceneActions(EnRailgibud* this, PlayState* play) { } } - switch (this->csAction) { + switch (this->cueId) { case 3: case 4: if (this->actionFunc == EnRailgibud_SinkIntoGround) { @@ -1233,7 +1233,7 @@ s32 EnRailgibud_PerformCutsceneActions(EnRailgibud* this, PlayState* play) { case 5: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if (play->csCtx.frames < 280) { + if (play->csCtx.curFrame < 280) { Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_CRY); } else { Actor_PlaySfx(&this->actor, NA_SE_EN_REDEAD_WEAKENED1); @@ -1242,11 +1242,11 @@ s32 EnRailgibud_PerformCutsceneActions(EnRailgibud* this, PlayState* play) { break; } - Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex); + Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel); return true; } - this->csAction = 99; + this->cueId = 99; return false; } diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h index cf06d19965..95a2bbd7b4 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h @@ -47,8 +47,8 @@ typedef struct EnRailgibud { /* 0x3F6 */ s16 drawDmgEffTimer; /* 0x3F8 */ s16 type; /* 0x3FA */ s16 isInvincible; - /* 0x3FC */ u16 actorActionCommand; - /* 0x3FE */ u16 csAction; + /* 0x3FC */ u16 cueType; + /* 0x3FE */ u16 cueId; /* 0x400 */ u16 textId; /* 0x402 */ s16 timeInitialized; // unused other than setting it /* 0x404 */ u8 drawDmgEffType; diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c index eaf54000fd..e270f15158 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -504,7 +504,7 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) { } } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = EnRuppecrow_HandleSongCutscene; } @@ -526,12 +526,12 @@ void EnRuppecrow_HandleSong(EnRuppecrow* this, PlayState* play) { void EnRuppecrow_HandleSongCutscene(EnRuppecrow* this, PlayState* play) { EnRuppecrow_UpdatePosition(this, play); - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); EnRuppecrow_UpdateSpeed(this, play); this->actionFunc = EnRuppecrow_FlyWhileDroppingRupees; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } Actor_MoveWithoutGravity(&this->actor); @@ -554,7 +554,7 @@ void EnRuppecrow_FlyWhileDroppingRupees(EnRuppecrow* this, PlayState* play) { this->skelAnime.playSpeed = 1.0f; Actor_MoveWithGravity(&this->actor); } else { - if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() != this->actor.csId) { EnRuppecrow_UpdateSpeed(this, play); Math_ApproachF(&this->actor.speed, this->speedModifier, 0.2f, 0.5f); } diff --git a/src/overlays/actors/ovl_En_Rz/z_en_rz.c b/src/overlays/actors/ovl_En_Rz/z_en_rz.c index 42e2dd0131..c870027bbd 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.c +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.c @@ -87,14 +87,14 @@ static ColliderCylinderInit sCylinderInit = { void EnRz_Init(Actor* thisx, PlayState* play) { EnRz* this = THIS; - s16 tempCutscene = this->actor.cutscene; + s16 csId = this->actor.csId; s32 i; - for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) { - this->cutscenes[i] = tempCutscene; - if (tempCutscene != -1) { - this->actor.cutscene = tempCutscene; - tempCutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = csId; + if (csId != CS_ID_NONE) { + this->actor.csId = csId; + csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } } @@ -156,12 +156,12 @@ void EnRz_Init(Actor* thisx, PlayState* play) { } if (EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) { - this->csAction = 0x226; + this->cueType = CS_CMD_ACTOR_CUE_550; } else { // EN_RZ_MARILLA - this->csAction = 0x227; + this->cueType = CS_CMD_ACTOR_CUE_551; } - this->actionIndex = 0; + this->cueId = 0; } /** @@ -359,18 +359,18 @@ void EnRz_Destroy(Actor* thisx, PlayState* play) { } s32 func_80BFBE70(EnRz* this, PlayState* play) { - u16 action; + u16 cueId; if ((EN_RZ_GET_SISTER(&this->actor) == EN_RZ_JUDO) && (this->animIndex == EN_RZ_ANIM_APPLAUDING)) { func_800B9010(&this->actor, NA_SE_EV_CLAPPING_2P - SFX_FLAG); } - if (Cutscene_CheckActorAction(play, this->csAction)) { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction)); - action = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action; - if (this->actionIndex != action) { - this->actionIndex = action; - switch (this->actionIndex) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; + if (this->cueId != cueId) { + this->cueId = cueId; + switch (this->cueId) { case 1: func_80BFBA1C(play, this, EN_RZ_ANIM_STANDING); break; @@ -395,18 +395,18 @@ s32 func_80BFBE70(EnRz* this, PlayState* play) { } s32 func_80BFBFAC(EnRz* this, PlayState* play) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { Message_StartTextbox(play, 0x2925, &this->actor); this->actionFunc = func_80BFC078; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); return false; - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); return true; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } return false; } @@ -498,7 +498,7 @@ void func_80BFC36C(EnRz* this, PlayState* play) { this->actionFunc = func_80BFC2F4; SET_WEEKEVENTREG(WEEKEVENTREG_75_80); } - this->actor.cutscene = this->cutscenes[1]; + this->actor.csId = this->csIdList[1]; } } @@ -518,7 +518,7 @@ void func_80BFC3F8(EnRz* this, PlayState* play) { if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_10000)) { this->actionFunc = func_80BFC36C; - this->actor.cutscene = this->cutscenes[0]; + this->actor.csId = this->csIdList[0]; this->actor.flags &= ~ACTOR_FLAG_10000; } else if (Player_GetMask(play) == PLAYER_MASK_KAMARO) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_77_04)) { diff --git a/src/overlays/actors/ovl_En_Rz/z_en_rz.h b/src/overlays/actors/ovl_En_Rz/z_en_rz.h index 38a7088e80..c6d8fe3c86 100644 --- a/src/overlays/actors/ovl_En_Rz/z_en_rz.h +++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.h @@ -40,9 +40,9 @@ typedef struct EnRz { /* 0x420 */ u16 stateFlags; /* 0x422 */ s16 animIndex; /* 0x424 */ s16 timer; - /* 0x426 */ u16 csAction; - /* 0x428 */ u16 actionIndex; - /* 0x42A */ s16 cutscenes[2]; + /* 0x426 */ u16 cueType; + /* 0x428 */ u16 cueId; + /* 0x42A */ s16 csIdList[2]; /* 0x430 */ EnRzActionFunc actionFunc; } EnRz; // size = 0x434 diff --git a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c index b6bd75d834..321c790d14 100644 --- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c +++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c @@ -166,7 +166,7 @@ void func_80BCD2BC(EnScopecrow* this, PlayState* play) { Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_SC_RUPPE, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, this->actor.params, - this->actor.cutscene, this->actor.halfDaysBits, NULL); + this->actor.csId, this->actor.halfDaysBits, NULL); } s32 func_80BCD334(EnScopecrow* this, Path* path, s32 pointIndex) { diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c index 1c82887b49..07e2646a05 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -448,14 +448,14 @@ void func_80BCBA00(EnScopenuts* this, PlayState* play) { } if (this->unk_36C == 0) { - if (ActorCutscene_GetCanPlayNext(this->unk_338)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_338, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_36C = 1; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->unk_338); + CutsceneManager_Queue(this->csId); return; } } @@ -593,7 +593,7 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { if (sp32 == 3) { if (this->unk_334 >= (this->path->count - 1)) { - ActorCutscene_Stop(this->unk_338); + CutsceneManager_Stop(this->csId); CLEAR_WEEKEVENTREG(WEEKEVENTREG_52_40); this->actionFunc = func_80BCC288; } else { @@ -601,7 +601,7 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { } } } else if (this->actor.playerHeightRel > 500.0f) { - ActorCutscene_Stop(this->unk_338); + CutsceneManager_Stop(this->csId); this->actionFunc = func_80BCC288; } @@ -609,17 +609,17 @@ void func_80BCBFFC(EnScopenuts* this, PlayState* play) { func_80BCAD64(this, sp32); if (this->unk_36C == 2) { - if (ActorCutscene_GetCanPlayNext(this->unk_338)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_338, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_36C = 3; } else { - ActorCutscene_SetIntentToPlay(this->unk_338); + CutsceneManager_Queue(this->csId); return; } } else if ((this->unk_36C == 1) && (this->unk_36E == 20)) { - ActorCutscene_Stop(this->unk_338); - this->unk_338 = ActorCutscene_GetAdditionalCutscene(this->unk_338); - ActorCutscene_SetIntentToPlay(this->unk_338); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); + CutsceneManager_Queue(this->csId); this->unk_36C = 2; } this->unk_36E++; @@ -723,7 +723,7 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { } else { this->actor.gravity = -1.0f; this->actor.draw = EnScopenuts_Draw; - this->unk_338 = this->actor.cutscene; + this->csId = this->actor.csId; this->unk_33C = 0; this->unk_358 = 150; this->unk_348 = 4; diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h index 5ea0d15eb1..ef2ea74d83 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h @@ -24,7 +24,7 @@ typedef struct EnScopenuts { /* 0x32C */ f32 unk_32C; /* 0x330 */ Path* path; /* 0x334 */ s32 unk_334; - /* 0x338 */ s16 unk_338; + /* 0x338 */ s16 csId; /* 0x33A */ UNK_TYPE1 unk33A[2]; /* 0x33C */ u16 unk_33C; /* 0x33E */ s16 unk_33E; diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index c021205324..871bb85a8b 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -532,14 +532,14 @@ void func_80ADBE80(EnSellnuts* this, PlayState* play) { func_80ADAE64(this); if (this->unk_366 == 0) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_366 = 1; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); return; } } @@ -659,31 +659,31 @@ void func_80ADC37C(EnSellnuts* this, PlayState* play) { this->actor.world.rot.x = -sp30.x; if (func_80ADCE4C(this, this->path, this->unk_334) && (sp2C < 500.0f)) { if (this->unk_334 >= (this->path->count - 1)) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->actionFunc = func_80ADC580; } else { this->unk_334++; } } } else if (this->actor.playerHeightRel > 500.0f) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->actionFunc = func_80ADC580; } Math_ApproachF(&this->actor.speed, 2.0f, 0.2f, 1.0f); Actor_MoveWithoutGravity(&this->actor); if (this->unk_366 == 2) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_366 = 3; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); return; } } else if ((this->unk_366 == 1) && (this->unk_368 == 20)) { - ActorCutscene_Stop(this->cutscene); - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene); - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); + CutsceneManager_Queue(this->csId); this->unk_366 = 2; } @@ -741,22 +741,22 @@ void func_80ADC7B4(EnSellnuts* this, PlayState* play) { s32 talkState = Message_GetState(&play->msgCtx); if (this->unk_366 == 0) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_366 = 1; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } else if ((this->unk_366 == 1) && (talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->unk_366 = 0; - ActorCutscene_Stop(this->cutscene); - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene); - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); + CutsceneManager_Queue(this->csId); this->unk_338 |= 8; this->actionFunc = func_80ADC8C4; } @@ -766,14 +766,14 @@ void func_80ADC8C4(EnSellnuts* this, PlayState* play) { Vec3s sp30; if (this->unk_366 == 0) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_366 = 1; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); return; } } @@ -816,7 +816,7 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { this->actor.shape.rot.y += 0x4000; this->unk_360 *= 0.93f; if (this->actor.world.pos.y < -50.0f) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->unk_338 &= ~8; this->unk_34E = 20; this->unk_350 = 4; @@ -835,7 +835,7 @@ void func_80ADCA64(EnSellnuts* this, PlayState* play) { this->collider.dim.height = 0; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 17); } else if (this->unk_34C == 17) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); SET_WEEKEVENTREG(WEEKEVENTREG_73_04); Actor_Kill(&this->actor); } @@ -959,7 +959,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); this->path = SubS_GetPathByIndex(play, ENSELLNUTS_GET_FC00(&this->actor), 0x3F); - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; Actor_SetScale(&this->actor, 0.01f); this->actor.colChkInfo.cylRadius = 0; this->actor.colChkInfo.mass = MASS_IMMOVABLE; diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h index b9793a6d3d..3acf7a3e0c 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.h @@ -23,7 +23,7 @@ typedef struct EnSellnuts { /* 0x334 */ s32 unk_334; /* 0x338 */ u16 unk_338; /* 0x33A */ u16 unk_33A; - /* 0x33C */ s16 cutscene; + /* 0x33C */ s16 csId; /* 0x33E */ UNK_TYPE1 unk33E[0x2]; /* 0x340 */ u16 unk_340; /* 0x342 */ u16 unk_342; diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.c b/src/overlays/actors/ovl_En_Shn/z_en_shn.c index 0e1b182e6b..bdd5b787ff 100644 --- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c +++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c @@ -259,7 +259,7 @@ s32 func_80AE6704(Actor* thisx, PlayState* play) { case 6: CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_40); - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); play->nextEntrance = ENTRANCE(SOUTHERN_SWAMP_POISONED, 6); gSaveContext.nextCutsceneIndex = 0; play->transitionTrigger = TRANS_TRIGGER_START; diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index f6e311d619..735111a2b5 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -230,7 +230,7 @@ void EnSkb_Init(Actor* thisx, PlayState* play) { this->unk_3D6 = ENSKB_GET_F0(&this->actor); this->actor.floorHeight = this->actor.world.pos.y; - if ((play->sceneId == SCENE_BOTI) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_BOTI) && (gSaveContext.sceneLayer == 1) && (play->csCtx.scriptIndex == 0)) { this->actor.flags |= ACTOR_FLAG_100000; } diff --git a/src/overlays/actors/ovl_En_Slime/z_en_slime.c b/src/overlays/actors/ovl_En_Slime/z_en_slime.c index 55d6cd8e09..3aab4b3ce4 100644 --- a/src/overlays/actors/ovl_En_Slime/z_en_slime.c +++ b/src/overlays/actors/ovl_En_Slime/z_en_slime.c @@ -843,7 +843,7 @@ void EnSlime_SpawnIceBlock(EnSlime* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_OBJ_ICEBLOCK, this->actor.world.pos.x, this->actor.world.pos.y + 30.0f, this->actor.world.pos.z, 0, 0, 0, 0); if (this->actor.child != NULL) { - this->actor.child->cutscene = this->actor.cutscene; + this->actor.child->csId = this->actor.csId; EnSlime_SetupIceBlock(this); } else { this->actor.colorFilterTimer = 0; diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c index a083d6ded5..baf3ccdfa2 100644 --- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c +++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c @@ -208,7 +208,7 @@ void EnSnowman_Init(Actor* thisx, PlayState* play) { thisx->world.pos.z, 0, 0, 0, EN_SNOWMAN_TYPE_SPLIT); thisx->parent = Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_SNOWMAN, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 0, 0, 0, - EN_SNOWMAN_TYPE_SPLIT, -1, thisx->halfDaysBits, NULL); + EN_SNOWMAN_TYPE_SPLIT, CS_ID_NONE, thisx->halfDaysBits, NULL); if ((thisx->child == NULL) || (thisx->parent == NULL)) { if (thisx->child != NULL) { Actor_Kill(thisx->child); diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index a716545bd8..a23600fb92 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -406,7 +406,7 @@ void EnSob1_Init(Actor* thisx, PlayState* play) { this->shopType = ZORA_SHOP; break; case GORON_SHOP: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { this->shopType = GORON_SHOP_SPRING; } else { this->shopType = GORON_SHOP; @@ -456,7 +456,7 @@ void EnSob1_EndInteraction(PlayState* play, EnSob1* this) { Player* player = GET_PLAYER(play); if (this->cutsceneState == ENSOB1_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_STOPPED; } Actor_ProcessTalkRequest(&this->actor, &play->state); @@ -546,11 +546,11 @@ void EnSob1_Idle(EnSob1* this, PlayState* play) { this->headRotTarget = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookFowardCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookFowardCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } player->stateFlags2 |= PLAYER_STATE2_20000000; @@ -623,11 +623,11 @@ void EnSob1_Hello(EnSob1* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if (this->cutsceneState == ENSOB1_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play) && @@ -664,19 +664,19 @@ void EnSob1_FaceShopkeeper(EnSob1* this, PlayState* play) { u8 cursorIndex; if (this->cutsceneState == ENSOB1_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookFowardCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookFowardCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } else { if (talkState == TEXT_STATE_CHOICE) { @@ -707,23 +707,23 @@ void EnSob1_TalkingToShopkeeper(EnSob1* this, PlayState* play) { void EnSob1_LookToShopkeeperFromShelf(EnSob1* this, PlayState* play) { if (this->cutsceneState == ENSOB1_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_STOPPED; } if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } else if (this->cutsceneState == ENSOB1_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; EnSob1_StartShopping(play, this); } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -765,11 +765,11 @@ void EnSob1_Walk(EnSob1* this, PlayState* play) { f32 distSq; if (this->cutsceneState == ENSOB1_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } if (this->path != NULL) { @@ -794,20 +794,20 @@ void EnSob1_Walking(EnSob1* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->cutsceneState == ENSOB1_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookFowardCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookFowardCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } player->stateFlags2 |= PLAYER_STATE2_20000000; @@ -828,17 +828,17 @@ void EnSob1_ItemPurchased(EnSob1* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); player->stateFlags2 |= PLAYER_STATE2_20000000; EnSob1_SetupAction(this, EnSob1_ContinueShopping); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } } if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { @@ -850,25 +850,25 @@ void EnSob1_ItemPurchased(EnSob1* this, PlayState* play) { void EnSob1_LookToShelf(EnSob1* this, PlayState* play) { if (this->cutsceneState == ENSOB1_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_STOPPED; } if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShelfCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShelfCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } else if (this->cutsceneState == ENSOB1_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene) != 0) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENSOB1_CUTSCENESTATE_PLAYING; EnSob1_UpdateCursorPos(play, this); EnSob1_SetupAction(this, EnSob1_BrowseShelf); Message_ContinueTextbox(play, this->items[this->cursorIndex]->actor.textId); } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -975,7 +975,7 @@ void EnSob1_HandleCanBuyItem(PlayState* play, EnSob1* this) { switch (item->canBuyFunc(play, item)) { case CANBUY_RESULT_SUCCESS_1: if (this->cutsceneState == ENSOB1_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENSOB1_CUTSCENESTATE_STOPPED; } func_8019F208(); @@ -1094,11 +1094,11 @@ void EnSob1_SetupItemPurchased(EnSob1* this, PlayState* play) { play->msgCtx.stateTimer = 4; EnSob1_SetupAction(this, EnSob1_ItemPurchased); if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } @@ -1290,9 +1290,9 @@ s16 EnSob1_GetDistSqAndOrient(Path* path, s32 pointIndex, Vec3f* pos, f32* distS } void EnSob1_GetCutscenes(EnSob1* this) { - this->lookFowardCutscene = this->actor.cutscene; - this->lookToShelfCutscene = ActorCutscene_GetAdditionalCutscene(this->lookFowardCutscene); - this->lookToShopkeeperCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToShelfCutscene); + this->lookFowardCsId = this->actor.csId; + this->lookToShelfCsId = CutsceneManager_GetAdditionalCsId(this->lookFowardCsId); + this->lookToShopkeeperCsId = CutsceneManager_GetAdditionalCsId(this->lookToShelfCsId); } void EnSob1_WaitForBlink(EnSob1* this) { @@ -1387,7 +1387,7 @@ void EnSob1_InitShop(EnSob1* this, PlayState* play) { this->cutsceneState = ENSOB1_CUTSCENESTATE_STOPPED; EnSob1_GetCutscenes(this); - this->cutscene = this->lookFowardCutscene; + this->csId = this->lookFowardCsId; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); sInitFuncs[this->shopType](this, play); this->actor.colChkInfo.mass = MASS_IMMOVABLE; diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h index eee86c112d..1509868ee1 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.h @@ -60,10 +60,10 @@ typedef struct EnSob1 { /* 0x39C */ u8 arrowAnimState; /* 0x39D */ u8 stickAnimState; /* 0x39E */ s16 cutsceneState; - /* 0x3A0 */ s16 cutscene; - /* 0x3A2 */ s16 lookFowardCutscene; - /* 0x3A4 */ s16 lookToShelfCutscene; - /* 0x3A6 */ s16 lookToShopkeeperCutscene; + /* 0x3A0 */ s16 csId; + /* 0x3A2 */ s16 lookFowardCsId; + /* 0x3A4 */ s16 lookToShelfCsId; + /* 0x3A6 */ s16 lookToShopkeeperCsId; /* 0x3A8 */ UNK_TYPE1 pad3A8[0x4]; /* 0x3AC */ f32 shopItemSelectedTween; /* 0x3B0 */ UNK_TYPE1 pad3B0[0x4]; diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index ad40c241c5..a7cd6617a0 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -306,60 +306,60 @@ void func_80BAAB78(EnSuttari* this, PlayState* play) { switch (this->textId) { case 0: this->flags1 |= 0x20; - this->cutsceneIdx = 0; + this->csIdIndex = 0; this->textId = 0x29E5; break; case 0x29E5: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); - this->cutsceneIdx = 1; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 1; this->textId = 0x29E6; break; case 0x29E6: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); - this->cutsceneIdx = 0; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 0; this->textId = 0x29E7; break; case 0x29E7: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); - this->cutsceneIdx = 1; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 1; this->textId = 0x29E8; break; case 0x29E8: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); - this->cutsceneIdx = 0; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 0; this->textId = 0x29E9; break; case 0x29E9: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); - this->cutsceneIdx = 1; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 1; this->textId = 0x29EA; break; case 0x29EA: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); - this->cutsceneIdx = 0; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 0; this->textId = 0x29EB; break; case 0x29EB: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); - this->cutsceneIdx = 1; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 1; this->textId = 0x29EC; break; case 0x29EC: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); - this->cutsceneIdx = 0; + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); + this->csIdIndex = 0; this->textId = 0x29ED; break; case 0x29ED: - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); this->flags1 |= 0x400; - this->cutsceneIdx = 1; + this->csIdIndex = 1; this->textId = 0x29EE; break; } - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIdx]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); this->actionFunc = func_80BADD0C; } else if (this->flags1 & 1) { switch (this->textId) { @@ -859,8 +859,8 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_83_04) && !(this->flags1 & 0x1000)) { - if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) { - ActorCutscene_Start(this->cutscenes[0], &this->actor); + if (CutsceneManager_IsNext(this->csIdList[0])) { + CutsceneManager_Start(this->csIdList[0], &this->actor); if (!(player->stateFlags1 & PLAYER_STATE1_10000000)) { this->flags2 |= 0x10; player->stateFlags1 |= PLAYER_STATE1_10000000; @@ -868,7 +868,7 @@ void func_80BAC2FC(EnSuttari* this, PlayState* play) { this->flags1 |= 0x1000; this->flags2 |= 2; } else { - ActorCutscene_SetIntentToPlay(this->cutscenes[0]); + CutsceneManager_Queue(this->csIdList[0]); } } func_80BABFD4(this, play); @@ -969,8 +969,8 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { if ((gSaveContext.save.entrance == ENTRANCE(NORTH_CLOCK_TOWN, 7)) || CHECK_WEEKEVENTREG(WEEKEVENTREG_58_40)) { Actor_Kill(&this->actor); } - this->cutscenes[0] = this->actor.cutscene; - this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); + this->csIdList[0] = this->actor.csId; + this->csIdList[1] = CutsceneManager_GetAdditionalCsId(this->csIdList[0]); this->flags1 |= 0x80; this->flags1 |= 8; this->animIndex = 1; @@ -994,8 +994,8 @@ void func_80BAC6E8(EnSuttari* this, PlayState* play) { } this->animIndex = 0; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); - this->cutscenes[0] = this->actor.cutscene; - this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]); + this->csIdList[0] = this->actor.csId; + this->csIdList[1] = CutsceneManager_GetAdditionalCsId(this->csIdList[0]); this->flags1 |= 4; this->actionFunc = func_80BAD7F8; return; @@ -1168,26 +1168,26 @@ void func_80BAD130(EnSuttari* this, PlayState* play) { } void func_80BAD230(EnSuttari* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscenes[1])) { - ActorCutscene_Start(this->cutscenes[1], &this->actor); + if (CutsceneManager_IsNext(this->csIdList[1])) { + CutsceneManager_Start(this->csIdList[1], &this->actor); this->textId = 0x2A31; Message_StartTextbox(play, this->textId, &this->actor); this->flags1 |= 0x4000; SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_CHASE | SEQ_FLAG_ASYNC); this->actionFunc = func_80BAD380; } else { - ActorCutscene_SetIntentToPlay(this->cutscenes[1]); + CutsceneManager_Queue(this->csIdList[1]); } } void func_80BAD2B4(EnSuttari* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { if (this->textId == 0x2A30) { - ActorCutscene_Stop(this->cutscenes[0]); - ActorCutscene_SetIntentToPlay(this->cutscenes[1]); + CutsceneManager_Stop(this->csIdList[0]); + CutsceneManager_Queue(this->csIdList[1]); this->actionFunc = func_80BAD230; } else { - ActorCutscene_Stop(this->cutscenes[1]); + CutsceneManager_Stop(this->csIdList[1]); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->flags1 |= 0x40; @@ -1211,7 +1211,7 @@ void func_80BAD380(EnSuttari* this, PlayState* play) { this->flags2 &= ~0x10; player->stateFlags1 &= ~PLAYER_STATE1_10000000; this->flags1 &= ~0x4000; - ActorCutscene_Stop(this->cutscenes[1]); + CutsceneManager_Stop(this->csIdList[1]); play->msgCtx.msgMode = 0x43; play->msgCtx.stateTimer = 4; this->flags1 |= 0x40; @@ -1346,7 +1346,7 @@ void func_80BADA9C(EnSuttari* this, PlayState* play) { if (Message_ShouldAdvance(play)) { if (this->flags1 & 0x400) { if (this->textId == 0x29EE) { - ActorCutscene_Stop(this->cutscenes[this->cutsceneIdx]); + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); } this->flags1 &= ~0x400; if (this->flags2 & 1) { @@ -1385,16 +1385,16 @@ void func_80BADA9C(EnSuttari* this, PlayState* play) { } void func_80BADD0C(EnSuttari* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->cutsceneIdx])) { - if (this->cutsceneIdx == 0) { - ActorCutscene_Start(this->cutscenes[this->cutsceneIdx], &this->enFsn->actor); + if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + if (this->csIdIndex == 0) { + CutsceneManager_Start(this->csIdList[this->csIdIndex], &this->enFsn->actor); } else { - ActorCutscene_Start(this->cutscenes[this->cutsceneIdx], &this->actor); + CutsceneManager_Start(this->csIdList[this->csIdIndex], &this->actor); } func_80BAAA94(this); this->actionFunc = func_80BADA9C; } else { - ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIdx]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h index 669cf549e6..0710007637 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.h @@ -56,8 +56,8 @@ typedef struct EnSuttari { /* 0x444 */ Vec3f unk444; /* 0x450 */ s32 animIndex; /* 0x454 */ UNK_TYPE1 unk_454[0x2]; - /* 0x456 */ s16 cutscenes[2]; - /* 0x45A */ s16 cutsceneIdx; + /* 0x456 */ s16 csIdList[2]; + /* 0x45A */ s16 csIdIndex; } EnSuttari; // size = 0x45C #endif // Z_EN_SUTTARI_H diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index f376057079..1bb6644166 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -1090,14 +1090,14 @@ void func_808DB100(EnSw* this, PlayState* play) { } void func_808DB25C(EnSw* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); func_808D9C18(this); this->actionFunc = func_808DB2E0; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.c b/src/overlays/actors/ovl_En_Test3/z_en_test3.c index 7941ea758e..d5ea5f9df6 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -339,11 +339,11 @@ s32 func_80A3E97C(EnTest3* this, PlayState* play) { } s32 func_80A3E9DC(EnTest3* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_D8D)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_D8D, &this->player.actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->player.actor); return true; } else { - ActorCutscene_SetIntentToPlay(this->unk_D8D); + CutsceneManager_Queue(this->csId); return false; } } @@ -357,8 +357,8 @@ s32 func_80A3EA30(EnTest3* this, PlayState* play) { } } if (this->unk_D78->unk_1 != 0) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_D8D); + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId); play->msgCtx.msgMode = 0x44; } return false; @@ -374,9 +374,9 @@ s32 func_80A3EAC4(EnTest3* this, PlayState* play) { s32 func_80A3EAF8(EnTest3* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { if (this->unk_D78->textId == 0x145F) { - ActorCutscene_Stop(this->unk_D8D); - this->unk_D8D = 0x7C; - ActorCutscene_SetIntentToPlay(this->unk_D8D); + CutsceneManager_Stop(this->csId); + this->csId = CS_ID_GLOBAL_TALK; + CutsceneManager_Queue(this->csId); this->player.targetedActor = &GET_PLAYER(play)->actor; } return 1; @@ -452,7 +452,7 @@ void EnTest3_Init(Actor* thisx, PlayState* play2) { D_80A41D24 = true; this->player.actor.room = -1; - this->player.unk_A86 = -1; + this->player.csId = CS_ID_NONE; this->player.transformation = PLAYER_FORM_HUMAN; this->player.ageProperties = &sAgeProperties; this->player.heldItemAction = PLAYER_IA_NONE; @@ -526,8 +526,8 @@ void func_80A3F0B0(EnTest3* this, PlayState* play) { } void func_80A3F114(EnTest3* this, PlayState* play) { - if (this->player.csMode != 0) { - play->startPlayerCutscene(play, &this->player, 6); + if (this->player.csMode != PLAYER_CSMODE_0) { + play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_END); } } @@ -596,7 +596,7 @@ s32 func_80A3F384(EnTest3* this, PlayState* play) { this->player.doorType = 1; this->player.doorDirection = (offset.z >= 0.0f) ? 1.0f : -1.0f; this->player.doorActor = &door->dyna.actor; - this->player.unk_A86 = -1; + this->player.csId = CS_ID_NONE; return true; } return false; @@ -616,7 +616,7 @@ void func_80A3F534(EnTest3* this, PlayState* play) { } else { this->unk_D78 = &D_80A41854[1]; } - this->unk_D8D = this->player.actor.cutscene; + this->csId = this->player.actor.csId; } void func_80A3F5A4(EnTest3* this, PlayState* play) { @@ -628,7 +628,7 @@ void func_80A3F5A4(EnTest3* this, PlayState* play) { } else { this->unk_D78 = &D_80A41854[12]; } - this->unk_D8D = this->player.actor.cutscene; + this->csId = this->player.actor.csId; } s32 func_80A3F62C(EnTest3* this, PlayState* play, struct_80A41828* arg2, ScheduleOutput* scheduleOutput) { @@ -666,8 +666,8 @@ s32 func_80A3F73C(EnTest3* this, PlayState* play) { this->unk_D90->stateFlags1 |= PLAYER_STATE1_20; func_800BC154(play, &play->actorCtx, &this->unk_D90->actor, 4); func_800BC154(play, &play->actorCtx, &this->player.actor, 2); - ActorCutscene_SetReturnCamera(this->subCamId); - play->startPlayerCutscene(play, &this->player, 7); + CutsceneManager_SetReturnCamera(this->subCamId); + play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_WAIT); } func_800B863C(&this->player.actor, play); if (this->unk_D88 == 3) { @@ -689,7 +689,7 @@ s32 func_80A3F8D4(EnTest3* this, PlayState* play, struct_80A41828* arg2, Schedul ((postActor = func_80A3F2BC(play, this, ACTOR_EN_PM, ACTORCAT_NPC, 100.0f, 20.0f)) != NULL)) { this->player.actor.home.rot.y = Actor_WorldYawTowardActor(&this->player.actor, postActor); } - play->startPlayerCutscene(play, &this->player, 0x61); + play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_97); return true; } @@ -736,7 +736,7 @@ s32 func_80A3FA58(EnTest3* this, PlayState* play) { return false; } if (this->unk_D8A == 90) { - play->startPlayerCutscene(play, &this->player, 0x15); + play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_21); } } else { this->unk_D8A++; @@ -757,20 +757,20 @@ s32 func_80A3FBE8(EnTest3* this, PlayState* play) { if (!Play_InCsMode(play)) { D_80A41D20 = 1; this->unk_D78 = &D_80A41854[20]; - this->unk_D8D = this->player.actor.cutscene; + this->csId = this->player.actor.csId; this->player.actor.textId = this->unk_D78->textId; } } else if (D_80A41D20 == 1) { - if (this->unk_D8D >= 0) { + if (this->csId >= 0) { if (func_80A3E9DC(this, play)) { - this->unk_D8D = -1; + this->csId = CS_ID_NONE; Environment_StopTime(); } } else if ((play->actorCtx.flags & ACTORCTX_FLAG_6) || (play->actorCtx.flags & ACTORCTX_FLAG_5)) { - this->unk_D8D = ActorCutscene_GetAdditionalCutscene(this->player.actor.cutscene); + this->csId = CutsceneManager_GetAdditionalCsId(this->player.actor.csId); SET_WEEKEVENTREG(WEEKEVENTREG_90_02); if (play->actorCtx.flags & ACTORCTX_FLAG_5) { - this->unk_D8D = ActorCutscene_GetAdditionalCutscene(this->unk_D8D); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); } SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1); D_80A41D20 = 2; @@ -778,7 +778,7 @@ s32 func_80A3FBE8(EnTest3* this, PlayState* play) { func_80A3F73C(this, play); } } else if ((D_80A41D20 == 2) && func_80A3E9DC(this, play)) { - ActorCutscene_SetReturnCamera(CAM_ID_MAIN); + CutsceneManager_SetReturnCamera(CAM_ID_MAIN); Environment_StartTime(); if (((void)0, gSaveContext.save.time) > CLOCK_TIME(6, 0)) { func_800FE658(TIME_TO_MINUTES_ALT_F(fabsf((s16) - ((void)0, gSaveContext.save.time)))); @@ -793,7 +793,7 @@ s32 func_80A3FBE8(EnTest3* this, PlayState* play) { } s32 func_80A3FDE4(EnTest3* this, PlayState* play, struct_80A41828* arg2, ScheduleOutput* scheduleOutput) { - this->unk_D8D = ActorCutscene_GetAdditionalCutscene(this->player.actor.cutscene); + this->csId = CutsceneManager_GetAdditionalCsId(this->player.actor.csId); return true; } @@ -813,7 +813,7 @@ s32 func_80A3FE20(EnTest3* this, PlayState* play) { } else if (D_80A41D64 == 1) { func_80A40230(this, play); } else if (D_80A41D64 == 2) { - ActorCutscene_Stop(this->unk_D8D); + CutsceneManager_Stop(this->csId); SET_WEEKEVENTREG(WEEKEVENTREG_90_02); D_80A41D64 = 3; } @@ -835,9 +835,9 @@ s32 func_80A3FF10(EnTest3* this, PlayState* play, struct_80A41828* arg2, Schedul return true; } else { func_80A3F15C(this, play, arg2); - this->unk_D8D = this->player.actor.cutscene; + this->csId = this->player.actor.csId; if (play->roomCtx.curRoom.num == 2) { - this->unk_D8D = ActorCutscene_GetAdditionalCutscene(this->unk_D8D); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); } return true; } @@ -856,7 +856,7 @@ s32 func_80A3FFD0(EnTest3* this, PlayState* play2) { } } else { SET_WEEKEVENTREG(WEEKEVENTREG_51_40); - play->startPlayerCutscene(play, &this->player, 0x6E); + play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_110); } return false; } @@ -1032,7 +1032,7 @@ void func_80A409D4(EnTest3* this, PlayState* play) { if ((play->actorCtx.flags & ACTORCTX_FLAG_5) || (play->actorCtx.flags & ACTORCTX_FLAG_4)) { play->actorCtx.flags &= ~ACTORCTX_FLAG_4; func_80A3F0B0(this, play); - ActorCutscene_SetReturnCamera(CAM_ID_MAIN); + CutsceneManager_SetReturnCamera(CAM_ID_MAIN); } else { sEnTest3_Input = *CONTROLLER1(&play->state); } @@ -1055,16 +1055,16 @@ void EnTest3_Update(Actor* thisx, PlayState* play2) { this->player.actor.draw = EnTest3_Draw; D_80A41D48 = false; this->player.actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); - if (Cutscene_CheckActorAction(play, 0x1FA) && + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_506) && !((this->player.actor.category == ACTORCAT_PLAYER) && ((play->actorCtx.flags & ACTORCTX_FLAG_5) || (play->actorCtx.flags & ACTORCTX_FLAG_4)))) { - if (this->player.csMode != 5) { - play->startPlayerCutscene(play, &this->player, 5); + if (this->player.csMode != PLAYER_CSMODE_5) { + play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_5); } play->actorCtx.flags &= ~ACTORCTX_FLAG_4; } else if (this->player.actor.category == ACTORCAT_PLAYER) { func_80A409D4(this, play); - } else if (play->startPlayerCutscene(play, &this->player, 0)) { + } else if (play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_0)) { if (this->unk_D88 >= 7) { Vec3f worldPos; diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.h b/src/overlays/actors/ovl_En_Test3/z_en_test3.h index a4f1ff6591..36cd15c27f 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.h +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.h @@ -26,7 +26,7 @@ typedef struct EnTest3 { /* 0xD89 */ u8 unk_D89; /* 0xD8A */ s16 unk_D8A; /* 0xD8C */ u8 unk_D8C; - /* 0xD8D */ s8 unk_D8D; + /* 0xD8D */ s8 csId; /* 0xD8E */ s16 subCamId; /* 0xD90 */ Player* unk_D90; /* 0xD94 */ EnTest3ActionFunc unk_D94; diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c index 59af8f7e8e..24d8b41378 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c @@ -43,19 +43,19 @@ static s16 sNightMessages2[] = { 0x1BB4, 0x1BB5, 0x1BB6 }; static s16 sDayMessages2[] = { 0x1BB2, 0x1BB2, 0x1BB3 }; static u16 D_80A43364[] = { CLOCK_TIME(6, 0), CLOCK_TIME(18, 0) }; -static s16 sCutscenes[2]; -static s16 sCurrentCs; +static s16 sCsIdList[2]; +static s16 sCurCsId; void func_80A41D70(EnTest4* this, PlayState* play) { - if (this->unk_144 != 0) { + if (this->csIdIndex != 0) { func_80151A68(play, sNightMessages1[CURRENT_DAY - 1]); - } else if ((sCutscenes[this->unk_144] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) { + } else if ((sCsIdList[this->csIdIndex] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) { if (play->actorCtx.flags & ACTORCTX_FLAG_1) { Sram_IncrementDay(); gSaveContext.save.time = CLOCK_TIME(6, 0); func_80151A68(play, sDayMessages1[CURRENT_DAY - 1]); } else { - this->unk_144 = 0; + this->csIdIndex = 0; this->unk_146 = gSaveContext.save.time += CLOCK_TIME_MINUTE; } @@ -67,22 +67,22 @@ void func_80A41D70(EnTest4* this, PlayState* play) { } if (gSaveContext.cutsceneTrigger == 0) { - if ((sCutscenes[this->unk_144] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { + if ((sCsIdList[this->csIdIndex] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { this->actionFunc = func_80A42F20; - sCurrentCs = sCutscenes[this->unk_144]; + sCurCsId = sCsIdList[this->csIdIndex]; this->transitionCsTimer = 0; SET_EVENTINF(EVENTINF_17); - } else if (this->unk_144 == 0) { + } else if (this->csIdIndex == 0) { play_sound(NA_SE_EV_CHICKEN_CRY_M); } else { func_8019F128(NA_SE_EV_DOG_CRY_EVENING); } } else { this->actionFunc = func_80A42AB8; - if (this->unk_144 == 0) { - this->unk_144 = 1; + if (this->csIdIndex == 0) { + this->csIdIndex = 1; } else { - this->unk_144 = 0; + this->csIdIndex = 0; } this->unk_146 = gSaveContext.save.time += CLOCK_TIME_MINUTE; @@ -90,9 +90,9 @@ void func_80A41D70(EnTest4* this, PlayState* play) { } void func_80A41FA4(EnTest4* this, PlayState* play) { - if (this->unk_144 != 0) { + if (this->csIdIndex != 0) { func_80151A68(play, sNightMessages2[CURRENT_DAY - 1]); - } else if ((sCutscenes[this->unk_144] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) { + } else if ((sCsIdList[this->csIdIndex] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) { Sram_IncrementDay(); gSaveContext.save.time = CLOCK_TIME(6, 0); Interface_NewDay(play, CURRENT_DAY); @@ -104,22 +104,22 @@ void func_80A41FA4(EnTest4* this, PlayState* play) { } if (gSaveContext.cutsceneTrigger == 0) { - if ((sCutscenes[this->unk_144] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { + if ((sCsIdList[this->csIdIndex] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { this->actionFunc = func_80A42F20; - sCurrentCs = sCutscenes[this->unk_144]; + sCurCsId = sCsIdList[this->csIdIndex]; this->transitionCsTimer = 0; SET_EVENTINF(EVENTINF_17); - } else if (this->unk_144 == 0) { + } else if (this->csIdIndex == 0) { play_sound(NA_SE_EV_CHICKEN_CRY_M); } else { func_8019F128(NA_SE_EV_DOG_CRY_EVENING); } } else { this->actionFunc = func_80A42AB8; - if (this->unk_144 == 0) { - this->unk_144 = 1; + if (this->csIdIndex == 0) { + this->csIdIndex = 1; } else { - this->unk_144 = 0; + this->csIdIndex = 0; } this->unk_146 = gSaveContext.save.time += CLOCK_TIME_MINUTE; @@ -278,7 +278,7 @@ void func_80A425E4(EnTest4* this, PlayState* play) { this->nextBellTime = CLOCK_TIME(17, 30); } - if ((sCutscenes[this->unk_144] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1) || (CURRENT_DAY == 3) || + if ((sCsIdList[this->csIdIndex] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1) || (CURRENT_DAY == 3) || (gSaveContext.save.time >= CLOCK_TIME(17, 0))) { gSaveContext.screenScale = 1000.0f; } @@ -292,17 +292,17 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { s32 dayTemp; EnTest4* this = THIS; Player* player = GET_PLAYER(play); - s8 temp_v0 = this->actor.cutscene; + s8 csId = this->actor.csId; - sCutscenes[0] = temp_v0; - if (temp_v0 >= 0) { - ActorCutscene* temp_v0_2 = ActorCutscene_GetCutscene(sCutscenes[0]); + sCsIdList[0] = csId; + if (csId >= 0) { + ActorCutscene* actorCutscene = CutsceneManager_GetCutsceneEntry(sCsIdList[0]); SET_EVENTINF(EVENTINF_52); - sCutscenes[1] = temp_v0_2->additionalCutscene; + sCsIdList[1] = actorCutscene->additionalCsId; } else { CLEAR_EVENTINF(EVENTINF_52); - sCutscenes[1] = sCutscenes[0]; + sCsIdList[1] = sCsIdList[0]; } if (sIsLoaded || (CHECK_EVENTINF(EVENTINF_27))) { @@ -318,29 +318,29 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { gSaveContext.gameMode = GAMEMODE_NORMAL; STOP_GAMESTATE(&play->state); SET_NEXT_GAMESTATE(&play->state, DayTelop_Init, sizeof(DayTelopState)); - this->unk_144 = 1; + this->csIdIndex = 1; gSaveContext.save.time = CLOCK_TIME(6, 0); Actor_Kill(&this->actor); } else { gSaveContext.save.day = 1; dayTemp = gSaveContext.save.day; gSaveContext.save.daysElapsed = dayTemp; - this->unk_144 = 1; + this->csIdIndex = 1; this->unk_146 = gSaveContext.save.time; this->actionFunc = func_80A42AB8; } } else if (gSaveContext.save.time == CLOCK_TIME(6, 0)) { - this->unk_144 = 0; + this->csIdIndex = 0; func_80A41D70(this, play); - if ((gSaveContext.cutsceneTrigger == 0) && (sCutscenes[this->unk_144] >= 0) && + if ((gSaveContext.cutsceneTrigger == 0) && (sCsIdList[this->csIdIndex] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { player->stateFlags1 |= PLAYER_STATE1_200; } } else { if ((gSaveContext.save.time > CLOCK_TIME(18, 0)) || (gSaveContext.save.time < CLOCK_TIME(6, 0))) { - this->unk_144 = 0; + this->csIdIndex = 0; } else { - this->unk_144 = 1; + this->csIdIndex = 1; } this->unk_146 = gSaveContext.save.time; this->actionFunc = func_80A42AB8; @@ -354,7 +354,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { } this->lastBellTime = gSaveContext.save.time; - if ((sCutscenes[this->unk_144] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) { + if ((sCsIdList[this->csIdIndex] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) { gSaveContext.screenScaleFlag = false; gSaveContext.screenScale = 1000.0f; } @@ -369,7 +369,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { if ((play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (play->numSetupActors <= 0) && (play->roomCtx.status == 0) && !Play_IsDebugCamEnabled()) { s16 temp_a2; - u16 temp_a0 = D_80A43364[this->unk_144]; + u16 temp_a0 = D_80A43364[this->csIdIndex]; s16 temp_a3; s16 bellDiff; s16 new_var; @@ -392,7 +392,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { Interface_StartMoonCrash(play); Actor_Kill(&this->actor); SET_EVENTINF(EVENTINF_17); - } else if (((sCutscenes[this->unk_144] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) && + } else if (((sCsIdList[this->csIdIndex] < 0) || (play->actorCtx.flags & ACTORCTX_FLAG_1)) && (CURRENT_DAY != 3)) { func_80A41FA4(this, play); } else { @@ -418,14 +418,14 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { } } - if ((sCutscenes[this->unk_144] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { + if ((sCsIdList[this->csIdIndex] >= 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_1)) { player->stateFlags1 |= PLAYER_STATE1_200; this->unk_146 = gSaveContext.save.time; } else { - if (this->unk_144 == 0) { - this->unk_144 = 1; + if (this->csIdIndex == 0) { + this->csIdIndex = 1; } else { - this->unk_144 = 0; + this->csIdIndex = 0; } this->unk_146 = gSaveContext.save.time += CLOCK_TIME_MINUTE; @@ -470,11 +470,11 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { void func_80A42F20(EnTest4* this, PlayState* play) { if (!this->transitionCsTimer) { - if (sCurrentCs >= 0) { - if (ActorCutscene_GetCanPlayNext(sCurrentCs) == 0) { - ActorCutscene_SetIntentToPlay(sCurrentCs); + if (sCurCsId >= 0) { + if (!CutsceneManager_IsNext(sCurCsId)) { + CutsceneManager_Queue(sCurCsId); } else { - ActorCutscene_Start(sCurrentCs, &this->actor); + CutsceneManager_Start(sCurCsId, &this->actor); this->transitionCsTimer = 1; } } else { @@ -483,7 +483,7 @@ void func_80A42F20(EnTest4* this, PlayState* play) { } else if (this->transitionCsTimer < 60) { this->transitionCsTimer++; if (this->transitionCsTimer == 10) { - if (this->unk_144 == 0) { + if (this->csIdIndex == 0) { play_sound(NA_SE_EV_CHICKEN_CRY_M); } else { func_8019F128(NA_SE_EV_DOG_CRY_EVENING); @@ -499,14 +499,14 @@ void func_80A42F20(EnTest4* this, PlayState* play) { } } else { this->actionFunc = func_80A42AB8; - if (this->unk_144 == 0) { - this->unk_144 = 1; + if (this->csIdIndex == 0) { + this->csIdIndex = 1; } else { - this->unk_144 = 0; + this->csIdIndex = 0; } - if (sCurrentCs >= 0) { - ActorCutscene_Stop(sCurrentCs); + if (sCurCsId >= 0) { + CutsceneManager_Stop(sCurCsId); } gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.h b/src/overlays/actors/ovl_En_Test4/z_en_test4.h index 0a372f245b..106a5a9aaa 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.h +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.h @@ -9,7 +9,7 @@ typedef void (*EnTest4ActionFunc)(struct EnTest4*, PlayState*); typedef struct EnTest4 { /* 0x000 */ Actor actor; - /* 0x144 */ s8 unk_144; // 0 on night, 1 on day + /* 0x144 */ s8 csIdIndex; // 0 on night, 1 on day /* 0x145 */ u8 transitionCsTimer; /* 0x146 */ u16 unk_146; /* 0x148 */ u16 nextBellTime; // Next time the bell will sound diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.c b/src/overlays/actors/ovl_En_Test6/z_en_test6.c index 2b57ecf51c..42ff16ccf8 100644 --- a/src/overlays/actors/ovl_En_Test6/z_en_test6.c +++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.c @@ -7,6 +7,7 @@ #include "z_en_test6.h" #include "z64quake.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "z64cutscene_commands.h" #define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_200000 | ACTOR_FLAG_2000000) @@ -54,30 +55,57 @@ ActorInit En_Test6_InitVars = { (ActorFunc)EnTest6_Draw, }; -u8 D_80A93E80[] = { - 0x00, 0x0D, 0x01, 0xA8, 0x00, 0x00, 0x00, 0x64, 0x04, 0x64, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x15, 0xFF, 0xED, 0x00, - 0x00, 0x04, 0x64, 0x00, 0x12, 0x00, 0x00, 0x00, 0x15, 0xFF, 0xED, 0x00, 0x00, 0x04, 0x64, 0x00, 0x10, 0x00, 0x00, - 0x00, 0x15, 0xFF, 0xED, 0x00, 0x00, 0x04, 0x64, 0x00, 0x11, 0xFF, 0xE6, 0xFF, 0xFB, 0xFF, 0xE0, 0x00, 0x00, 0x04, - 0x64, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x12, 0xFF, 0xE0, 0x00, 0x00, 0x04, 0x64, 0x00, 0x0E, 0x00, 0x01, 0x00, 0x16, - 0xFF, 0xE5, 0x00, 0x00, 0x04, 0x64, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFB, 0x00, 0x00, 0x04, 0x64, 0x00, - 0x07, 0x00, 0x10, 0x00, 0x1D, 0xFF, 0xB3, 0x00, 0x00, 0x04, 0x64, 0x00, 0x03, 0x00, 0x01, 0x00, 0x13, 0x00, 0x6F, - 0x00, 0x00, 0x04, 0x64, 0x00, 0x03, 0xFF, 0xC5, 0x00, 0x15, 0x00, 0x5B, 0x00, 0x00, 0x04, 0x64, 0x00, 0x03, 0xFF, - 0xED, 0x00, 0x3B, 0x00, 0x54, 0x00, 0x00, 0x04, 0x64, 0x00, 0x88, 0xFF, 0xED, 0x00, 0x3B, 0x00, 0x54, 0x00, 0x00, - 0x04, 0x64, 0x00, 0x6C, 0xFF, 0xEF, 0x00, 0x39, 0x00, 0x52, 0x00, 0x00, 0x04, 0x64, 0x00, 0x0D, 0x00, 0x00, 0x00, - 0x32, 0x02, 0xA9, 0x00, 0x00, 0x04, 0x64, 0x00, 0x12, 0x00, 0x00, 0x00, 0x32, 0x02, 0xA9, 0x00, 0x00, 0x04, 0x64, - 0x00, 0x10, 0x00, 0x00, 0x00, 0x32, 0x02, 0xA9, 0x00, 0x00, 0x04, 0x64, 0x00, 0x11, 0xFF, 0x98, 0x01, 0x77, 0x01, - 0x59, 0x00, 0x00, 0x04, 0x64, 0x00, 0x0F, 0x00, 0x00, 0xFF, 0xC2, 0x01, 0x21, 0x00, 0x00, 0x04, 0x64, 0x00, 0x0E, - 0xFF, 0xD1, 0x00, 0x7D, 0x00, 0xCD, 0x00, 0x00, 0x04, 0x64, 0x00, 0x0C, 0xFF, 0xC6, 0xFF, 0xEF, 0x00, 0xC7, 0x00, - 0x00, 0x04, 0x64, 0x00, 0x07, 0x00, 0x10, 0x00, 0x35, 0x00, 0xD3, 0x00, 0x00, 0x04, 0x64, 0x00, 0x03, 0xFF, 0xE1, - 0x00, 0x3F, 0x02, 0x6F, 0x00, 0x00, 0x04, 0x64, 0x00, 0x03, 0xFE, 0xAB, 0x01, 0xD0, 0x02, 0x1E, 0x00, 0x00, 0x04, - 0x64, 0x00, 0x03, 0xFE, 0xAB, 0x01, 0xD0, 0x02, 0x1E, 0x00, 0x00, 0x04, 0x64, 0x00, 0x88, 0xFE, 0xAB, 0x01, 0xD0, - 0x02, 0x1E, 0x00, 0x00, 0x04, 0x64, 0x00, 0x6C, 0xFE, 0xAD, 0x01, 0xCE, 0x02, 0x1C, 0x00, 0x00, 0x00, 0x0F, 0x00, - 0x0A, 0x00, 0x46, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0A, 0x00, 0x46, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0A, 0x00, 0x46, - 0x00, 0x00, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x0A, 0xFF, 0xEC, 0x00, 0x37, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x06, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x05, 0xFF, 0xFB, - 0x00, 0x32, 0x00, 0x00, 0x00, 0x02, 0xFF, 0xDC, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x02, 0xFF, 0xD8, 0x00, 0x78, 0x00, - 0x00, 0x00, 0x02, 0xFF, 0xC4, 0x00, 0x78, 0x00, 0x00, 0x00, 0x02, 0xFF, 0xBA, 0x00, 0x82, 0x00, 0x00, 0x00, 0x02, - 0xFF, 0xB0, 0x00, 0x8C, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x04, +CutsceneData D_80A93E80[] = { + // Header + CS_CAM_SPLINE(13, 424, 0, 100), + + // Camera At Data + /* 0x0 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 13, 0, 21, -19, CS_CAM_REL_0), + /* 0x1 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 18, 0, 21, -19, CS_CAM_REL_0), + /* 0x2 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 16, 0, 21, -19, CS_CAM_REL_0), + /* 0x3 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 17, -26, -5, -32, CS_CAM_REL_0), + /* 0x4 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 15, 0, 18, -32, CS_CAM_REL_0), + /* 0x5 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 14, 1, 22, -27, CS_CAM_REL_0), + /* 0x6 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 12, 0, 1, -5, CS_CAM_REL_0), + /* 0x7 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 7, 16, 29, -77, CS_CAM_REL_0), + /* 0x8 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, 1, 19, 111, CS_CAM_REL_0), + /* 0x9 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -59, 21, 91, CS_CAM_REL_0), + /* 0xA */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -19, 59, 84, CS_CAM_REL_0), + /* 0xB */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 136, -19, 59, 84, CS_CAM_REL_0), + /* 0xC */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 108, -17, 57, 82, CS_CAM_REL_0), + + // Camera Eye Data + /* 0x0 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 13, 0, 50, 681, CS_CAM_REL_0), + /* 0x1 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 18, 0, 50, 681, CS_CAM_REL_0), + /* 0x2 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 16, 0, 50, 681, CS_CAM_REL_0), + /* 0x3 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 17, -104, 375, 345, CS_CAM_REL_0), + /* 0x4 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 15, 0, -62, 289, CS_CAM_REL_0), + /* 0x5 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 14, -47, 125, 205, CS_CAM_REL_0), + /* 0x6 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 12, -58, -17, 199, CS_CAM_REL_0), + /* 0x7 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 7, 16, 53, 211, CS_CAM_REL_0), + /* 0x8 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -31, 63, 623, CS_CAM_REL_0), + /* 0x9 */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -341, 464, 542, CS_CAM_REL_0), + /* 0xA */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 3, -341, 464, 542, CS_CAM_REL_0), + /* 0xB */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 136, -341, 464, 542, CS_CAM_REL_0), + /* 0xC */ CS_CAM_POINT(CS_CAM_INTERP_4, 100, 108, -339, 462, 540, CS_CAM_REL_0), + + // Camera Roll and Fov Data + /* 0x0 */ CS_CAM_MISC(15, 0xA, 70, 0), + /* 0x1 */ CS_CAM_MISC(15, 0xA, 70, 0), + /* 0x2 */ CS_CAM_MISC(15, 0xA, 70, 0), + /* 0x3 */ CS_CAM_MISC(10, 0x2, 60, 0), + /* 0x4 */ CS_CAM_MISC(10, -0x14, 55, 0), + /* 0x5 */ CS_CAM_MISC(16, 0x0, 43, 0), + /* 0x6 */ CS_CAM_MISC(12, 0x6, 47, 0), + /* 0x7 */ CS_CAM_MISC(5, -0x5, 50, 0), + /* 0x8 */ CS_CAM_MISC(2, -0x24, 108, 0), + /* 0x9 */ CS_CAM_MISC(2, -0x28, 120, 0), + /* 0xA */ CS_CAM_MISC(2, -0x3C, 120, 0), + /* 0xB */ CS_CAM_MISC(2, -0x46, 130, 0), + /* 0xC */ CS_CAM_MISC(2, -0x50, 140, 0), + + // Terminate + CS_CAM_END() }; TexturePtr D_80A9402C[] = { @@ -113,12 +141,12 @@ void func_80A90730(EnTest6* this, PlayState* play) { case ENTEST6_24: case ENTEST6_25: func_80A91690(this, play); - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); return; case ENTEST6_26: func_80A920C8(this, play); - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); return; } @@ -301,7 +329,7 @@ void EnTest6_Init(Actor* thisx, PlayState* play2) { if (((ENTEST6_GET(&this->actor) == ENTEST6_24) || (ENTEST6_GET(&this->actor) == ENTEST6_25) || (ENTEST6_GET(&this->actor) == ENTEST6_26)) && - (play->playerActorCsIds[8] == -1)) { + (play->playerCsIds[PLAYER_CS_ID_SONG_WARP] == CS_ID_NONE)) { Actor_Kill(&this->actor); return; } @@ -313,7 +341,7 @@ void EnTest6_Init(Actor* thisx, PlayState* play2) { } this->unk_286 = 0; - this->unk_274 = 0; + this->cueId = 0; this->unk_278 = 0; this->unk_276 = 99; func_80A90730(this, play); @@ -350,21 +378,21 @@ void func_80A9156C(EnTest6* this, PlayState* play) { switch (ENTEST6_GET(&this->actor)) { case ENTEST6_24: case ENTEST6_25: - if (!ActorCutscene_GetCanPlayNext(play->playerActorCsIds[8])) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); } else { - ActorCutscene_Start(play->playerActorCsIds[8], NULL); - this->subCamId = ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8]); + CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_SONG_WARP], NULL); + this->subCamId = CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); EnTest6_SetupAction(this, func_80A91760); } break; case ENTEST6_26: - if (!ActorCutscene_GetCanPlayNext(play->playerActorCsIds[8])) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); } else { - ActorCutscene_Start(play->playerActorCsIds[8], NULL); - this->subCamId = ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8]); + CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_SONG_WARP], NULL); + this->subCamId = CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); EnTest6_SetupAction(this, func_80A92188); } break; @@ -379,7 +407,7 @@ void func_80A9156C(EnTest6* this, PlayState* play) { } void func_80A91690(EnTest6* this, PlayState* play) { - this->unk_274 = 90; + this->cueId = 90; this->unk_27A = 100; this->unk_286 = 0; if (ENTEST6_GET(&this->actor) == ENTEST6_25) { @@ -394,8 +422,8 @@ void func_80A916F0(EnTest6* this, PlayState* play) { player->actor.freezeTimer = 0; play->unk_18844 = false; - ActorCutscene_Stop(play->playerActorCsIds[8]); - func_800B7298(play, NULL, PLAYER_CSMODE_6); + CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); + func_800B7298(play, NULL, PLAYER_CSMODE_END); EnTest6_DisableMotionBlur(); Distortion_ClearType(DISTORTION_TYPE_5); Actor_Kill(&this->actor); @@ -415,14 +443,14 @@ void func_80A91760(EnTest6* this, PlayState* play) { mainCam = Play_GetCamera(play, CAM_ID_MAIN); - switch (this->unk_274) { + switch (this->cueId) { case 90: this->unk_276 = 2; this->unk_15C = 0.0f; this->unk_14C = 0.1f; this->unk_282 = 0; this->unk_278 = 0; - this->unk_274 = 91; + this->cueId = 91; break; case 91: @@ -466,7 +494,7 @@ void func_80A91760(EnTest6* this, PlayState* play) { Distortion_SetType(DISTORTION_TYPE_5); Distortion_SetCountdown(80); play->unk_18844 = true; - this->unk_274 = 95; + this->cueId = 95; } break; @@ -523,7 +551,7 @@ void func_80A91760(EnTest6* this, PlayState* play) { if (this->unk_254 != NULL) { ZeldaArena_Free(this->unk_254); } - this->unk_274 = 99; + this->cueId = 99; } break; @@ -537,7 +565,7 @@ void func_80A91760(EnTest6* this, PlayState* play) { } if (this->unk_286 != 0) { - func_800B7298(play, NULL, PLAYER_CSMODE_7); + func_800B7298(play, NULL, PLAYER_CSMODE_WAIT); } else { if (this->unk_27A == 90) { func_800B7298(play, NULL, PLAYER_CSMODE_66); @@ -615,8 +643,8 @@ void func_80A92118(EnTest6* this, PlayState* play) { player->actor.freezeTimer = 0; play->unk_18844 = false; - ActorCutscene_Stop(play->playerActorCsIds[8]); - func_800B7298(play, NULL, PLAYER_CSMODE_6); + CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); + func_800B7298(play, NULL, PLAYER_CSMODE_END); EnTest6_DisableMotionBlur(); Distortion_ClearType(DISTORTION_TYPE_5); Actor_Kill(&this->actor); @@ -687,7 +715,7 @@ void func_80A92188(EnTest6* this, PlayState* play) { EnTest6_EnableMotionBlur(20); Distortion_SetType(DISTORTION_TYPE_5); Distortion_SetCountdown(90); - this->unk_274 = 2; + this->cueId = 2; break; case 110: @@ -696,34 +724,34 @@ void func_80A92188(EnTest6* this, PlayState* play) { case 38: case 114: - this->unk_274 = 1; + this->cueId = 1; break; case 76: - this->unk_274 = 3; + this->cueId = 3; break; case 61: EnTest6_EnableMotionBlur(150); - this->unk_274 = 4; + this->cueId = 4; break; case 51: EnTest6_EnableMotionBlur(180); - this->unk_274 = 5; + this->cueId = 5; break; case 14: case 15: EnTest6_EnableMotionBlur(50); Distortion_ClearType(DISTORTION_TYPE_5); - this->unk_274 = 0; + this->cueId = 0; break; case 1: EnTest6_DisableMotionBlur(); if (CHECK_EVENTINF(EVENTINF_52)) { - this->unk_274 = 9; + this->cueId = 9; } break; } @@ -731,19 +759,19 @@ void func_80A92188(EnTest6* this, PlayState* play) { func_80A92950(this, play); if (this->unk_27A == 115) { - subCamId = ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8]); + subCamId = CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); subCam = Play_GetCamera(play, subCamId); this->subCamAt = subCam->at; this->subCamEye = subCam->eye; this->subCamFov = subCam->fov; - func_8016119C(subCam, &this->unk_18C); + CutsceneCamera_Init(subCam, &this->unk_18C); } if ((this->unk_27A <= 115) && (this->unk_27A >= 16)) { - func_80161998(D_80A93E80, &this->unk_18C); + CutsceneCamera_UpdateSplines((u8*)D_80A93E80, &this->unk_18C); } else if (this->unk_27A < 16) { - subCamId = ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8]); + subCamId = CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); Play_SetCameraAtEyeUp(play, subCamId, &this->subCamAt, &this->subCamEye, &sSubCamUp); Play_SetCameraFov(play, subCamId, this->subCamFov); @@ -780,7 +808,7 @@ void func_80A92188(EnTest6* this, PlayState* play) { break; case 38: - func_800B7298(play, NULL, PLAYER_CSMODE_7); + func_800B7298(play, NULL, PLAYER_CSMODE_WAIT); break; case 14: @@ -825,13 +853,13 @@ void func_80A92950(EnTest6* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 temp_f0; s32 i; - s32 temp_v0; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 0x1F9)) { - temp_v0 = Cutscene_GetActorActionIndex(play, 0x1F9); - this->unk_274 = play->csCtx.actorActions[temp_v0]->action; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_505)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_505); + this->cueId = play->csCtx.actorCues[cueChannel]->id; - switch (this->unk_274) { + switch (this->cueId) { case 1: break; @@ -841,39 +869,39 @@ void func_80A92950(EnTest6* this, PlayState* play) { this->unk_27C = 0; player->actor.shape.shadowDraw = NULL; - if (play->csCtx.actorActions[temp_v0]->startPos.x != 0) { - this->unk_154 = (u32)play->csCtx.actorActions[temp_v0]->startPos.x; + if (play->csCtx.actorCues[cueChannel]->startPos.x != 0) { + this->unk_154 = (u32)play->csCtx.actorCues[cueChannel]->startPos.x; } else { this->unk_154 = 150.0f; } - if (play->csCtx.actorActions[temp_v0]->startPos.y != 0) { - this->unk_280 = play->csCtx.actorActions[temp_v0]->startPos.y; + if (play->csCtx.actorCues[cueChannel]->startPos.y != 0) { + this->unk_280 = play->csCtx.actorCues[cueChannel]->startPos.y; } else { this->unk_280 = 38; } - if (play->csCtx.actorActions[temp_v0]->startPos.z != 0) { - this->unk_150 = (u32)play->csCtx.actorActions[temp_v0]->startPos.z; + if (play->csCtx.actorCues[cueChannel]->startPos.z != 0) { + this->unk_150 = (u32)play->csCtx.actorCues[cueChannel]->startPos.z; } else { this->unk_150 = 480.0f; } break; case 3: - if (play->csCtx.actorActions[temp_v0]->startPos.x != 0) { - this->unk_154 += (u32)play->csCtx.actorActions[temp_v0]->startPos.x; + if (play->csCtx.actorCues[cueChannel]->startPos.x != 0) { + this->unk_154 += (u32)play->csCtx.actorCues[cueChannel]->startPos.x; } - if (play->csCtx.actorActions[temp_v0]->startPos.y != 0) { - this->unk_280 += (s16)play->csCtx.actorActions[temp_v0]->startPos.y; + if (play->csCtx.actorCues[cueChannel]->startPos.y != 0) { + this->unk_280 += (s16)play->csCtx.actorCues[cueChannel]->startPos.y; } else { this->unk_280 += 6; } - if (play->csCtx.actorActions[temp_v0]->startPos.z != 0) { - this->unk_158 = (u32)play->csCtx.actorActions[temp_v0]->startPos.z; + if (play->csCtx.actorCues[cueChannel]->startPos.z != 0) { + this->unk_158 = (u32)play->csCtx.actorCues[cueChannel]->startPos.z; } else { this->unk_158 = -32.0f; } @@ -881,30 +909,30 @@ void func_80A92950(EnTest6* this, PlayState* play) { break; case 4: - if (play->csCtx.actorActions[temp_v0]->startPos.x != 0) { - this->unk_154 += (u32)play->csCtx.actorActions[temp_v0]->startPos.x; + if (play->csCtx.actorCues[cueChannel]->startPos.x != 0) { + this->unk_154 += (u32)play->csCtx.actorCues[cueChannel]->startPos.x; } - if (play->csCtx.actorActions[temp_v0]->startPos.y != 0) { - this->unk_280 += (s16)play->csCtx.actorActions[temp_v0]->startPos.y; + if (play->csCtx.actorCues[cueChannel]->startPos.y != 0) { + this->unk_280 += (s16)play->csCtx.actorCues[cueChannel]->startPos.y; } else { this->unk_280 -= 4; } break; case 5: - if (play->csCtx.actorActions[temp_v0]->startPos.x != 0) { - this->unk_154 += (u32)play->csCtx.actorActions[temp_v0]->startPos.x; + if (play->csCtx.actorCues[cueChannel]->startPos.x != 0) { + this->unk_154 += (u32)play->csCtx.actorCues[cueChannel]->startPos.x; } - if (play->csCtx.actorActions[temp_v0]->startPos.y != 0) { - this->unk_280 += (s16)play->csCtx.actorActions[temp_v0]->startPos.y; + if (play->csCtx.actorCues[cueChannel]->startPos.y != 0) { + this->unk_280 += (s16)play->csCtx.actorCues[cueChannel]->startPos.y; } else { this->unk_280 -= 8; } - if (play->csCtx.actorActions[temp_v0]->startPos.z != 0) { - this->unk_158 += (u32)play->csCtx.actorActions[temp_v0]->startPos.z; + if (play->csCtx.actorCues[cueChannel]->startPos.z != 0) { + this->unk_158 += (u32)play->csCtx.actorCues[cueChannel]->startPos.z; } else { this->unk_158 += 20.0f; } @@ -912,7 +940,7 @@ void func_80A92950(EnTest6* this, PlayState* play) { this->unk_150 += this->unk_158; if (this->unk_150 > 3500.0f) { this->unk_150 = 3500.0f; - this->unk_274 = 0; + this->cueId = 0; } break; @@ -922,20 +950,20 @@ void func_80A92950(EnTest6* this, PlayState* play) { this->unk_27C = 0; player->actor.shape.shadowDraw = NULL; - if (play->csCtx.actorActions[temp_v0]->startPos.x != 0) { - this->unk_154 = (u32)play->csCtx.actorActions[temp_v0]->startPos.x; + if (play->csCtx.actorCues[cueChannel]->startPos.x != 0) { + this->unk_154 = (u32)play->csCtx.actorCues[cueChannel]->startPos.x; } else { this->unk_154 = 100.0f; } - if (play->csCtx.actorActions[temp_v0]->startPos.y != 0) { - this->unk_14C = (u32)play->csCtx.actorActions[temp_v0]->startPos.y; + if (play->csCtx.actorCues[cueChannel]->startPos.y != 0) { + this->unk_14C = (u32)play->csCtx.actorCues[cueChannel]->startPos.y; } else { this->unk_14C = 20.0f; } - if (play->csCtx.actorActions[temp_v0]->startPos.z != 0) { - this->unk_150 = (u32)play->csCtx.actorActions[temp_v0]->startPos.z; + if (play->csCtx.actorCues[cueChannel]->startPos.z != 0) { + this->unk_150 = (u32)play->csCtx.actorCues[cueChannel]->startPos.z; } else { this->unk_150 = 300.0f; } @@ -943,8 +971,8 @@ void func_80A92950(EnTest6* this, PlayState* play) { break; case 7: - if (play->csCtx.actorActions[temp_v0]->startPos.x != 0) { - this->unk_158 = (u32)play->csCtx.actorActions[temp_v0]->startPos.x; + if (play->csCtx.actorCues[cueChannel]->startPos.x != 0) { + this->unk_158 = (u32)play->csCtx.actorCues[cueChannel]->startPos.x; } else { this->unk_158 = -5.0f; } @@ -952,8 +980,8 @@ void func_80A92950(EnTest6* this, PlayState* play) { break; case 8: - if (play->csCtx.actorActions[temp_v0]->startPos.x != 0) { - this->unk_158 += (u32)play->csCtx.actorActions[temp_v0]->startPos.x; + if (play->csCtx.actorCues[cueChannel]->startPos.x != 0) { + this->unk_158 += (u32)play->csCtx.actorCues[cueChannel]->startPos.x; } else { this->unk_158 += 2.0f; } @@ -961,7 +989,7 @@ void func_80A92950(EnTest6* this, PlayState* play) { this->unk_154 += this->unk_158; if (this->unk_154 > 10000.0f) { this->unk_154 = 10000.0f; - this->unk_274 = 0; + this->cueId = 0; } break; @@ -987,7 +1015,7 @@ void func_80A92950(EnTest6* this, PlayState* play) { return; } } else { - switch (this->unk_274) { + switch (this->cueId) { case 2: this->unk_276 = 0; this->unk_278 = 0; @@ -1016,7 +1044,7 @@ void func_80A92950(EnTest6* this, PlayState* play) { this->unk_150 += this->unk_158; if (this->unk_150 > 3500.0f) { this->unk_150 = 3500.0f; - this->unk_274 = 0; + this->cueId = 0; } break; @@ -1041,7 +1069,7 @@ void func_80A92950(EnTest6* this, PlayState* play) { this->unk_154 += this->unk_158; if (this->unk_154 > 10000.0f) { this->unk_154 = 10000.0f; - this->unk_274 = 0; + this->cueId = 0; } break; @@ -1231,7 +1259,7 @@ void func_80A939E8(EnTest6* this, PlayState* play2) { OPEN_DISPS(play->state.gfxCtx); - switch (this->unk_274) { + switch (this->cueId) { case 91: case 93: Lights_PointSetPosition(&this->lights[0].info, player->actor.world.pos.x, player->actor.world.pos.y - 10.0f, @@ -1297,7 +1325,7 @@ void func_80A939E8(EnTest6* this, PlayState* play2) { void EnTest6_Draw(Actor* thisx, PlayState* play) { EnTest6* this = THIS; - if (this->unk_274 != 0) { + if (this->cueId != 0) { switch (this->unk_276) { case 1: func_80A93298(this, play); diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.h b/src/overlays/actors/ovl_En_Test6/z_en_test6.h index ec06afb919..d7e40a9831 100644 --- a/src/overlays/actors/ovl_En_Test6/z_en_test6.h +++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.h @@ -31,13 +31,13 @@ typedef struct EnTest6 { /* 0x15C */ f32 unk_15C; /* 0x160 */ f32 unk_160; /* 0x164 */ EnTest6Light lights[2]; - /* 0x18C */ DbCameraUnkStruct unk_18C; + /* 0x18C */ CutsceneCamera unk_18C; /* 0x20C */ Vec3f unk_20C[6]; /* 0x254 */ Vec3f (*unk_254)[64]; /* 0x258 */ Vec3f subCamAt; /* 0x264 */ Vec3f subCamEye; /* 0x270 */ f32 subCamFov; - /* 0x274 */ s16 unk_274; + /* 0x274 */ s16 cueId; /* 0x276 */ s16 unk_276; /* 0x278 */ s16 unk_278; /* 0x27A */ s16 unk_27A; diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c index 56b6c6f810..9c672ed512 100644 --- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c +++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c @@ -412,12 +412,12 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) { Audio_PlayBgm_StorePrevBgm(NA_BGM_SONG_OF_SOARING); } - if (play->playerActorCsIds[8] == -1) { + if (play->playerCsIds[PLAYER_CS_ID_SONG_WARP] == CS_ID_NONE) { Actor_Kill(&this->actor); return; } - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); player2->stateFlags1 |= PLAYER_STATE1_20; Lights_PointNoGlowSetInfo(&this->lightInfo, (Math_SinS(this->unk_1E8E) * 90.0f) + player->actor.world.pos.x, player->actor.world.pos.y + 10.0f, @@ -428,15 +428,15 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) { void EnTest7_Destroy(Actor* thisx, PlayState* play) { EnTest7* this = THIS; - ActorCutscene_Stop(play->playerActorCsIds[8]); + CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); LightContext_RemoveLight(play, &play->lightCtx, this->lightNode); } void func_80AF19A8(EnTest7* this, PlayState* play) { - if (!ActorCutscene_GetCanPlayNext(play->playerActorCsIds[8])) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); } else { - ActorCutscene_Start(play->playerActorCsIds[8], NULL); + CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_SONG_WARP], NULL); func_80AF082C(this, func_80AF1A2C); play->unk_18844 = true; } @@ -452,7 +452,8 @@ void func_80AF1A2C(EnTest7* this, PlayState* play) { func_800FD698(play, 2000, 4000, sp2C); if (this->unk_1E54 >= 10) { - Camera* subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + Camera* subCam = + Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); this->subCamEye = subCam->eye; this->subCamAt = subCam->at; @@ -514,7 +515,8 @@ void func_80AF1CA0(EnTest7* this, PlayState* play) { } if (Rand_ZeroOne() < 0.3f) { - Camera* subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + Camera* subCam = + Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); f32 rand = Rand_ZeroOne(); sp34.x = ((subCam->eye.x - this->actor.world.pos.x) * rand) + this->actor.world.pos.x; @@ -537,7 +539,7 @@ void func_80AF1E44(EnTest7* this, PlayState* play) { func_80AF1B68(this, play); if (Rand_ZeroOne() < 0.3f) { - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); rand = Rand_ZeroOne(); sp34.x = ((subCam->eye.x - this->actor.world.pos.x) * rand) + this->actor.world.pos.x; sp34.y = ((subCam->eye.y - this->actor.world.pos.y) * rand) + this->actor.world.pos.y; @@ -585,7 +587,7 @@ void func_80AF2030(EnTest7* this, PlayState* play) { this->unk_148.unk_10 -= 0x2EE0; this->actor.world.pos.y += 100.0f; - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); subCam->focalActor = NULL; subCam->eye.x = ((subCam->eye.x - this->subCamEye.x) * sp1C) + this->subCamEye.x; @@ -667,10 +669,11 @@ void func_80AF2350(EnTest7* this, PlayState* play) { gSaveContext.respawnFlag = -6; } else { play->nextEntrance = D_80AF343C[ENTEST7_GET(&this->actor) - ENTEST7_1C]; - if ((play->nextEntrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) && CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + if ((play->nextEntrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) && + CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { play->nextEntrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10); } else if ((play->nextEntrance == ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8)) && - CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) { + CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) { play->nextEntrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 8); } } @@ -685,7 +688,8 @@ void func_80AF24D8(EnTest7* this, PlayState* play, f32 arg2) { Vec3f sp3C; Vec3f* pos; Player* player = GET_PLAYER(play); - Camera* subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + Camera* subCam = + Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); pos = &player->actor.world.pos; subCam->focalActor = NULL; @@ -708,7 +712,7 @@ void func_80AF2654(EnTest7* this, PlayState* play, f32 arg2) { Camera* subCam; Vec3f sp30; - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); subCam->focalActor = NULL; pos = &player->actor.world.pos; @@ -777,7 +781,8 @@ void func_80AF29C0(EnTest7* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); Vec3f* pos = &player->actor.world.pos; - Camera* subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + Camera* subCam = + Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); subCam->at.x = ((D_80AF3454 * Math_SinS(D_80AF3450[0]) * Math_CosS(D_80AF3450[1]))) + pos->x; subCam->at.y = (Math_SinS(D_80AF3450[1]) * D_80AF3454) + pos->y; @@ -791,15 +796,15 @@ void func_80AF29C0(EnTest7* this, PlayState* play) { void func_80AF2AE8(EnTest7* this, PlayState* play) { Camera* subCam; - if (!ActorCutscene_GetCanPlayNext(play->playerActorCsIds[8])) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); return; } - ActorCutscene_Start(play->playerActorCsIds[8], NULL); + CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_SONG_WARP], NULL); func_80AF082C(this, func_80AF2C48); - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); this->subCamEye = subCam->eye; this->subCamAt = subCam->at; @@ -810,7 +815,8 @@ void func_80AF2BAC(EnTest7* this, PlayState* play, Vec3f* arg2, f32 arg3) { f32 x; f32 y; f32 z; - Camera* subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + Camera* subCam = + Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); subCam->focalActor = NULL; x = ((subCam->at.x - arg2->x) * arg3) + arg2->x; @@ -836,7 +842,7 @@ void func_80AF2C48(EnTest7* this, PlayState* play) { this->actor.world.pos.y = ((this->actor.world.pos.y - this->actor.home.pos.y) * sp24) + this->actor.home.pos.y; this->actor.world.pos.z = ((this->actor.world.pos.z - this->actor.home.pos.z) * sp24) + this->actor.home.pos.z; - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); func_80AF2BAC(this, play, &this->actor.home.pos, sp24); subCam->at.x = this->actor.world.pos.x; @@ -855,7 +861,7 @@ void func_80AF2DB4(EnTest7* this, PlayState* play) { Player* player = GET_PLAYER(play); Vec3f* pos = &player->actor.world.pos; - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); subCam->eye.x = (Math_SinS(-player->actor.shape.rot.y) * 200.0f * -0.83907f) + pos->x; subCam->eye.y = pos->y + 108.8042f; @@ -869,13 +875,13 @@ void func_80AF2DB4(EnTest7* this, PlayState* play) { void func_80AF2EC8(EnTest7* this, PlayState* play) { Camera* subCam; - if (!ActorCutscene_GetCanPlayNext(play->playerActorCsIds[8])) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[8]); + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_SONG_WARP]); } else { - ActorCutscene_Start(play->playerActorCsIds[8], NULL); + CutsceneManager_Start(play->playerCsIds[PLAYER_CS_ID_SONG_WARP], NULL); func_80AF082C(this, func_80AF2F98); - subCam = Play_GetCamera(play, ActorCutscene_GetCurrentSubCamId(play->playerActorCsIds[8])); + subCam = Play_GetCamera(play, CutsceneManager_GetCurrentSubCamId(play->playerCsIds[PLAYER_CS_ID_SONG_WARP])); this->subCamEye = subCam->eye; this->subCamAt = subCam->at; this->unk_1E54 = 40; diff --git a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c index c0ae22fd5a..10f3ea5296 100644 --- a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c +++ b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c @@ -98,8 +98,8 @@ void EnTimeTag_RooftopOath_DoNothing(EnTimeTag* this, PlayState* play) { } void EnTimeTag_RooftopOath_Cutscene(EnTimeTag* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->actionFunc = EnTimeTag_RooftopOath_DoNothing; gSaveContext.timerStates[TIMER_ID_MOON_CRASH] = TIMER_STATE_OFF; @@ -109,7 +109,7 @@ void EnTimeTag_RooftopOath_Cutscene(EnTimeTag* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_25_02); } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -117,9 +117,9 @@ void EnTimeTag_RooftopOath_Wait(EnTimeTag* this, PlayState* play) { EnTimeTag* this2 = this; if ((play->msgCtx.ocarinaMode == 3) && (play->msgCtx.lastPlayedSong == OCARINA_SONG_OATH)) { - if (this->actor.cutscene != -1) { + if (this->actor.csId != CS_ID_NONE) { this->actionFunc = EnTimeTag_RooftopOath_Cutscene; - ActorCutscene_SetIntentToPlay(this2->actor.cutscene); + CutsceneManager_Queue(this2->actor.csId); gSaveContext.timerStates[TIMER_ID_MOON_CRASH] = TIMER_STATE_OFF; } play->msgCtx.ocarinaMode = 4; @@ -127,7 +127,7 @@ void EnTimeTag_RooftopOath_Wait(EnTimeTag* this, PlayState* play) { } void EnTimeTag_SoaringEngraving_GetSong(EnTimeTag* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() != this->actor.csId) { this->actionFunc = EnTimeTag_SoaringEngraving_Wait; this->actor.textId = 0xC02; Item_Give(play, ITEM_SONG_SOARING); @@ -135,14 +135,14 @@ void EnTimeTag_SoaringEngraving_GetSong(EnTimeTag* this, PlayState* play) { } void EnTimeTag_SoaringEngraving_StartCutscene(EnTimeTag* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); this->actionFunc = EnTimeTag_SoaringEngraving_GetSong; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -211,8 +211,8 @@ void EnTimeTag_Diary_Cutscene(EnTimeTag* this, PlayState* play) { case 0x1230: // Mikau diary part 4 Message_CloseTextbox(play); this->actionFunc = EnTimeTag_Diary_Wait; - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { - ActorCutscene_Stop(this->actor.cutscene); + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { + CutsceneManager_Stop(this->actor.csId); } break; @@ -240,16 +240,16 @@ void EnTimeTag_Diary_Cutscene(EnTimeTag* this, PlayState* play) { } if (TIMETAG_DIARY_TIMER(&this->actor) != 0) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { TIMETAG_DIARY_TIMER(&this->actor) = 0; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); TIMETAG_DIARY_TIMER(&this->actor) = 0; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } @@ -301,7 +301,7 @@ void EnTimeTag_KickOut_Transition(EnTimeTag* this, PlayState* play) { */ void EnTimeTag_KickOut_WaitForTrigger(EnTimeTag* this, PlayState* play) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_KICKOUT_WAIT) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_KICKOUT_TIME_PASSED)) { - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); Message_StartTextbox(play, 0x1883 + TIMETAG_KICKOUT_GET_TEXT(&this->actor), NULL); this->actionFunc = EnTimeTag_KickOut_Transition; } @@ -334,7 +334,7 @@ void EnTimeTag_KickOut_WaitForTime(EnTimeTag* this, PlayState* play) { } } else if ((hour == TIMETAG_KICKOUT_HOUR(&this->actor)) && (minute == TIMETAG_KICKOUT_MINUTE(&this->actor)) && !Play_InCsMode(play)) { - func_800B7298(play, &this->actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT); Message_StartTextbox(play, 0x1883 + TIMETAG_KICKOUT_GET_TEXT(&this->actor), NULL); this->actionFunc = EnTimeTag_KickOut_Transition; } diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 91fd666354..d434bacaa6 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -247,7 +247,7 @@ void EnTk_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.flags |= ACTOR_FLAG_10; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4); - SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList)); switch (this->unk_2B0) { case 4: @@ -705,16 +705,16 @@ void func_80AED940(EnTk* this, PlayState* play) { void func_80AEDBEC(EnTk* this, PlayState* play) { this->actor.params = -1; - this->unk_2E8 = 0; + this->csLength = 0; this->actor.speed = 0.0f; SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4); this->actionFunc = func_80AEDC4C; } void func_80AEDC4C(EnTk* this, PlayState* play) { - if ((this->actor.params >= 0) && SubS_StartActorCutscene(&this->actor, this->cutscenes[1], this->actor.params, - SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { - this->unk_2E8 = ActorCutscene_GetLength(this->cutscenes[1]); + if ((this->actor.params >= 0) && + SubS_StartCutscene(&this->actor, this->csIdList[1], this->actor.params, SUBS_CUTSCENE_WITH_PLAYER)) { + this->csLength = CutsceneManager_GetLength(this->csIdList[1]); Message_ContinueTextbox(play, 0x1411); func_80AEDCBC(this, play); } @@ -731,9 +731,9 @@ void func_80AEDCBC(EnTk* this, PlayState* play) { } void func_80AEDD4C(EnTk* this, PlayState* play) { - this->unk_2E8--; - if (this->unk_2E8 <= 0) { - ActorCutscene_Stop(this->cutscenes[1]); + this->csLength--; + if (this->csLength <= 0) { + CutsceneManager_Stop(this->csIdList[1]); Message_CloseTextbox(play); Actor_Kill(&this->actor); } @@ -901,7 +901,7 @@ void func_80AEE2A8(EnTk* this, PlayState* play) { } void func_80AEE2C0(EnTk* this, PlayState* play) { - if (SubS_StartActorCutscene(&this->actor, this->cutscenes[0], 0x7C, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + if (SubS_StartCutscene(&this->actor, this->csIdList[0], CS_ID_GLOBAL_TALK, SUBS_CUTSCENE_WITH_PLAYER)) { func_80AEE374(this, play); } } @@ -995,15 +995,15 @@ void func_80AEE650(EnTk* this, PlayState* play) { void func_80AEE6B8(EnTk* this, PlayState* play) { if (this->unk_2CA & 0x20) { if (this->unk_2E4 >= 3) { - ActorCutscene_Stop(this->cutscenes[0]); + CutsceneManager_Stop(this->csIdList[0]); Message_CloseTextbox(play); func_80AEDBEC(this, play); - } else if (SubS_StartActorCutscene(&this->actor, 0x7C, this->cutscenes[0], SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + } else if (SubS_StartCutscene(&this->actor, CS_ID_GLOBAL_TALK, this->csIdList[0], SUBS_CUTSCENE_WITH_PLAYER)) { this->unk_310 = 3; func_80AEDE10(this, play); this->unk_2CA &= ~0x20; } - } else if (SubS_StartActorCutscene(&this->actor, 0x7C, this->cutscenes[0], SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + } else if (SubS_StartCutscene(&this->actor, CS_ID_GLOBAL_TALK, this->csIdList[0], SUBS_CUTSCENE_WITH_PLAYER)) { this->unk_310 = 4; func_80AEDE10(this, play); } diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h index 42a8aa96ad..9604133e7f 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -36,13 +36,13 @@ typedef struct EnTk { /* 0x2E0 */ s32 unk_2E0; /* 0x2E4 */ s16 unk_2E4; /* 0x2E6 */ u16 unk_2E6; - /* 0x2E8 */ s16 unk_2E8; + /* 0x2E8 */ s16 csLength; /* 0x2EC */ Vec3f unk_2EC; /* 0x2F8 */ Vec3s unk_2F8; /* 0x300 */ Vec3f unk_300; /* 0x30C */ EnTkUnkFunc unk_30C; /* 0x310 */ s16 unk_310; - /* 0x312 */ s16 cutscenes[2]; + /* 0x312 */ s16 csIdList[2]; /* 0x316 */ s16 unk_316; /* 0x318 */ s16 unk_318; /* 0x31A */ s16 unk_31A; diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c index 54ed5babc1..3a563ab609 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -312,7 +312,7 @@ void func_80BA3CC4(EnToto* this, PlayState* play) { } void func_80BA3D38(EnToto* this, PlayState* play) { - this->cutscene = this->actor.cutscene; + this->csId = this->actor.csId; this->text = ENTOTO_WEEK_EVENT_FLAGS ? D_80BA50BC : D_80BA5088; func_80BA4C0C(this, play); play->actorCtx.flags |= ACTORCTX_FLAG_5; @@ -343,7 +343,7 @@ void func_80BA3DBC(EnToto* this, PlayState* play) { } func_80BA36C0(this, play, 0); - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); play->actorCtx.flags &= ~ACTORCTX_FLAG_5; } @@ -357,7 +357,7 @@ s32 func_80BA3ED4(EnToto* this, PlayState* play) { s32 func_80BA3EE8(EnToto* this, PlayState* play) { if (this->text->unk1 == 2) { - func_800B7298(play, NULL, PLAYER_CSMODE_7); + func_800B7298(play, NULL, PLAYER_CSMODE_WAIT); } return 0; } @@ -389,21 +389,21 @@ s32 func_80BA3FCC(EnToto* this, PlayState* play) { } s32 func_80BA402C(EnToto* this, PlayState* play) { - s16 prevCutscene = this->cutscene; + s16 prevCsId = this->csId; - this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene); - ActorCutscene_SetIntentToPlay(this->cutscene); - ActorCutscene_Stop(prevCutscene); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); + CutsceneManager_Queue(this->csId); + CutsceneManager_Stop(prevCsId); return 0; } s32 func_80BA407C(EnToto* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscene, &GET_PLAYER(play)->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &GET_PLAYER(play)->actor); return 1; } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); return 0; } @@ -452,7 +452,7 @@ s32 func_80BA42BC(EnToto* this, PlayState* play) { Vec3s* end = &D_80BA510C[3]; func_80BA3FB0(this, play); - func_800B7298(play, NULL, PLAYER_CSMODE_6); + func_800B7298(play, NULL, PLAYER_CSMODE_END); if (player->actor.world.pos.z > -310.0f) { if ((player->actor.world.pos.x > -150.0f) || (player->actor.world.pos.z > -172.0f)) { phi_s0 = 3; @@ -480,14 +480,14 @@ s32 func_80BA43F4(EnToto* this, PlayState* play) { s32 func_80BA445C(EnToto* this, PlayState* play) { if (func_80BA4128(this, play)) { - func_800B7298(play, NULL, PLAYER_CSMODE_6); + func_800B7298(play, NULL, PLAYER_CSMODE_END); return 1; } return 0; } s32 func_80BA44A0(EnToto* this, PlayState* play) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->unk2B1 = 0; return 0; } @@ -675,17 +675,17 @@ s32 func_80BA4C44(EnToto* this, PlayState* play) { } void func_80BA4CB4(EnToto* this, PlayState* play) { - CsCmdActorAction* action = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 525)]; + CsCmdActorCue* cue = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_525)]; - if (this->unk2B5 != action->action) { - this->unk2B5 = action->action; - if (this->unk2B5 != 4) { - if (this->unk2B5 == 3) { + if (this->cueId != cue->id) { + this->cueId = cue->id; + if (this->cueId != 4) { + if (this->cueId == 3) { Animation_MorphToPlayOnce(&this->skelAnime, &object_zm_Anim_001DF0, -4.0f); } else { Animation_PlayOnce(&this->skelAnime, - this->unk2B5 == 1 ? &object_zm_Anim_0016A4 : &object_zm_Anim_0022C8); - if (this->unk2B5 == 2 && this->unk2B3 != 0xF) { + (this->cueId == 1) ? &object_zm_Anim_0016A4 : &object_zm_Anim_0022C8); + if ((this->cueId == 2) && (this->unk2B3 != 0xF)) { func_80151BB4(play, 9); func_80151BB4(play, 10); } @@ -694,11 +694,11 @@ void func_80BA4CB4(EnToto* this, PlayState* play) { } Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x320); if (SkelAnime_Update(&this->skelAnime)) { - if (this->unk2B5 != 3) { - Animation_PlayLoop(&this->skelAnime, this->unk2B5 == 1 ? &object_zm_Anim_00C880 : &object_zm_Anim_001324); + if (this->cueId != 3) { + Animation_PlayLoop(&this->skelAnime, (this->cueId == 1) ? &object_zm_Anim_00C880 : &object_zm_Anim_001324); } } - if (this->unk2B5 == 4 && !Actor_HasParent(&this->actor, play)) { + if ((this->cueId == 4) && !Actor_HasParent(&this->actor, play)) { Actor_OfferGetItem(&this->actor, play, GI_MASK_CIRCUS_LEADER, 9999.9f, 9999.9f); } } @@ -707,7 +707,7 @@ void EnToto_Update(Actor* thisx, PlayState* play) { EnToto* this = THIS; s32 pad; - if (Cutscene_CheckActorAction(play, 0x20D)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_525)) { func_80BA4CB4(this, play); } else { D_80BA51B8[this->actionFuncIndex](this, play); diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.h b/src/overlays/actors/ovl_En_Toto/z_en_toto.h index 3c95a7dbb5..cf9f3c718f 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.h +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.h @@ -30,10 +30,10 @@ typedef struct EnToto { /* 0x264 */ ColliderCylinder collider; /* 0x2B0 */ u8 actionFuncIndex; /* 0x2B1 */ u8 unk2B1; - /* 0x2B2 */ s8 cutscene; + /* 0x2B2 */ s8 csId; /* 0x2B3 */ u8 unk2B3; /* 0x2B4 */ u8 unk2B4; - /* 0x2B5 */ u8 unk2B5; + /* 0x2B5 */ u8 cueId; /* 0x2B6 */ u8 unk2B6; /* 0x2B7 */ u8 unk2B7; /* 0x2B8 */ EnTotoText* text; diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index 6decc1150c..e4a4a4ab88 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -170,22 +170,22 @@ void EnTrt_UpdateCursorPos(PlayState* play, EnTrt* this) { void EnTrt_SetupGetMushroomCutscene(EnTrt* this) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - if (this->cutscene != this->tmpGetMushroomCutscene) { - ActorCutscene_Stop(this->cutscene); - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (this->csId != this->tmpGetMushroomCsId) { + CutsceneManager_Stop(this->csId); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->tmpGetMushroomCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->tmpGetMushroomCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } } if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING_SPECIAL; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -213,7 +213,7 @@ void EnTrt_EndInteraction(PlayState* play, EnTrt* this) { Player* player = GET_PLAYER(play); if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } Actor_ProcessTalkRequest(&this->actor, &play->state); @@ -318,11 +318,11 @@ void EnTrt_Hello(EnTrt* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) { @@ -337,7 +337,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); Player* player = GET_PLAYER(play); - this->tmpGetMushroomCutscene = this->getMushroomCutscene; + this->tmpGetMushroomCsId = this->getMushroomCsId; if (this->cutsceneState != ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { EnTrt_SetupGetMushroomCutscene(this); if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { @@ -357,7 +357,7 @@ void EnTrt_GetMushroom(EnTrt* this, PlayState* play) { break; case 0x889: if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } play->msgCtx.msgMode = 0x43; @@ -402,7 +402,7 @@ void EnTrt_StartRedPotionConversation(EnTrt* this, PlayState* play) { if (this->textId == 0x88F) { if (Inventory_HasEmptyBottle() || !CHECK_WEEKEVENTREG(WEEKEVENTREG_12_10)) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } play->msgCtx.msgMode = 0x43; @@ -465,18 +465,18 @@ void EnTrt_GivenRedPotionForKoume(EnTrt* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); player->stateFlags2 |= PLAYER_STATE2_20000000; //! @bug: EnTrt_ContinueShopping gets overwritten by EnTrt_ItemGiven this->actionFunc = EnTrt_ContinueShopping; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } } func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); @@ -517,19 +517,19 @@ void EnTrt_FaceShopkeeper(EnTrt* this, PlayState* play) { u8 cursorIndex; if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookForwardCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookForwardCutscene; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } else if (talkState == TEXT_STATE_CHOICE) { func_8011552C(play, DO_ACTION_DECIDE); @@ -551,25 +551,25 @@ void EnTrt_FaceShopkeeper(EnTrt* this, PlayState* play) { void EnTrt_LookToShelf(EnTrt* this, PlayState* play) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShelfCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShelfCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } else if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; EnTrt_UpdateCursorPos(play, this); this->actionFunc = EnTrt_BrowseShelf; Message_ContinueTextbox(play, EnTrt_GetItemTextId(this)); } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -675,7 +675,7 @@ void EnTrt_HandleCanBuyItem(PlayState* play, EnTrt* this) { switch (item->canBuyFunc(play, item)) { case CANBUY_RESULT_SUCCESS_1: if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } func_8019F208(); @@ -746,7 +746,7 @@ void EnTrt_SelectItem(EnTrt* this, PlayState* play) { EnTrt_SetupCannotBuy(play, this, 0x846); } else { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } EnTrt_SetupBuyItemWithFanfare(play, this); @@ -790,11 +790,11 @@ void EnTrt_IdleSleeping(EnTrt* this, PlayState* play) { this->flags |= ENTRT_MET; } if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookForwardCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookForwardCutscene; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } player->stateFlags2 |= PLAYER_STATE2_20000000; @@ -831,11 +831,11 @@ void EnTrt_IdleAwake(EnTrt* this, PlayState* play) { } if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookForwardCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookForwardCutscene; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } player->stateFlags2 |= PLAYER_STATE2_20000000; @@ -866,11 +866,11 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) { s16 animLastFrame = Animation_GetLastFrame(&gKotakeWakeUpAnim) / (s16)this->skelAnime.playSpeed; if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING_SPECIAL; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } else if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { if (this->animIndex != TRT_ANIM_HANDS_ON_COUNTER) { @@ -923,11 +923,11 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) { void EnTrt_Surprised(EnTrt* this, PlayState* play) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING_SPECIAL; } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } else if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) { if (DECR(this->timer) == 0) { @@ -954,7 +954,7 @@ void EnTrt_TryToGiveRedPotionAfterSurprised(EnTrt* this, PlayState* play) { if ((talkState == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { if (Inventory_HasEmptyBottle() || !CHECK_WEEKEVENTREG(WEEKEVENTREG_12_10)) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } this->actionFunc = EnTrt_GiveRedPotionForKoume; @@ -973,7 +973,7 @@ void EnTrt_TryToGiveRedPotion(EnTrt* this, PlayState* play) { if (this->textId == 0x83C) { if (Inventory_HasEmptyBottle()) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } play->msgCtx.msgMode = 0x43; @@ -997,17 +997,17 @@ void EnTrt_ItemGiven(EnTrt* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); player->stateFlags2 |= PLAYER_STATE2_20000000; this->actionFunc = EnTrt_ContinueShopping; this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } } if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { @@ -1054,7 +1054,7 @@ void EnTrt_ShopkeeperGone(EnTrt* this, PlayState* play) { } } if ((talkState == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { play->nextEntrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 5); } else { play->nextEntrance = ENTRANCE(SOUTHERN_SWAMP_POISONED, 5); @@ -1098,11 +1098,11 @@ void EnTrt_SetupItemGiven(EnTrt* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { this->actionFunc = EnTrt_ItemGiven; if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); } func_800B85E0(&this->actor, play, 400.0f, PLAYER_IA_MINUS1); } @@ -1440,23 +1440,23 @@ void EnTrt_SetupLookToShopkeeperFromShelf(PlayState* play, EnTrt* this) { void EnTrt_LookToShopkeeperFromShelf(EnTrt* this, PlayState* play) { if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) { - ActorCutscene_Stop(this->cutscene); + CutsceneManager_Stop(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED; } if (this->cutsceneState == ENTRT_CUTSCENESTATE_STOPPED) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); + this->csId = this->lookToShopkeeperCsId; + CutsceneManager_Queue(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } else if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_StartAndSetFlag(this->cutscene, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING; EnTrt_StartShopping(play, this); } else { - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } } @@ -1473,7 +1473,7 @@ void EnTrt_InitShopkeeper(EnTrt* this, PlayState* play) { void EnTrt_InitShop(EnTrt* this, PlayState* play) { EnTrt_GetCutscenes(this, play); - this->cutscene = this->lookForwardCutscene; + this->csId = this->lookForwardCutscene; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); EnTrt_InitShopkeeper(this, play); this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -1553,10 +1553,10 @@ void EnTrt_InitShop(EnTrt* this, PlayState* play) { } void EnTrt_GetCutscenes(EnTrt* this, PlayState* play) { - this->lookForwardCutscene = this->actor.cutscene; - this->lookToShelfCutscene = ActorCutscene_GetAdditionalCutscene(this->lookForwardCutscene); - this->lookToShopkeeperCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToShelfCutscene); - this->getMushroomCutscene = ActorCutscene_GetAdditionalCutscene(this->lookToShopkeeperCutscene); + this->lookForwardCutscene = this->actor.csId; + this->lookToShelfCsId = CutsceneManager_GetAdditionalCsId(this->lookForwardCutscene); + this->lookToShopkeeperCsId = CutsceneManager_GetAdditionalCsId(this->lookToShelfCsId); + this->getMushroomCsId = CutsceneManager_GetAdditionalCsId(this->lookToShopkeeperCsId); } void EnTrt_DrawCursor(PlayState* play, EnTrt* this, f32 x, f32 y, f32 z, u8 drawCursor) { diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.h b/src/overlays/actors/ovl_En_Trt/z_en_trt.h index c81032af53..dfa3ba5c42 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.h +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.h @@ -35,8 +35,8 @@ typedef struct EnTrt { /* 0x3D6 */ s16 blinkTimer; /* 0x3D8 */ s16 eyeTexIndex; /* 0x3DC */ EnTrtBlinkFunc blinkFunc; - /* 0x3E0 */ s16 cutscene; - /* 0x3E2 */ s16 tmpGetMushroomCutscene; + /* 0x3E0 */ s16 csId; + /* 0x3E2 */ s16 tmpGetMushroomCsId; /* 0x3E4 */ Vec3f cursorPos; /* 0x3F0 */ Color_RGBAu32 cursorColor; /* 0x400 */ u8 drawCursor; @@ -46,9 +46,9 @@ typedef struct EnTrt { /* 0x408 */ u16 prevTextId; /* 0x40A */ u16 talkOptionTextId; /* 0x40C */ s16 lookForwardCutscene; - /* 0x40E */ s16 lookToShelfCutscene; - /* 0x410 */ s16 lookToShopkeeperCutscene; - /* 0x412 */ s16 getMushroomCutscene; + /* 0x40E */ s16 lookToShelfCsId; + /* 0x410 */ s16 lookToShopkeeperCsId; + /* 0x412 */ s16 getMushroomCsId; /* 0x414 */ UNK_TYPE1 pad414[0x2]; /* 0x416 */ Vec3s headRot; /* 0x41C */ Vec3f headPos; diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c index cdf1c64830..67f52e064a 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -189,15 +189,15 @@ void func_80AD3530(EnTrt2* this, PlayState* play) { } void func_80AD3664(EnTrt2* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); if (this->unk_3D9 == 0) { this->unk_3B2 = 1; } else { this->unk_3B2 = 2; } } else { - ActorCutscene_SetIntentToPlay(this->unk_3DA); + CutsceneManager_Queue(this->csId); return; } func_800B9010(&this->actor, NA_SE_EN_KOTAKE_FLY - SFX_FLAG); @@ -217,9 +217,9 @@ void func_80AD36EC(EnTrt2* this, PlayState* play) { this->unk_3D9 = 1; this->actor.velocity.y = 0.0f; this->path = SubS_GetPathByIndex(play, this->path->unk1, -1); - ActorCutscene_Stop(this->unk_3DA); - this->unk_3DA = ActorCutscene_GetAdditionalCutscene(this->unk_3DA); - ActorCutscene_SetIntentToPlay(this->unk_3DA); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); + CutsceneManager_Queue(this->csId); this->unk_3B2 = 0; } else { this->unk_1E4++; @@ -262,7 +262,7 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { this->actor.world.rot.x = -this->actor.shape.rot.x; if (func_80AD475C(this, this->path, this->unk_1E4)) { if (this->unk_1E4 >= (this->path->count - 1)) { - ActorCutscene_Stop(this->unk_3DA); + CutsceneManager_Stop(this->csId); this->unk_3D9 = 2; } else { this->unk_1E4++; @@ -271,7 +271,7 @@ void func_80AD38B8(EnTrt2* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->unk_1E4 >= (this->path->count - 1)) { - ActorCutscene_Stop(this->unk_3DA); + CutsceneManager_Stop(this->csId); this->unk_3D9 = 2; } else { sp30.y = this->actor.wallYaw; @@ -466,15 +466,15 @@ void func_80AD417C(EnTrt2* this, PlayState* play) { void func_80AD4298(EnTrt2* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); player->stateFlags1 |= PLAYER_STATE1_20; this->unk_3B2 = 6; } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->unk_3DA); + CutsceneManager_Queue(this->csId); } } @@ -492,7 +492,7 @@ void func_80AD434C(EnTrt2* this, PlayState* play) { if (this->actor.world.pos.y > 200.0f) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->unk_3B2 = 0x13; - ActorCutscene_Stop(this->unk_3DA); + CutsceneManager_Stop(this->csId); } else { s32 i; Vec3f sp68; @@ -738,7 +738,7 @@ void func_80AD4DB4(EnTrt2* this, PlayState* play) { this->unk_3C0 = 0; this->unk_3D8 = false; - this->unk_3DA = this->actor.cutscene; + this->csId = this->actor.csId; this->unk_3B6 = 20; this->unk_3B8 = 0; this->unk_3BC = func_80AD4608; diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h index 44c2565f7e..f30f41d800 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h @@ -38,7 +38,7 @@ typedef struct EnTrt2 { /* 0x3D6 */ s16 unk_3D6; /* 0x3D8 */ u8 unk_3D8; /* 0x3D9 */ u8 unk_3D9; - /* 0x3DA */ s16 unk_3DA; + /* 0x3DA */ s16 csId; } EnTrt2; // size = 0x3DC #endif // Z_EN_TRT2_H diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index a9335f8507..bb146784de 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -771,7 +771,7 @@ s32 func_80A875AC(Actor* thisx, PlayState* play) { switch (this->unk_364) { case 0: if ((this->unk_34E & 0x40) || CHECK_WEEKEVENTREG(WEEKEVENTREG_16_10)) { - this->unk_374 = this->actor.cutscene; + this->csId = this->actor.csId; this->unk_364++; } else { this->unk_364++; @@ -780,14 +780,14 @@ s32 func_80A875AC(Actor* thisx, PlayState* play) { } case 1: - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_374); - } else if (ActorCutscene_GetCanPlayNext(this->unk_374)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_374, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId); + } else if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_364++; } else { - ActorCutscene_SetIntentToPlay(this->unk_374); + CutsceneManager_Queue(this->csId); } break; @@ -867,19 +867,19 @@ s32 func_80A87880(Actor* thisx, PlayState* play) { switch (this->unk_364) { case 0: - ActorCutscene_Stop(this->unk_374); - this->unk_374 = ActorCutscene_GetAdditionalCutscene(this->unk_374); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); this->unk_364++; case 1: - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_374); - } else if (ActorCutscene_GetCanPlayNext(this->unk_374)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_374, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId); + } else if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_364++; } else { - ActorCutscene_SetIntentToPlay(this->unk_374); + CutsceneManager_Queue(this->csId); } break; @@ -999,19 +999,19 @@ s32 func_80A87DC0(Actor* thisx, PlayState* play) { switch (this->unk_364) { case 0: - ActorCutscene_Stop(this->unk_374); - this->unk_374 = ActorCutscene_GetAdditionalCutscene(this->unk_374); + CutsceneManager_Stop(this->csId); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); this->unk_364++; case 1: - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_374); - } else if (ActorCutscene_GetCanPlayNext(this->unk_374)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_374, &this->actor); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csId); + } else if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->actor); this->unk_364++; } else { - ActorCutscene_SetIntentToPlay(this->unk_374); + CutsceneManager_Queue(this->csId); } break; @@ -1102,8 +1102,8 @@ void func_80A881E0(EnTru* this, PlayState* play) { this->unk_34E |= 0x80; } - if (ActorCutscene_GetCurrentIndex() != -1) { - ActorCutscene_Stop(ActorCutscene_GetCurrentIndex()); + if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) { + CutsceneManager_Stop(CutsceneManager_GetCurrentCsId()); } if (!(this->unk_34E & 0x40) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_16_10)) { diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.h b/src/overlays/actors/ovl_En_Tru/z_en_tru.h index 48964b555e..c6d2af00c9 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.h +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.h @@ -49,7 +49,7 @@ typedef struct EnTru { /* 0x36E */ s16 eyeTexIndex; /* 0x370 */ s16 unk_370; /* 0x372 */ s16 unk_372; - /* 0x374 */ s16 unk_374; + /* 0x374 */ s16 csId; /* 0x378 */ EnTruUnkFunc unk_378; /* 0x37C */ s32 animIndex; /* 0x380 */ UNK_TYPE1 unk380[0x4]; diff --git a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c index aaa022f7ae..22ce0600c5 100644 --- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c +++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c @@ -103,7 +103,7 @@ void func_80ADFCEC(EnTsn* this, PlayState* play) { break; } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { if ((ENTSN_GET_F(&this->actor)) == ENTSN_F_0) { this->actionFunc = func_80AE0D78; } else { @@ -144,7 +144,7 @@ void EnTsn_Init(Actor* thisx, PlayState* play) { this->actor.terminalVelocity = -9.0f; this->actor.gravity = -1.0f; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); } } @@ -369,7 +369,7 @@ void func_80AE0698(EnTsn* this, PlayState* play) { this->actionFunc = func_80AE0C88; this->unk_220 &= ~2; this->actor.focus.pos = this->actor.world.pos; - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); ENTSN_SET_Z(&this->unk_1D8->actor, false); } @@ -433,7 +433,7 @@ void func_80AE0704(EnTsn* this, PlayState* play) { func_80AE0460(this, play); this->unk_220 &= ~2; this->actor.focus.pos = this->actor.world.pos; - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); this->actor.flags &= ~ACTOR_FLAG_TALK_REQUESTED; REMOVE_QUEST_ITEM(QUEST_PICTOGRAPH); } else { @@ -515,16 +515,16 @@ void func_80AE0704(EnTsn* this, PlayState* play) { } if (this->unk_220 & 4) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { this->unk_220 &= ~4; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->unk_220 &= ~4; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } @@ -545,7 +545,7 @@ void func_80AE0D10(EnTsn* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); this->actionFunc = func_80AE0D78; - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c index 3f15ff8c81..6d5522e8a8 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c @@ -126,9 +126,9 @@ void EnWarpTag_Unused809C09A0(EnWarptag* this, PlayState* play) { */ void EnWarpTag_Unused809C0A20(EnWarptag* this, PlayState* play) { if (play->msgCtx.ocarinaMode == 9) { - func_800B7298(play, NULL, PLAYER_CSMODE_7); + func_800B7298(play, NULL, PLAYER_CSMODE_WAIT); this->actionFunc = EnWarpTag_RespawnPlayer; - ActorCutscene_Stop(ActorCutscene_GetCurrentIndex()); + CutsceneManager_Stop(CutsceneManager_GetCurrentCsId()); } else if (play->msgCtx.ocarinaMode >= 2) { play->msgCtx.ocarinaMode = 4; @@ -141,7 +141,7 @@ void EnWarpTag_Unused809C0A20(EnWarptag* this, PlayState* play) { */ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) { ActorEntry* playerActorEntry; - Player* player; + Player* player = GET_PLAYER(play); s32 playerSpawnIndex; s32 new15E; s32 entrance; @@ -149,13 +149,13 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) { u8 playerForm; s16 playerParams; - player = GET_PLAYER(play); - if (play->playerActorCsIds[4] >= 0 && ActorCutscene_GetCurrentIndex() != play->playerActorCsIds[4]) { - if (ActorCutscene_GetCanPlayNext(play->playerActorCsIds[4]) == 0) { - ActorCutscene_SetIntentToPlay(play->playerActorCsIds[4]); + if (play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON] >= 0 && + CutsceneManager_GetCurrentCsId() != play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON]) { + if (!CutsceneManager_IsNext(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON])) { + CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON]); } else { - ActorCutscene_StartAndSetUnkLinkFields(play->playerActorCsIds[4], &this->dyna.actor); + CutsceneManager_StartWithPlayerCs(play->playerCsIds[PLAYER_CS_ID_WARP_PAD_MOON], &this->dyna.actor); Player_PlaySfx(player, NA_SE_PL_WARP_PLATE); Play_EnableMotionBlur(0); } @@ -231,11 +231,11 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) { * ActionFunc: Deku Playground, return to North Clock Town. */ void EnWarpTag_GrottoReturn(EnWarptag* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() != this->dyna.actor.cutscene) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_GetCurrentCsId() != this->dyna.actor.csId) { + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 530b75b0e0..e81b5dabc4 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -77,7 +77,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { EnWeatherTag_SetupAction(this, func_80966A08); break; case WEATHERTAG_TYPE_UNK1: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) { Actor_Kill(&this->actor); } EnWeatherTag_SetupAction(this, func_80966B08); @@ -246,11 +246,11 @@ void func_80966B08(EnWeatherTag* this, PlayState* play) { // because it uses cutsecnes.. is this the clear ikana cutcsene? void func_80966BF4(EnWeatherTag* this, PlayState* play) { u8 newUnk20; - CsCmdActorAction* tmpAction; + CsCmdActorCue* cue; - if (Cutscene_CheckActorAction(play, 567)) { - tmpAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 567)]; - if ((play->csCtx.frames >= tmpAction->startFrame) && (tmpAction->action >= 2)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_567)) { + cue = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_567)]; + if ((play->csCtx.curFrame >= cue->startFrame) && (cue->id >= 2)) { switch (gSaveContext.save.day) { case 0: case 1: @@ -379,14 +379,13 @@ void func_80967060(EnWeatherTag* this, PlayState* play) { // type 4_3, start cutscene then die? void func_80967148(EnWeatherTag* this, PlayState* play) { - s16 tempCutscene; + s16 csId = this->actor.csId; - tempCutscene = this->actor.cutscene; - if (ActorCutscene_GetCanPlayNext(tempCutscene)) { - ActorCutscene_Start(tempCutscene, &this->actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_Start(csId, &this->actor); EnWeatherTag_SetupAction(this, EnWeatherTag_DoNothing); } else { - ActorCutscene_SetIntentToPlay(tempCutscene); + CutsceneManager_Queue(csId); } } @@ -485,7 +484,7 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if ((play->actorCtx.flags & ACTORCTX_FLAG_1) && (play->msgCtx.msgMode != 0) && (play->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&play->state) && - (play->transitionTrigger == TRANS_TRIGGER_OFF) && (ActorCutscene_GetCurrentIndex() == -1) && + (play->transitionTrigger == TRANS_TRIGGER_OFF) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && (play->csCtx.state == 0)) { gSaveContext.save.time = ((void)0, gSaveContext.save.time) + (u16)R_TIME_SPEED; diff --git a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c index ac8375c242..125be50565 100644 --- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c +++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c @@ -668,13 +668,13 @@ void EnWiz_MoveGhosts(EnWiz* this) { } void EnWiz_StartIntroCutscene(EnWiz* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetFlag(this->actor.cutscene, &this->actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCsAndSetFlag(this->actor.csId, &this->actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); this->actor.flags |= ACTOR_FLAG_100000; EnWiz_SetupAppear(this, play); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -828,13 +828,13 @@ void EnWiz_Dance(EnWiz* this, PlayState* play) { } void EnWiz_SetupSecondPhaseCutscene(EnWiz* this, PlayState* play) { - s16 secondPhaseCutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + s16 secondPhaseCsId = CutsceneManager_GetAdditionalCsId(this->actor.csId); - if (!ActorCutscene_GetCanPlayNext(secondPhaseCutscene)) { - ActorCutscene_SetIntentToPlay(secondPhaseCutscene); + if (!CutsceneManager_IsNext(secondPhaseCsId)) { + CutsceneManager_Queue(secondPhaseCsId); } else { - ActorCutscene_StartAndSetFlag(secondPhaseCutscene, &this->actor); - this->subCamId = ActorCutscene_GetCurrentSubCamId(secondPhaseCutscene); + CutsceneManager_StartWithPlayerCsAndSetFlag(secondPhaseCsId, &this->actor); + this->subCamId = CutsceneManager_GetCurrentSubCamId(secondPhaseCsId); this->actor.flags |= ACTOR_FLAG_100000; EnWiz_ChangeAnim(this, EN_WIZ_ANIM_DANCE, false); this->action = EN_WIZ_ACTION_RUN_BETWEEN_PLATFORMS; @@ -885,7 +885,7 @@ void EnWiz_SecondPhaseCutscene(EnWiz* this, PlayState* play) { this->platformCount = 0; this->fightState = EN_WIZ_FIGHT_STATE_SECOND_PHASE_GHOSTS_COPY_WIZROBE; this->timer = 0; - ActorCutscene_Stop(ActorCutscene_GetAdditionalCutscene(this->actor.cutscene)); + CutsceneManager_Stop(CutsceneManager_GetAdditionalCsId(this->actor.csId)); this->actor.flags &= ~ACTOR_FLAG_100000; EnWiz_SetupDisappear(this); return; @@ -1037,7 +1037,7 @@ void EnWiz_Disappear(EnWiz* this, PlayState* play) { if ((this->introCutsceneState == EN_WIZ_INTRO_CS_DISAPPEAR) && (this->introCutsceneTimer == 0)) { this->introCutsceneState = EN_WIZ_INTRO_CS_END; - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); this->actor.flags &= ~ACTOR_FLAG_100000; } diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 9b74a97ac9..3c0357999d 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -202,7 +202,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_ANI, this->actor.world.pos.x, this->actor.world.pos.y + 120.0f, this->actor.world.pos.z - 15.0f, 0, 0, 0, 1); if (this->actor.child != NULL) { - this->actor.child->cutscene = this->actor.cutscene; + this->actor.child->csId = this->actor.csId; } this->unk_151 = 1; } else { diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c index 35bd7113e1..c5224f8e8c 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c @@ -81,7 +81,7 @@ static Vec3f D_80BFB300 = { 500.0f, -500.0f, 0.0f }; void EnYb_Init(Actor* thisx, PlayState* play) { EnYb* this = THIS; - s16 tempCutscene; + s16 csId; s32 i; Actor_SetScale(&this->actor, 0.01f); @@ -102,17 +102,17 @@ void EnYb_Init(Actor* thisx, PlayState* play) { EnYb_ChangeAnim(play, this, 2, ANIMMODE_LOOP, 0.0f); - tempCutscene = this->actor.cutscene; - for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) { - this->cutscenes[i] = tempCutscene; - if (tempCutscene != -1) { - this->actor.cutscene = tempCutscene; - tempCutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + csId = this->actor.csId; + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = csId; + if (csId != CS_ID_NONE) { + this->actor.csId = csId; + csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } } - this->cutsceneIndex = -1; - this->actor.cutscene = this->cutscenes[0]; + this->csIdIndex = -1; + this->actor.csId = this->csIdList[0]; // between midnight and morning start spawned if (gSaveContext.save.time < CLOCK_TIME(6, 0)) { @@ -215,17 +215,17 @@ void EnYb_UpdateAnimation(EnYb* this, PlayState* play) { } void EnYb_FinishTeachingCutscene(EnYb* this) { - if (this->cutsceneIndex != -1) { - if (ActorCutscene_GetCurrentIndex() == this->cutscenes[this->cutsceneIndex]) { - ActorCutscene_Stop(this->cutscenes[this->cutsceneIndex]); + if (this->csIdIndex != -1) { + if (CutsceneManager_GetCurrentCsId() == this->csIdList[this->csIdIndex]) { + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); } - this->cutsceneIndex = -1; + this->csIdIndex = -1; } } -void EnYb_ChangeCutscene(EnYb* this, s16 cutsceneId) { +void EnYb_ChangeCutscene(EnYb* this, s16 csIdIndex) { EnYb_FinishTeachingCutscene(this); - this->cutsceneIndex = cutsceneId; + this->csIdIndex = csIdIndex; } /** @@ -414,16 +414,16 @@ void EnYb_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (this->cutsceneIndex != -1 && ActorCutscene_GetCurrentIndex() != this->cutscenes[this->cutsceneIndex]) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]); - } else if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->cutsceneIndex])) { - if (this->cutsceneIndex == 0) { - ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[this->cutsceneIndex], &this->actor); + if ((this->csIdIndex != -1) && (CutsceneManager_GetCurrentCsId() != this->csIdList[this->csIdIndex])) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); + } else if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + if (this->csIdIndex == 0) { + CutsceneManager_StartWithPlayerCs(this->csIdList[this->csIdIndex], &this->actor); } } else { - ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } } diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.h b/src/overlays/actors/ovl_En_Yb/z_en_yb.h index c7b977653b..4728ef44ee 100644 --- a/src/overlays/actors/ovl_En_Yb/z_en_yb.h +++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.h @@ -20,8 +20,8 @@ typedef struct EnYb { /* 0x410 */ u16 playerOcarinaOut; /* 0x412 */ s16 animIndex; /* 0x414 */ s16 alpha; - /* 0x416 */ s16 cutscenes[2]; - /* 0x41A */ s16 cutsceneIndex; + /* 0x416 */ s16 csIdList[2]; + /* 0x41A */ s16 csIdIndex; /* 0x41C */ s16 teachingCutsceneTimer; /* 0x420 */ EnYbActionFunc actionFunc; } EnYb; // size = 0x424 diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.c b/src/overlays/actors/ovl_En_Zob/z_en_zob.c index 2632724646..5f1b16e35f 100644 --- a/src/overlays/actors/ovl_En_Zob/z_en_zob.c +++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.c @@ -80,7 +80,7 @@ Vec3f D_80BA1120 = { 300.0f, 900.0f, 0.0f }; void EnZob_Init(Actor* thisx, PlayState* play) { EnZob* this = THIS; s32 i; - s16 cs; + s16 csId; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -90,8 +90,8 @@ void EnZob_Init(Actor* thisx, PlayState* play) { Animation_PlayLoop(&this->skelAnime, &object_zob_Anim_006998); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->unk_2F4 = 0; - this->unk_30E = -1; - this->unk_310 = 0; + this->csIdIndex = -1; + this->cueId = 0; this->unk_302 = 9; this->unk_304 = 0; this->actor.terminalVelocity = -4.0f; @@ -100,16 +100,16 @@ void EnZob_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BA0728; this->actor.textId = 0; - cs = this->actor.cutscene; - for (i = 0; i < ARRAY_COUNT(this->unk_306); i++) { - this->unk_306[i] = cs; - if (cs != -1) { - this->actor.cutscene = cs; - cs = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + csId = this->actor.csId; + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = csId; + if (csId != CS_ID_NONE) { + this->actor.csId = csId; + csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } } - this->actor.cutscene = this->unk_306[0]; + this->actor.csId = this->csIdList[0]; this->actor.flags |= ACTOR_FLAG_2000000; switch (ENZOB_GET_F(&this->actor)) { @@ -120,7 +120,7 @@ void EnZob_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BA0AD8; } - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); return; } @@ -135,7 +135,7 @@ void EnZob_Init(Actor* thisx, PlayState* play) { break; default: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); } this->actor.flags |= ACTOR_FLAG_10; @@ -253,17 +253,17 @@ void func_80B9FA3C(EnZob* this, PlayState* play) { } void func_80B9FC0C(EnZob* this) { - if (this->unk_30E != -1) { - if (ActorCutscene_GetCurrentIndex() == this->unk_306[this->unk_30E]) { - ActorCutscene_Stop(this->unk_306[this->unk_30E]); + if (this->csIdIndex != -1) { + if (CutsceneManager_GetCurrentCsId() == this->csIdList[this->csIdIndex]) { + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); } - this->unk_30E = -1; + this->csIdIndex = -1; } } -void func_80B9FC70(EnZob* this, s16 arg1) { +void func_80B9FC70(EnZob* this, s16 csIdIndex) { func_80B9FC0C(this); - this->unk_30E = arg1; + this->csIdIndex = csIdIndex; } void func_80B9FCA0(EnZob* this, PlayState* play) { @@ -278,19 +278,19 @@ void func_80B9FCA0(EnZob* this, PlayState* play) { } void func_80B9FD24(EnZob* this, PlayState* play) { - s32 actionIndex; - s16 action; + s32 cueChannel; + s16 cueId; func_80B9F86C(this); - if (Cutscene_CheckActorAction(play, 500)) { - this->unk_30E = -1; - actionIndex = Cutscene_GetActorActionIndex(play, 500); - action = play->csCtx.actorActions[actionIndex]->action; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_500)) { + this->csIdIndex = -1; + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_500); + cueId = play->csCtx.actorCues[cueChannel]->id; - if (action != this->unk_310) { - this->unk_310 = action; - switch (action) { + if (this->cueId != cueId) { + this->cueId = cueId; + switch (cueId) { case 1: func_80B9F7E4(this, 8, ANIMMODE_LOOP); break; @@ -549,7 +549,7 @@ void func_80BA0610(EnZob* this, PlayState* play) { void func_80BA06BC(EnZob* this, PlayState* play) { func_80B9FD24(this, play); - if (!Cutscene_CheckActorAction(play, 500)) { + if (!Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_500)) { this->actionFunc = func_80BA0610; this->actor.flags |= ACTOR_FLAG_10000; func_80BA0610(this, play); @@ -572,12 +572,12 @@ void func_80BA0728(EnZob* this, PlayState* play) { this->actionFunc = func_80BA00BC; this->unk_304 = 1; func_80B9F7E4(this, 2, ANIMMODE_ONCE); - this->unk_30E = 0; + this->csIdIndex = 0; this->unk_2F4 |= 1; } else if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80BA0374; func_80B9FA3C(this, play); - } else if (Cutscene_CheckActorAction(play, 500)) { + } else if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_500)) { this->actionFunc = func_80BA06BC; } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.xzDistToPlayer > 60.0f) && Player_IsFacingActor(&this->actor, 0x3000, play) && Actor_IsFacingPlayer(&this->actor, 0x3000)) { @@ -684,8 +684,8 @@ void func_80BA0C14(EnZob* this, PlayState* play) { this->unk_312 = 999; } - if (Cutscene_CheckActorAction(play, 515)) { - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 515)]->action == 1) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_515)) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_515)]->id == 1) { this->actionFunc = func_80BA0CF4; this->unk_312 = -1; } @@ -697,8 +697,8 @@ void func_80BA0C14(EnZob* this, PlayState* play) { void func_80BA0CF4(EnZob* this, PlayState* play) { func_80B9F86C(this); - if (Cutscene_CheckActorAction(play, 515) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 515)]->action == 2)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_515) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_515)]->id == 2)) { this->actionFunc = func_80BA0C14; } } @@ -715,14 +715,14 @@ void EnZob_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if ((this->unk_30E != -1) && (ActorCutscene_GetCurrentIndex() != this->unk_306[this->unk_30E])) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_306[this->unk_30E]); - } else if (ActorCutscene_GetCanPlayNext(this->unk_306[this->unk_30E])) { - ActorCutscene_Start(this->unk_306[this->unk_30E], &this->actor); + if ((this->csIdIndex != -1) && (CutsceneManager_GetCurrentCsId() != this->csIdList[this->csIdIndex])) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); + } else if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + CutsceneManager_Start(this->csIdList[this->csIdIndex], &this->actor); } else { - ActorCutscene_SetIntentToPlay(this->unk_306[this->unk_30E]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.h b/src/overlays/actors/ovl_En_Zob/z_en_zob.h index 25ce14fdc7..e0bd7bf796 100644 --- a/src/overlays/actors/ovl_En_Zob/z_en_zob.h +++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.h @@ -25,9 +25,9 @@ typedef struct EnZob { /* 0x2FC */ Vec3s unk_2FC; /* 0x302 */ s16 unk_302; /* 0x304 */ u16 unk_304; - /* 0x306 */ s16 unk_306[4]; - /* 0x30E */ s16 unk_30E; - /* 0x310 */ s16 unk_310; + /* 0x306 */ s16 csIdList[4]; + /* 0x30E */ s16 csIdIndex; + /* 0x310 */ s16 cueId; /* 0x312 */ s16 unk_312; /* 0x314 */ EnZobActionFunc actionFunc; } EnZob; // size = 0x318 diff --git a/src/overlays/actors/ovl_En_Zod/z_en_zod.c b/src/overlays/actors/ovl_En_Zod/z_en_zod.c index 7808e8089a..aaf3b85f00 100644 --- a/src/overlays/actors/ovl_En_Zod/z_en_zod.c +++ b/src/overlays/actors/ovl_En_Zod/z_en_zod.c @@ -119,12 +119,12 @@ void EnZod_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80BAFDB4; EnZod_ChangeAnim(this, ENZOD_ANIM_PLAYING_VIVACE, ANIMMODE_ONCE); this->actor.flags |= ACTOR_FLAG_10; - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); break; } this->actionFunc = func_80BAFB84; - if (!(CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80))) { + if (!(CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE))) { Actor_Kill(&this->actor); break; } @@ -137,7 +137,7 @@ void EnZod_Init(Actor* thisx, PlayState* play) { break; default: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); } this->actor.flags |= ACTOR_FLAG_10; @@ -445,20 +445,20 @@ void EnZod_DoNothing(EnZod* this, PlayState* play) { void EnZod_Rehearse(EnZod* this, PlayState* play) { EnZod_UpdateAnimation(this); - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); - this->actor.cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); - if (this->actor.cutscene == -1) { + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); + this->actor.csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); + if (this->actor.csId == CS_ID_NONE) { this->actionFunc = EnZod_DoNothing; play->nextEntrance = play->setupExitList[ENZOD_GET_ENTRANCE_INDEX(&this->actor)]; play->transitionType = TRANS_TYPE_FADE_WHITE_FAST; play->transitionTrigger = TRANS_TRIGGER_START; CLEAR_WEEKEVENTREG(WEEKEVENTREG_78_01); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -468,9 +468,9 @@ void EnZod_SetupRehearse(EnZod* this, PlayState* play) { Message_CloseTextbox(play); EnZod_ChangeAnim(this, ENZOD_ANIM_PLAYING_LENTO, ANIMMODE_ONCE); this->actionFunc = EnZod_Rehearse; - ActorCutscene_Stop(this->actor.cutscene); - this->actor.cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); + this->actor.csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); + CutsceneManager_Queue(this->actor.csId); SET_WEEKEVENTREG(WEEKEVENTREG_79_01); SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_INDIGO_GO_SESSION | SEQ_FLAG_ASYNC); } @@ -478,13 +478,13 @@ void EnZod_SetupRehearse(EnZod* this, PlayState* play) { void func_80BAFDB4(EnZod* this, PlayState* play) { EnZod_UpdateAnimation(this); - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); func_800B7298(play, NULL, 0x44); Message_StartTextbox(play, 0x103A, &this->actor); this->actionFunc = EnZod_SetupRehearse; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -500,8 +500,8 @@ void func_80BAFE34(EnZod* this, PlayState* play) { this->fogNear = 999; } - if (Cutscene_CheckActorAction(play, 0x203)) { - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x203)]->action == 1) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_515)) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_515)]->id == 1) { this->actionFunc = func_80BAFF14; this->fogNear = -1; } @@ -513,8 +513,8 @@ void func_80BAFE34(EnZod* this, PlayState* play) { void func_80BAFF14(EnZod* this, PlayState* play) { EnZod_UpdateAnimation(this); - if (Cutscene_CheckActorAction(play, 0x203) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x203)]->action == 4)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_515) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_515)]->id == 4)) { this->actionFunc = func_80BAFE34; } } diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c index fe5c1cd620..ccbb1f752e 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -181,7 +181,7 @@ void EnZog_Init(Actor* thisx, PlayState* play) { s32 pad; EnZog* this = THIS; s32 i; - s16 cs; + s16 csId; if (!D_80B95E10) { for (i = 0; i < ARRAY_COUNT(D_80B958AC); i++) { @@ -206,7 +206,7 @@ void EnZog_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; if ((ENZOG_GET_F(&this->actor) != ENZOG_F_2) && (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA) && - ((play->csCtx.currentCsIndex != 2) || (gSaveContext.sceneLayer != 0) || (play->sceneId != SCENE_30GYOSON))) { + ((play->csCtx.scriptIndex != 2) || (gSaveContext.sceneLayer != 0) || (play->sceneId != SCENE_30GYOSON))) { Actor_Kill(&this->actor); return; } @@ -219,7 +219,7 @@ void EnZog_Init(Actor* thisx, PlayState* play) { this->unk_30A = 0; this->unk_31C = 2; this->unk_31E = 0; - this->unk_31A = -1; + this->csIdIndex = -1; this->unk_322 = 100; Math_Vec3f_Copy(&this->unk_2F0, &this->actor.world.pos); @@ -245,13 +245,13 @@ void EnZog_Init(Actor* thisx, PlayState* play) { this->unk_304 = 0; this->unk_2FE = this->unk_2FC; this->unk_300 = this->unk_302; - cs = this->actor.cutscene; + csId = this->actor.csId; - for (i = 0; i < ARRAY_COUNT(this->unk_30C); i++) { - this->unk_30C[i] = cs; - if (cs != -1) { - this->actor.cutscene = cs; - cs = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); + for (i = 0; i < ARRAY_COUNT(this->csIdList); i++) { + this->csIdList[i] = csId; + if (csId != CS_ID_NONE) { + this->actor.csId = csId; + csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); } } @@ -331,17 +331,17 @@ void func_80B93A48(EnZog* this, PlayState* play) { void func_80B93B44(EnZog* this) { if (!(this->unk_30A & 4)) { - if (this->unk_31A != -1) { - ActorCutscene_Stop(this->unk_30C[this->unk_31A]); + if (this->csIdIndex != -1) { + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); } } - this->unk_31A = -1; + this->csIdIndex = -1; this->unk_30A &= ~4; } -void func_80B93BA8(EnZog* this, s16 arg1) { +void func_80B93BA8(EnZog* this, s16 csIdIndex) { func_80B93B44(this); - this->unk_31A = arg1; + this->csIdIndex = csIdIndex; this->unk_30A |= 4; } @@ -401,10 +401,10 @@ void func_80B93DE8(Vec3f* arg0, PlayState* play, s32 arg2) { } s32 func_80B93EA0(EnZog* this, PlayState* play) { - s16 sp3E; + s16 cueId; if (SkelAnime_Update(&this->skelAnime)) { - switch (this->unk_306) { + switch (this->cueId) { case 2: case 3: Animation_PlayLoop(&this->skelAnime, *D_80B958F0); @@ -458,13 +458,13 @@ s32 func_80B93EA0(EnZog* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); } - if (Cutscene_CheckActorAction(play, 471)) { - sp3E = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 471)]->action; - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, 471)); + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_471)) { + cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_471)]->id; + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_471)); - switch (this->unk_306) { + switch (this->cueId) { case 2: - if (play->csCtx.frames == 60) { + if (play->csCtx.curFrame == 60) { Actor_PlaySfx(&this->actor, NA_SE_EV_JUMP_SAND); } break; @@ -497,10 +497,10 @@ s32 func_80B93EA0(EnZog* this, PlayState* play) { break; } - if (this->unk_306 != sp3E) { - this->unk_306 = sp3E; + if (this->cueId != cueId) { + this->cueId = cueId; - switch (this->unk_306) { + switch (this->cueId) { case 1: func_80B939C0(this, 7, ANIMMODE_LOOP); this->unk_31C = 2; @@ -593,7 +593,7 @@ void func_80B943A0(EnZog* this, PlayState* play) { void func_80B943C0(EnZog* this, PlayState* play) { if (!(this->unk_30A & 4)) { this->actionFunc = func_80B943A0; - this->unk_306 = -1; + this->cueId = -1; } } @@ -657,7 +657,7 @@ void func_80B946B4(EnZog* this, PlayState* play) { func_80B93A48(this, play); if (!(this->unk_30A & 4)) { this->actionFunc = func_80B9461C; - this->unk_306 = -1; + this->cueId = -1; } } @@ -957,7 +957,7 @@ void EnZog_Update(Actor* thisx, PlayState* play) { Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 10.0f, UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4); - if (Cutscene_CheckActorAction(play, 0x1D7) && (ENZOG_GET_F(&this->actor) != ENZOG_F_2)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_471) && (ENZOG_GET_F(&this->actor) != ENZOG_F_2)) { this->actionFunc = func_80B9461C; this->actor.shape.yOffset = 0.0f; } @@ -982,18 +982,18 @@ void EnZog_Update(Actor* thisx, PlayState* play) { this->actor.focus.pos.y += 30.0f; if (this->unk_30A & 4) { - if (this->unk_31A == -1) { + if (this->csIdIndex == -1) { this->unk_30A &= ~4; - } else if (this->unk_30C[this->unk_31A] == -1) { + } else if (this->csIdList[this->csIdIndex] == CS_ID_NONE) { this->unk_30A &= ~4; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_30C[this->unk_31A]); - } else if (ActorCutscene_GetCanPlayNext(this->unk_30C[this->unk_31A])) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_30C[this->unk_31A], &this->actor); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); + } else if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + CutsceneManager_StartWithPlayerCs(this->csIdList[this->csIdIndex], &this->actor); this->unk_30A &= ~4; } else { - ActorCutscene_SetIntentToPlay(this->unk_30C[this->unk_31A]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } } diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.h b/src/overlays/actors/ovl_En_Zog/z_en_zog.h index 9971d77fa3..7371682504 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.h +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.h @@ -27,11 +27,11 @@ typedef struct EnZog { /* 0x300 */ s16 unk_300; /* 0x302 */ s16 unk_302; /* 0x304 */ s16 unk_304; - /* 0x306 */ s16 unk_306; + /* 0x306 */ s16 cueId; /* 0x308 */ s16 unk_308; /* 0x30A */ u16 unk_30A; - /* 0x30C */ s16 unk_30C[7]; - /* 0x31A */ s16 unk_31A; + /* 0x30C */ s16 csIdList[7]; + /* 0x31A */ s16 csIdIndex; /* 0x31C */ s16 unk_31C; /* 0x31E */ s16 unk_31E; /* 0x320 */ s16 unk_320; diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c index 17abb250df..21201346ae 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c @@ -75,7 +75,10 @@ void func_80B31590(EnZoraegg* this) { void EnZoraegg_Init(Actor* thisx, PlayState* play) { s32 pad; EnZoraegg* this = THIS; - u16 sp40[] = { 457, 458, 459, 460, 461, 462, 464 }; + u16 cueTypes[] = { + CS_CMD_ACTOR_CUE_457, CS_CMD_ACTOR_CUE_458, CS_CMD_ACTOR_CUE_459, CS_CMD_ACTOR_CUE_460, + CS_CMD_ACTOR_CUE_461, CS_CMD_ACTOR_CUE_462, CS_CMD_ACTOR_CUE_464, + }; Actor_SetScale(&this->actor, 0.006f); SkelAnime_InitFlex(play, &this->skelAnime, &object_zoraegg_Skel_004C90, &object_zoraegg_Anim_005098, @@ -162,7 +165,7 @@ void EnZoraegg_Init(Actor* thisx, PlayState* play) { case ENZORAEGG_1F_07: case ENZORAEGG_1F_08: case ENZORAEGG_1F_09: - this->actorActionCmd = sp40[(ENZORAEGG_GET_1F(&this->actor)) - ENZORAEGG_1F_03]; + this->cueType = cueTypes[(ENZORAEGG_GET_1F(&this->actor)) - ENZORAEGG_1F_03]; Animation_PlayOnce(&this->skelAnime, &object_zoraegg_Anim_001E08); this->unk_1EC = 1; this->unk_1EE = 0; @@ -181,7 +184,7 @@ void EnZoraegg_Init(Actor* thisx, PlayState* play) { case ENZORAEGG_1F_0E: case ENZORAEGG_1F_0F: case ENZORAEGG_1F_10: - this->actorActionCmd = sp40[(ENZORAEGG_GET_1F(&this->actor)) - ENZORAEGG_1F_0A]; + this->cueType = cueTypes[(ENZORAEGG_GET_1F(&this->actor)) - ENZORAEGG_1F_0A]; this->unk_1EC = 2; this->actionFunc = func_80B324B0; Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_004FE4); @@ -352,7 +355,7 @@ void func_80B320E0(EnZoraegg* this, PlayState* play) { } void func_80B321D0(EnZoraegg* this, PlayState* play) { - if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) { + if (CutsceneManager_GetCurrentCsId() != this->actor.csId) { this->actionFunc = func_80B322BC; func_80B319D0(play, func_80B319A8(play) + 1); } @@ -362,26 +365,26 @@ void func_80B32228(EnZoraegg* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, this->unk_1DC); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, this->unk_1DC); this->actionFunc = func_80B321D0; } else { if (this->unk_1E8 > 0) { this->unk_1E8--; } else if (this->unk_1E8 == 0) { - ActorCutscene_Stop(player->unk_A86); - player->unk_A86 = -1; + CutsceneManager_Stop(player->csId); + player->csId = CS_ID_NONE; this->unk_1E8 = -1; } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } void func_80B322BC(EnZoraegg* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (this->actor.cutscene != -1) { + if (this->actor.csId != CS_ID_NONE) { this->unk_1DC = func_80B31CB4(play); if (this->unk_1DC != NULL) { this->unk_1E8 = 3; @@ -400,11 +403,11 @@ void func_80B32390(EnZoraegg* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + if (CutsceneManager_IsNext(this->actor.csId)) { Actor* temp_v0 = func_80B31D14(play); if (temp_v0 != NULL) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, temp_v0); + CutsceneManager_StartWithPlayerCs(this->actor.csId, temp_v0); SET_EVENTINF(EVENTINF_33); Actor_Kill(&this->actor); } @@ -412,29 +415,29 @@ void func_80B32390(EnZoraegg* this, PlayState* play) { (fabsf(player->actor.world.pos.x - this->actor.world.pos.x) < (100.0f * this->actor.scale.x)) && (fabsf(player->actor.world.pos.z - this->actor.world.pos.z) < (100.0f * this->actor.scale.z)) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 30.0f)) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } void func_80B324B0(EnZoraegg* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Cutscene_CheckActorAction(play, this->actorActionCmd)) { + if (Cutscene_IsCueInChannel(play, this->cueType)) { if (this->unk_1EA & 4) { - if (Cutscene_CheckActorAction(play, this->actorActionCmd) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCmd)]->action == 3)) { + if (Cutscene_IsCueInChannel(play, this->cueType) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 3)) { Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_004FE4); this->unk_1EA &= ~4; } } else { - if (Cutscene_CheckActorAction(play, this->actorActionCmd) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCmd)]->action == 4)) { + if (Cutscene_IsCueInChannel(play, this->cueType) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 4)) { Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_004E04); this->unk_1EA |= 4; } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCmd)); + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); if ((this->unk_1EA & 4) && Animation_OnFrame(&this->skelAnime, this->unk_1E4)) { Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1); @@ -453,10 +456,10 @@ void func_80B32644(EnZoraegg* this, PlayState* play) { this->unk_1EA |= 2; } - if (!Cutscene_CheckActorAction(play, this->actorActionCmd)) { + if (!Cutscene_IsCueInChannel(play, this->cueType)) { this->actionFunc = func_80B324B0; } else { - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCmd)); + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); if (this->unk_1EE > 25) { this->unk_1EE -= 25; @@ -469,8 +472,8 @@ void func_80B32644(EnZoraegg* this, PlayState* play) { void func_80B326F4(EnZoraegg* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Cutscene_CheckActorAction(play, this->actorActionCmd) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCmd)]->action == 3)) { + if (Cutscene_IsCueInChannel(play, this->cueType) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 3)) { Animation_Change(&this->skelAnime, &object_zoraegg_Anim_004D20, 1.0f, 0.0f, Animation_GetLastFrame(&object_zoraegg_Anim_004D20), ANIMMODE_ONCE, 5.0f); this->unk_1E8 = 0; @@ -481,7 +484,7 @@ void func_80B326F4(EnZoraegg* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_2); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCmd)); + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); if (Animation_OnFrame(&this->skelAnime, 4.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1); @@ -504,7 +507,7 @@ void func_80B32820(EnZoraegg* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); } - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCmd)); + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); if (Animation_OnFrame(&this->skelAnime, 16.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_0); @@ -538,7 +541,7 @@ void func_80B32928(EnZoraegg* this, PlayState* play) { } } - Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->actorActionCmd)); + Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); if (Animation_OnFrame(&this->skelAnime, 97.0f) || Animation_OnFrame(&this->skelAnime, 101.0f) || Animation_OnFrame(&this->skelAnime, 105.0f)) { @@ -547,8 +550,8 @@ void func_80B32928(EnZoraegg* this, PlayState* play) { } void func_80B32A88(EnZoraegg* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, this->actorActionCmd) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->actorActionCmd)]->action == 2)) { + if (Cutscene_IsCueInChannel(play, this->cueType) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 2)) { this->unk_1E8 = 0; this->actionFunc = func_80B32928; } @@ -570,7 +573,7 @@ void func_80B32B3C(EnZoraegg* this, PlayState* play) { void func_80B32B70(EnZoraegg* this, PlayState* play) { func_80B31C40(this, play); - if (Cutscene_CheckActorAction(play, 0x1C9)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_457)) { Actor_Kill(&this->actor); } } @@ -583,7 +586,7 @@ void func_80B32BB8(EnZoraegg* this, PlayState* play) { this->actionFunc = func_80B32B70; } - if (Cutscene_CheckActorAction(play, 0x1C9)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_457)) { Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h index f36f77c2bc..18a4212720 100644 --- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h +++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h @@ -53,7 +53,7 @@ typedef struct EnZoraegg { /* 0x1ED */ u8 unk_1ED; /* 0x1EE */ u8 unk_1EE; /* 0x1EF */ u8 unk_1EF; - /* 0x1F0 */ u16 actorActionCmd; + /* 0x1F0 */ u16 cueType; /* 0x1F2 */ s16 unk_1F2; /* 0x1F4 */ s16 unk_1F4; /* 0x1F8 */ EnZoraeggActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.c b/src/overlays/actors/ovl_En_Zos/z_en_zos.c index 3898e754c2..3c11d1bcee 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.c +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.c @@ -100,7 +100,7 @@ void EnZos_Init(Actor* thisx, PlayState* play) { switch (ENZOS_GET_F(&this->actor)) { case ENZOS_F_1: - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); } @@ -120,7 +120,7 @@ void EnZos_Init(Actor* thisx, PlayState* play) { break; default: - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); } this->actor.flags |= ACTOR_FLAG_10; @@ -280,13 +280,13 @@ void func_80BBB354(EnZos* this, PlayState* play) { void func_80BBB414(EnZos* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Cutscene_CheckActorAction(play, 501)) { - s16 action = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 501)]->action; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_501)) { + s16 cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_501)]->id; - if (action != this->unk_2BA) { - this->unk_2BA = action; + if (this->cueId != cueId) { + this->cueId = cueId; - switch (action) { + switch (cueId) { case 1: EnZos_ChangeAnim(this, EN_ZOS_ANIM_LEAN_ON_KEYBOARD_AND_SIGH, ANIMMODE_LOOP); break; @@ -302,15 +302,15 @@ void func_80BBB414(EnZos* this, PlayState* play) { void func_80BBB4CC(EnZos* this, PlayState* play) { func_80BBB414(this, play); - if ((this->actor.cutscene != -1) && (ActorCutscene_GetCurrentIndex() != this->actor.cutscene)) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); - this->actor.cutscene = -1; + if ((this->actor.csId != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() != this->actor.csId)) { + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); + this->actor.csId = CS_ID_NONE; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } @@ -534,7 +534,7 @@ void func_80BBBCBC(EnZos* this, PlayState* play) { void func_80BBBD5C(EnZos* this, PlayState* play) { func_80BBB414(this, play); - if (!Cutscene_CheckActorAction(play, 0x1F5)) { + if (!Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_501)) { this->actionFunc = func_80BBBCBC; this->actor.flags |= ACTOR_FLAG_10000; func_800B8500(&this->actor, play, 1000.0f, 1000.0f, PLAYER_IA_MINUS1); @@ -567,7 +567,7 @@ void func_80BBBDE0(EnZos* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { this->actionFunc = func_80BBB8AC; func_80BBB15C(this, play); - } else if (Cutscene_CheckActorAction(play, 0x1F5)) { + } else if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_501)) { this->actionFunc = func_80BBBD5C; } else if (func_80BBAF5C(this, play)) { func_800B8614(&this->actor, play, 120.0f); @@ -675,8 +675,8 @@ void func_80BBC298(EnZos* this, PlayState* play) { this->unk_2BC = 999; } - if (Cutscene_CheckActorAction(play, 515)) { - if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 515)]->action == 1) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_515)) { + if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_515)]->id == 1) { this->actionFunc = func_80BBC37C; this->unk_2BC = -1; } @@ -688,8 +688,8 @@ void func_80BBC298(EnZos* this, PlayState* play) { void func_80BBC37C(EnZos* this, PlayState* play) { func_80BBAFFC(this, play); - if (Cutscene_CheckActorAction(play, 515) && - (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 515)]->action == 3)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_515) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_515)]->id == 3)) { this->actionFunc = func_80BBC298; } } diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.h b/src/overlays/actors/ovl_En_Zos/z_en_zos.h index e3ede7b28a..669430a0c4 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.h +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.h @@ -26,7 +26,7 @@ typedef struct EnZos { /* 0x2B0 */ UNK_TYPE1 unk2B0[6]; /* 0x2B6 */ u16 unk_2B6; /* 0x2B8 */ s16 animIndex; - /* 0x2BA */ s16 unk_2BA; + /* 0x2BA */ s16 cueId; /* 0x2BC */ s16 unk_2BC; /* 0x2C0 */ EnZosActionFunc actionFunc; } EnZos; // size = 0x2C4 diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c index a24791080e..f382cdf804 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -185,14 +185,14 @@ void EnZot_Init(Actor* thisx, PlayState* play2) { func_80B96BEC(this, 2, ANIMMODE_LOOP); this->actor.colChkInfo.cylRadius = 0; this->actor.shape.yOffset = -1400.0f; - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); } break; case 18: this->actionFunc = func_80B99384; - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); } break; @@ -220,7 +220,8 @@ void EnZot_Init(Actor* thisx, PlayState* play2) { break; } - if ((ENZOT_GET_1F(thisx) >= 2) && (ENZOT_GET_1F(thisx) < 11) && CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if ((ENZOT_GET_1F(thisx) >= 2) && (ENZOT_GET_1F(thisx) < 11) && + CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->actor); } } @@ -488,8 +489,8 @@ void func_80B973BC(EnZot* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_10000; this->actor.textId = 0; this->actionFunc = func_80B97708; - if ((this->actor.cutscene != -1) && !(this->unk_2F2 & 1)) { - ActorCutscene_Stop(this->actor.cutscene); + if ((this->actor.csId != CS_ID_NONE) && !(this->unk_2F2 & 1)) { + CutsceneManager_Stop(this->actor.csId); } this->unk_2F2 &= ~1; break; @@ -497,16 +498,16 @@ void func_80B973BC(EnZot* this, PlayState* play) { } if (this->unk_2F2 & 1) { - if (this->actor.cutscene == -1) { + if (this->actor.csId == CS_ID_NONE) { this->unk_2F2 &= ~1; - } else if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); - } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + } else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->actor.csId); + } else if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->unk_2F2 &= ~1; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.c b/src/overlays/actors/ovl_En_Zov/z_en_zov.c index 5a93d91ccc..c6dca4bd74 100644 --- a/src/overlays/actors/ovl_En_Zov/z_en_zov.c +++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.c @@ -91,10 +91,10 @@ void EnZov_Init(Actor* thisx, PlayState* play) { Animation_PlayLoop(&this->skelAnime, &object_zov_Anim_00D3EC); this->unk_320 = 0; - this->unk_32C = -1; - this->unk_326 = -1; - this->unk_328[0] = this->picto.actor.cutscene; - this->unk_328[1] = 0x7C; + this->csIdIndex = -1; + this->cueId = -1; + this->csIdList[0] = this->picto.actor.csId; + this->csIdList[1] = CS_ID_GLOBAL_TALK; this->unk_322 = 0; this->actionFunc = func_80BD1C84; this->picto.validationFunc = EnZov_ValidatePictograph; @@ -107,7 +107,7 @@ void EnZov_Init(Actor* thisx, PlayState* play) { case ENZOV_F_1: this->actionFunc = func_80BD1F1C; func_80BD1570(this, 9, ANIMMODE_LOOP); - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { Actor_Kill(&this->picto.actor); return; } @@ -120,7 +120,7 @@ void EnZov_Init(Actor* thisx, PlayState* play) { default: this->unk_320 |= 2; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80) || CHECK_WEEKEVENTREG(WEEKEVENTREG_53_20)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE) || CHECK_WEEKEVENTREG(WEEKEVENTREG_53_20)) { Actor_Kill(&this->picto.actor); } break; @@ -134,17 +134,17 @@ void EnZov_Destroy(Actor* thisx, PlayState* play) { } void func_80BD13DC(EnZov* this) { - if (this->unk_32C != -1) { - if (ActorCutscene_GetCurrentIndex() == this->unk_328[this->unk_32C]) { - ActorCutscene_Stop(this->unk_328[this->unk_32C]); + if (this->csIdIndex != -1) { + if (CutsceneManager_GetCurrentCsId() == this->csIdList[this->csIdIndex]) { + CutsceneManager_Stop(this->csIdList[this->csIdIndex]); } - this->unk_32C = -1; + this->csIdIndex = -1; } } void func_80BD1440(EnZov* this, s16 arg1) { func_80BD13DC(this); - this->unk_32C = arg1; + this->csIdIndex = arg1; } void func_80BD1470(EnZov* this, s16 index, u8 mode, f32 transitionRate) { @@ -328,12 +328,12 @@ void func_80BD19FC(EnZov* this, PlayState* play) { s32 func_80BD1AE0(EnZov* this, PlayState* play) { func_80BD1764(this); - if (Cutscene_CheckActorAction(play, 504)) { - s16 action = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 504)]->action; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_504)) { + s16 cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_504)]->id; - if (action != this->unk_326) { - this->unk_326 = action; - switch (this->unk_326) { + if (this->cueId != cueId) { + this->cueId = cueId; + switch (this->cueId) { case 1: func_80BD1570(this, 0, ANIMMODE_LOOP); break; @@ -367,7 +367,7 @@ void func_80BD1BF0(EnZov* this, PlayState* play) { void func_80BD1C38(EnZov* this, PlayState* play) { if (func_80BD1AE0(this, play)) { - Cutscene_ActorTranslateAndYaw(&this->picto.actor, play, Cutscene_GetActorActionIndex(play, 504)); + Cutscene_ActorTranslateAndYaw(&this->picto.actor, play, Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_504)); } } @@ -381,7 +381,7 @@ void func_80BD1C84(EnZov* this, PlayState* play) { func_800B8614(&this->picto.actor, play, 120.0f); } - if (Cutscene_CheckActorAction(play, 0x1F8)) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_504)) { this->actionFunc = func_80BD1BF0; func_80BD1BF0(this, play); } @@ -480,7 +480,7 @@ void EnZov_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (!Cutscene_CheckActorAction(play, 0x1F8)) { + if (!Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_504)) { this->unk_320 &= ~0x10; } @@ -506,14 +506,14 @@ void EnZov_Update(Actor* thisx, PlayState* play) { this->unk_2EC = 0; } - if ((this->unk_32C != -1) && (ActorCutscene_GetCurrentIndex() != this->unk_328[this->unk_32C])) { - if ((this->unk_32C == 0) && (ActorCutscene_GetCurrentIndex() == 0x7C)) { - ActorCutscene_Stop(0x7C); - ActorCutscene_SetIntentToPlay(this->unk_328[this->unk_32C]); - } else if (ActorCutscene_GetCanPlayNext(this->unk_328[this->unk_32C])) { - ActorCutscene_Start(this->unk_328[this->unk_32C], &this->picto.actor); + if ((this->csIdIndex != -1) && (CutsceneManager_GetCurrentCsId() != this->csIdList[this->csIdIndex])) { + if ((this->csIdIndex == 0) && (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK)) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); + } else if (CutsceneManager_IsNext(this->csIdList[this->csIdIndex])) { + CutsceneManager_Start(this->csIdList[this->csIdIndex], &this->picto.actor); } else { - ActorCutscene_SetIntentToPlay(this->unk_328[this->unk_32C]); + CutsceneManager_Queue(this->csIdList[this->csIdIndex]); } } } diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.h b/src/overlays/actors/ovl_En_Zov/z_en_zov.h index a5e217ca34..7e12041009 100644 --- a/src/overlays/actors/ovl_En_Zov/z_en_zov.h +++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.h @@ -30,9 +30,9 @@ typedef struct EnZov { /* 0x320 */ u16 unk_320; /* 0x322 */ s16 unk_322; /* 0x324 */ s16 unk_324; - /* 0x326 */ s16 unk_326; - /* 0x328 */ s16 unk_328[2]; - /* 0x32C */ s16 unk_32C; + /* 0x326 */ s16 cueId; + /* 0x328 */ s16 csIdList[2]; + /* 0x32C */ s16 csIdIndex; /* 0x330 */ EnZovActionFunc actionFunc; } EnZov; // size = 0x334 diff --git a/src/overlays/actors/ovl_En_Zow/z_en_zow.c b/src/overlays/actors/ovl_En_Zow/z_en_zow.c index 638fa0263f..446470dbef 100644 --- a/src/overlays/actors/ovl_En_Zow/z_en_zow.c +++ b/src/overlays/actors/ovl_En_Zow/z_en_zow.c @@ -357,7 +357,7 @@ void func_80BDD1E0(EnZow* this, PlayState* play) { u16 phi_a1; if (ENZOW_GET_F(&this->actor) == ENZOW_F_1) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_78_04)) { phi_a1 = 0x12FD; @@ -384,7 +384,7 @@ void func_80BDD1E0(EnZow* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_78_10); phi_a1 = 0x12FF; } - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) { if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA) { phi_a1 = 0x12EC; } else { diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index b6c5be1238..7cc5dfb17a 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -588,20 +588,20 @@ void func_809381B0(ObjBean* this) { void func_809381C4(ObjBean* this, PlayState* play) { this->unk_1E8(this); - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); - if (this->dyna.actor.cutscene >= 0) { + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); + if (this->dyna.actor.csId >= 0) { func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_1); } this->unk_1E4 = 2; func_80938284(this); } else if (this->unk_1E4 == 4) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); play_sound(NA_SE_SY_ERROR); this->unk_1E4 = 0; func_80937FB0(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -618,7 +618,7 @@ void func_80938298(ObjBean* this, PlayState* play) { this->unk_1E4 = 5; func_8093833C(this); } else if (this->unk_1E4 == 4) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); play_sound(NA_SE_SY_ERROR); this->unk_1E4 = 0; func_80937FB0(this); @@ -634,7 +634,7 @@ void func_80938358(ObjBean* this, PlayState* play) { this->unk_1E8(this); if (this->unk_1B2 <= 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); func_80937FB0(this); } } @@ -735,7 +735,7 @@ void func_80938704(ObjBean* this) { void func_80938728(ObjBean* this, PlayState* play) { if (this->unk_200 != 0) { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); func_8093876C(this); } } @@ -745,16 +745,16 @@ void func_8093876C(ObjBean* this) { } void func_80938780(ObjBean* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); - if (this->dyna.actor.cutscene >= 0) { + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); + if (this->dyna.actor.csId >= 0) { func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_1); } this->unk_1B4 = 36; func_80937130(this); func_80938AA4(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -909,7 +909,7 @@ void ObjBean_Update(Actor* thisx, PlayState* play) { if (this->unk_1B4 > 0) { this->unk_1B4--; if (this->unk_1B4 == 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c index 1146175fda..85468c59ce 100644 --- a/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c +++ b/src/overlays/actors/ovl_Obj_Bigicicle/z_obj_bigicicle.c @@ -182,7 +182,7 @@ void func_80AE8FD4(ObjBigicicle* this, PlayState* play) { if ((this->collider1.base.acFlags & AC_HIT) || ((this->collider2.base.acFlags & AC_HIT) && (this->collider2.info.acHitInfo->toucher.dmgFlags & 0x3820))) { if ((this->unk_148 == 0) || (this->unk_149 == 1)) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = func_80AE9090; return; } @@ -195,8 +195,8 @@ void func_80AE8FD4(ObjBigicicle* this, PlayState* play) { } void func_80AE9090(ObjBigicicle* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->unk_149++; func_80AE8DE4(this, play); if (this->unk_149 == 2) { @@ -213,7 +213,7 @@ void func_80AE9090(ObjBigicicle* this, PlayState* play) { this->actionFunc = func_80AE9180; } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -227,7 +227,7 @@ void func_80AE9180(ObjBigicicle* this, PlayState* play) { } else { this->actor.shape.rot.x = 0x4000; this->actor.shape.rot.z = 0; - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); this->actionFunc = func_80AE8FD4; } } @@ -284,7 +284,7 @@ void func_80AE939C(ObjBigicicle* this, PlayState* play) { } SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_GLASSBROKEN_IMPACT); - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index 437f0c2346..a4f44973fb 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -48,7 +48,7 @@ void ObjBlockstop_CheckForBlock(ObjBlockstop* this, PlayState* play) { s32 params = OBJOSHIHIKI_GET_F(prop); if (params < 3) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = ObjBlockstop_TryPlayCutscene; } } @@ -57,15 +57,15 @@ void ObjBlockstop_CheckForBlock(ObjBlockstop* this, PlayState* play) { } void ObjBlockstop_TryPlayCutscene(ObjBlockstop* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + if (CutsceneManager_IsNext(this->actor.csId)) { Flags_SetSwitch(play, this->actor.params); - if (ActorCutscene_GetLength(this->actor.cutscene) != -1) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_GetLength(this->actor.csId) != -1) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); } Actor_Kill(&this->actor); return; } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } void ObjBlockstop_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c index 6f426bfdd1..43f137326d 100644 --- a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c +++ b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c @@ -151,29 +151,29 @@ void ObjBoat_UpdateCutscene(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjBoat* this = THIS; - if (Cutscene_CheckActorAction(play, 511)) { - CsCmdActorAction* actionIndex = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 511)]; - if (this->csAction != actionIndex->action) { - this->dyna.actor.shape.rot.x = actionIndex->urot.x; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_511)) { + CsCmdActorCue* cue = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_511)]; - if (actionIndex->action != 1) { + if (this->cueId != cue->id) { + this->dyna.actor.shape.rot.x = cue->rot.x; + if (cue->id != 1) { Path* path = &play->setupPathList[OBJBOAT_GET_PATH(&this->dyna.actor)]; - if (actionIndex->action == 3) { + if (cue->id == 3) { path = &play->setupPathList[path->unk1]; } this->maxPointIndex = path->count; this->points = Lib_SegmentedToVirtual(path->points); Math_Vec3s_ToVec3f(&this->dyna.actor.world.pos, this->points); - this->dyna.actor.speed = actionIndex->urot.z * (45.0f / 0x2000); + this->dyna.actor.speed = cue->rot.z * (45.0f / 0x2000); this->points++; this->curPointIndex = 1; } - this->csAction = actionIndex->action; + this->cueId = cue->id; } else { - if (actionIndex->action != 1) { + if (cue->id != 1) { Vec3f posTarget; f32 distRemaining; @@ -185,9 +185,9 @@ void ObjBoat_UpdateCutscene(Actor* thisx, PlayState* play2) { } } - if (actionIndex->action != 3) { + if (cue->id != 3) { ObjBoat_SetRotations(this); - if (actionIndex->action == 2) { + if (cue->id == 2) { func_800B9010(&this->dyna.actor, NA_SE_EV_PIRATE_SHIP - SFX_FLAG); } } else { diff --git a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h index 879e2e50cb..bfc7c7c2b3 100644 --- a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h +++ b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.h @@ -15,7 +15,7 @@ typedef struct ObjBoat { /* 0x15E */ u8 lastPointIndex; // max point if direction is negative, first point if forwards /* 0x15F */ union { u8 timer; - u8 csAction; + u8 cueId; }; /* 0x160 */ s16 angle; // Angle used to set rotations /* 0x162 */ UNK_TYPE1 pad_162; diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c index d05c685718..66c927f1d9 100644 --- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c +++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c @@ -92,7 +92,7 @@ void ObjChan_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sObjChanCylinderInit); - SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); + SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList)); switch (OBJCHAN_SUBTYPE(&this->actor)) { case OBJCHAN_SUBTYPE_CHANDELIER: this->rotation = this->actor.shape.rot.y; @@ -178,12 +178,12 @@ void ObjChan_InitChandelier(ObjChan* this2, PlayState* play) { (s32)DEG_TO_BINANG_ALT3(i * 360.0f / 5.0f) + this->rotation); temp_v0 = (ObjChan*)Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_OBJ_CHAN, childPos.x, childPos.y, childPos.z, childRot.x, childRot.y, childRot.z, - (this->actor.params & 0xFFF) | 0x1000, this->actor.cutscene, + (this->actor.params & 0xFFF) | 0x1000, this->actor.csId, this->actor.halfDaysBits, &this->actor); if (temp_v0 != NULL) { this->pots[i] = temp_v0; temp_v0->myPotIndex = i; - temp_v0->actor.cutscene = this->actor.cutscene; + temp_v0->actor.csId = this->actor.csId; } else { Actor_Kill(&this->actor); } @@ -232,13 +232,13 @@ void ObjChan_ChandelierAction(ObjChan* this2, PlayState* play) { } this->actor.shape.rot.z = (Math_SinS(this->unk1D4) * this->unk1D0); if ((this->stateFlags & OBJCHAN_STATE_START_CUTSCENE) && - SubS_StartActorCutscene(&this->actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + SubS_StartCutscene(&this->actor, this->csIdList[0], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { this->stateFlags |= OBJCHAN_STATE_CUTSCENE; this->stateFlags &= ~OBJCHAN_STATE_START_CUTSCENE; } if ((this->stateFlags & OBJCHAN_STATE_CUTSCENE) && this->rotationSpeed == OBJCHAN_ROTATION_SPEED) { this->stateFlags &= ~OBJCHAN_STATE_CUTSCENE; - ActorCutscene_Stop(this->cutscenes[0]); + CutsceneManager_Stop(this->csIdList[0]); } Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW); Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY); @@ -315,7 +315,7 @@ void ObjChan_PotAction(ObjChan* this, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_37_10); Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_MM, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x8000, - this->actor.cutscene, this->actor.halfDaysBits, NULL); + this->actor.csId, this->actor.halfDaysBits, NULL); } } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.h b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.h index f08f18adf4..0e6fbca865 100644 --- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.h +++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.h @@ -54,7 +54,7 @@ typedef struct ObjChan { /* 0x1D8 */ f32 flameSize; /* 0x1DC */ s16 rotationSpeed; // Main object only. Slowly ramps up under some circumstances. In other circumstances it's immediately set to maximum speed. /* 0x1DE */ s16 rotation; // Increases as the chandelier spins. Don't know why they didn't use the actor's rotation variable. - /* 0x1E0 */ s16 cutscenes[2]; + /* 0x1E0 */ s16 csIdList[2]; } ObjChan; // size = 0x1E4 #endif // Z_OBJ_CHAN_H diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 957ac1433d..412bade059 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -493,8 +493,8 @@ void func_8098E0B8(ObjComb* this, PlayState* play) { return; } - if ((this->unk_1B4 == 10) && (this->unk_1B6 != 0) && (this->unk_1B5 == 2) && (this->actor.cutscene >= 0)) { - if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) { + if ((this->unk_1B4 == 10) && (this->unk_1B6 != 0) && (this->unk_1B5 == 2) && (this->actor.csId >= 0)) { + if (CutsceneManager_GetCurrentCsId() == this->actor.csId) { func_800B7298(play, &this->actor, PLAYER_CSMODE_4); } } @@ -518,17 +518,17 @@ void ObjComb_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (this->actor.update == NULL) { - if ((this->unk_1B5 == 2) && (func_800F2138(this->actor.cutscene) == -1)) { - ActorCutscene_Stop(this->actor.cutscene); + if ((this->unk_1B5 == 2) && (CutsceneManager_GetCutsceneScriptIndex(this->actor.csId) == -1)) { + CutsceneManager_Stop(this->actor.csId); this->unk_1B5 = 0; } } else { if (this->unk_1B5 != 0) { Actor_SetFocus(&this->actor, 0.0f); if (this->unk_1B5 == 1) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); - if (this->actor.cutscene >= 0) { + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); + if (this->actor.csId >= 0) { func_800B7298(play, &this->actor, PLAYER_CSMODE_1); } @@ -539,7 +539,7 @@ void ObjComb_Update(Actor* thisx, PlayState* play) { this->unk_1B5 = 2; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } } diff --git a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c index 43edd11e0c..a33bf2a430 100644 --- a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c +++ b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c @@ -167,7 +167,7 @@ void ObjDanpeilift_Update(Actor* thisx, PlayState* play) { if (this->cutsceneTimer > 0) { this->cutsceneTimer--; if (this->cutsceneTimer == 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } } if (OBJDANPEILIFT_REACT_TO_PLAYER_ON_TOP(thisx)) { diff --git a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c index 8af30b3fd6..ee76dd9d42 100644 --- a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c +++ b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c @@ -69,37 +69,37 @@ void func_80983678(ObjDemo* this, PlayState* play) { func_80983634(play); if ((this->actor.xzDistToPlayer < this->xzRange) && (fabsf(this->actor.playerHeightRel) < this->yRange)) { if (this->unk_148 == 1) { - ActorCutscene_Stop(0x7D); + CutsceneManager_Stop(CS_ID_GLOBAL_DOOR); } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = func_80983704; } } void func_80983704(ObjDemo* this, PlayState* play) { - if ((this->unk_148 == 1) && (ActorCutscene_GetCurrentIndex() == 0x7D)) { - ActorCutscene_Stop(0x7D); - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + if ((this->unk_148 == 1) && (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_DOOR)) { + CutsceneManager_Stop(CS_ID_GLOBAL_DOOR); + CutsceneManager_Queue(this->actor.csId); } else { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + if (CutsceneManager_IsNext(this->actor.csId)) { if (this->unk_148 == 1) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + CutsceneManager_Start(this->actor.csId, &this->actor); func_800E0348(play->cameraPtrs[CAM_ID_MAIN]); } else { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); } if (play->sceneId == SCENE_CASTLE) { SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_IKANA_CASTLE | SEQ_FLAG_ASYNC); } - this->actor.cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); - if (this->actor.cutscene == -1) { + this->actor.csId = CutsceneManager_GetAdditionalCsId(this->actor.csId); + if (this->actor.csId == CS_ID_NONE) { if (this->actor.params != 0xFF) { Flags_SetSwitch(play, this->actor.params); } Actor_Kill(&this->actor); } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); func_80983634(play); } } diff --git a/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c b/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c index a4c4e21d21..f9f86501d5 100644 --- a/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c +++ b/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c @@ -77,7 +77,7 @@ static InitChainEntry sInitChain[] = { }; void func_80A4CA90(ObjFireshield* this) { - if (this->actor.cutscene >= 0) { + if (this->actor.csId >= 0) { this->actionFunc = func_80A4CABC; } else { this->actionFunc = func_80A4CC54; @@ -87,17 +87,17 @@ void func_80A4CA90(ObjFireshield* this) { void func_80A4CABC(ObjFireshield* this) { s32 pad; - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + if (CutsceneManager_IsNext(this->actor.csId)) { s32 sp18 = OBJFIRESHIELD_GET_7F(&this->actor); s32 temp_a0 = (sp18 & ~0x1F) >> 5; - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); this->actionFunc = func_80A4CB7C; this->unk_194 = 20; D_80A4D884[temp_a0] |= 1 << (sp18 & 0x1F); D_80A4D894[temp_a0] |= 1 << (sp18 & 0x1F); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -113,7 +113,7 @@ void func_80A4CB7C(ObjFireshield* this) { return; } - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); this->actionFunc = func_80A4CD28; D_80A4D894[(sp18 & ~0x1F) >> 5] &= ~(1 << (sp18 & 0x1F)); } diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c index 2a2e23c13d..73aa848a2b 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c @@ -61,10 +61,10 @@ void func_80B3C2B0(ObjGhaka* this) { void func_80B3C2C4(ObjGhaka* this, PlayState* play) { if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_20_20)) { Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_BG_GORON_OYU, 0.0f, 25.0f, 261.0f, 0, 0, 0, 0, - this->dyna.actor.cutscene, this->dyna.actor.halfDaysBits, 0); + this->dyna.actor.csId, this->dyna.actor.halfDaysBits, 0); } else { - Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_BG_GORON_OYU, 0.0f, 25.0f, 261.0f, 0, 0, 0, 1, -1, - this->dyna.actor.halfDaysBits, 0); + Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_BG_GORON_OYU, 0.0f, 25.0f, 261.0f, 0, 0, 0, 1, + CS_ID_NONE, this->dyna.actor.halfDaysBits, 0); } } diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c index d35c9f11e0..8b851285a6 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c @@ -113,7 +113,7 @@ void ObjHakaisi_Init(Actor* thisx, PlayState* play) { this->unk_19A = 0; this->unk_198 = 0; this->switchFlag = OBJHAKAISI_GET_SWITCHFLAG(thisx); - this->unk_196 = this->dyna.actor.cutscene; + this->csId = this->dyna.actor.csId; if (this->switchFlag == 0xFF) { this->switchFlag = -1; @@ -192,11 +192,11 @@ void func_80B14558(ObjHakaisi* this) { } void func_80B1456C(ObjHakaisi* this, PlayState* play) { - if (this->unk_196 != -1) { - if (ActorCutscene_GetCanPlayNext(this->unk_196)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_196, &this->dyna.actor); + if (this->csId != CS_ID_NONE) { + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->dyna.actor); } else { - ActorCutscene_SetIntentToPlay(this->unk_196); + CutsceneManager_Queue(this->csId); } } if (this->dyna.actor.colChkInfo.health < 30) { @@ -258,8 +258,8 @@ void func_80B149A8(ObjHakaisi* this) { void func_80B149C0(ObjHakaisi* this, PlayState* play) { if (this->unk_19A < 60) { this->unk_19A++; - } else if ((this->unk_196 != -1) && !ActorCutscene_GetCanPlayNext(this->unk_196)) { - ActorCutscene_Stop(this->unk_196); + } else if ((this->csId != CS_ID_NONE) && !CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Stop(this->csId); } } diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h index ed5341a82b..1454181dd3 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h @@ -17,7 +17,7 @@ typedef struct ObjHakaisi { /* 0x184 */ Vec3f unk_184; /* 0x190 */ s32 switchFlag; /* 0x194 */ s16 unk_194; - /* 0x196 */ s16 unk_196; + /* 0x196 */ s16 csId; /* 0x198 */ s16 unk_198; /* 0x19A */ s16 unk_19A; /* 0x19C */ s16 unk_19C; diff --git a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c index 5be919068b..7b0351e789 100644 --- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c +++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c @@ -79,7 +79,7 @@ void ObjHgdoor_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, header); this->rotation = 0; this->timer = 0; - this->cutscene = this->dyna.actor.cutscene; + this->csId = this->dyna.actor.csId; ObjHgdoor_SetupIdle(this); } @@ -94,7 +94,7 @@ void ObjHgdoor_SetupIdle(ObjHgdoor* this) { } void ObjHgdoor_Idle(ObjHgdoor* this, PlayState* play) { - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) && + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) && (this->dyna.actor.xzDistToPlayer < 100.0f) && (this->dyna.actor.playerHeightRel < 40.0f) && OBJHGDOOR_IS_RIGHT_DOOR(&this->dyna.actor)) { ObjHgdoor_SetChild(this, play); @@ -108,31 +108,31 @@ void ObjHgdoor_SetupCutscene(ObjHgdoor* this) { } void ObjHgdoor_PlayCutscene(ObjHgdoor* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_Start(this->cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Start(this->csId, &this->dyna.actor); ObjHgdoor_SetupCsAction(this); ObjHgdoor_SetupCsAction((ObjHgdoor*)this->dyna.actor.child); } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->cutscene); + CutsceneManager_Queue(this->csId); } } void ObjHgdoor_SetupCsAction(ObjHgdoor* this) { - this->csAction = 0x63; + this->cueId = 99; this->actionFunc = ObjHgdoor_HandleCsAction; } void ObjHgdoor_HandleCsAction(ObjHgdoor* this, PlayState* play) { - s32 actionIndex; + s32 cueChannel; - if (Cutscene_CheckActorAction(play, 483)) { - actionIndex = Cutscene_GetActorActionIndex(play, 483); - if (this->csAction != play->csCtx.actorActions[actionIndex]->action) { - this->csAction = play->csCtx.actorActions[actionIndex]->action; - switch (play->csCtx.actorActions[actionIndex]->action) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_483)) { + cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_483); + if (this->cueId != play->csCtx.actorCues[cueChannel]->id) { + this->cueId = play->csCtx.actorCues[cueChannel]->id; + switch (play->csCtx.actorCues[cueChannel]->id) { case 1: Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WOOD_DOOR_OPEN_SPEEDY); if ((this->dyna.actor.parent != NULL) && (this->dyna.actor.parent->id == ACTOR_EN_HG)) { @@ -149,7 +149,7 @@ void ObjHgdoor_HandleCsAction(ObjHgdoor* this, PlayState* play) { ObjHgdoor_SetupStopCs(this); } } else { - this->csAction = 0x63; + this->cueId = 99; } } @@ -160,8 +160,8 @@ void ObjHgdoor_SetupStopCs(ObjHgdoor* this) { void ObjHgdoor_StopCs(ObjHgdoor* this, PlayState* play) { if (this->timer++ > 80) { - if (!ActorCutscene_GetCanPlayNext(this->cutscene)) { - ActorCutscene_Stop(this->cutscene); + if (!CutsceneManager_IsNext(this->csId)) { + CutsceneManager_Stop(this->csId); } } } diff --git a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.h b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.h index 7172952bb2..1411a5e662 100644 --- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.h +++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.h @@ -13,10 +13,10 @@ typedef void (*ObjHgdoorActionFunc)(struct ObjHgdoor*, PlayState*); typedef struct ObjHgdoor { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ ObjHgdoorActionFunc actionFunc; - /* 0x160 */ s16 cutscene; + /* 0x160 */ s16 csId; /* 0x162 */ s16 rotation; /* 0x164 */ s16 timer; - /* 0x166 */ u16 csAction; + /* 0x166 */ u16 cueId; } ObjHgdoor; // size = 0x168 #endif // Z_OBJ_HGDOOR_H diff --git a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c index cade13522e..e69729b92f 100644 --- a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c +++ b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c @@ -380,7 +380,7 @@ void func_80A54C04(ObjHugebombiwa* this, PlayState* play) { } if (func_80A54A0C(this)) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); func_80A54CD8(this); return; } @@ -407,8 +407,8 @@ void func_80A54CD8(ObjHugebombiwa* this) { void func_80A54CEC(ObjHugebombiwa* this, PlayState* play) { s32 pad; - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); Flags_SetSwitch(play, ENHUGEBOMBIWA_GET_7F(&this->actor)); if (!(ENHUGEBOMBIWA_GET_100(&this->actor)) && ((play->sceneId == SCENE_17SETUGEN) || (play->sceneId == SCENE_17SETUGEN2))) { @@ -429,7 +429,7 @@ void func_80A54CEC(ObjHugebombiwa* this, PlayState* play) { func_80A55310(this); } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -523,7 +523,7 @@ void func_80A55064(ObjHugebombiwa* this, PlayState* play) { this->unk_4B2--; if ((this->unk_4B0 >= 20) || (this->unk_4B2 <= 0)) { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); Actor_Kill(&this->actor); } } @@ -619,7 +619,7 @@ void func_80A55564(ObjHugebombiwa* this, PlayState* play) { this->unk_4B2--; if ((this->unk_4B0 >= 20) || (this->unk_4B2 <= 0)) { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c index 089cddf02d..41cdd83695 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c @@ -213,7 +213,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { D_80B9DED0 = Lib_SegmentedToVirtual(object_hunsui_Matanimheader_000BF0); D_80B9DED4 = Lib_SegmentedToVirtual(object_hunsui_Matanimheader_001888); - SubS_FillCutscenesList(&this->dyna.actor, this->unk_170, ARRAY_COUNT(this->unk_170)); + SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList)); this->unk_18C = 0; switch (this->unk_160) { @@ -327,7 +327,7 @@ void ObjHunsui_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if ((this->unk_172 & 0x40) && - SubS_StartActorCutscene(&this->dyna.actor, this->unk_17C, -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) { + SubS_StartCutscene(&this->dyna.actor, this->csId, CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) { this->unk_172 &= ~0x40; } @@ -355,7 +355,7 @@ void func_80B9CE64(ObjHunsui* this, PlayState* play) { if (!(this->unk_172 & 1)) { if (sp2C != this->unk_180) { - this->unk_17C = this->unk_170[0]; + this->csId = this->csIdList[0]; this->unk_172 |= 0x40; } } @@ -447,7 +447,7 @@ void func_80B9D120(ObjHunsui* this, PlayState* play) { } if (func_80B9C450(play, this->unk_168, this->unk_164)) { - this->unk_17C = this->unk_170[0]; + this->csId = this->csIdList[0]; this->unk_172 |= 0x40; func_80B9D4D0(this, play); } @@ -560,7 +560,7 @@ void func_80B9D508(ObjHunsui* this, PlayState* play) { } if (!(this->unk_172 & 1) && !func_80B9C450(play, this->unk_168, this->unk_164)) { - this->unk_17C = this->unk_170[0]; + this->csId = this->csIdList[0]; this->unk_172 |= 0x40; func_80B9D0FC(this, play); } @@ -569,7 +569,7 @@ void func_80B9D508(ObjHunsui* this, PlayState* play) { void func_80B9D714(ObjHunsui* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - s16 cs; + s16 csId; f32 sp28; if ((this->unk_16C != play->roomCtx.curRoom.num) && (this->unk_16C != play->roomCtx.prevRoom.num) && @@ -579,19 +579,19 @@ void func_80B9D714(ObjHunsui* this, PlayState* play) { if (Flags_GetSwitch(play, this->unk_168)) { this->unk_172 &= ~2; this->unk_172 |= 0x10; - cs = this->dyna.actor.cutscene; + csId = this->dyna.actor.csId; if (this->unk_16E == 0) { - if ((cs >= 0) && !ActorCutscene_GetCanPlayNext(cs)) { - ActorCutscene_SetIntentToPlay(cs); - } else if (cs >= 0) { - ActorCutscene_StartAndSetUnkLinkFields(cs, &this->dyna.actor); + if ((csId >= 0) && !CutsceneManager_IsNext(csId)) { + CutsceneManager_Queue(csId); + } else if (csId >= 0) { + CutsceneManager_StartWithPlayerCs(csId, &this->dyna.actor); this->unk_16E = -1; } else { this->unk_16E = 40; } } else if (this->unk_16E < 0) { - if (func_800F22C4(cs, &this->dyna.actor)) { + if (func_800F22C4(csId, &this->dyna.actor) != 0) { this->unk_16E = 40; } } else { diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h index 14a2eea626..c06abbe7d7 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h @@ -31,11 +31,11 @@ typedef struct ObjHunsui { /* 0x16C */ s8 unk_16C; /* 0x16D */ s8 unk_16D; /* 0x16E */ s8 unk_16E; - /* 0x170 */ s16 unk_170[1]; + /* 0x170 */ s16 csIdList[1]; /* 0x172 */ u16 unk_172; /* 0x174 */ f32 unk_174; /* 0x178 */ f32 unk_178; - /* 0x17C */ s16 unk_17C; + /* 0x17C */ s16 csId; /* 0x180 */ s32 unk_180; /* 0x184 */ s16 unk_184; /* 0x186 */ s16 unk_186; diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index dc95eec27d..0ef50dc981 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -116,7 +116,7 @@ void ObjIcePoly_Init(Actor* thisx, PlayState* play) { thisx->shape.rot.z = -0x500; if (((this->unk_149 != OBJICEPOLY_FF_FF) && Flags_GetSwitch(play, this->unk_149)) || - ((play->sceneId == SCENE_KAJIYA) && CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80))) { + ((play->sceneId == SCENE_KAJIYA) && CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE))) { Actor_Kill(thisx); return; } @@ -200,7 +200,7 @@ void func_80931A38(ObjIcePoly* this, PlayState* play) { (this->colliders2[1].info.acHitInfo->toucher.dmgFlags == 0x800)) || ((this->colliders2[1].base.ac->id == ACTOR_OBJ_AQUA) && (this->colliders2[1].base.ac->params == OBJAQUA_1))))) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->unk_14A = 0; this->actionFunc = func_80931E58; this->actor.focus.rot.y = this->actor.yawTowardsPlayer; @@ -220,7 +220,7 @@ void func_80931A38(ObjIcePoly* this, PlayState* play) { } while (actor != NULL); } } else if ((this->unk_149 != OBJICEPOLY_FF_FF) && Flags_GetSwitch(play, this->unk_149)) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->unk_14A = 1; this->actionFunc = func_80931E58; } else { @@ -265,8 +265,8 @@ void func_80931A38(ObjIcePoly* this, PlayState* play) { } void func_80931E58(ObjIcePoly* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); if (this->unk_14A == 1) { func_80931828(this, play); Actor_Kill(&this->actor); @@ -277,7 +277,7 @@ void func_80931E58(ObjIcePoly* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_ICE_MELT); this->actionFunc = func_80931EEC; } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -327,7 +327,7 @@ void func_80931EEC(ObjIcePoly* this, PlayState* play) { this->unk_148 -= 6; if (this->unk_14A == 0) { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); if (this->unk_149 != OBJICEPOLY_FF_FF) { Flags_SetSwitch(play, this->unk_149); } diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index 886762306b..a1e0d64bc3 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -971,13 +971,13 @@ void ObjIceBlock_SetupAttemptSpawnCutscene(ObjIceblock* this) { } void ObjIceBlock_AttemptSpawnCutscene(ObjIceblock* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->extendedDrawFunc = func_80A26BF8; this->spawnCutsceneTimer = 80; func_80A25824(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -1209,7 +1209,7 @@ void func_80A25FD4(ObjIceblock* this, PlayState* play) { func_80A23370(this, sp2C); func_80A260E8(this); sp30 = false; - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT); this->unk_1B0 |= 1; } @@ -1255,7 +1255,7 @@ void func_80A26144(ObjIceblock* this, PlayState* play) { if ((this->unk_1B0 & 1) && (isBool || sp28 || (this->dyna.actor.xzDistToPlayer > 400.0f))) { this->unk_1B0 &= ~1; - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END); } if (isBool) { @@ -1454,7 +1454,7 @@ void ObjIceblock_Update(Actor* thisx, PlayState* play) { this->unk_1B0 &= ~0x100; if (this->unk_1B0 & 1) { this->unk_1B0 &= ~1; - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END); } func_80A266C4(this); } @@ -1463,7 +1463,7 @@ void ObjIceblock_Update(Actor* thisx, PlayState* play) { if (this->spawnCutsceneTimer > 0) { this->spawnCutsceneTimer--; if (this->spawnCutsceneTimer == 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c index 0f4f835039..276c4a28e5 100644 --- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c +++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c @@ -36,7 +36,7 @@ void ObjJgGakki_Init(Actor* thisx, PlayState* play2) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_Init(play, &this->skelAnime, &gGoronElderDrumSkel, NULL, NULL, NULL, 0); - if (((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 7)) && (play->csCtx.currentCsIndex == 0)) { + if (((play->sceneId == SCENE_SPOT00) && (gSaveContext.sceneLayer == 7)) && (play->csCtx.scriptIndex == 0)) { Animation_Change(&this->skelAnime, &gGoronElderDrumTakeOutAnim, 1.0f, frameCount, frameCount, ANIMMODE_ONCE, 0.0f); } else if ((play->sceneId == SCENE_17SETUGEN) || (play->sceneId == SCENE_10YUKIYAMANOMURA)) { diff --git a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c index 65ebe75b65..31e6905ecc 100644 --- a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c +++ b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c @@ -78,11 +78,11 @@ void func_80C08BBC(ObjKzsaku* this) { } void ObjKzsaku_Rise(ObjKzsaku* this, PlayState* play) { - if (this->dyna.actor.cutscene != -1) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (this->dyna.actor.csId != CS_ID_NONE) { + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } if (this->raisedAmount < 450.0f) { @@ -103,8 +103,8 @@ void func_80C08C84(ObjKzsaku* this) { void func_80C08CB0(ObjKzsaku* this, PlayState* play) { if (this->timer <= 20) { if (this->timer == 20) { - if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) { + CutsceneManager_Stop(this->dyna.actor.csId); } this->timer = 21; } else { diff --git a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c index 8225c6c49c..c54378a746 100644 --- a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c +++ b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c @@ -134,7 +134,7 @@ void func_80AF3ADC(ObjLightblock* this, PlayState* play) { } if (this->collisionCounter >= 8) { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); func_80AF3B8C(this); } else { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); @@ -146,13 +146,13 @@ void func_80AF3B8C(ObjLightblock* this) { } void func_80AF3BA0(ObjLightblock* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); Flags_SetSwitch(play, LIGHTBLOCK_DESTROYED(&this->dyna.actor)); func_80AF3910(this, play); func_80AF3C18(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -162,12 +162,12 @@ void func_80AF3C18(ObjLightblock* this) { } void func_80AF3C34(ObjLightblock* this, PlayState* play) { - s8 temp_a0; + s8 csId; this->timer--; if (this->timer <= 0) { - temp_a0 = this->dyna.actor.cutscene; - ActorCutscene_Stop(temp_a0); + csId = this->dyna.actor.csId; + CutsceneManager_Stop(csId); Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 4518e4e29f..34479a72af 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -189,13 +189,13 @@ void ObjLightswitch_SetAction(ObjLightswitch* this, ObjLightswitchSetupFunc setu } void ObjLightswitch_PlayCinema(ObjLightswitch* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); ObjLightswitch_UpdateSwitchFlags(this, play, this->switchFlagSetType); this->cutsceneTimer = 50; this->setupFunc(this); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -351,7 +351,7 @@ void ObjLightswitch_Update(Actor* thisx, PlayState* play) { if ((this->cutsceneTimer > 0) && ((s32)this->actionFunc != (s32)ObjLightswitch_PlayCinema)) { this->cutsceneTimer--; if (this->cutsceneTimer == 0) { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index d544fcbfcb..da16d938f1 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -109,7 +109,7 @@ void ObjMakekinsuta_Update(Actor* thisx, PlayState* play) { if (Flags_GetSwitch(play, OBJMAKEKINSUTA_GET_SWITCH_FLAGS(thisx))) { this->actor.update = func_8099FD7C; - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } else { if (this->unk144 >= 0) { if (this->unk144 == 0) { @@ -127,15 +127,15 @@ void ObjMakekinsuta_Update(Actor* thisx, PlayState* play) { } void func_8099FD7C(Actor* thisx, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(thisx->cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(thisx->cutscene, thisx); - if (thisx->cutscene >= 0) { + if (CutsceneManager_IsNext(thisx->csId)) { + CutsceneManager_StartWithPlayerCs(thisx->csId, thisx); + if (thisx->csId >= 0) { func_800B7298(play, thisx, PLAYER_CSMODE_4); } func_8099FB64(thisx, play); thisx->update = Actor_Noop; thisx->flags &= ~ACTOR_FLAG_10; } else { - ActorCutscene_SetIntentToPlay(thisx->cutscene); + CutsceneManager_Queue(thisx->csId); } } diff --git a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c index e2750e6392..b0ac87b4ee 100644 --- a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c +++ b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c @@ -40,7 +40,7 @@ ActorInit Obj_Mu_Pict_InitVars = { void ObjMuPict_Init(Actor* thisx, PlayState* play) { ObjMuPict* this = THIS; - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20)) { + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_75_20) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) { Actor_Kill(&this->actor); } @@ -64,14 +64,14 @@ void func_80C06B70(ObjMuPict* this, PlayState* play) { s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - if (this->actor.cutscene < 0) { + if (this->actor.csId < 0) { func_80C06DC8(this, play); func_80C06CC4(this); } else { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); + if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { + CutsceneManager_Stop(CS_ID_GLOBAL_TALK); } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); func_80C06DC8(this, play); func_80C06C54(this); } @@ -85,11 +85,11 @@ void func_80C06C54(ObjMuPict* this) { } void func_80C06C68(ObjMuPict* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_Start(this->actor.csId, &this->actor); func_80C06CC4(this); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -113,8 +113,8 @@ void func_80C06CD8(ObjMuPict* this, PlayState* play) { case TEXT_STATE_DONE: if (Message_ShouldAdvance(play)) { func_80C06B5C(this); - if (this->actor.cutscene >= 0) { - ActorCutscene_Stop(this->actor.cutscene); + if (this->actor.csId >= 0) { + CutsceneManager_Stop(this->actor.csId); } } break; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 678f76ed02..95c43a4bf6 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -139,7 +139,7 @@ void ObjMure_SpawnActors0(Actor* thisx, PlayState* play) { ObjMure_GetSpawnPos(&pos, &this->actor.world.pos, this->ptn, i); this->children[i] = Actor_SpawnAsChildAndCutscene( &play->actorCtx, play, sSpawnActorIds[this->type], pos.x, pos.y, pos.z, this->actor.world.rot.x, - this->actor.world.rot.y, this->actor.world.rot.z, sSpawnParams[this->type], this->actor.cutscene, + this->actor.world.rot.y, this->actor.world.rot.z, sSpawnParams[this->type], this->actor.csId, this->actor.halfDaysBits, NULL); if (this->children[i] != NULL) { if (this->type == 0x90) { @@ -152,7 +152,7 @@ void ObjMure_SpawnActors0(Actor* thisx, PlayState* play) { ObjMure_GetSpawnPos(&pos, &this->actor.world.pos, this->ptn, i); this->children[i] = Actor_SpawnAsChildAndCutscene( &play->actorCtx, play, sSpawnActorIds[this->type], pos.x, pos.y, pos.z, this->actor.world.rot.x, - this->actor.world.rot.y, this->actor.world.rot.z, sSpawnParams[this->type], this->actor.cutscene, + this->actor.world.rot.y, this->actor.world.rot.z, sSpawnParams[this->type], this->actor.csId, this->actor.halfDaysBits, NULL); if (this->children[i] != NULL) { this->children[i]->room = this->actor.room; @@ -174,7 +174,7 @@ void ObjMure_SpawnActors1(ObjMure* this, PlayState* play2) { this->children[i] = Actor_SpawnAsChildAndCutscene( &play2->actorCtx, play, sSpawnActorIds[this->type], spawnPos.x, spawnPos.y, spawnPos.z, actor->world.rot.x, actor->world.rot.y, actor->world.rot.z, - (this->type == OBJMURE_TYPE_BUTTERFLY && i == 0) ? 1 : sSpawnParams[this->type], this->actor.cutscene, + (this->type == OBJMURE_TYPE_BUTTERFLY && i == 0) ? 1 : sSpawnParams[this->type], this->actor.csId, this->actor.halfDaysBits, NULL); if (this->children[i] != NULL) { this->childrenStates[i] = OBJMURE_CHILD_STATE_0; diff --git a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c index bf20758ca4..7f7f9550af 100644 --- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c +++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c @@ -69,7 +69,7 @@ void ObjNozoki_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->dyna.actor.shape.rot.x = 0; this->dyna.actor.shape.rot.z = 0; - this->unk_15F = this->dyna.actor.cutscene; + this->csId = this->dyna.actor.csId; if (play->sceneId == SCENE_AYASHIISHOP) { this->unk_15C = 4; @@ -107,7 +107,7 @@ void func_80BA2514(ObjNozoki* this, PlayState* play) { if (this->unk_15C == 0) { Actor_SetObjectDependency(play, &this->dyna.actor); DynaPolyActor_LoadMesh(play, &this->dyna, &object_secom_obj_Colheader_0001C0); - if (ActorCutscene_GetAdditionalCutscene(this->unk_15F) >= 0) { + if (CutsceneManager_GetAdditionalCsId(this->csId) >= 0) { this->dyna.actor.params |= OBJNOZOKI_400; } ObjNozoki_SetupAction(this, func_80BA27C4); @@ -129,16 +129,16 @@ void func_80BA2514(ObjNozoki* this, PlayState* play) { } s32 func_80BA26A8(ObjNozoki* this) { - if (this->unk_15F < 0) { + if (this->csId < 0) { return true; } - if (ActorCutscene_GetCanPlayNext(this->unk_15F)) { - ActorCutscene_StartAndSetUnkLinkFields(this->unk_15F, &this->dyna.actor); + if (CutsceneManager_IsNext(this->csId)) { + CutsceneManager_StartWithPlayerCs(this->csId, &this->dyna.actor); return true; } - ActorCutscene_SetIntentToPlay(this->unk_15F); + CutsceneManager_Queue(this->csId); return false; } @@ -185,7 +185,7 @@ void func_80BA27C4(ObjNozoki* this, PlayState* play) { this->unk_15E = 25; play_sound(NA_SE_SY_SECOM_WARNING); } else { - this->unk_15E = ActorCutscene_GetLength(this->unk_15F); + this->unk_15E = CutsceneManager_GetLength(this->csId); if (this->unk_15E < 0) { this->unk_15E = 50; } @@ -213,23 +213,23 @@ void func_80BA28DC(ObjNozoki* this, PlayState* play) { return; } } else if (Flags_GetSwitch(play, OBJNOZOKI_GET_SWITCHFLAG1(&this->dyna.actor))) { - s32 cs = this->dyna.actor.cutscene; + s32 csId = this->dyna.actor.csId; - if (cs == this->unk_15F) { + if (csId == this->csId) { if (OBJNOZOKI_GET_400(&this->dyna.actor)) { Vec3f sp28; Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &sp28, &GET_PLAYER(play)->actor.world.pos); if (sp28.z < -20.0f) { - this->unk_15F = ActorCutscene_GetAdditionalCutscene(this->unk_15F); + this->csId = CutsceneManager_GetAdditionalCsId(this->csId); } } } else if (D_80BA36B4 == 0) { if (func_80BA26A8(this)) { D_80BA36B4 = 1; } - } else if (ActorCutscene_GetCurrentIndex() != this->unk_15F) { - this->unk_15F = cs; + } else if (CutsceneManager_GetCurrentCsId() != this->csId) { + this->csId = csId; this->dyna.actor.params &= ~OBJNOZOKI_400; SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_ENEMY | 0x800 | SEQ_FLAG_ASYNC); } @@ -275,13 +275,13 @@ void func_80BA2BA4(ObjNozoki* this, PlayState* play) { s32 func_80BA2C28(ObjNozoki* this) { s32 i; - s16 cs = this->unk_15F; + s16 csId = this->csId; for (i = 0; i < 3; i++) { - if (ActorCutscene_GetCurrentIndex() == cs) { + if (CutsceneManager_GetCurrentCsId() == csId) { return i; } - cs = ActorCutscene_GetAdditionalCutscene(cs); + csId = CutsceneManager_GetAdditionalCsId(csId); } return -1; diff --git a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.h b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.h index 4c4b74916f..8bfc9818e2 100644 --- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.h +++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.h @@ -20,7 +20,7 @@ typedef struct ObjNozoki { /* 0x15C */ u8 unk_15C; /* 0x15D */ u8 unk_15D; /* 0x15E */ s8 unk_15E; - /* 0x15F */ s8 unk_15F; + /* 0x15F */ s8 csId; /* 0x160 */ ObjNozokiActionFunc actionFunc; } ObjNozoki; // size = 0x164 diff --git a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c index 0b4e4e14b7..eab144cbdc 100644 --- a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c +++ b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c @@ -221,7 +221,7 @@ void func_80AC9B5C(ObjOcarinalift* this, PlayState* play) { if (OBJOCARINALIFT_GET_C(&this->dyna.actor) != OBJOCARINALIFT_PARAMSC_1) { Flags_SetSwitch(play, OBJOCARINALIFT_GET_SWITCH_FLAG(&this->dyna.actor)); } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); func_80AC9C20(this); } } else { @@ -239,12 +239,12 @@ void func_80AC9C20(ObjOcarinalift* this) { } void func_80AC9C48(ObjOcarinalift* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->cutsceneTimer = 50; func_80AC96B4(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -256,7 +256,7 @@ void ObjOcarinalift_Update(Actor* thisx, PlayState* play) { if (this->cutsceneTimer > 0) { this->cutsceneTimer--; if (this->cutsceneTimer == 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } } } diff --git a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c index ee26937da8..dbd0dfe31a 100644 --- a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c +++ b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c @@ -113,7 +113,7 @@ s32 ObjPurify_IsPurified(ObjPurify* this) { return true; } } else { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { return true; } } diff --git a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c index 5788f15859..3c8a7ecc0f 100644 --- a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c +++ b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c @@ -198,18 +198,18 @@ void ObjRaillift_Wait(ObjRaillift* this, PlayState* play) { void ObjRaillift_Idle(ObjRaillift* this, PlayState* play) { if (Flags_GetSwitch(play, OBJRAILLIFT_GET_FLAG(&this->dyna.actor))) { this->dyna.actor.speed = 0.0f; - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); this->actionFunc = ObjRaillift_StartCutscene; } } void ObjRaillift_StartCutscene(ObjRaillift* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->cutsceneTimer = 50; this->actionFunc = ObjRaillift_Move; } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -223,7 +223,7 @@ void ObjRaillift_Update(Actor* thisx, PlayState* play) { if (this->cutsceneTimer > 0) { this->cutsceneTimer--; if (this->cutsceneTimer == 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); } } if (OBJRAILLIFT_REACT_TO_PLAYER_ON_TOP(thisx)) { diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 154f662f8c..3871508bae 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -64,7 +64,7 @@ void func_80973D3C(ObjRoomtimer* this, PlayState* play) { if (this->actor.params != 0x1FF) { gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_STOP; } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = func_80973DE0; } else if ((this->actor.params != 0x1FF) && (gSaveContext.timerStates[TIMER_ID_MINIGAME_2] == TIMER_STATE_OFF)) { play_sound(NA_SE_OC_ABYSS); @@ -74,17 +74,17 @@ void func_80973D3C(ObjRoomtimer* this, PlayState* play) { } void func_80973DE0(ObjRoomtimer* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + if (CutsceneManager_IsNext(this->actor.csId)) { Flags_SetClear(play, this->actor.room); Flags_SetSwitch(play, this->switchFlag); - if (ActorCutscene_GetLength(this->actor.cutscene) != -1) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_GetLength(this->actor.csId) != -1) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); } Actor_Kill(&this->actor); return; } - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } void ObjRoomtimer_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c index 385bb65fbd..fa04972ef0 100644 --- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c +++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c @@ -535,7 +535,7 @@ void func_80A22334(ObjSkateblock* this, PlayState* play) { func_80A21C88(this, sp2C); func_80A2244C(this); sp30 = false; - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT); this->unk_1C1 |= 1; } @@ -591,7 +591,7 @@ void func_80A224A4(ObjSkateblock* this, PlayState* play) { if ((this->unk_1C1 & 1) && (sp24 || sp28 || (this->dyna.actor.xzDistToPlayer > 400.0f))) { this->unk_1C1 &= ~1; - func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6); + func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END); } func_80A21F74(this, play); diff --git a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c index b0416cc58e..c94d67860c 100644 --- a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c +++ b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c @@ -106,7 +106,7 @@ void func_80B02CD0(ObjSnowball* this, PlayState* play) { Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ptr->unk_00, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, this->actor.home.rot.x, 0, this->actor.home.rot.z, - ptr->unk_02, -1, this->actor.halfDaysBits, NULL); + ptr->unk_02, CS_ID_NONE, this->actor.halfDaysBits, NULL); } void func_80B02D58(ObjSnowball* this, PlayState* play) { @@ -121,10 +121,10 @@ void func_80B02DB0(ObjSnowball* this, PlayState* play) { s32 pad; ObjSnowballStruct2* ptr = &D_80B04F84[this->actor.home.rot.y]; - Actor_SpawnAsChildAndCutscene( - &play->actorCtx, play, ptr->unk_00, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, - this->actor.home.rot.x, 0, this->actor.home.rot.z, this->actor.params | ptr->unk_02, - ActorCutscene_GetAdditionalCutscene(this->actor.cutscene), this->actor.halfDaysBits, NULL); + Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ptr->unk_00, this->actor.home.pos.x, this->actor.home.pos.y, + this->actor.home.pos.z, this->actor.home.rot.x, 0, this->actor.home.rot.z, + this->actor.params | ptr->unk_02, CutsceneManager_GetAdditionalCsId(this->actor.csId), + this->actor.halfDaysBits, NULL); } void func_80B02E54(ObjSnowball* this, PlayState* play) { @@ -132,7 +132,7 @@ void func_80B02E54(ObjSnowball* this, PlayState* play) { Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ptr->unk_00, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, this->actor.home.rot.x, 0, this->actor.home.rot.z, - this->actor.params | ptr->unk_02, -1, this->actor.halfDaysBits, NULL); + this->actor.params | ptr->unk_02, CS_ID_NONE, this->actor.halfDaysBits, NULL); } void func_80B02EE4(ObjSnowball* this, PlayState* play) { @@ -549,7 +549,7 @@ void func_80B04350(ObjSnowball* this, PlayState* play) { this->unk_20A = 0; } - if (this->actor.cutscene < 0) { + if (this->actor.csId < 0) { func_80B03FF8(this, play); if (this->unk_20A == 0) { func_80B04608(this, play); @@ -584,13 +584,13 @@ void func_80B04350(ObjSnowball* this, PlayState* play) { } void func_80B04540(ObjSnowball* this, PlayState* play) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = func_80B0457C; } void func_80B0457C(ObjSnowball* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); func_80B03FF8(this, play); this->unk_20B = 1; if (this->unk_20A == 0) { @@ -599,7 +599,7 @@ void func_80B0457C(ObjSnowball* this, PlayState* play) { func_80B046E4(this, play); } } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -615,7 +615,7 @@ void func_80B04648(ObjSnowball* this, PlayState* play) { this->unk_208--; if (this->unk_208 <= 0) { if (this->unk_20B != 0) { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); } if (this->actor.home.rot.y == 1) { @@ -719,7 +719,7 @@ void func_80B047C0(ObjSnowball* this, PlayState* play) { if ((this->unk_208 <= 0) || ((this->unk_1A8[0].unk_2D & 1) && (this->unk_1A8[1].unk_2D & 1))) { if (this->unk_20B != 0) { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); } if (this->actor.home.rot.y == 1) { diff --git a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c index 6e959a8dcf..907df33fcd 100644 --- a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c +++ b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c @@ -676,15 +676,15 @@ void func_80B30A2C(ObjSpidertent* this) { } void func_80B30A4C(ObjSpidertent* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); - if (this->dyna.actor.cutscene >= 0) { + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); + if (this->dyna.actor.csId >= 0) { func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_1); } Flags_SetSwitch(play, OBJSPIDERTENT_GET_7F00(&this->dyna.actor)); func_80B30AD4(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -791,7 +791,7 @@ void func_80B30AF8(ObjSpidertent* this, PlayState* play) { } } } else if (this->unk_3C1 <= 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 9a1ab70956..2c03f86899 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -266,7 +266,7 @@ void ObjSwitch_CrystalUpdateTimer(ObjSwitch* this) { void ObjSwitch_StopCutscene(ObjSwitch* this) { if (this->isPlayingCutscene) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); this->isPlayingCutscene = false; } } @@ -486,8 +486,8 @@ void ObjSwitch_TryPlayCutsceneInit(ObjSwitch* this, PlayState* play, ObjSwitchSe } void ObjSwitch_TryPlayCutscene(ObjSwitch* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); ObjSwitch_SetSwitchFlagState(this, play, this->nextSwitchFlagState); if (this->floorSwitchPlayerSnapState == 1) { this->floorSwitchPlayerSnapState = 2; @@ -495,7 +495,7 @@ void ObjSwitch_TryPlayCutscene(ObjSwitch* this, PlayState* play) { this->isPlayingCutscene = true; this->setupFunc(this); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c index 5e6f399a8b..f1b7bfa6f6 100644 --- a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c +++ b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c @@ -109,12 +109,12 @@ void func_80C25698(ObjSwprize* this) { } void func_80C256AC(ObjSwprize* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + if (CutsceneManager_IsNext(this->actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); func_80C253D0(this, play); func_80C25710(this); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -127,7 +127,7 @@ void func_80C2572C(ObjSwprize* this, PlayState* play) { if (this->timer > 0) { this->timer--; if (this->timer == 0) { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); ObjSwprize_SetupDoNothing(this); } } diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 96716d107a..902caa42bf 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -143,16 +143,16 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { s32 pad1; if (this->pendingAction != OBJ_SYOKUDAI_PENDING_ACTION_NONE) { - if (ActorCutscene_GetCurrentIndex() != thisx->cutscene) { - if (ActorCutscene_GetCanPlayNext(thisx->cutscene) != 0) { - ActorCutscene_StartAndSetUnkLinkFields(thisx->cutscene, thisx); + if (CutsceneManager_GetCurrentCsId() != thisx->csId) { + if (CutsceneManager_IsNext(thisx->csId)) { + CutsceneManager_StartWithPlayerCs(thisx->csId, thisx); if (this->pendingAction >= OBJ_SYOKUDAI_PENDING_ACTION_CUTSCENE_AND_SWITCH) { Flags_SetSwitch(play, switchFlag); } } else { - ActorCutscene_SetIntentToPlay(thisx->cutscene); + CutsceneManager_Queue(thisx->csId); } - } else if (func_800F22C4(thisx->cutscene, thisx) != 0) { + } else if (func_800F22C4(thisx->csId, thisx) != 0) { this->snuffTimer = OBJ_SYOKUDAI_SNUFF_NEVER; this->pendingAction = OBJ_SYOKUDAI_PENDING_ACTION_NONE; } @@ -171,6 +171,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { } else { s32 interaction = OBJ_SYOKUDAI_INTERACTION_NONE; u32 flameColliderHurtboxDmgFlags = 0; + player = GET_PLAYER(play); if (OBJ_SYOKUDAI_GET_START_LIT(thisx)) { @@ -240,7 +241,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { if (groupSize == 0) { if ((type == OBJ_SYOKUDAI_TYPE_NO_SWITCH) && (switchFlag == 0x7F)) { this->snuffTimer = OBJ_SYOKUDAI_SNUFF_NEVER; - } else if (thisx->cutscene >= 0) { + } else if (thisx->csId >= 0) { this->pendingAction = OBJ_SYOKUDAI_PENDING_ACTION_CUTSCENE_AND_SWITCH; } else { Flags_SetSwitch(play, switchFlag); diff --git a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c index 9a01a8da3c..aeaddd2eec 100644 --- a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c +++ b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c @@ -296,14 +296,14 @@ void func_80B9C174(ObjTaru* this, PlayState* play) { } void func_80B9C1A0(ObjTaru* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); Flags_SetSwitch(play, OBJ_TARU_GET_7F(&this->dyna.actor)); Actor_Kill(&this->dyna.actor); return; } - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } void ObjTaru_Update(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c index ec47acd86f..6cdada70be 100644 --- a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c +++ b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c @@ -195,7 +195,7 @@ void ObjTokeiStep_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) { + if ((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0)) { DynaPolyActor_LoadMesh(play, &this->dyna, &gClocktowerPanelCol); ObjTokeiStep_InitSteps(this); ObjTokeiStep_SetupBeginOpen(this); @@ -221,12 +221,12 @@ void ObjTokeiStep_SetupBeginOpen(ObjTokeiStep* this) { } void ObjTokeiStep_BeginOpen(ObjTokeiStep* this, PlayState* play) { - CsCmdActorAction* action; + CsCmdActorCue* cue; - if (Cutscene_CheckActorAction(play, 134)) { - action = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 134)]; + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_134)) { + cue = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_134)]; - if ((action->startFrame == play->csCtx.frames) && (action->action != 0)) { + if ((cue->startFrame == play->csCtx.curFrame) && (cue->id != 0)) { this->dyna.actor.draw = ObjTokeiStep_DrawOpen; ObjTokeiStep_SetupOpen(this); } diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index 00dd90b94f..7dd00abc35 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -121,8 +121,8 @@ void ObjTokeidai_ExteriorGear_Init(ObjTokeidai* this, PlayState* play) { this->opaDList = gClockTowerExteriorGearDL; ObjTokeidai_SetupClockOrExteriorGear(this); - if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0))) { + if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0)) || + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0))) { ObjTokeidai_SetupTowerOpening(this); } else if ((CURRENT_DAY == 3 && gSaveContext.save.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) { this->actionFunc = ObjTokeidai_ExteriorGear_OpenedIdle; @@ -138,8 +138,8 @@ void ObjTokeidai_TowerClock_Init(ObjTokeidai* this, PlayState* play) { this->actor.draw = ObjTokeidai_Clock_Draw; ObjTokeidai_Clock_Init(this); - if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0))) { + if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0)) || + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0))) { ObjTokeidai_SetupTowerOpening(this); } else if ((CURRENT_DAY == 3 && gSaveContext.save.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) { this->actor.world.pos.y += (this->actor.scale.y * 5191.0f) - 50.0f; @@ -171,8 +171,8 @@ void ObjTokeidai_Counterweight_Init(ObjTokeidai* this, PlayState* play) { this->spotlightIntensity = 0; } - if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.currentCsIndex == 0))) { + if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0)) || + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0))) { this->spotlightIntensity = 0; ObjTokeidai_SetupTowerOpening(this); @@ -329,8 +329,8 @@ void ObjTokeidai_ExteriorGear_Collapse(ObjTokeidai* this, PlayState* play) { } void ObjTokeidai_ExteriorGear_OpenedIdle(ObjTokeidai* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 132) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 132)]->action == 2) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_132) && + play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_132)]->id == 2) { this->actionFunc = ObjTokeidai_ExteriorGear_Collapse; this->actor.speed = this->actor.scale.y * 5.0f; this->actor.velocity.y = 0.0f; @@ -397,8 +397,8 @@ void ObjTokeidai_TowerClock_SlideOff(ObjTokeidai* this, PlayState* play) { } void ObjTokeidai_TowerClock_OpenedIdle(ObjTokeidai* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 132) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 132)]->action == 1) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_132) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_132)]->id == 1)) { this->actionFunc = ObjTokeidai_TowerClock_SlideOff; this->slidingClockFaceAngle = 0; this->aerialClockFaceSpeed = -0xD; @@ -415,8 +415,8 @@ void ObjTokeidai_Counterweight_Collapse(ObjTokeidai* this, PlayState* play) { } void ObjTokeidai_Counterweight_OpenedIdle(ObjTokeidai* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 132) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 132)]->action == 3) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_132) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_132)]->id == 3)) { this->actionFunc = ObjTokeidai_Counterweight_Collapse; this->xRotation = 0; this->actor.velocity.y = 0.0f; @@ -432,22 +432,20 @@ void ObjTokeidai_TerminaFieldWalls_Collapse(ObjTokeidai* this, PlayState* play) } void ObjTokeidai_TerminaFieldWalls_Idle(ObjTokeidai* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 132) != 0 && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 132)]->action == 1) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_132) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_132)]->id == 1)) { this->actionFunc = ObjTokeidai_TerminaFieldWalls_Collapse; } } void ObjTokeidai_TowerOpening_EndCutscene(ObjTokeidai* this, PlayState* play) { - if (Cutscene_CheckActorAction(play, 132) != 0 && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 132)]->action == 5) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_132) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_132)]->id == 5)) { SET_WEEKEVENTREG(WEEKEVENTREG_08_40); - if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && - (play->csCtx.currentCsIndex == 0)) || - ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && - (play->csCtx.currentCsIndex == 0))) { + if (((play->sceneId == SCENE_CLOCKTOWER) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0)) || + ((play->sceneId == SCENE_00KEIKOKU) && (gSaveContext.sceneLayer == 2) && (play->csCtx.scriptIndex == 0))) { Audio_SetCutsceneFlag(false); - gSaveContext.save.cutscene = 0; + gSaveContext.save.cutsceneIndex = 0; gSaveContext.nextCutsceneIndex = 0; gSaveContext.respawnFlag = 2; play->transitionTrigger = TRANS_TRIGGER_START; @@ -587,8 +585,8 @@ void ObjTokeidai_TowerOpening_RaiseTower(ObjTokeidai* this, PlayState* play) { } void ObjTokeidai_TowerOpening_Start(ObjTokeidai* this, PlayState* play) { - if ((Cutscene_CheckActorAction(play, 132) && - play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 132)]->action == 4) || + if ((Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_132) && + (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_132)]->id == 4)) || CHECK_WEEKEVENTREG(WEEKEVENTREG_08_40)) { this->actionFunc = ObjTokeidai_TowerOpening_RaiseTower; } @@ -698,7 +696,7 @@ void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, PlayState* play) { } else { if (!(play->actorCtx.flags & ACTORCTX_FLAG_1) && OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD && - ActorCutscene_GetCurrentIndex() == -1) { + CutsceneManager_GetCurrentCsId() == CS_ID_NONE) { this->actor.draw = NULL; } this->clockTime = gSaveContext.save.time; @@ -731,7 +729,7 @@ void ObjTokeidai_ExteriorGear_Idle(ObjTokeidai* this, PlayState* play) { } else { if (!(play->actorCtx.flags & ACTORCTX_FLAG_1) && (OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_TERMINA_FIELD) && - (ActorCutscene_GetCurrentIndex() == -1)) { + (CutsceneManager_GetCurrentCsId() == CS_ID_NONE)) { this->actor.draw = NULL; } this->clockTime = gSaveContext.save.time; diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index 46fbe067c2..f80c447514 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -1139,7 +1139,7 @@ void ObjUm_RanchWaitPathFinished(ObjUm* this, PlayState* play) { case OBJUM_PATH_STATE_1: case OBJUM_PATH_STATE_FINISH: if (CHECK_WEEKEVENTREG(WEEKEVENTREG_31_80)) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); play->nextEntrance = ENTRANCE(MILK_ROAD, 5); play->transitionType = TRANS_TYPE_64; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; @@ -1158,12 +1158,12 @@ void ObjUm_RanchWaitPathFinished(ObjUm* this, PlayState* play) { void ObjUm_RanchStartCs(ObjUm* this, PlayState* play) { ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->lastTime = gSaveContext.save.time; ObjUm_SetupAction(this, func_80B7A0E0); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -1276,12 +1276,12 @@ void ObjUm_PreMilkRunStartCs(ObjUm* this, PlayState* play) { ObjUm_SetPlayerPosition(this, play); this->flags |= OBJ_UM_FLAG_0004; player->stateFlags1 |= PLAYER_STATE1_20; - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->lastTime = gSaveContext.save.time; ObjUm_SetupAction(this, func_80B7A394); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -1357,17 +1357,17 @@ void func_80B7A614(ObjUm* this, PlayState* play) { } if (this->flags & OBJ_UM_FLAG_MINIGAME_FINISHED) { - s32 sp20 = ActorCutscene_GetAdditionalCutscene(this->dyna.actor.cutscene); + s32 csId = CutsceneManager_GetAdditionalCsId(this->dyna.actor.csId); if (this->areAllPotsBroken) { - sp20 = ActorCutscene_GetAdditionalCutscene(sp20); + csId = CutsceneManager_GetAdditionalCsId(csId); } - if (ActorCutscene_GetCanPlayNext(sp20)) { - ActorCutscene_StartAndSetUnkLinkFields(sp20, &this->dyna.actor); + if (CutsceneManager_IsNext(csId)) { + CutsceneManager_StartWithPlayerCs(csId, &this->dyna.actor); ObjUm_SetupAction(this, ObjUm_RunMinigame); this->flags &= ~OBJ_UM_FLAG_PLAYING_MINIGAME; } else { - ActorCutscene_SetIntentToPlay(sp20); + CutsceneManager_Queue(csId); } } @@ -1396,14 +1396,14 @@ void func_80B7A860(ObjUm* this, PlayState* play) { ObjUm_RotatePlayer(this, play, 0); this->flags |= OBJ_UM_FLAG_0004; - if (play->csCtx.frames == 449) { + if (play->csCtx.curFrame == 449) { ObjUm_InitBandits(this, play); - } else if (play->csCtx.frames >= 450) { + } else if (play->csCtx.curFrame >= 450) { func_80B78DF0(this, play); } if (play->csCtx.state == 0) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); ObjUm_SetupAction(this, func_80B7A7AC); } @@ -1526,12 +1526,12 @@ void ObjUm_StartCs(ObjUm* this, PlayState* play) { ObjUm_RotatePlayer(this, play, 0); this->flags |= OBJ_UM_FLAG_0004; - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); this->lastTime = gSaveContext.save.time; ObjUm_SetupAction(this, func_80B7ABE4); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } @@ -1546,7 +1546,7 @@ void ObjUm_PostMilkRunWaitPathFinished(ObjUm* this, PlayState* play) { ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_TROT); if ((ObjUm_UpdatePath(this, play) == OBJUM_PATH_STATE_4) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_59_02)) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Audio_SetCutsceneFlag(false); SET_WEEKEVENTREG(WEEKEVENTREG_59_02); gSaveContext.nextCutsceneIndex = 0xFFF3; @@ -1568,11 +1568,11 @@ void ObjUm_PostMilkRunStartCs(ObjUm* this, PlayState* play) { this->flags |= OBJ_UM_FLAG_0004; ObjUm_ChangeAnim(this, play, OBJ_UM_ANIM_IDLE); - if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if (CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); ObjUm_SetupAction(this, ObjUm_PostMilkRunWaitPathFinished); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } } diff --git a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c index 81efe0fc52..46a6b994d7 100644 --- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c +++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c @@ -172,18 +172,18 @@ void func_80C081C8(ObjUsiyane* this, PlayState* play) { } void func_80C082CC(ObjUsiyane* this, PlayState* play) { - this->unk_164 = -1; + this->cueId = -1; } void func_80C082E0(ObjUsiyane* this, PlayState* play) { - CsCmdActorAction* csAction; + CsCmdActorCue* cue; - if (Cutscene_CheckActorAction(play, 0x228)) { - this->unk_160 = Cutscene_GetActorActionIndex(play, 0x228); - csAction = play->csCtx.actorActions[this->unk_160]; - if (this->unk_164 != csAction->action) { - this->unk_164 = csAction->action; - if (this->unk_164 == 2) { + if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_552)) { + this->cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_552); + cue = play->csCtx.actorCues[this->cueChannel]; + if (this->cueId != cue->id) { + this->cueId = cue->id; + if (this->cueId == 2) { func_80C07F30(this, play); this->actionFunc = func_80C081C8; } diff --git a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.h b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.h index 2abc2a38b0..92bd96549f 100644 --- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.h +++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.h @@ -24,8 +24,8 @@ typedef struct { typedef struct ObjUsiyane { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ ObjUsiyaneActionFunc actionFunc; - /* 0x160 */ s32 unk_160; - /* 0x164 */ s32 unk_164; + /* 0x160 */ s32 cueChannel; + /* 0x164 */ s32 cueId; /* 0x168 */ ObjUsiyaneStruct unk_168[10][4]; /* 0x708 */ f32 unk_708; /* 0x70C */ f32 unk_70C; diff --git a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c index b7eef869db..075ad18db7 100644 --- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c +++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c @@ -97,19 +97,19 @@ s32 ObjWarpstone_ClosedIdle(ObjWarpstone* this, PlayState* play) { } s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, PlayState* play) { - if (this->dyna.actor.cutscene < 0 || ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + if ((this->dyna.actor.csId < 0) || CutsceneManager_IsNext(this->dyna.actor.csId)) { + CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor); ObjWarpstone_SetupAction(this, ObjWarpstone_PlayOpeningCutscene); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_OWL_WARP_SWITCH_ON); } else { - ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + CutsceneManager_Queue(this->dyna.actor.csId); } return true; } s32 ObjWarpstone_PlayOpeningCutscene(ObjWarpstone* this, PlayState* play) { if (this->openingCSTimer++ >= OBJ_WARPSTONE_TIMER_ACTIVATE_THRESHOLD) { - ActorCutscene_Stop(this->dyna.actor.cutscene); + CutsceneManager_Stop(this->dyna.actor.csId); Sram_ActivateOwl(OBJ_WARPSTONE_GET_ID(&this->dyna.actor)); ObjWarpstone_SetupAction(this, ObjWarpstone_OpenedIdle); } else if (this->openingCSTimer < OBJ_WARPSTONE_TIMER_OPEN_THRESHOLD) { diff --git a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c index 4558a6a75a..54ebe8cc76 100644 --- a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c +++ b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c @@ -52,15 +52,15 @@ void func_808A7968(ObjWturn* this, PlayState* play) { } void func_808A7A24(ObjWturn* this) { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); this->actionFunc = func_808A7A5C; } void func_808A7A5C(ObjWturn* this, PlayState* play) { - if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + if (CutsceneManager_IsNext(this->actor.csId)) { func_808A7AAC(this, play); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } @@ -69,9 +69,9 @@ void func_808A7AAC(ObjWturn* this, PlayState* play) { Vec3f subCamEye; Vec3f subCamAt; - ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor); + CutsceneManager_StartWithPlayerCs(this->actor.csId, &this->actor); Play_EnableMotionBlur(140); - this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene); + this->subCamId = CutsceneManager_GetCurrentSubCamId(this->actor.csId); func_800B7298(play, &this->actor, PLAYER_CSMODE_21); subCamAt.x = player->actor.focus.pos.x; subCamAt.z = player->actor.focus.pos.z; diff --git a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c index 1196cb0be0..cea1a4e71e 100644 --- a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c +++ b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c @@ -105,19 +105,19 @@ void ObjY2shutter_Update(Actor* thisx, PlayState* play) { if (this->settleTimer == 0) { if (Flags_GetSwitch(play, OBJY2SHUTTER_GET_SWITCHFLAG(&this->dyna.actor))) { - s16 cutscene = this->dyna.actor.cutscene; + s16 csId = this->dyna.actor.csId; if (this->openTimer == 0) { - if ((cutscene >= 0) && !ActorCutscene_GetCanPlayNext(cutscene)) { - ActorCutscene_SetIntentToPlay(cutscene); - } else if (cutscene >= 0) { - ActorCutscene_StartAndSetUnkLinkFields(cutscene, &this->dyna.actor); + if ((csId >= 0) && !CutsceneManager_IsNext(csId)) { + CutsceneManager_Queue(csId); + } else if (csId >= 0) { + CutsceneManager_StartWithPlayerCs(csId, &this->dyna.actor); this->openTimer = -1; } else { ObjY2shutter_SetupOpen(this, info, shutterType); } } else if (this->openTimer < 0) { - if (func_800F22C4(cutscene, &this->dyna.actor)) { + if (func_800F22C4(csId, &this->dyna.actor) != 0) { ObjY2shutter_SetupOpen(this, info, shutterType); } } else { diff --git a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c index 0d0db63858..7915551c22 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c +++ b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c @@ -79,7 +79,7 @@ void OceffWipe5_Draw(Actor* thisx, PlayState* play) { f32 phi_fv1 = 1220.0f; if ((((OCEFF_WIPE5_GET_SONG_TYPE(thisx) == 2) && (play->sceneId == SCENE_LABO)) && - ((play->csCtx.currentCsIndex == 0) || (play->csCtx.currentCsIndex == 1))) && + ((play->csCtx.scriptIndex == 0) || (play->csCtx.scriptIndex == 1))) && (play->csCtx.state != 0)) { phi_fv1 = 1150.0f; } diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 23713aa716..f237bed470 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -87,7 +87,7 @@ void ShotSun_SpawnFairy(ShotSun* this, PlayState* play2) { if (this->timer > 0) { this->timer--; } else { - ActorCutscene_Stop(this->actor.cutscene); + CutsceneManager_Stop(this->actor.csId); switch (params) { case SHOTSUN_FAIRY_SPAWNER_SUNS: fairyType = ENELF_TYPE_7; @@ -103,9 +103,9 @@ void ShotSun_SpawnFairy(ShotSun* this, PlayState* play2) { } void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) { - if ((this->actor.cutscene == -1) || ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { - if (this->actor.cutscene != -1) { - ActorCutscene_Start(this->actor.cutscene, &this->actor); + if ((this->actor.csId == CS_ID_NONE) || CutsceneManager_IsNext(this->actor.csId)) { + if (this->actor.csId != CS_ID_NONE) { + CutsceneManager_Start(this->actor.csId, &this->actor); } this->actionFunc = ShotSun_SpawnFairy; this->timer = 50; @@ -113,7 +113,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) { this->actor.home.pos.z, 0, 0, 0, 0x11); Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_APPEAR); } else { - ActorCutscene_SetIntentToPlay(this->actor.cutscene); + CutsceneManager_Queue(this->actor.csId); } } diff --git a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c index 5e42daffb7..5523ded787 100644 --- a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c +++ b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c @@ -91,7 +91,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) { void TGSw_Init(Actor* thisx, PlayState* play) { TGSw* this = THIS; - this->actor.cutscene = this->actor.world.rot.z; + this->actor.csId = this->actor.world.rot.z; this->actionFunc = TGSw_ActionDecider; } diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index 7edfb8e78a..9697b111ff 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -17,8 +17,8 @@ void TitleSetup_SetupTitleScreen(TitleSetupState* this) { Sram_InitNewSave(); - gSaveContext.save.entrance = sOpeningEntrances[D_801BB12C]; - gSaveContext.nextCutsceneIndex = gSaveContext.save.cutscene = sOpeningCutscenes[D_801BB12C]; + gSaveContext.save.entrance = sOpeningEntrances[gOpeningEntranceIndex]; + gSaveContext.nextCutsceneIndex = gSaveContext.save.cutsceneIndex = sOpeningCutscenes[gOpeningEntranceIndex]; gSaveContext.sceneLayer = 0; gSaveContext.save.time = CLOCK_TIME(8, 0); diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index ab34ebffe7..08bf652621 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -533,69 +533,69 @@ void MapSelect_UpdateMenu(MapSelectState* this) { } if (CHECK_BTN_ALL(controller1->press.button, BTN_Z)) { - if (gSaveContext.save.cutscene == 0x8000) { - gSaveContext.save.cutscene = 0; - } else if (gSaveContext.save.cutscene == 0) { - gSaveContext.save.cutscene = 0x8800; - } else if (gSaveContext.save.cutscene == 0x8800) { - gSaveContext.save.cutscene = 0xFFF0; - } else if (gSaveContext.save.cutscene == 0xFFF0) { - gSaveContext.save.cutscene = 0xFFF1; - } else if (gSaveContext.save.cutscene == 0xFFF1) { - gSaveContext.save.cutscene = 0xFFF2; - } else if (gSaveContext.save.cutscene == 0xFFF2) { - gSaveContext.save.cutscene = 0xFFF3; - } else if (gSaveContext.save.cutscene == 0xFFF3) { - gSaveContext.save.cutscene = 0xFFF4; - } else if (gSaveContext.save.cutscene == 0xFFF4) { - gSaveContext.save.cutscene = 0xFFF5; - } else if (gSaveContext.save.cutscene == 0xFFF5) { - gSaveContext.save.cutscene = 0xFFF6; - } else if (gSaveContext.save.cutscene == 0xFFF6) { - gSaveContext.save.cutscene = 0xFFF7; - } else if (gSaveContext.save.cutscene == 0xFFF7) { - gSaveContext.save.cutscene = 0xFFF8; - } else if (gSaveContext.save.cutscene == 0xFFF8) { - gSaveContext.save.cutscene = 0xFFF9; - } else if (gSaveContext.save.cutscene == 0xFFF9) { - gSaveContext.save.cutscene = 0xFFFA; - } else if (gSaveContext.save.cutscene == 0xFFFA) { - gSaveContext.save.cutscene = 0x8000; + if (gSaveContext.save.cutsceneIndex == 0x8000) { + gSaveContext.save.cutsceneIndex = 0; + } else if (gSaveContext.save.cutsceneIndex == 0) { + gSaveContext.save.cutsceneIndex = 0x8800; + } else if (gSaveContext.save.cutsceneIndex == 0x8800) { + gSaveContext.save.cutsceneIndex = 0xFFF0; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF0) { + gSaveContext.save.cutsceneIndex = 0xFFF1; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF1) { + gSaveContext.save.cutsceneIndex = 0xFFF2; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF2) { + gSaveContext.save.cutsceneIndex = 0xFFF3; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF3) { + gSaveContext.save.cutsceneIndex = 0xFFF4; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF4) { + gSaveContext.save.cutsceneIndex = 0xFFF5; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF5) { + gSaveContext.save.cutsceneIndex = 0xFFF6; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF6) { + gSaveContext.save.cutsceneIndex = 0xFFF7; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF7) { + gSaveContext.save.cutsceneIndex = 0xFFF8; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF8) { + gSaveContext.save.cutsceneIndex = 0xFFF9; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF9) { + gSaveContext.save.cutsceneIndex = 0xFFFA; + } else if (gSaveContext.save.cutsceneIndex == 0xFFFA) { + gSaveContext.save.cutsceneIndex = 0x8000; } } else if (CHECK_BTN_ALL(controller1->press.button, BTN_R)) { - if (gSaveContext.save.cutscene == 0x8000) { - gSaveContext.save.cutscene = 0xFFFA; - } else if (gSaveContext.save.cutscene == 0) { - gSaveContext.save.cutscene = 0x8000; - } else if (gSaveContext.save.cutscene == 0x8800) { - gSaveContext.save.cutscene = 0; - } else if (gSaveContext.save.cutscene == 0xFFF0) { - gSaveContext.save.cutscene = 0x8800; - } else if (gSaveContext.save.cutscene == 0xFFF1) { - gSaveContext.save.cutscene = 0xFFF0; - } else if (gSaveContext.save.cutscene == 0xFFF2) { - gSaveContext.save.cutscene = 0xFFF1; - } else if (gSaveContext.save.cutscene == 0xFFF3) { - gSaveContext.save.cutscene = 0xFFF2; - } else if (gSaveContext.save.cutscene == 0xFFF4) { - gSaveContext.save.cutscene = 0xFFF3; - } else if (gSaveContext.save.cutscene == 0xFFF5) { - gSaveContext.save.cutscene = 0xFFF4; - } else if (gSaveContext.save.cutscene == 0xFFF6) { - gSaveContext.save.cutscene = 0xFFF5; - } else if (gSaveContext.save.cutscene == 0xFFF7) { - gSaveContext.save.cutscene = 0xFFF6; - } else if (gSaveContext.save.cutscene == 0xFFF8) { - gSaveContext.save.cutscene = 0xFFF7; - } else if (gSaveContext.save.cutscene == 0xFFF9) { - gSaveContext.save.cutscene = 0xFFF8; - } else if (gSaveContext.save.cutscene == 0xFFFA) { - gSaveContext.save.cutscene = 0xFFF9; + if (gSaveContext.save.cutsceneIndex == 0x8000) { + gSaveContext.save.cutsceneIndex = 0xFFFA; + } else if (gSaveContext.save.cutsceneIndex == 0) { + gSaveContext.save.cutsceneIndex = 0x8000; + } else if (gSaveContext.save.cutsceneIndex == 0x8800) { + gSaveContext.save.cutsceneIndex = 0; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF0) { + gSaveContext.save.cutsceneIndex = 0x8800; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF1) { + gSaveContext.save.cutsceneIndex = 0xFFF0; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF2) { + gSaveContext.save.cutsceneIndex = 0xFFF1; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF3) { + gSaveContext.save.cutsceneIndex = 0xFFF2; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF4) { + gSaveContext.save.cutsceneIndex = 0xFFF3; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF5) { + gSaveContext.save.cutsceneIndex = 0xFFF4; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF6) { + gSaveContext.save.cutsceneIndex = 0xFFF5; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF7) { + gSaveContext.save.cutsceneIndex = 0xFFF6; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF8) { + gSaveContext.save.cutsceneIndex = 0xFFF7; + } else if (gSaveContext.save.cutsceneIndex == 0xFFF9) { + gSaveContext.save.cutsceneIndex = 0xFFF8; + } else if (gSaveContext.save.cutsceneIndex == 0xFFFA) { + gSaveContext.save.cutsceneIndex = 0xFFF9; } } gSaveContext.save.isNight = false; - if (gSaveContext.save.cutscene == 0x8800) { + if (gSaveContext.save.cutsceneIndex == 0x8800) { gSaveContext.save.isNight = true; } @@ -995,7 +995,7 @@ void MapSelect_DrawMenu(MapSelectState* this) { MapSelect_PrintMenu(this, printer); MapSelect_PrintAgeSetting(this, printer, GET_PLAYER_FORM); - MapSelect_PrintCutsceneSetting(this, printer, ((void)0, gSaveContext.save.cutscene)); + MapSelect_PrintCutsceneSetting(this, printer, ((void)0, gSaveContext.save.cutsceneIndex)); POLY_OPA_DISP = GfxPrint_Close(printer); GfxPrint_Destroy(printer); @@ -1085,7 +1085,7 @@ void MapSelect_Init(GameState* thisx) { } Game_SetFramerateDivisor(&this->state, 1); - gSaveContext.save.cutscene = 0; + gSaveContext.save.cutsceneIndex = 0; gSaveContext.save.playerForm = PLAYER_FORM_HUMAN; gSaveContext.save.linkAge = 0; } diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt index 372557384d..88fab2cab8 100644 --- a/tools/disasm/files.txt +++ b/tools/disasm/files.txt @@ -440,7 +440,7 @@ 0x8015E750 : "z_message_staff", 0x80160A90 : "z_player_call", 0x80160C00 : "z_shrink_window", - 0x80161180 : "db_camera", + 0x80161180 : "cutscene_camera", 0x80163700 : "z_kaleido_manager", 0x801639A0 : "z_kaleido_scope_call", 0x80163C90 : "z_fbdemo_dlftbls", @@ -652,7 +652,7 @@ 0x801DF150 : "z_message", 0x801DF730 : "z_message_nes", 0x801DF860 : "z_message_staff", - 0x801DF900 : "db_camera", + 0x801DF900 : "cutscene_camera", 0x801DF9C0 : "z_kaleido_manager", 0x801DF9E0 : "z_fbdemo_circle", 0x801DFA00 : "z_play", @@ -723,7 +723,7 @@ 0x801F6B00 : "z_message", 0x801F6B30 : "z_player_call", 0x801F6B40 : "z_shrink_window", - 0x801F6B50 : "db_camera", + 0x801F6B50 : "cutscene_camera", 0x801F6BF0 : "z_kaleido_manager", 0x801F6C00 : "z_kaleido_scope_call", 0x801F6C10 : "z_play", diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 1264073931..8cbc8f13f6 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -1533,54 +1533,54 @@ 0x800E9DBC:("DebugCamera_ScreenText",), 0x800E9E94:("DebugCamera_DrawScreenText",), 0x800E9F78:("Debug_DrawText",), - 0x800EA060:("Cutscene_Init",), - 0x800EA0D4:("Cutscene_Start",), - 0x800EA0EC:("Cutscene_End",), - 0x800EA110:("Cutscene_Update1",), - 0x800EA15C:("Cutscene_Update2",), - 0x800EA210:("Cutscene_DoNothing",), - 0x800EA220:("func_800EA220",), - 0x800EA258:("func_800EA258",), - 0x800EA2B8:("func_800EA2B8",), - 0x800EA324:("Cutscene_Command_Misc",), - 0x800EABAC:("Cutscene_Command_SetLighting",), - 0x800EAC08:("Cutscene_Command_PlaySequence",), - 0x800EAC44:("Cutscene_Command_StopSequence",), - 0x800EAC94:("Cutscene_Command_FadeSequence",), - 0x800EAD14:("Cutscene_Command_PlayAmbienceSequence",), - 0x800EAD48:("func_800EAD48",), - 0x800EAD7C:("func_800EAD7C",), - 0x800EADB0:("func_800EADB0",), - 0x800EAECC:("Cutscene_Command_FadeAmbienceSequence",), - 0x800EAF20:("Cutscene_Command_Rumble",), - 0x800EAFE0:("Cutscene_Command_FadeColorScreen",), - 0x800EB1DC:("Cutscene_Command_SetTime",), - 0x800EB364:("Cutscene_TerminatorImpl",), - 0x800EB4B4:("Cutscene_Command_Terminator",), - 0x800EB6F8:("Cutscene_Command_ChooseCreditsScenes",), - 0x800EBB68:("Cutscene_Command_MotionBlur",), - 0x800EBCD0:("Cutscene_Command_GiveTatlToPlayer",), - 0x800EBD60:("Cutscene_Command_TransitionFX",), - 0x800EC678:("Cutscene_Command_Camera",), + 0x800EA060:("Cutscene_InitContext",), + 0x800EA0D4:("Cutscene_StartManual",), + 0x800EA0EC:("Cutscene_StopManual",), + 0x800EA110:("Cutscene_UpdateManual",), + 0x800EA15C:("Cutscene_UpdateScripted",), + 0x800EA210:("CutsceneHandler_DoNothing",), + 0x800EA220:("Cutscene_StepTimer",), + 0x800EA258:("CutsceneHandler_StartManual",), + 0x800EA2B8:("CutsceneHandler_StartScript",), + 0x800EA324:("CutsceneCmd_Misc",), + 0x800EABAC:("CutsceneCmd_SetLightSetting",), + 0x800EAC08:("CutsceneCmd_StartSequence",), + 0x800EAC44:("CutsceneCmd_StopSequence",), + 0x800EAC94:("CutsceneCmd_FadeOutSequence",), + 0x800EAD14:("CutsceneCmd_StartAmbience",), + 0x800EAD48:("Cutscene_SetSfxReverbIndexTo2",), + 0x800EAD7C:("Cutscene_SetSfxReverbIndexTo1",), + 0x800EADB0:("CutsceneCmd_ModifySequence",), + 0x800EAECC:("CutsceneCmd_FadeOutAmbience",), + 0x800EAF20:("CutsceneCmd_RumbleController",), + 0x800EAFE0:("CutsceneCmd_TransitionGeneral",), + 0x800EB1DC:("CutsceneCmd_SetTime",), + 0x800EB364:("CutsceneCmd_DestinationDefault",), + 0x800EB4B4:("CutsceneCmd_Destination",), + 0x800EB6F8:("CutsceneCmd_ChooseCreditsScenes",), + 0x800EBB68:("CutsceneCmd_MotionBlur",), + 0x800EBCD0:("CutsceneCmd_GiveTatlToPlayer",), + 0x800EBD60:("CutsceneCmd_Transition",), + 0x800EC678:("CutsceneCmd_UpdateCamSpline",), 0x800EC6D4:("Cutscene_CountNormalMasks",), - 0x800EC924:("Cutscene_Command_Textbox",), - 0x800ECD7C:("func_800ECD7C",), - 0x800ECE40:("Cutscene_ProcessCommands",), - 0x800ED980:("func_800ED980",), - 0x800ED9C4:("func_800ED9C4",), - 0x800EDA04:("func_800EDA04",), - 0x800EDA84:("func_800EDA84",), - 0x800EDBE0:("func_800EDBE0",), + 0x800EC924:("CutsceneCmd_Text",), + 0x800ECD7C:("Cutscene_SetActorCue",), + 0x800ECE40:("Cutscene_ProcessScript",), + 0x800ED980:("CutsceneHandler_RunScript",), + 0x800ED9C4:("CutsceneHandler_StopManual",), + 0x800EDA04:("CutsceneHandler_StopScript",), + 0x800EDA84:("Cutscene_SetupScripted",), + 0x800EDBE0:("Cutscene_HandleEntranceTriggers",), 0x800EDDB0:("func_800EDDB0",), 0x800EDDBC:("func_800EDDBC",), - 0x800EDDCC:("Cutscene_LoadCutsceneData",), + 0x800EDDCC:("Cutscene_StartScripted",), 0x800EDE34:("Cutscene_ActorTranslate",), 0x800EDF24:("Cutscene_ActorTranslateAndYaw",), 0x800EDF78:("Cutscene_ActorTranslateAndYawSmooth",), 0x800EE0CC:("Cutscene_ActorTranslateXZAndYawSmooth",), 0x800EE1D8:("Cutscene_GetSceneLayer",), - 0x800EE200:("Cutscene_GetActorActionIndex",), - 0x800EE29C:("Cutscene_CheckActorAction",), + 0x800EE200:("Cutscene_GetCueChannel",), + 0x800EE29C:("Cutscene_IsCueInChannel",), 0x800EE2F4:("Cutscene_IsPlaying",), 0x800EE320:("GetItem_Draw",), 0x800EE364:("GetItem_DrawBombchu",), @@ -1632,35 +1632,35 @@ 0x800F10AC:("EnHy_UpdateCollider",), 0x800F112C:("EnHy_PlayWalkingSound",), 0x800F1250:("Text_GetFaceReaction",), - 0x800F12D0:("EnvFlags_UnsetAll",), - 0x800F1304:("EnvFlags_Set",), - 0x800F1374:("EnvFlags_Unset",), - 0x800F13E8:("EnvFlags_Get",), - 0x800F1460:("func_800F1460",), - 0x800F14F8:("ActorCutscene_GetCutsceneImpl",), - 0x800F1544:("ActorCutscene_Init",), - 0x800F15D8:("func_800F15D8",), - 0x800F1648:("ActorCutscene_ClearWaiting",), - 0x800F1678:("ActorCutscene_ClearNextCutscenes",), - 0x800F16A8:("ActorCutscene_MarkNextCutscenes",), - 0x800F17FC:("ActorCutscene_End",), - 0x800F1A7C:("ActorCutscene_Update",), - 0x800F1BA4:("ActorCutscene_SetIntentToPlay",), - 0x800F1BE4:("ActorCutscene_GetCanPlayNext",), - 0x800F1C68:("ActorCutscene_StartAndSetUnkLinkFields",), - 0x800F1CE0:("ActorCutscene_StartAndSetFlag",), - 0x800F1D84:("ActorCutscene_Start",), - 0x800F1FBC:("ActorCutscene_Stop",), - 0x800F207C:("ActorCutscene_GetCurrentIndex",), - 0x800F208C:("ActorCutscene_GetCutscene",), - 0x800F20B8:("ActorCutscene_GetAdditionalCutscene",), - 0x800F20F8:("ActorCutscene_GetLength",), - 0x800F2138:("func_800F2138",), - 0x800F2178:("func_800F2178",), - 0x800F21B8:("ActorCutscene_GetCurrentSubCamId",), - 0x800F21CC:("func_800F21CC",), + 0x800F12D0:("CutsceneFlags_UnsetAll",), + 0x800F1304:("CutsceneFlags_Set",), + 0x800F1374:("CutsceneFlags_Unset",), + 0x800F13E8:("CutsceneFlags_Get",), + 0x800F1460:("CutsceneManager_SetHudVisibility",), + 0x800F14F8:("CutsceneManager_GetCutsceneEntryImpl",), + 0x800F1544:("CutsceneManager_Init",), + 0x800F15D8:("CutsceneManager_StoreCamera",), + 0x800F1648:("CutsceneManager_ClearWaiting",), + 0x800F1678:("CutsceneManager_ClearNextCutscenes",), + 0x800F16A8:("CutsceneManager_MarkNextCutscenes",), + 0x800F17FC:("CutsceneManager_End",), + 0x800F1A7C:("CutsceneManager_Update",), + 0x800F1BA4:("CutsceneManager_Queue",), + 0x800F1BE4:("CutsceneManager_IsNext",), + 0x800F1C68:("CutsceneManager_StartWithPlayerCs",), + 0x800F1CE0:("CutsceneManager_StartWithPlayerCsAndSetFlag",), + 0x800F1D84:("CutsceneManager_Start",), + 0x800F1FBC:("CutsceneManager_Stop",), + 0x800F207C:("CutsceneManager_GetCurrentCsId",), + 0x800F208C:("CutsceneManager_GetCutsceneEntry",), + 0x800F20B8:("CutsceneManager_GetAdditionalCsId",), + 0x800F20F8:("CutsceneManager_GetLength",), + 0x800F2138:("CutsceneManager_GetCutsceneScriptIndex",), + 0x800F2178:("CutsceneManager_GetCutsceneCustomValue",), + 0x800F21B8:("CutsceneManager_GetCurrentSubCamId",), + 0x800F21CC:("CutsceneManager_FindEntranceCsId",), 0x800F22C4:("func_800F22C4",), - 0x800F23C4:("ActorCutscene_SetReturnCamera",), + 0x800F23C4:("CutsceneManager_SetReturnCamera",), 0x800F23E0:("Curve_CubicHermiteSpline",), 0x800F2478:("Curve_Interpolate",), 0x800F2620:("SkelCurve_Clear",), @@ -2447,8 +2447,8 @@ 0x801303E0:("Scene_CommandSoundSettings",), 0x8013043C:("Scene_CommandEchoSetting",), 0x80130454:("Scene_CommandAltHeaderList",), - 0x801304CC:("Scene_CommandCutsceneList",), - 0x80130500:("Scene_CommandActorCutsceneList",), + 0x801304CC:("Scene_CommandCutsceneScriptList",), + 0x80130500:("Scene_CommandCutsceneList",), 0x80130540:("Scene_CommandMiniMap",), 0x80130578:("Scene_Command1D",), 0x80130588:("Scene_CommandMiniMapCompassInfo",), @@ -2701,7 +2701,7 @@ 0x8013E07C:("SubS_ActorPathing_MoveWithoutGravityReverse",), 0x8013E0A4:("SubS_ActorPathing_SetNextPoint",), 0x8013E1C8:("SubS_ChangeAnimationBySpeedInfo",), - 0x8013E2D4:("SubS_StartActorCutscene",), + 0x8013E2D4:("SubS_StartCutscene",), 0x8013E3B8:("SubS_FillCutscenesList",), 0x8013E4B0:("SubS_ConstructPlane",), 0x8013E5CC:("SubS_LineSegVsPlane",), @@ -2797,7 +2797,7 @@ 0x80144684:("Sram_GenerateRandomSaveFields",), 0x80144890:("Sram_InitNewSave",), 0x80144968:("Sram_InitDebugSave",), - 0x80144A94:("func_80144A94",), + 0x80144A94:("Sram_ResetSaveFromMoonCrash",), 0x80144E78:("Sram_OpenSave",), 0x8014546C:("func_8014546C",), 0x80145698:("func_80145698",), @@ -2905,13 +2905,13 @@ 0x80160CE4:("ShrinkWindow_Update",), 0x80160D98:("ShrinkWindow_Draw",), 0x80161180:("func_80161180",), - 0x8016119C:("func_8016119C",), - 0x8016122C:("func_8016122C",), - 0x801612B8:("func_801612B8",), - 0x80161998:("func_80161998",), + 0x8016119C:("CutsceneCamera_Init",), + 0x8016122C:("CutsceneCamera_Interpolate",), + 0x801612B8:("CutsceneCamera_ProcessSpline",), + 0x80161998:("CutsceneCamera_UpdateSplines",), 0x80161BAC:("func_80161BAC",), - 0x80161BE0:("func_80161BE0",), - 0x80161C0C:("func_80161C0C",), + 0x80161BE0:("CutsceneCamera_SetState",), + 0x80161C0C:("CutsceneCamera_Reset",), 0x80161C20:("func_80161C20",), 0x80161E4C:("func_80161E4C",), 0x801620CC:("func_801620CC",), @@ -3037,7 +3037,7 @@ 0x8016A02C:("func_8016A02C",), 0x8016A0AC:("Play_IsUnderwater",), 0x8016A168:("Play_IsDebugCamEnabled",), - 0x8016A178:("Play_AssignPlayerActorCsIdsFromScene",), + 0x8016A178:("Play_AssignPlayerCsIdsFromScene",), 0x8016A268:("Play_FillScreen",), 0x8016A2C8:("Play_Init",), 0x8016AC10:("func_8016AC10",), @@ -3845,7 +3845,7 @@ 0x8019D488:("AudioOcarina_MemoryGameInit",), 0x8019D4F8:("AudioOcarina_MemoryGameNextNote",), 0x8019D600:("AudioOcarina_Update",), - 0x8019D758:("AudioOcarina_PlayLongScarecrowAfterCredits",), + 0x8019D758:("AudioOcarina_PlayLongScarecrowSong",), 0x8019D864:("AudioOcarina_SetCustomSequence",), 0x8019D8B4:("AudioOcarina_PlayCustomSequence",), 0x8019D8E4:("AudioOcarina_CreateCustomSequence",), @@ -7124,7 +7124,7 @@ 0x8092C86C:("func_8092C86C",), 0x8092C934:("func_8092C934",), 0x8092C9BC:("func_8092C9BC",), - 0x8092CA74:("func_8092CA74",), + 0x8092CA74:("EnDns_GetCueType",), 0x8092CAD0:("func_8092CAD0",), 0x8092CB98:("func_8092CB98",), 0x8092CC68:("func_8092CC68",), @@ -12870,7 +12870,7 @@ 0x80B01B30:("EnGiant_Init",), 0x80B01E74:("EnGiant_Destroy",), 0x80B01E84:("EnGiant_ChangeToStartOrLoopAnimation",), - 0x80B01EE8:("EnGiant_ChangeAnimBasedOnCsAction",), + 0x80B01EE8:("EnGiant_ChangeAnimBasedOnCueId",), 0x80B020A0:("EnGiant_UpdateAlpha",), 0x80B0211C:("EnGiant_PlayAndUpdateAnimation",), 0x80B02234:("EnGiant_PlaySound",), @@ -14411,7 +14411,7 @@ 0x80B73AE4:("EnJg_UpdateCollision",), 0x80B73B98:("EnJg_GetWalkingYRotation",), 0x80B73C58:("EnJg_ReachedPoint",), - 0x80B73DF4:("EnJg_GetCutsceneForTeachingLullabyIntro",), + 0x80B73DF4:("EnJg_GetCsIdForTeachingLullabyIntro",), 0x80B73E3C:("EnJg_SetupGoronShrineCheer",), 0x80B73F1C:("EnJg_SetupTalk",), 0x80B7406C:("EnJg_Idle",), @@ -15161,7 +15161,7 @@ 0x80BA78F8:("EnRailgibud_PostLimbDraw",), 0x80BA79D4:("EnRailgibud_Draw",), 0x80BA7B6C:("EnRailgibud_InitCutsceneGibdo",), - 0x80BA7C78:("EnRailgibud_InitActorActionCommand",), + 0x80BA7C78:("EnRailgibud_InitCueType",), 0x80BA7CF0:("EnRailgibud_SetupDoNothing",), 0x80BA7D04:("EnRailgibud_DoNothing",), 0x80BA7D14:("EnRailgibud_SetupSinkIntoGround",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 6ed78a3482..855900bb2f 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -923,14 +923,14 @@ 0x801BB0DC:("D_801BB0DC","UNK_TYPE1","",0x1), 0x801BB0FC:("D_801BB0FC","UNK_TYPE2","",0x2), 0x801BB100:("D_801BB100","UNK_TYPE1","",0x1), - 0x801BB124:("D_801BB124","UNK_TYPE2","",0x2), - 0x801BB128:("D_801BB128","UNK_TYPE2","",0x2), - 0x801BB12C:("D_801BB12C","UNK_TYPE1","",0x1), + 0x801BB124:("sCurTextId","UNK_TYPE2","",0x2), + 0x801BB128:("sCurOcarinaAction","UNK_TYPE2","",0x2), + 0x801BB12C:("gOpeningEntranceIndex","UNK_TYPE1","",0x1), 0x801BB130:("sCutsceneStoredPlayerForm","UNK_TYPE1","",0x1), - 0x801BB134:("sCsStateHandlers1","cutscene_update_func","[5]",0x14), - 0x801BB148:("sCsStateHandlers2","cutscene_update_func","[5]",0x14), + 0x801BB134:("sManualCutsceneHandlers","cutscene_update_func","[5]",0x14), + 0x801BB148:("sScriptedCutsceneHandlers","cutscene_update_func","[5]",0x14), 0x801BB15C:("D_801BB15C","UNK_TYPE2","",0x2), - 0x801BB160:("D_801BB160","UNK_TYPE4","",0x4), + 0x801BB160:("sCutsceneTextboxType","UNK_TYPE4","",0x4), 0x801BB170:("sDrawItemTable","DrawItemTableEntry","[118]",0x1098), 0x801BC210:("gEffFootprintVtx","UNK_TYPE1","",0x1), 0x801BC240:("gEffFootprintMaterialDL","Gfx","[9]",0x48), @@ -940,16 +940,8 @@ 0x801BC400:("gEnHyParentBodyParts","UNK_TYPE1","",0x1), 0x801BC410:("gEnHyShadowSizes","s32",[],0x10), 0x801BC420:("sReactionTextIds","u16","[]",0x140A), - 0x801BD830:("actorCutscenesGlobalCutscenes","ActorCutscene","[8]",0x80), - 0x801BD8B0:("actorCutsceneCurrent","s16","",0x2), - 0x801BD8B2:("actorCutsceneCurrentLength","s16","",0x2), - 0x801BD8B4:("actorCutsceneEnding","s16","",0x2), - 0x801BD8B6:("actorCutsceneCurrentCamera","s16","",0x2), - 0x801BD8B8:("actorCutsceneCurrentCutsceneActor","Actor*","",0x4), - 0x801BD8BC:("actorCutsceneStartMethod","UNK_TYPE4","",0x4), - 0x801BD8C0:("actorCutscenesPlayState","PlayState*","",0x4), - 0x801BD8C4:("actorCutsceneReturnCamera","s16","",0x2), - 0x801BD8C6:("D_801BD8C6","s16","",0x2), + 0x801BD830:("sGlobalCutsceneList","ActorCutscene","[8]",0x80), + 0x801BD8B0:("sCutsceneMgr","ActorCutsceneManager","",0x18), 0x801BD8D0:("sFireObjCollisionInit","ColliderCylinderInit","",0x2c), 0x801BD8FC:("sFireObjColors","FireObjColors","[1]",0x08), 0x801BD904:("sFireObjLightParams","FireObjLightParams","[1]",0x08), @@ -2145,7 +2137,7 @@ 0x801D0D58:("sQuakeIndex","UNK_TYPE2","",0x2), 0x801D0D5C:("sIsCameraUnderwater","UNK_TYPE2","",0x2), 0x801D0D60:("D_801D0D60","Input*","",0x4), - 0x801D0D64:("D_801D0D64","s16","[10]",0x14), + 0x801D0D64:("sPlayerCsIdToCsCamId","s16","[10]",0x14), 0x801D0D78:("D_801D0D78","u16","[4]",0x4), 0x801D0D80:("D_801D0D80","UNK_TYPE1","",0x1), 0x801D11F4:("D_801D11F4","UNK_TYPE1","",0x1), @@ -3931,18 +3923,18 @@ 0x801F3F60:("gRegEditor","RegEditor*","",0x4), 0x801F3F70:("sDebugObjectListHead","UNK_TYPE1","",0x1), 0x801F3F80:("D_801F3F80","UNK_TYPE1","",0xDC0), - 0x801F4D40:("seqId","u16","",0x2), + 0x801F4D40:("sSeqId","u16","",0x2), 0x801F4D42:("sCutsceneQuakeIndex","UNK_TYPE2","",0x2), 0x801F4D48:("sCutsceneCameraInfo","UNK_TYPE","",0x80), - 0x801F4DC8:("D_801F4DC8","u16","[10]",0x14), + 0x801F4DC8:("sCueTypeList","u16","[10]",0x14), 0x801F4DDC:("D_801F4DDC","UNK_TYPE1","",0x1), - 0x801F4DE0:("D_801F4DE0","UNK_TYPE1","",0x1), - 0x801F4DE2:("D_801F4DE2","UNK_TYPE2","",0x2), - 0x801F4DF0:("actorCutscenes","ActorCutscene*","",0x4), - 0x801F4DF4:("actorCutsceneCount","s16","",0x2), - 0x801F4DF8:("actorCutsceneWaiting","u8","[16]",0x10), + 0x801F4DE0:("gDisablePlayerCsModeStartPos","UNK_TYPE1","",0x1), + 0x801F4DE2:("gDungeonBossWarpSceneId","UNK_TYPE2","",0x2), + 0x801F4DF0:("sSceneCutsceneList","ActorCutscene*","",0x4), + 0x801F4DF4:("sSceneCutsceneCount","s16","",0x2), + 0x801F4DF8:("sWaitingCutsceneList","u8","[16]",0x10), 0x801F4E08:("D_801F4E08","UNK_TYPE1","",0x1), - 0x801F4E10:("actorCutsceneNextCutscenes","u8","[16]",0x10), + 0x801F4E10:("sNextCutsceneList","u8","[16]",0x10), 0x801F4E20:("D_801F4E20","UNK_TYPE1","",0x1), 0x801F4E30:("D_801F4E30","UNK_TYPE1","",0x1), 0x801F4E31:("D_801F4E31","UNK_TYPE1","",0x1), @@ -4049,7 +4041,7 @@ 0x801F6B3C:("sPlayerCallDrawFunc","UNK_TYPE1","",0x1), 0x801F6B40:("sShrinkWindow","ShrinkWindow","",0x4), 0x801F6B44:("sShrinkWindowPtr","ShrinkWindow*","",0x4), - 0x801F6B50:("D_801F6B50","UNK_TYPE4","",0x4), + 0x801F6B50:("sCurCsCamera","UNK_TYPE4","",0x4), 0x801F6B58:("D_801F6B58","UNK_TYPE1","",0x1), 0x801F6BF0:("sKaleidoMgrFaultAddrConvClient","FaultAddrConvClient","",0xC), 0x801F6C00:("sKaleidoScopeUpdateFunc","void*","",0x4), @@ -6194,7 +6186,7 @@ 0x8089E314:("D_8089E314","UNK_TYPE1","",0x1), 0x8089E334:("D_8089E334","UNK_TYPE1","",0x1), 0x8089E33C:("D_8089E33C","UNK_TYPE4","",0x4), - 0x8089E34C:("D_8089E34C","UNK_TYPE2","",0x2), + 0x8089E34C:("sCsId","UNK_TYPE2","",0x2), 0x8089E350:("D_8089E350","UNK_TYPE4","",0x4), 0x8089E354:("D_8089E354","UNK_TYPE1","",0x1), 0x8089E364:("D_8089E364","UNK_TYPE4","",0x4), @@ -11094,7 +11086,7 @@ 0x80A2B90C:("sColHeaders","UNK_TYPE1","",0x1), 0x80A2B93C:("sTexAnims","UNK_TYPE1","",0x1), 0x80A2B96C:("D_80A2B96C","UNK_TYPE1","",0x1), - 0x80A2B974:("D_80A2B974","UNK_TYPE2","",0x2), + 0x80A2B974:("sCsIdList","UNK_TYPE2","",0x2), 0x80A2B978:("D_80A2B978","UNK_TYPE1","",0x1), 0x80A2B988:("D_80A2B988","UNK_TYPE1","",0x1), 0x80A2B9A0:("jtbl_80A2B9A0","UNK_PTR","",0x4), @@ -11483,8 +11475,8 @@ 0x80A43352:("sNightMessages2","s16","[3]",0x6), 0x80A4335A:("sDayMessages2","s16","[3]",0x6), 0x80A43364:("D_80A43364","u16","[2]",0x4), - 0x80A434D0:("sCutscenes","s16","[2]",0x4), - 0x80A434D4:("sCurrentCs","s16","",0x2), + 0x80A434D0:("sCsIdList","s16","[2]",0x4), + 0x80A434D4:("sCurCsId","s16","",0x2), 0x80A449E0:("En_Bat_InitVars","ActorInit","",0x1), 0x80A44A00:("sSphereInit","ColliderSphereInit","",0x1), 0x80A44A2C:("sDamageTable","DamageTable","4",0x1), @@ -12831,7 +12823,7 @@ 0x80AC0254:("D_80AC0254","UNK_TYPE2","",0x2), 0x80AC0258:("D_80AC0258","UNK_TYPE2","",0x2), 0x80AC025C:("D_80AC025C","UNK_TYPE4","",0x4), - 0x80AC0260:("D_80AC0260","UNK_TYPE2","",0x2), + 0x80AC0260:("sCueId","UNK_TYPE2","",0x2), 0x80AC0264:("D_80AC0264","UNK_TYPE4","",0x4), 0x80AC0270:("D_80AC0270","f32","",0x4), 0x80AC0274:("D_80AC0274","f32","",0x4), @@ -15211,14 +15203,14 @@ 0x80B8E19C:("D_80B8E19C","CollisionCheckInfoInit2","",0xC), 0x80B8E308:("D_80B8E308","void*","",0x4), 0x80B8E318:("D_80B8E318","UNK_TYPE1","",0x1), - 0x80B8E32C:("D_80B8E32C","UNK_TYPE2","",0x2), + 0x80B8E32C:("sCueId","UNK_TYPE2","",0x2), 0x80B8E330:("jtbl_80B8E330","UNK_PTR","",0x4), 0x80B8E34C:("jtbl_80B8E34C","UNK_PTR","",0x4), 0x80B913F0:("En_Ma_Yto_InitVars","UNK_TYPE1","",0x1), 0x80B91410:("D_80B91410","UNK_TYPE1","",0x1), 0x80B9143C:("D_80B9143C","UNK_TYPE1","",0x1), 0x80B91448:("D_80B91448","UNK_TYPE1","",0x1), - 0x80B915F0:("D_80B915F0","UNK_TYPE2","",0x2), + 0x80B915F0:("sCueId","UNK_TYPE2","",0x2), 0x80B91600:("jtbl_80B91600","UNK_PTR","",0x4), 0x80B91614:("jtbl_80B91614","UNK_PTR","",0x4), 0x80B91628:("jtbl_80B91628","UNK_PTR","",0x4), @@ -16606,7 +16598,7 @@ 0x80C1E984:("D_80C1E984","UNK_TYPE1","",0x1), 0x80C1F150:("Dm_Bal_InitVars","UNK_TYPE1","",0x1), 0x80C1F170:("sAnimationInfo","UNK_PTR","",0x4), - 0x80C1F2C0:("D_80C1F2C0","UNK_TYPE2","",0x2), + 0x80C1F2C0:("sCueId","UNK_TYPE2","",0x2), 0x80C1F2C4:("D_80C1F2C4","UNK_TYPE4","",0x4), 0x80C1F2D0:("D_80C1F2D0","UNK_TYPE1","",0x1), 0x80C1F2E0:("D_80C1F2E0","f32","",0x4), diff --git a/tools/namefixer.py b/tools/namefixer.py index b037f94156..d5493bbfc8 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -590,18 +590,43 @@ wordReplace = { "func_800FE498": "Environment_StartTime", "func_800FE4A8": "Environment_IsTimeStopped", "func_800F5A8C": "Environment_LerpWeight", + "func_801A3F54": "Audio_SetCutsceneFlag", - "func_800EA0D4": "Cutscene_Start", - "func_800EA0EC": "Cutscene_End", + "func_800EA0D4": "Cutscene_StartManual", + "Cutscene_Start": "Cutscene_StartManual", + "func_800EA0EC": "Cutscene_StopManual", + "Cutscene_End": "Cutscene_StopManual", "func_800EDE34": "Cutscene_ActorTranslate", "func_800EDF24": "Cutscene_ActorTranslateAndYaw", "func_800EDF78": "Cutscene_ActorTranslateAndYawSmooth", "func_800EE0CC": "Cutscene_ActorTranslateXZAndYawSmooth", "func_800EE1D8": "Cutscene_GetSceneLayer", - "func_800EE200": "Cutscene_GetActorActionIndex", - "func_800EE29C": "Cutscene_CheckActorAction", + "func_800EE200": "Cutscene_GetCueChannel", + "Cutscene_GetActorActionIndex": "Cutscene_GetCueChannel", + "func_800EE29C": "Cutscene_IsCueInChannel", + "Cutscene_CheckActorAction": "Cutscene_IsCueInChannel", "func_800EE2F4": "Cutscene_IsPlaying", "Cutscene_GetSceneSetupIndex": "Cutscene_GetSceneLayer", + + "func_800F15D8": "CutsceneManager_StoreCamera", + "ActorCutscene_SetIntentToPlay": "CutsceneManager_Queue", + "ActorCutscene_GetCanPlayNext": "CutsceneManager_IsNext", + "ActorCutscene_StartAndSetUnkLinkFields": "CutsceneManager_StartWithPlayerCs", + "ActorCutscene_StartAndSetFlag": "CutsceneManager_StartWithPlayerCsAndSetFlag", + "ActorCutscene_Start": "CutsceneManager_Start", + "ActorCutscene_Stop": "CutsceneManager_Stop", + "ActorCutscene_GetCurrentIndex": "CutsceneManager_GetCurrentCsId", + "ActorCutscene_GetCutscene": "CutsceneManager_GetCutsceneEntry", + "ActorCutscene_GetAdditionalCutscene": "CutsceneManager_GetAdditionalCsId", + "ActorCutscene_GetLength": "CutsceneManager_GetLength", + "ActorCutscene_GetCurrentSubCamId": "CutsceneManager_GetCurrentSubCamId", + "ActorCutscene_GetCurrentCamera": "CutsceneManager_GetCurrentSubCamId", + + "EnvFlags_UnsetAll": "CutsceneFlags_UnsetAll", + "EnvFlags_Set": "CutsceneFlags_Set", + "EnvFlags_Unset": "CutsceneFlags_Unset", + "EnvFlags_Get": "CutsceneFlags_Get", + "func_801343C0": "SkelAnime_DrawTransformFlexOpa", "func_80114E90": "Inventory_HasEmptyBottle", "func_80114F2C": "Inventory_HasItemInBottle", @@ -622,7 +647,8 @@ wordReplace = { "func_8013E640": "SubS_FindActorCustom", "func_ActorCategoryIterateById": "SubS_FindActor", "func_8013BB7C": "SubS_FindNearestActor", - "func_8013E2D4": "SubS_StartActorCutscene", + "func_8013E2D4": "SubS_StartCutscene", + "SubS_StartActorCutscene": "SubS_StartCutscene", "func_8013E3B8": "SubS_FillCutscenesList", "func_8013AED4": "SubS_UpdateFlags", "func_8013D8DC": "SubS_IsObjectLoaded", @@ -693,8 +719,6 @@ wordReplace = { "func_8010A54C": "Minimap_Draw", "func_8010A580": "Map_Update", - "ActorCutscene_GetCurrentCamera": "ActorCutscene_GetCurrentSubCamId", - "Entrance_CreateIndex": "Entrance_Create", "Entrance_CreateIndexFromSpawn": "Entrance_CreateFromSpawn", @@ -731,6 +755,7 @@ wordReplace = { "actor.minVelocityY": "actor.terminalVelocity", "actor.yDistToWater": "actor.depthInWater", "actor.yDistToPlayer": "actor.playerHeightRel", + "actor.cutscene": "actor.csId", "actor.speedXZ": "actor.speed", "thisx->speedXZ": "thisx->speed", @@ -765,7 +790,9 @@ wordReplace = { "gSaveContext.permanentSceneFlags": "gSaveContext.save.saveInfo.permanentSceneFlags", "gSaveContext.bomberCode": "gSaveContext.save.saveInfo.bomberCode", "gSaveContext.skullTokenCount": "gSaveContext.save.saveInfo.skullTokenCount", - "gSaveContext.cutscene": "gSaveContext.save.cutscene", + "gSaveContext.cutscene": "gSaveContext.save.saveInfo.cutsceneIndex", + "gSaveContext.save.cutscene": "gSaveContext.save.saveInfo.cutsceneIndex", + "gSaveContext.save.saveInfo.cutscene": "gSaveContext.save.saveInfo.cutsceneIndex", "gSaveContext.health": "gSaveContext.save.saveInfo.playerData.health", "gSaveContext.equips": "gSaveContext.save.saveInfo.equips", "gSaveContext.unk_1016": "gSaveContext.jinxTimer", @@ -852,10 +879,20 @@ wordReplace = { "ageProperties->unk_04": "ageProperties->shadowScale", "ageProperties->unk_92": "ageProperties->voiceSfxOffset", "ageProperties->unk_94": "ageProperties->surfaceSfxOffset", + "player->unk_A86": "player->csId", + + "csCtx.npcActions": "csCtx.actorCues", + "csCtx->npcActions": "csCtx->actorCues", + "csCtx.actorActions": "csCtx.actorCues", + "csCtx->actorActions": "csCtx->actorCues", + "csCtx.playerAction": "csCtx.playerCue", + "csCtx->playerAction": "csCtx->playerCue", + "csCtx.unk_12": "csCtx.scriptIndex", + "csCtx.currentCsIndex": "csCtx.scriptIndex", + "csCtx->currentCsIndex": "csCtx->scriptIndex", + "csCtx.frames": "csCtx.curFrame", + "csCtx->frames": "csCtx->curFrame", - "csCtx.npcActions": "csCtx.actorActions", - "csCtx->npcActions": "csCtx->actorActions", - "csCtx.unk_12": "csCtx.currentCsIndex", "globalCtx->mf_187FC": "play->billboardMtxF", "globalCtx->projectionMatrix": "play->viewProjectionMtxF", "globalCtx->actorCtx.actorList[": "play->actorCtx.actorLists[", @@ -887,6 +924,8 @@ wordReplace = { "play->nextEntranceIndex": "play->nextEntrance", "play->sceneNum": "play->sceneId", "play->pauseCtx.unk_1F0": "play->pauseCtx.bombersNotebookOpen", + "play->playerActorCsIds": "play->playerCsIds", + "play->envFlags": "play->cutsceneFlags", "play->roomCtx.curRoom.unk3": "play->roomCtx.curRoom.behaviorType1", "play->roomCtx.curRoom.unk2": "play->roomCtx.curRoom.behaviorType2", "play->roomCtx.unk31": "play->roomCtx.status", @@ -951,6 +990,11 @@ wordReplace = { "PLAYER_AP_FISHING_POLE": "PLAYER_IA_FISHING_ROD", "PLAYER_IA_BOTTLE": "PLAYER_IA_BOTTLE_EMPTY", + "WEEKEVENTREG_20_02": "WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE", + "WEEKEVENTREG_33_80": "WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE", + "WEEKEVENTREG_52_20": "WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE", + "WEEKEVENTREG_55_80": "WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE", + # Enums "TRANS_TYPE_00": "TRANS_TYPE_WIPE", "TRANS_TYPE_01": "TRANS_TYPE_TRIFORCE", @@ -975,6 +1019,10 @@ wordReplace = { "TRANS_TYPE_20": "TRANS_TYPE_FADE_DYNAMIC", "TRANS_TYPE_21": "TRANS_TYPE_CIRCLE", "TRANS_TYPE_22": "TRANS_TYPE_WIPE5", + "PLAYER_CSMODE_6": "PLAYER_CSMODE_END", + "PLAYER_CSMODE_7": "PLAYER_CSMODE_WAIT", + "SUBS_CUTSCENE_SET_UNK_LINK_FIELDS": "SUBS_CUTSCENE_WITH_PLAYER", + "SUBS_CUTSCENE_SET_FLAG": "SUBS_CUTSCENE_WITH_PLAYER_SET_FLAG", "COLPOLY_SURFACE_GROUND": "SURFACE_MATERIAL_DIRT", "COLPOLY_SURFACE_SAND": "SURFACE_MATERIAL_SAND", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 92cd63a29a..a643f147fc 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1047,54 +1047,54 @@ asm/non_matchings/code/z_debug_mode/Debug_DrawScreenText.s,Debug_DrawScreenText, asm/non_matchings/code/z_debug_mode/DebugCamera_ScreenText.s,DebugCamera_ScreenText,0x800E9DBC,0x36 asm/non_matchings/code/z_debug_mode/DebugCamera_DrawScreenText.s,DebugCamera_DrawScreenText,0x800E9E94,0x39 asm/non_matchings/code/z_debug_mode/Debug_DrawText.s,Debug_DrawText,0x800E9F78,0x3A -asm/non_matchings/code/z_demo/Cutscene_Init.s,Cutscene_Init,0x800EA060,0x1D -asm/non_matchings/code/z_demo/Cutscene_Start.s,Cutscene_Start,0x800EA0D4,0x6 -asm/non_matchings/code/z_demo/Cutscene_End.s,Cutscene_End,0x800EA0EC,0x9 -asm/non_matchings/code/z_demo/Cutscene_Update1.s,Cutscene_Update1,0x800EA110,0x13 -asm/non_matchings/code/z_demo/Cutscene_Update2.s,Cutscene_Update2,0x800EA15C,0x2D -asm/non_matchings/code/z_demo/Cutscene_DoNothing.s,Cutscene_DoNothing,0x800EA210,0x4 -asm/non_matchings/code/z_demo/func_800EA220.s,func_800EA220,0x800EA220,0xE -asm/non_matchings/code/z_demo/func_800EA258.s,func_800EA258,0x800EA258,0x18 -asm/non_matchings/code/z_demo/func_800EA2B8.s,func_800EA2B8,0x800EA2B8,0x1B -asm/non_matchings/code/z_demo/Cutscene_Command_Misc.s,Cutscene_Command_Misc,0x800EA324,0x222 -asm/non_matchings/code/z_demo/Cutscene_Command_SetLighting.s,Cutscene_Command_SetLighting,0x800EABAC,0x17 -asm/non_matchings/code/z_demo/Cutscene_Command_PlaySequence.s,Cutscene_Command_PlaySequence,0x800EAC08,0xF -asm/non_matchings/code/z_demo/Cutscene_Command_StopSequence.s,Cutscene_Command_StopSequence,0x800EAC44,0x14 -asm/non_matchings/code/z_demo/Cutscene_Command_FadeSequence.s,Cutscene_Command_FadeSequence,0x800EAC94,0x20 -asm/non_matchings/code/z_demo/Cutscene_Command_PlayAmbienceSequence.s,Cutscene_Command_PlayAmbienceSequence,0x800EAD14,0xD -asm/non_matchings/code/z_demo/func_800EAD48.s,func_800EAD48,0x800EAD48,0xD -asm/non_matchings/code/z_demo/func_800EAD7C.s,func_800EAD7C,0x800EAD7C,0xD -asm/non_matchings/code/z_demo/func_800EADB0.s,func_800EADB0,0x800EADB0,0x47 -asm/non_matchings/code/z_demo/Cutscene_Command_FadeAmbienceSequence.s,Cutscene_Command_FadeAmbienceSequence,0x800EAECC,0x15 -asm/non_matchings/code/z_demo/Cutscene_Command_Rumble.s,Cutscene_Command_Rumble,0x800EAF20,0x30 -asm/non_matchings/code/z_demo/Cutscene_Command_FadeColorScreen.s,Cutscene_Command_FadeColorScreen,0x800EAFE0,0x7F -asm/non_matchings/code/z_demo/Cutscene_Command_SetTime.s,Cutscene_Command_SetTime,0x800EB1DC,0x62 -asm/non_matchings/code/z_demo/Cutscene_TerminatorImpl.s,Cutscene_TerminatorImpl,0x800EB364,0x54 -asm/non_matchings/code/z_demo/Cutscene_Command_Terminator.s,Cutscene_Command_Terminator,0x800EB4B4,0x91 -asm/non_matchings/code/z_demo/Cutscene_Command_ChooseCreditsScenes.s,Cutscene_Command_ChooseCreditsScenes,0x800EB6F8,0x11C -asm/non_matchings/code/z_demo/Cutscene_Command_MotionBlur.s,Cutscene_Command_MotionBlur,0x800EBB68,0x5A -asm/non_matchings/code/z_demo/Cutscene_Command_GiveTatlToPlayer.s,Cutscene_Command_GiveTatlToPlayer,0x800EBCD0,0x24 -asm/non_matchings/code/z_demo/Cutscene_Command_TransitionFX.s,Cutscene_Command_TransitionFX,0x800EBD60,0x246 -asm/non_matchings/code/z_demo/Cutscene_Command_Camera.s,Cutscene_Command_Camera,0x800EC678,0x17 +asm/non_matchings/code/z_demo/Cutscene_InitContext.s,Cutscene_InitContext,0x800EA060,0x1D +asm/non_matchings/code/z_demo/Cutscene_StartManual.s,Cutscene_StartManual,0x800EA0D4,0x6 +asm/non_matchings/code/z_demo/Cutscene_StopManual.s,Cutscene_StopManual,0x800EA0EC,0x9 +asm/non_matchings/code/z_demo/Cutscene_UpdateManual.s,Cutscene_UpdateManual,0x800EA110,0x13 +asm/non_matchings/code/z_demo/Cutscene_UpdateScripted.s,Cutscene_UpdateScripted,0x800EA15C,0x2D +asm/non_matchings/code/z_demo/CutsceneHandler_DoNothing.s,CutsceneHandler_DoNothing,0x800EA210,0x4 +asm/non_matchings/code/z_demo/Cutscene_StepTimer.s,Cutscene_StepTimer,0x800EA220,0xE +asm/non_matchings/code/z_demo/CutsceneHandler_StartManual.s,CutsceneHandler_StartManual,0x800EA258,0x18 +asm/non_matchings/code/z_demo/CutsceneHandler_StartScript.s,CutsceneHandler_StartScript,0x800EA2B8,0x1B +asm/non_matchings/code/z_demo/CutsceneCmd_Misc.s,CutsceneCmd_Misc,0x800EA324,0x222 +asm/non_matchings/code/z_demo/CutsceneCmd_SetLightSetting.s,CutsceneCmd_SetLightSetting,0x800EABAC,0x17 +asm/non_matchings/code/z_demo/CutsceneCmd_StartSequence.s,CutsceneCmd_StartSequence,0x800EAC08,0xF +asm/non_matchings/code/z_demo/CutsceneCmd_StopSequence.s,CutsceneCmd_StopSequence,0x800EAC44,0x14 +asm/non_matchings/code/z_demo/CutsceneCmd_FadeOutSequence.s,CutsceneCmd_FadeOutSequence,0x800EAC94,0x20 +asm/non_matchings/code/z_demo/CutsceneCmd_StartAmbience.s,CutsceneCmd_StartAmbience,0x800EAD14,0xD +asm/non_matchings/code/z_demo/Cutscene_SetSfxReverbIndexTo2.s,Cutscene_SetSfxReverbIndexTo2,0x800EAD48,0xD +asm/non_matchings/code/z_demo/Cutscene_SetSfxReverbIndexTo1.s,Cutscene_SetSfxReverbIndexTo1,0x800EAD7C,0xD +asm/non_matchings/code/z_demo/CutsceneCmd_ModifySequence.s,CutsceneCmd_ModifySequence,0x800EADB0,0x47 +asm/non_matchings/code/z_demo/CutsceneCmd_FadeOutAmbience.s,CutsceneCmd_FadeOutAmbience,0x800EAECC,0x15 +asm/non_matchings/code/z_demo/CutsceneCmd_RumbleController.s,CutsceneCmd_RumbleController,0x800EAF20,0x30 +asm/non_matchings/code/z_demo/CutsceneCmd_TransitionGeneral.s,CutsceneCmd_TransitionGeneral,0x800EAFE0,0x7F +asm/non_matchings/code/z_demo/CutsceneCmd_SetTime.s,CutsceneCmd_SetTime,0x800EB1DC,0x62 +asm/non_matchings/code/z_demo/CutsceneCmd_DestinationDefault.s,CutsceneCmd_DestinationDefault,0x800EB364,0x54 +asm/non_matchings/code/z_demo/CutsceneCmd_Destination.s,CutsceneCmd_Destination,0x800EB4B4,0x91 +asm/non_matchings/code/z_demo/CutsceneCmd_ChooseCreditsScenes.s,CutsceneCmd_ChooseCreditsScenes,0x800EB6F8,0x11C +asm/non_matchings/code/z_demo/CutsceneCmd_MotionBlur.s,CutsceneCmd_MotionBlur,0x800EBB68,0x5A +asm/non_matchings/code/z_demo/CutsceneCmd_GiveTatlToPlayer.s,CutsceneCmd_GiveTatlToPlayer,0x800EBCD0,0x24 +asm/non_matchings/code/z_demo/CutsceneCmd_Transition.s,CutsceneCmd_Transition,0x800EBD60,0x246 +asm/non_matchings/code/z_demo/CutsceneCmd_UpdateCamSpline.s,CutsceneCmd_UpdateCamSpline,0x800EC678,0x17 asm/non_matchings/code/z_demo/Cutscene_CountNormalMasks.s,Cutscene_CountNormalMasks,0x800EC6D4,0x94 -asm/non_matchings/code/z_demo/Cutscene_Command_Textbox.s,Cutscene_Command_Textbox,0x800EC924,0x116 -asm/non_matchings/code/z_demo/func_800ECD7C.s,func_800ECD7C,0x800ECD7C,0x31 -asm/non_matchings/code/z_demo/Cutscene_ProcessCommands.s,Cutscene_ProcessCommands,0x800ECE40,0x2D0 -asm/non_matchings/code/z_demo/func_800ED980.s,func_800ED980,0x800ED980,0x11 -asm/non_matchings/code/z_demo/func_800ED9C4.s,func_800ED9C4,0x800ED9C4,0x10 -asm/non_matchings/code/z_demo/func_800EDA04.s,func_800EDA04,0x800EDA04,0x20 -asm/non_matchings/code/z_demo/func_800EDA84.s,func_800EDA84,0x800EDA84,0x57 -asm/non_matchings/code/z_demo/func_800EDBE0.s,func_800EDBE0,0x800EDBE0,0x74 +asm/non_matchings/code/z_demo/CutsceneCmd_Text.s,CutsceneCmd_Text,0x800EC924,0x116 +asm/non_matchings/code/z_demo/Cutscene_SetActorCue.s,Cutscene_SetActorCue,0x800ECD7C,0x31 +asm/non_matchings/code/z_demo/Cutscene_ProcessScript.s,Cutscene_ProcessScript,0x800ECE40,0x2D0 +asm/non_matchings/code/z_demo/CutsceneHandler_RunScript.s,CutsceneHandler_RunScript,0x800ED980,0x11 +asm/non_matchings/code/z_demo/CutsceneHandler_StopManual.s,CutsceneHandler_StopManual,0x800ED9C4,0x10 +asm/non_matchings/code/z_demo/CutsceneHandler_StopScript.s,CutsceneHandler_StopScript,0x800EDA04,0x20 +asm/non_matchings/code/z_demo/Cutscene_SetupScripted.s,Cutscene_SetupScripted,0x800EDA84,0x57 +asm/non_matchings/code/z_demo/Cutscene_HandleEntranceTriggers.s,Cutscene_HandleEntranceTriggers,0x800EDBE0,0x74 asm/non_matchings/code/z_demo/func_800EDDB0.s,func_800EDDB0,0x800EDDB0,0x3 asm/non_matchings/code/z_demo/func_800EDDBC.s,func_800EDDBC,0x800EDDBC,0x4 -asm/non_matchings/code/z_demo/Cutscene_LoadCutsceneData.s,Cutscene_LoadCutsceneData,0x800EDDCC,0x1A +asm/non_matchings/code/z_demo/Cutscene_StartScripted.s,Cutscene_StartScripted,0x800EDDCC,0x1A asm/non_matchings/code/z_demo/Cutscene_ActorTranslate.s,Cutscene_ActorTranslate,0x800EDE34,0x3C asm/non_matchings/code/z_demo/Cutscene_ActorTranslateAndYaw.s,Cutscene_ActorTranslateAndYaw,0x800EDF24,0x15 asm/non_matchings/code/z_demo/Cutscene_ActorTranslateAndYawSmooth.s,Cutscene_ActorTranslateAndYawSmooth,0x800EDF78,0x55 asm/non_matchings/code/z_demo/Cutscene_ActorTranslateXZAndYawSmooth.s,Cutscene_ActorTranslateXZAndYawSmooth,0x800EE0CC,0x43 asm/non_matchings/code/z_demo/Cutscene_GetSceneLayer.s,Cutscene_GetSceneLayer,0x800EE1D8,0xA -asm/non_matchings/code/z_demo/Cutscene_GetActorActionIndex.s,Cutscene_GetActorActionIndex,0x800EE200,0x27 -asm/non_matchings/code/z_demo/Cutscene_CheckActorAction.s,Cutscene_CheckActorAction,0x800EE29C,0x16 +asm/non_matchings/code/z_demo/Cutscene_GetCueChannel.s,Cutscene_GetCueChannel,0x800EE200,0x27 +asm/non_matchings/code/z_demo/Cutscene_IsCueInChannel.s,Cutscene_IsCueInChannel,0x800EE29C,0x16 asm/non_matchings/code/z_demo/Cutscene_IsPlaying.s,Cutscene_IsPlaying,0x800EE2F4,0xB asm/non_matchings/code/z_draw/GetItem_Draw.s,GetItem_Draw,0x800EE320,0x11 asm/non_matchings/code/z_draw/GetItem_DrawBombchu.s,GetItem_DrawBombchu,0x800EE364,0x27 @@ -1150,31 +1150,31 @@ asm/non_matchings/code/code_800F12D0/func_800F12D0.s,func_800F12D0,0x800F12D0,0x asm/non_matchings/code/code_800F12D0/func_800F1304.s,func_800F1304,0x800F1304,0x1C asm/non_matchings/code/code_800F12D0/func_800F1374.s,func_800F1374,0x800F1374,0x1D asm/non_matchings/code/code_800F12D0/func_800F13E8.s,func_800F13E8,0x800F13E8,0x1E -asm/non_matchings/code/z_eventmgr/func_800F1460.s,func_800F1460,0x800F1460,0x26 -asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCutsceneImpl.s,ActorCutscene_GetCutsceneImpl,0x800F14F8,0x13 -asm/non_matchings/code/z_eventmgr/ActorCutscene_Init.s,ActorCutscene_Init,0x800F1544,0x25 -asm/non_matchings/code/z_eventmgr/func_800F15D8.s,func_800F15D8,0x800F15D8,0x1C -asm/non_matchings/code/z_eventmgr/ActorCutscene_ClearWaiting.s,ActorCutscene_ClearWaiting,0x800F1648,0xC -asm/non_matchings/code/z_eventmgr/ActorCutscene_ClearNextCutscenes.s,ActorCutscene_ClearNextCutscenes,0x800F1678,0xC -asm/non_matchings/code/z_eventmgr/ActorCutscene_MarkNextCutscenes.s,ActorCutscene_MarkNextCutscenes,0x800F16A8,0x55 -asm/non_matchings/code/z_eventmgr/ActorCutscene_End.s,ActorCutscene_End,0x800F17FC,0xA0 -asm/non_matchings/code/z_eventmgr/ActorCutscene_Update.s,ActorCutscene_Update,0x800F1A7C,0x4A -asm/non_matchings/code/z_eventmgr/ActorCutscene_SetIntentToPlay.s,ActorCutscene_SetIntentToPlay,0x800F1BA4,0x10 -asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCanPlayNext.s,ActorCutscene_GetCanPlayNext,0x800F1BE4,0x21 -asm/non_matchings/code/z_eventmgr/ActorCutscene_StartAndSetUnkLinkFields.s,ActorCutscene_StartAndSetUnkLinkFields,0x800F1C68,0x1E -asm/non_matchings/code/z_eventmgr/ActorCutscene_StartAndSetFlag.s,ActorCutscene_StartAndSetFlag,0x800F1CE0,0x29 -asm/non_matchings/code/z_eventmgr/ActorCutscene_Start.s,ActorCutscene_Start,0x800F1D84,0x8E -asm/non_matchings/code/z_eventmgr/ActorCutscene_Stop.s,ActorCutscene_Stop,0x800F1FBC,0x30 -asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCurrentIndex.s,ActorCutscene_GetCurrentIndex,0x800F207C,0x4 -asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCutscene.s,ActorCutscene_GetCutscene,0x800F208C,0xB -asm/non_matchings/code/z_eventmgr/ActorCutscene_GetAdditionalCutscene.s,ActorCutscene_GetAdditionalCutscene,0x800F20B8,0x10 -asm/non_matchings/code/z_eventmgr/ActorCutscene_GetLength.s,ActorCutscene_GetLength,0x800F20F8,0x10 -asm/non_matchings/code/z_eventmgr/func_800F2138.s,func_800F2138,0x800F2138,0x10 -asm/non_matchings/code/z_eventmgr/func_800F2178.s,func_800F2178,0x800F2178,0x10 -asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCurrentSubCamId.s,ActorCutscene_GetCurrentSubCamId,0x800F21B8,0x5 -asm/non_matchings/code/z_eventmgr/func_800F21CC.s,func_800F21CC,0x800F21CC,0x3E +asm/non_matchings/code/z_eventmgr/CutsceneManager_SetHudVisibility.s,CutsceneManager_SetHudVisibility,0x800F1460,0x26 +asm/non_matchings/code/z_eventmgr/CutsceneManager_GetCutsceneEntryImpl.s,CutsceneManager_GetCutsceneEntryImpl,0x800F14F8,0x13 +asm/non_matchings/code/z_eventmgr/CutsceneManager_Init.s,CutsceneManager_Init,0x800F1544,0x25 +asm/non_matchings/code/z_eventmgr/CutsceneManager_StoreCamera.s,CutsceneManager_StoreCamera,0x800F15D8,0x1C +asm/non_matchings/code/z_eventmgr/CutsceneManager_ClearWaiting.s,CutsceneManager_ClearWaiting,0x800F1648,0xC +asm/non_matchings/code/z_eventmgr/CutsceneManager_ClearNextCutscenes.s,CutsceneManager_ClearNextCutscenes,0x800F1678,0xC +asm/non_matchings/code/z_eventmgr/CutsceneManager_MarkNextCutscenes.s,CutsceneManager_MarkNextCutscenes,0x800F16A8,0x55 +asm/non_matchings/code/z_eventmgr/CutsceneManager_End.s,CutsceneManager_End,0x800F17FC,0xA0 +asm/non_matchings/code/z_eventmgr/CutsceneManager_Update.s,CutsceneManager_Update,0x800F1A7C,0x4A +asm/non_matchings/code/z_eventmgr/CutsceneManager_Queue.s,CutsceneManager_Queue,0x800F1BA4,0x10 +asm/non_matchings/code/z_eventmgr/CutsceneManager_IsNext.s,CutsceneManager_IsNext,0x800F1BE4,0x21 +asm/non_matchings/code/z_eventmgr/CutsceneManager_StartWithPlayerCs.s,CutsceneManager_StartWithPlayerCs,0x800F1C68,0x1E +asm/non_matchings/code/z_eventmgr/CutsceneManager_StartWithPlayerCsAndSetFlag.s,CutsceneManager_StartWithPlayerCsAndSetFlag,0x800F1CE0,0x29 +asm/non_matchings/code/z_eventmgr/CutsceneManager_Start.s,CutsceneManager_Start,0x800F1D84,0x8E +asm/non_matchings/code/z_eventmgr/CutsceneManager_Stop.s,CutsceneManager_Stop,0x800F1FBC,0x30 +asm/non_matchings/code/z_eventmgr/CutsceneManager_GetCurrentCsId.s,CutsceneManager_GetCurrentCsId,0x800F207C,0x4 +asm/non_matchings/code/z_eventmgr/CutsceneManager_GetCutsceneEntry.s,CutsceneManager_GetCutsceneEntry,0x800F208C,0xB +asm/non_matchings/code/z_eventmgr/CutsceneManager_GetAdditionalCsId.s,CutsceneManager_GetAdditionalCsId,0x800F20B8,0x10 +asm/non_matchings/code/z_eventmgr/CutsceneManager_GetLength.s,CutsceneManager_GetLength,0x800F20F8,0x10 +asm/non_matchings/code/z_eventmgr/CutsceneManager_GetCutsceneScriptIndex.s,CutsceneManager_GetCutsceneScriptIndex,0x800F2138,0x10 +asm/non_matchings/code/z_eventmgr/CutsceneManager_GetCutsceneCustomValue.s,CutsceneManager_GetCutsceneCustomValue,0x800F2178,0x10 +asm/non_matchings/code/z_eventmgr/CutsceneManager_GetCurrentSubCamId.s,CutsceneManager_GetCurrentSubCamId,0x800F21B8,0x5 +asm/non_matchings/code/z_eventmgr/CutsceneManager_FindEntranceCsId.s,CutsceneManager_FindEntranceCsId,0x800F21CC,0x3E asm/non_matchings/code/z_eventmgr/func_800F22C4.s,func_800F22C4,0x800F22C4,0x40 -asm/non_matchings/code/z_eventmgr/ActorCutscene_SetReturnCamera.s,ActorCutscene_SetReturnCamera,0x800F23C4,0x7 +asm/non_matchings/code/z_eventmgr/CutsceneManager_SetReturnCamera.s,CutsceneManager_SetReturnCamera,0x800F23C4,0x7 asm/non_matchings/code/z_fcurve_data/func_800F23E0.s,func_800F23E0,0x800F23E0,0x26 asm/non_matchings/code/z_fcurve_data/func_800F2478.s,func_800F2478,0x800F2478,0x6A asm/non_matchings/code/z_fcurve_data_skelanime/func_800F2620.s,func_800F2620,0x800F2620,0xC @@ -1961,8 +1961,8 @@ asm/non_matchings/code/z_scene/Scene_Command09.s,Scene_Command09,0x801303D0,0x4 asm/non_matchings/code/z_scene/Scene_CommandSoundSettings.s,Scene_CommandSoundSettings,0x801303E0,0x17 asm/non_matchings/code/z_scene/Scene_CommandEchoSetting.s,Scene_CommandEchoSetting,0x8013043C,0x6 asm/non_matchings/code/z_scene/Scene_CommandAltHeaderList.s,Scene_CommandAltHeaderList,0x80130454,0x1E -asm/non_matchings/code/z_scene/Scene_CommandCutsceneList.s,Scene_CommandCutsceneList,0x801304CC,0xD -asm/non_matchings/code/z_scene/Scene_CommandActorCutsceneList.s,Scene_CommandActorCutsceneList,0x80130500,0x10 +asm/non_matchings/code/z_scene/Scene_CommandCutsceneScriptList.s,Scene_CommandCutsceneScriptList,0x801304CC,0xD +asm/non_matchings/code/z_scene/Scene_CommandCutsceneList.s,Scene_CommandCutsceneList,0x80130500,0x10 asm/non_matchings/code/z_scene/Scene_CommandMiniMap.s,Scene_CommandMiniMap,0x80130540,0xE asm/non_matchings/code/z_scene/Scene_Command1D.s,Scene_Command1D,0x80130578,0x4 asm/non_matchings/code/z_scene/Scene_CommandMiniMapCompassInfo.s,Scene_CommandMiniMapCompassInfo,0x80130588,0xA @@ -2215,7 +2215,7 @@ asm/non_matchings/code/z_sub_s/SubS_ActorPathing_MoveWithGravity.s,SubS_ActorPat asm/non_matchings/code/z_sub_s/SubS_ActorPathing_MoveWithoutGravityReverse.s,SubS_ActorPathing_MoveWithoutGravityReverse,0x8013E07C,0xA asm/non_matchings/code/z_sub_s/SubS_ActorPathing_SetNextPoint.s,SubS_ActorPathing_SetNextPoint,0x8013E0A4,0x49 asm/non_matchings/code/z_sub_s/SubS_ChangeAnimationBySpeedInfo.s,SubS_ChangeAnimationBySpeedInfo,0x8013E1C8,0x43 -asm/non_matchings/code/z_sub_s/SubS_StartActorCutscene.s,SubS_StartActorCutscene,0x8013E2D4,0x39 +asm/non_matchings/code/z_sub_s/SubS_StartCutscene.s,SubS_StartCutscene,0x8013E2D4,0x39 asm/non_matchings/code/z_sub_s/SubS_FillCutscenesList.s,SubS_FillCutscenesList,0x8013E3B8,0x3E asm/non_matchings/code/z_sub_s/SubS_ConstructPlane.s,SubS_ConstructPlane,0x8013E4B0,0x47 asm/non_matchings/code/z_sub_s/SubS_LineSegVsPlane.s,SubS_LineSegVsPlane,0x8013E5CC,0x1D @@ -2311,7 +2311,7 @@ asm/non_matchings/code/z_sram_NES/Sram_ResetSave.s,Sram_ResetSave,0x80144628,0x1 asm/non_matchings/code/z_sram_NES/Sram_GenerateRandomSaveFields.s,Sram_GenerateRandomSaveFields,0x80144684,0x83 asm/non_matchings/code/z_sram_NES/func_80144890.s,func_80144890,0x80144890,0x36 asm/non_matchings/code/z_sram_NES/Sram_InitDebugSave.s,Sram_InitDebugSave,0x80144968,0x4B -asm/non_matchings/code/z_sram_NES/func_80144A94.s,func_80144A94,0x80144A94,0xF9 +asm/non_matchings/code/z_sram_NES/Sram_ResetSaveFromMoonCrash.s,Sram_ResetSaveFromMoonCrash,0x80144A94,0xF9 asm/non_matchings/code/z_sram_NES/Sram_OpenSave.s,Sram_OpenSave,0x80144E78,0x17D asm/non_matchings/code/z_sram_NES/func_8014546C.s,func_8014546C,0x8014546C,0x8B asm/non_matchings/code/z_sram_NES/func_80145698.s,func_80145698,0x80145698,0x4D @@ -2418,27 +2418,27 @@ asm/non_matchings/code/z_shrink_window/ShrinkWindow_Init.s,ShrinkWindow_Init,0x8 asm/non_matchings/code/z_shrink_window/ShrinkWindow_Destroy.s,ShrinkWindow_Destroy,0x80160CD4,0x4 asm/non_matchings/code/z_shrink_window/ShrinkWindow_Update.s,ShrinkWindow_Update,0x80160CE4,0x2D asm/non_matchings/code/z_shrink_window/ShrinkWindow_Draw.s,ShrinkWindow_Draw,0x80160D98,0xFA -asm/non_matchings/code/db_camera/func_80161180.s,func_80161180,0x80161180,0x7 -asm/non_matchings/code/db_camera/func_8016119C.s,func_8016119C,0x8016119C,0x24 -asm/non_matchings/code/db_camera/func_8016122C.s,func_8016122C,0x8016122C,0x23 -asm/non_matchings/code/db_camera/func_801612B8.s,func_801612B8,0x801612B8,0x1B8 -asm/non_matchings/code/db_camera/func_80161998.s,func_80161998,0x80161998,0x85 -asm/non_matchings/code/db_camera/func_80161BAC.s,func_80161BAC,0x80161BAC,0xD -asm/non_matchings/code/db_camera/func_80161BE0.s,func_80161BE0,0x80161BE0,0xB -asm/non_matchings/code/db_camera/func_80161C0C.s,func_80161C0C,0x80161C0C,0x5 -asm/non_matchings/code/db_camera/func_80161C20.s,func_80161C20,0x80161C20,0x8B -asm/non_matchings/code/db_camera/func_80161E4C.s,func_80161E4C,0x80161E4C,0xA0 -asm/non_matchings/code/db_camera/func_801620CC.s,func_801620CC,0x801620CC,0xAC -asm/non_matchings/code/db_camera/func_8016237C.s,func_8016237C,0x8016237C,0x1A -asm/non_matchings/code/db_camera/func_801623E4.s,func_801623E4,0x801623E4,0x42 -asm/non_matchings/code/db_camera/func_801624EC.s,func_801624EC,0x801624EC,0x14 -asm/non_matchings/code/db_camera/func_8016253C.s,func_8016253C,0x8016253C,0x120 -asm/non_matchings/code/db_camera/func_801629BC.s,func_801629BC,0x801629BC,0x25 -asm/non_matchings/code/db_camera/func_80162A50.s,func_80162A50,0x80162A50,0x16A -asm/non_matchings/code/db_camera/func_80162FF8.s,func_80162FF8,0x80162FF8,0x79 -asm/non_matchings/code/db_camera/func_801631DC.s,func_801631DC,0x801631DC,0x56 -asm/non_matchings/code/db_camera/func_80163334.s,func_80163334,0x80163334,0xCB -asm/non_matchings/code/db_camera/func_80163660.s,func_80163660,0x80163660,0x28 +asm/non_matchings/code/cutscene_camera/func_80161180.s,func_80161180,0x80161180,0x7 +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Init.s,CutsceneCamera_Init,0x8016119C,0x24 +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Interpolate.s,CutsceneCamera_Interpolate,0x8016122C,0x23 +asm/non_matchings/code/cutscene_camera/CutsceneCamera_ProcessSpline.s,CutsceneCamera_ProcessSpline,0x801612B8,0x1B8 +asm/non_matchings/code/cutscene_camera/CutsceneCamera_UpdateSplines.s,CutsceneCamera_UpdateSplines,0x80161998,0x85 +asm/non_matchings/code/cutscene_camera/func_80161BAC.s,func_80161BAC,0x80161BAC,0xD +asm/non_matchings/code/cutscene_camera/CutsceneCamera_SetState.s,CutsceneCamera_SetState,0x80161BE0,0xB +asm/non_matchings/code/cutscene_camera/CutsceneCamera_Reset.s,CutsceneCamera_Reset,0x80161C0C,0x5 +asm/non_matchings/code/cutscene_camera/func_80161C20.s,func_80161C20,0x80161C20,0x8B +asm/non_matchings/code/cutscene_camera/func_80161E4C.s,func_80161E4C,0x80161E4C,0xA0 +asm/non_matchings/code/cutscene_camera/func_801620CC.s,func_801620CC,0x801620CC,0xAC +asm/non_matchings/code/cutscene_camera/func_8016237C.s,func_8016237C,0x8016237C,0x1A +asm/non_matchings/code/cutscene_camera/func_801623E4.s,func_801623E4,0x801623E4,0x42 +asm/non_matchings/code/cutscene_camera/func_801624EC.s,func_801624EC,0x801624EC,0x14 +asm/non_matchings/code/cutscene_camera/func_8016253C.s,func_8016253C,0x8016253C,0x120 +asm/non_matchings/code/cutscene_camera/func_801629BC.s,func_801629BC,0x801629BC,0x25 +asm/non_matchings/code/cutscene_camera/func_80162A50.s,func_80162A50,0x80162A50,0x16A +asm/non_matchings/code/cutscene_camera/func_80162FF8.s,func_80162FF8,0x80162FF8,0x79 +asm/non_matchings/code/cutscene_camera/func_801631DC.s,func_801631DC,0x801631DC,0x56 +asm/non_matchings/code/cutscene_camera/func_80163334.s,func_80163334,0x80163334,0xCB +asm/non_matchings/code/cutscene_camera/func_80163660.s,func_80163660,0x80163660,0x28 asm/non_matchings/code/z_kaleido_manager/func_80163700.s,func_80163700,0x80163700,0x16 asm/non_matchings/code/z_kaleido_manager/func_80163758.s,func_80163758,0x80163758,0x17 asm/non_matchings/code/z_kaleido_manager/func_801637B4.s,func_801637B4,0x801637B4,0x14 @@ -3361,7 +3361,7 @@ asm/non_matchings/code/code_8019AF00/AudioOcarina_TerminaWallGenerateNotes.s,Aud asm/non_matchings/code/code_8019AF00/AudioOcarina_MemoryGameInit.s,AudioOcarina_MemoryGameInit,0x8019D488,0x1C asm/non_matchings/code/code_8019AF00/AudioOcarina_MemoryGameNextNote.s,AudioOcarina_MemoryGameNextNote,0x8019D4F8,0x42 asm/non_matchings/code/code_8019AF00/AudioOcarina_Update.s,AudioOcarina_Update,0x8019D600,0x56 -asm/non_matchings/code/code_8019AF00/AudioOcarina_PlayLongScarecrowAfterCredits.s,AudioOcarina_PlayLongScarecrowAfterCredits,0x8019D758,0x43 +asm/non_matchings/code/code_8019AF00/AudioOcarina_PlayLongScarecrowSong.s,AudioOcarina_PlayLongScarecrowSong,0x8019D758,0x43 asm/non_matchings/code/code_8019AF00/AudioOcarina_SetCustomSequence.s,AudioOcarina_SetCustomSequence,0x8019D864,0x14 asm/non_matchings/code/code_8019AF00/AudioOcarina_PlayCustomSequence.s,AudioOcarina_PlayCustomSequence,0x8019D8B4,0xC asm/non_matchings/code/code_8019AF00/AudioOcarina_CreateCustomSequence.s,AudioOcarina_CreateCustomSequence,0x8019D8E4,0x191 diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index 0719070588..34b3ddc46d 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -165,7 +165,7 @@ weekEventReg = { (19 << 8) | 0x40: "WEEKEVENTREG_19_40", (19 << 8) | 0x80: "WEEKEVENTREG_19_80", (20 << 8) | 0x01: "WEEKEVENTREG_20_01", - (20 << 8) | 0x02: "WEEKEVENTREG_20_02", + (20 << 8) | 0x02: "WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE", (20 << 8) | 0x04: "WEEKEVENTREG_20_04", (20 << 8) | 0x08: "WEEKEVENTREG_20_08", (20 << 8) | 0x10: "WEEKEVENTREG_20_10", @@ -275,7 +275,7 @@ weekEventReg = { (33 << 8) | 0x10: "WEEKEVENTREG_33_10", (33 << 8) | 0x20: "WEEKEVENTREG_33_20", (33 << 8) | 0x40: "WEEKEVENTREG_33_40", - (33 << 8) | 0x80: "WEEKEVENTREG_33_80", + (33 << 8) | 0x80: "WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE", (34 << 8) | 0x01: "WEEKEVENTREG_34_01", (34 << 8) | 0x02: "WEEKEVENTREG_34_02", (34 << 8) | 0x04: "WEEKEVENTREG_34_04", @@ -425,7 +425,7 @@ weekEventReg = { (52 << 8) | 0x04: "WEEKEVENTREG_52_04", (52 << 8) | 0x08: "WEEKEVENTREG_52_08", (52 << 8) | 0x10: "WEEKEVENTREG_52_10", - (52 << 8) | 0x20: "WEEKEVENTREG_52_20", + (52 << 8) | 0x20: "WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE", (52 << 8) | 0x40: "WEEKEVENTREG_52_40", (52 << 8) | 0x80: "WEEKEVENTREG_52_80", (53 << 8) | 0x01: "WEEKEVENTREG_53_01", @@ -451,7 +451,7 @@ weekEventReg = { (55 << 8) | 0x10: "WEEKEVENTREG_55_10", (55 << 8) | 0x20: "WEEKEVENTREG_55_20", (55 << 8) | 0x40: "WEEKEVENTREG_55_40", - (55 << 8) | 0x80: "WEEKEVENTREG_55_80", + (55 << 8) | 0x80: "WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE", (56 << 8) | 0x01: "WEEKEVENTREG_56_01", (56 << 8) | 0x02: "WEEKEVENTREG_56_02", (56 << 8) | 0x04: "WEEKEVENTREG_56_04",