Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actor Cutscene system from Majora's Mask #161

Merged
merged 14 commits into from
Jan 6, 2025
5 changes: 5 additions & 0 deletions include/animated_materials.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#define ANIMATED_MATERIALS_H

#include "ultra64.h"
#include "config.h"

#if ENABLE_ANIMATED_MATERIALS

typedef enum AnimatedMatType {
/* 0 */ ANIM_MAT_TYPE_TEX_SCROLL,
Expand Down Expand Up @@ -82,3 +85,5 @@ void AnimatedMat_DrawAlphaStepOpa(struct PlayState* play, AnimatedMaterial* matA
void AnimatedMat_DrawAlphaStepXlu(struct PlayState* play, AnimatedMaterial* matAnim, f32 alphaRatio, u32 step);

#endif

#endif
12 changes: 12 additions & 0 deletions include/config/config_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,16 @@
*/
#define ENABLE_ANIMATED_MATERIALS true

/**
* Enable New Letterbox (from Majora's Mask)
*/
#define ENABLE_NEW_LETTERBOX true

/**
* Enable Cutscene Improvements (from Majora's Mask)
*
* This includes actor cutscenes
*/
#define ENABLE_CUTSCENE_IMPROVEMENTS true

#endif
8 changes: 8 additions & 0 deletions include/config/config_safeguards.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@
#define USE_WIDESCREEN (ENABLE_WIDESCREEN && gSaveContext.save.useWidescreen == true)
#endif

#if ENABLE_CUTSCENE_IMPROVEMENTS && !ENABLE_NEW_LETTERBOX
#undef ENABLE_NEW_LETTERBOX
#define ENABLE_NEW_LETTERBOX true
#endif

/*****************
* config_graphics.h
*/
//! TODO: implement better Wii VC compatibility
#ifdef CONSOLE_WIIVC
#undef ENABLE_F3DEX3
Expand Down
21 changes: 21 additions & 0 deletions include/letterbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,25 @@ void Letterbox_Init(void);
void Letterbox_Destroy(void);
void Letterbox_Update(s32 updateRate);

#if ENABLE_NEW_LETTERBOX

struct GraphicsContext;

void ShrinkWindow_Letterbox_SetSizeTarget(s32 target);
s32 ShrinkWindow_Letterbox_GetSizeTarget(void);
void ShrinkWindow_Letterbox_SetSize(s32 size);
s32 ShrinkWindow_Letterbox_GetSize(void);

void ShrinkWindow_Pillarbox_SetSizeTarget(s32 target);
s32 ShrinkWindow_Pillarbox_GetSizeTarget(void);
void ShrinkWindow_Pillarbox_SetSize(s32 size);
s32 ShrinkWindow_Pillarbox_GetSize(void);

void ShrinkWindow_Init(void);
void ShrinkWindow_Destroy(void);
void ShrinkWindow_Update(s32 framerateDivisor);
void ShrinkWindow_Draw(struct GraphicsContext* gfxCtx);

#endif

#endif
4 changes: 4 additions & 0 deletions include/tables/scene_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,9 @@
#endif

#if CAN_INCLUDE_EXAMPLE_SCENE
#if ENABLE_ANIMATED_MATERIALS
/* 0x6C */ DEFINE_SCENE(example_scene, none, SCENE_EXAMPLE, SDC_MAT_ANIM, 0, 0)
#else
/* 0x6C */ DEFINE_SCENE(example_scene, none, SCENE_EXAMPLE, SDC_HAUNTED_WASTELAND, 0, 0)
#endif
#endif
7 changes: 7 additions & 0 deletions include/z64actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ typedef struct ActorShape {
// Flag controlling the use of `Actor.sfx`. Do not use directly. See Actor_PlaySfx_FlaggedTimer
#define ACTOR_FLAG_SFX_TIMER (1 << 28)

// Actor can update even if Player is currently in one of the `sCategoryFreezeMasks` states.
// Typically an actor will halt while the player is in one of the `sCategoryFreezeMasks` states (depending on category).
// This flag allows a given actor to be an exception.
//
// Note: Not implemented yet.
#define ACTOR_FLAG_FREEZE_EXCEPTION (1 << 29)

#define COLORFILTER_GET_COLORINTENSITY(colorFilterParams) (((colorFilterParams) & 0x1F00) >> 5)
#define COLORFILTER_GET_DURATION(colorFilterParams) ((colorFilterParams) & 0xFF)

Expand Down
19 changes: 17 additions & 2 deletions include/z64camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ typedef enum CameraSettingType {
/* 0x3F */ CAM_SET_DIRECTED_YAW, // Does not auto-update yaw, tends to keep the camera pointed at a certain yaw (used by biggoron and final spirit lowering platform) "TEPPEN"
/* 0x40 */ CAM_SET_PIVOT_FROM_SIDE, // Fixed side view, allows rotation of camera (eg. Potion Shop, Meadow at fairy grotto) "CIRCLE7"
/* 0x41 */ CAM_SET_NORMAL4,
/* 0x42 */ CAM_SET_MAX
#if ENABLE_CUTSCENE_IMPROVEMENTS
/* 0x42 */ CAM_SET_FIXED1,
#endif
/* 0x43 */ CAM_SET_MAX
} CameraSettingType;

typedef enum CameraModeType {
Expand Down Expand Up @@ -305,7 +308,10 @@ typedef enum CameraFuncType {
/* 0x44 */ CAM_FUNC_SPEC7,
/* 0x45 */ CAM_FUNC_SPEC8,
/* 0x46 */ CAM_FUNC_SPEC9,
/* 0x47 */ CAM_FUNC_MAX
#if ENABLE_CUTSCENE_IMPROVEMENTS
/* 0x47 */ CAM_FUNC_FIXED1,
#endif
/* 0x48 */ CAM_FUNC_MAX
} CameraFuncType;

typedef enum CameraDataType {
Expand Down Expand Up @@ -1733,4 +1739,13 @@ void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* d
s32 func_8005B198(void);
s16 Camera_SetFinishedFlag(Camera* camera);

s16 Camera_GetBgCamOrActorCsCamSetting(Camera* camera, u32 camDataId);
Vec3s* Camera_GetBgCamOrActorCsCamFuncData(Camera* camera, u32 camDataId);
#if ENABLE_CUTSCENE_IMPROVEMENTS
s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags);
s32 Camera_ChangeSetting(Camera* camera, s16 setting);
s32 Camera_ChangeActorCsCamIndex(Camera* camera, s32 bgCamIndex);
void Camera_800E0348(Camera* camera);
#endif

#endif
Loading
Loading