Transitions

This commit is contained in:
Derek Hensley
2022-10-04 21:19:22 -07:00
parent 4e809f1c17
commit 8582c2a7e2
17 changed files with 93 additions and 93 deletions
+5 -5
View File
@@ -554,7 +554,7 @@ void Cutscene_Command_SetTime(PlayState* play, CutsceneContext* csCtx, CsCmdDayT
void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
csCtx->state = CS_STATE_4;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
Audio_SetCutsceneFlag(false);
gSaveContext.cutsceneTransitionControl = 1;
@@ -593,7 +593,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
}
} else if (cmd->base == 2) {
if (csCtx->frames == cmd->startFrame) {
Play_MotionBlurDisable();
Play_DisableMotionBlur();
switch (D_801F4DE2) {
case 0x1F:
@@ -763,16 +763,16 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
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)) {
Play_MotionBlurEnable(180);
Play_EnableMotionBlur(180);
}
if (cmd->base == 2) {
f32 progress = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames);
if (progress >= 0.9f) {
Play_MotionBlurDisable();
Play_DisableMotionBlur();
} else {
Play_MotionBlurSetAlpha((1.0f - progress) * 180.0f);
Play_SetMotionBlurAlpha((1.0f - progress) * 180.0f);
}
}
}
+22 -22
View File
@@ -33,7 +33,7 @@ typedef enum {
/* 2 */ MOTION_BLUR_RUNNING
} MotionBlurStatus;
void Play_MotionBlurDraw(PlayState* this) {
void Play_DrawMotionBlur(PlayState* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
s32 alpha;
Gfx* gfx;
@@ -85,28 +85,28 @@ void Play_MotionBlurDraw(PlayState* this) {
}
}
void Play_MotionBlurInit(void) {
void Play_InitMotionBlur(void) {
R_MOTION_BLUR_ENABLED = false;
R_MOTION_BLUR_PRIORITY_ENABLED = false;
sMotionBlurStatus = MOTION_BLUR_STOPPED;
}
void Play_MotionBlurDestroy(void) {
void Play_DestroyMotionBlur(void) {
R_MOTION_BLUR_ENABLED = false;
R_MOTION_BLUR_PRIORITY_ENABLED = false;
sMotionBlurStatus = MOTION_BLUR_STOPPED;
}
void Play_MotionBlurSetAlpha(u32 alpha) {
void Play_SetMotionBlurAlpha(u32 alpha) {
R_MOTION_BLUR_ALPHA = alpha;
}
void Play_MotionBlurEnable(u32 alpha) {
void Play_EnableMotionBlur(u32 alpha) {
R_MOTION_BLUR_ALPHA = alpha;
R_MOTION_BLUR_ENABLED = true;
}
void Play_MotionBlurDisable(void) {
void Play_DisableMotionBlur(void) {
R_MOTION_BLUR_ENABLED = false;
}
@@ -193,16 +193,16 @@ void func_801656A4(void* arg0, u16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5
}
}
void Play_MotionBlurPrioritySetAlpha(u32 alpha) {
void Play_SetMotionBlurPriorityAlpha(u32 alpha) {
R_MOTION_BLUR_PRIORITY_ALPHA = alpha;
}
void Play_MotionBlurPriorityEnable(u32 alpha) {
void Play_EnableMotionBlurPriority(u32 alpha) {
R_MOTION_BLUR_PRIORITY_ALPHA = alpha;
R_MOTION_BLUR_PRIORITY_ENABLED = true;
}
void Play_MotionBlurPriorityDisable(void) {
void Play_DisableMotionBlurPriority(void) {
R_MOTION_BLUR_PRIORITY_ENABLED = false;
}
@@ -216,10 +216,10 @@ void func_80165E1C(PreRender* prerender) {
func_801656A4(gPictoPhotoI8, prerender->fbufSave, 320, 80, 64, 240 - 1, 176 - 1, 8);
}
s32 func_80165E7C(PlayState* this, s32 transitionType) {
s32 Play_ChooseDynamicTransition(PlayState* this, s32 transitionType) {
s32 nextTransitionType = transitionType;
if (transitionType == TRANS_TYPE_20) {
if (transitionType == TRANS_TYPE_FADE_DYNAMIC) {
if (!gSaveContext.save.isNight) {
nextTransitionType = TRANS_TYPE_FADE_WHITE;
} else {
@@ -292,11 +292,11 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) {
this->transitionMode = TRANS_MODE_CS_BLACK_FILL_INIT;
break;
case TRANS_TYPE_21:
case TRANS_TYPE_CIRCLE:
fbdemoType = FBDEMO_CIRCLE;
break;
case TRANS_TYPE_22:
case TRANS_TYPE_WIPE5:
fbdemoType = FBDEMO_WIPE5;
break;
@@ -380,7 +380,7 @@ const char D_801DFB20[] = "fi";
const char D_801DFB24[] = "fj";
const char D_801DFB28[] = "fk";
void Play_ClearTransitionInstanceType(PlayState* this) {
void Play_ClearTransition(PlayState* this) {
if (this->transitionCtx.fbdemoType != -1) {
Transition_Destroy(&this->transitionCtx);
}
@@ -414,7 +414,7 @@ void Play_Destroy(GameState* thisx) {
func_8016FC98(&D_801F6D50);
this->state.gfxCtx->callback = NULL;
this->state.gfxCtx->callbackParam = 0;
Play_MotionBlurDestroy();
Play_DestroyMotionBlur();
if (SREG(94) != 0) {
PreRender_ApplyFiltersSlowlyDestroy(&this->pauseBgPreRender);
@@ -439,7 +439,7 @@ void Play_Destroy(GameState* thisx) {
if ((this->transitionMode == TRANS_MODE_INSTANCE_RUNNING) || D_801D0D54) {
this->transitionCtx.destroy(&this->transitionCtx.instanceData);
Play_ClearTransitionInstanceType(this);
Play_ClearTransition(this);
this->transitionMode = TRANS_MODE_OFF;
}
@@ -634,7 +634,7 @@ void Play_UpdateTransition(PlayState* this) {
}
if (!D_801D0D54) {
Play_SetupTransition(this, func_80165E7C(this, this->transitionType));
Play_SetupTransition(this, Play_ChooseDynamicTransition(this, this->transitionType));
}
if (this->transitionMode >= TRANS_MODE_FILL_WHITE_INIT) {
@@ -725,7 +725,7 @@ void Play_UpdateTransition(PlayState* this) {
case TRANS_MODE_INSTANCE_RUNNING:
if (this->transitionCtx.isDone(&this->transitionCtx.instanceData)) {
if (this->transitionTrigger != TRANS_TRIGGER_END) {
if (this->transitionCtx.transitionType == TRANS_TYPE_21) {
if (this->transitionCtx.transitionType == TRANS_TYPE_CIRCLE) {
D_801D0D54 = false;
}
@@ -745,11 +745,11 @@ void Play_UpdateTransition(PlayState* this) {
SET_NEXT_GAMESTATE(&this->state, FileSelect_Init, sizeof(FileSelectState));
}
} else {
if (this->transitionCtx.transitionType == TRANS_TYPE_21) {
if (this->transitionCtx.transitionType == TRANS_TYPE_CIRCLE) {
D_801D0D54 = true;
} else {
this->transitionCtx.destroy(&this->transitionCtx.instanceData);
Play_ClearTransitionInstanceType(this);
Play_ClearTransition(this);
}
this->transitionMode = TRANS_MODE_OFF;
if (gTrnsnUnkState == 3) {
@@ -1376,7 +1376,7 @@ void Play_Draw(PlayState* this) {
}
DebugDisplay_DrawObjects(this);
Play_MotionBlurDraw(this);
Play_DrawMotionBlur(this);
if (((SREG(94) == 1) || (gTrnsnUnkState == 1)) || (SREG(89) == 1)) {
Gfx* sp74;
@@ -2232,7 +2232,7 @@ void Play_Init(GameState* thisx) {
}
}
Play_MotionBlurInit();
Play_InitMotionBlur();
SREG(94) = 0;
SREG(89) = 0;
+2 -2
View File
@@ -1637,7 +1637,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE);
Play_MotionBlurEnable(150);
Play_EnableMotionBlur(150);
this->unk_1D14 = 0;
this->subCamAtVel = 0.0f;
this->unk_1D58 = 0.0f;
@@ -1757,7 +1757,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_1;
player->stateFlags1 &= ~0x100;
this->unk_1D70 = 0.01f;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
break;
}
+8 -8
View File
@@ -784,7 +784,7 @@ void Boss03_CatchPlayer(Boss03* this, PlayState* play) {
player->unk_AE8 = 101;
player->actor.parent = NULL;
player->csMode = 0;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
}
func_809E344C(this, play);
@@ -856,7 +856,7 @@ void Boss03_ChewPlayer(Boss03* this, PlayState* play) {
this->unk_25C = 15;
if (this->workTimer[WORK_TIMER_CURRENT_ACTION] == 90) {
Play_MotionBlurEnable(0x96);
Play_EnableMotionBlur(0x96);
}
SkelAnime_Update(&this->skelAnime);
@@ -912,7 +912,7 @@ void Boss03_ChewPlayer(Boss03* this, PlayState* play) {
player->unk_AE8 = 101;
player->actor.parent = NULL;
player->csMode = 0;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
func_800B8D50(play, NULL, 10.0f, this->actor.shape.rot.y, 0.0f, 0x20);
}
@@ -1191,7 +1191,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
this->csState = 2;
this->csTimer = 0;
this->unk_240 = 0;
Play_MotionBlurEnable(0x96);
Play_EnableMotionBlur(0x96);
this->subCamFov = 80.0f;
case 2:
@@ -1284,7 +1284,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
this->actor.speedXZ = -200.0f;
Actor_MoveWithoutGravityReverse(&this->actor);
this->actor.world.pos.y = this->waterHeight - 150.0f;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
case 5:
SkelAnime_Update(&this->skelAnime);
@@ -1631,7 +1631,7 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, 6);
this->csState = 3;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
Boss03_PlayUnderwaterSfx(&this->actor.projectedPos, NA_SE_EN_KONB_INIT_OLD);
Boss03_PlayUnderwaterSfx(&D_809E9848, NA_SE_EN_KONB_INIT_OLD);
}
@@ -1755,7 +1755,7 @@ void Boss03_SetupStunned(Boss03* this, PlayState* play) {
player->unk_AE8 = 101;
player->actor.parent = NULL;
player->csMode = 0;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
}
this->unk_240 = 0;
@@ -1907,7 +1907,7 @@ void Boss03_UpdateCollision(Boss03* this, PlayState* play) {
player->unk_AE8 = 101;
player->actor.parent = NULL;
player->csMode = 0;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
}
continue;
+2 -2
View File
@@ -271,7 +271,7 @@ void func_809EC568(Boss04* this, PlayState* play) {
Math_Vec3f_Copy(&this->subCamEye, &player->actor.world.pos);
this->subCamEye.y += 100.0f;
Math_Vec3f_Copy(&this->subCamAt, &this->actor.world.pos);
Play_MotionBlurEnable(150);
Play_EnableMotionBlur(150);
this->subCamFov = 60.0f;
boss = play->actorCtx.actorLists[ACTORCAT_BOSS].first;
@@ -391,7 +391,7 @@ void func_809EC568(Boss04* this, PlayState* play) {
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, 6);
Play_MotionBlurDisable();
Play_DisableMotionBlur();
gSaveContext.eventInf[6] |= 1;
}
break;
+5 -5
View File
@@ -170,7 +170,7 @@ void EnGs_Destroy(Actor* thisx, PlayState* play) {
EnGs* this = THIS;
Collider_DestroyCylinder(play, &this->collider);
Play_MotionBlurDisable();
Play_DisableMotionBlur();
}
void func_80997D14(EnGs* this, PlayState* play) {
@@ -902,16 +902,16 @@ void func_80999AC0(EnGs* this) {
void func_80999B34(EnGs* this) {
if (this->unk_216 > 0) {
if (this->unk_218 == 0) {
Play_MotionBlurEnable(this->unk_216);
Play_EnableMotionBlur(this->unk_216);
this->unk_218 = this->unk_216;
} else {
Play_MotionBlurSetAlpha(this->unk_218);
Play_SetMotionBlurAlpha(this->unk_218);
}
} else if (this->unk_218 > 0) {
Math_StepToS(&this->unk_218, this->unk_216, 20);
Play_MotionBlurSetAlpha(this->unk_218);
Play_SetMotionBlurAlpha(this->unk_218);
if (this->unk_218 <= 0) {
Play_MotionBlurDisable();
Play_DisableMotionBlur();
}
}
}
+2 -2
View File
@@ -110,7 +110,7 @@ void EnJs_Init(Actor* thisx, PlayState* play) {
this->actionFunc = func_8096A6F4;
Animation_PlayLoop(&this->skelAnime, &gMoonChildSittingAnim);
Play_MotionBlurEnable(0x3C);
Play_EnableMotionBlur(0x3C);
if (gSaveContext.save.weekEventReg[84] & 0x20) {
Inventory_DeleteItem(ITEM_MASK_FIERCE_DEITY, SLOT(ITEM_MASK_FIERCE_DEITY));
@@ -151,7 +151,7 @@ void EnJs_Destroy(Actor* thisx, PlayState* play) {
paramsF = ENJS_GET_TYPE(&this->actor);
switch (paramsF) {
case 0:
Play_MotionBlurDisable();
Play_DisableMotionBlur();
break;
case 5:
case 6:
@@ -813,7 +813,7 @@ void EnKakasi_SetupDanceNightAway(EnKakasi* this) {
this->subCamFovNext = 60.0f;
EnKakasi_ChangeAnim(this, ENKAKASI_ANIM_TWIRL);
Math_Vec3f_Copy(&this->unk22C, &this->picto.actor.home.pos);
Play_MotionBlurEnable(0xB4);
Play_EnableMotionBlur(0xB4);
this->actionFunc = EnKakasi_DancingNightAway;
}
@@ -917,7 +917,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) {
this->unk204 = 0xA;
if (this->unk190 == 0xE) {
func_800B7298(play, &this->picto.actor, 0x49);
Play_MotionBlurDisable();
Play_DisableMotionBlur();
this->unk204 = 0x14;
}
}
@@ -184,11 +184,11 @@ void func_80A90730(EnTest6* this, PlayState* play) {
}
void func_80A90C08(s16 arg0) {
Play_MotionBlurEnable(arg0);
Play_EnableMotionBlur(arg0);
}
void func_80A90C34(void) {
Play_MotionBlurDisable();
Play_DisableMotionBlur();
}
void func_80A90C54(PlayState* play, f32 arg1) {
@@ -461,7 +461,7 @@ void func_80AF1A2C(EnTest7* this, PlayState* play) {
func_80AF082C(this, func_80AF1CA0);
this->unk_144 |= 0x20;
Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_OPEN);
Play_MotionBlurEnable(0x78);
Play_EnableMotionBlur(0x78);
}
}
@@ -602,7 +602,7 @@ void func_80AF2030(EnTest7* this, PlayState* play) {
play->unk_18844 = false;
this->unk_144 &= ~4;
func_80AF082C(this, func_80AF21E8);
Play_MotionBlurDisable();
Play_DisableMotionBlur();
}
}
@@ -157,7 +157,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
} else {
ActorCutscene_StartAndSetUnkLinkFields(play->playerActorCsIds[4], &this->dyna.actor);
func_800B8E58(player, NA_SE_PL_WARP_PLATE);
Play_MotionBlurEnable(0);
Play_EnableMotionBlur(0);
}
} else {
@@ -215,7 +215,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
Play_TriggerVoidOut(&play->state);
gSaveContext.respawnFlag = ~0x4;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
}
}
@@ -224,7 +224,7 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) {
if (new15E < 0) {
new15E = 0;
}
Play_MotionBlurSetAlpha(new15E * 0.04f); // unknown Play_ function
Play_SetMotionBlurAlpha(new15E * 0.04f); // unknown Play_ function
}
}
@@ -454,7 +454,7 @@ void ObjTokeidai_TowerOpening_EndCutscene(ObjTokeidai* this, PlayState* play) {
play->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_RETURN].entrance;
play->transitionType = TRANS_TYPE_FADE_BLACK;
if (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams == 0xCFF) {
gSaveContext.nextTransitionType = TRANS_TYPE_21;
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE;
} else {
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
}
@@ -67,7 +67,7 @@ void func_808A7AAC(ObjWturn* this, PlayState* play) {
Vec3f subCamAt;
ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor);
Play_MotionBlurEnable(140);
Play_EnableMotionBlur(140);
this->subCamId = ActorCutscene_GetCurrentSubCamId(this->actor.cutscene);
func_800B7298(play, &this->actor, 21);
subCamAt.x = player->actor.focus.pos.x;
@@ -96,7 +96,7 @@ void func_808A7C04(ObjWturn* this, PlayState* play) {
func_800B7298(play, &this->actor, 0x54);
func_800B8E58(player, NA_SE_VO_NAVY_ENEMY);
this->unk_14A = 0;
Play_MotionBlurDisable();
Play_DisableMotionBlur();
this->actionFunc = func_808A7C78;
}