Credits skip (you can merge this now) (#52)

This commit is contained in:
Isaac 2022-03-31 18:52:28 +10:00 committed by GitHub
parent 36c1d52e1f
commit 87aa18ef65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 21 deletions

View file

@ -1530,6 +1530,7 @@ void update_mario_inputs(struct MarioState *m) {
/* End of developer stuff */
if ((m->action == ACT_END_PEACH_CUTSCENE || m->action == ACT_CREDITS_CUTSCENE) && m->controller->buttonPressed & START_BUTTON) {
gCurrCreditsEntry = NULL;
gCurrActStarNum = 0;
gCurrActNum = 0;
gChangeLevel = 16;

View file

@ -2807,33 +2807,36 @@ static s32 act_credits_cutscene(struct MarioState *m) {
m->actionState += 2;
}
if (m->playerIndex == 0) {
s32 width = m->actionState * 640 / 100;
s32 height = m->actionState * 480 / 100;
if (gCurrCreditsEntry != NULL) {
if (m->playerIndex == 0) {
s32 width = m->actionState * 640 / 100;
s32 height = m->actionState * 480 / 100;
sEndCutsceneVp.vp.vscale[0] = 640 - width;
sEndCutsceneVp.vp.vscale[1] = 480 - height;
sEndCutsceneVp.vp.vtrans[0] = (gCurrCreditsEntry->unk02 & 0x10 ? width : -width) * 56 / 100 + 640;
sEndCutsceneVp.vp.vtrans[1] = (gCurrCreditsEntry->unk02 & 0x20 ? height : -height) * 66 / 100 + 480;
sEndCutsceneVp.vp.vscale[0] = 640 - width;
sEndCutsceneVp.vp.vscale[1] = 480 - height;
sEndCutsceneVp.vp.vtrans[0] = (gCurrCreditsEntry->unk02 & 0x10 ? width : -width) * 56 / 100 + 640;
sEndCutsceneVp.vp.vtrans[1] = (gCurrCreditsEntry->unk02 & 0x20 ? height : -height) * 66 / 100 + 480;
override_viewport_and_clip(&sEndCutsceneVp, 0, 0, 0, 0);
override_viewport_and_clip(&sEndCutsceneVp, 0, 0, 0, 0);
}
}
}
if (m->actionTimer == TIMER_CREDITS_PROGRESS && m->playerIndex == 0) {
reset_cutscene_msg_fade();
if (gCurrCreditsEntry != NULL) {
if (m->actionTimer == TIMER_CREDITS_PROGRESS && m->playerIndex == 0) {
reset_cutscene_msg_fade();
}
if (m->actionTimer >= TIMER_CREDITS_PROGRESS && m->playerIndex == 0) {
sDispCreditsEntry = gCurrCreditsEntry;
}
if (m->actionTimer++ == TIMER_CREDITS_WARP && m->playerIndex == 0) {
level_trigger_warp(m, WARP_OP_CREDITS_NEXT);
}
m->marioObj->header.gfx.angle[1] += (gCurrCreditsEntry->unk02 & 0xC0) << 8;
}
if (m->actionTimer >= TIMER_CREDITS_PROGRESS && m->playerIndex == 0) {
sDispCreditsEntry = gCurrCreditsEntry;
}
if (m->actionTimer++ == TIMER_CREDITS_WARP && m->playerIndex == 0) {
level_trigger_warp(m, WARP_OP_CREDITS_NEXT);
}
m->marioObj->header.gfx.angle[1] += (gCurrCreditsEntry->unk02 & 0xC0) << 8;
return FALSE;
}