Transition docs (#3322)
* transition variables renamed * transition circle * transition wipe * sand storm * remaining sceneloadflag rename * transition trigger macros * transition mode enum * transition type enum * tc set params * creg debug transitions
This commit is contained in:
@@ -72,13 +72,14 @@ void func_800BC590(PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_800BC5E0(PlayState* play, s32 transitionType) {
|
||||
void Gameplay_SetupTransition(PlayState* play, s32 transitionType) {
|
||||
TransitionContext* transitionCtx = &play->transitionCtx;
|
||||
|
||||
memset(transitionCtx,0, sizeof(TransitionContext));
|
||||
|
||||
transitionCtx->transitionType = transitionType;
|
||||
|
||||
// Circle Transition Types
|
||||
if ((transitionCtx->transitionType >> 5) == 1) {
|
||||
transitionCtx->init = TransitionCircle_Init;
|
||||
transitionCtx->destroy = TransitionCircle_Destroy;
|
||||
@@ -91,7 +92,7 @@ void func_800BC5E0(PlayState* play, s32 transitionType) {
|
||||
transitionCtx->setEnvColor = TransitionCircle_SetEnvColor;
|
||||
} else {
|
||||
switch (transitionCtx->transitionType) {
|
||||
case 1:
|
||||
case TRANS_TYPE_TRIFORCE:
|
||||
transitionCtx->init = TransitionTriforce_Init;
|
||||
transitionCtx->destroy = TransitionTriforce_Destroy;
|
||||
transitionCtx->start = TransitionTriforce_Start;
|
||||
@@ -102,8 +103,8 @@ void func_800BC5E0(PlayState* play, s32 transitionType) {
|
||||
transitionCtx->setColor = TransitionTriforce_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
break;
|
||||
case 0:
|
||||
case 8:
|
||||
case TRANS_TYPE_WIPE:
|
||||
case TRANS_TYPE_WIPE_FAST:
|
||||
transitionCtx->init = TransitionWipe_Init;
|
||||
transitionCtx->destroy = TransitionWipe_Destroy;
|
||||
transitionCtx->start = TransitionWipe_Start;
|
||||
@@ -114,16 +115,16 @@ void func_800BC5E0(PlayState* play, s32 transitionType) {
|
||||
transitionCtx->setColor = TransitionWipe_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 13:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
case TRANS_TYPE_FADE_BLACK:
|
||||
case TRANS_TYPE_FADE_WHITE:
|
||||
case TRANS_TYPE_FADE_BLACK_FAST:
|
||||
case TRANS_TYPE_FADE_WHITE_FAST:
|
||||
case TRANS_TYPE_FADE_BLACK_SLOW:
|
||||
case TRANS_TYPE_FADE_WHITE_SLOW:
|
||||
case TRANS_TYPE_FADE_WHITE_CS_DELAYED:
|
||||
case TRANS_TYPE_FADE_WHITE_INSTANT:
|
||||
case TRANS_TYPE_FADE_GREEN:
|
||||
case TRANS_TYPE_FADE_BLUE:
|
||||
transitionCtx->init = TransitionFade_Init;
|
||||
transitionCtx->destroy = TransitionFade_Destroy;
|
||||
transitionCtx->start = TransitionFade_Start;
|
||||
@@ -134,24 +135,24 @@ void func_800BC5E0(PlayState* play, s32 transitionType) {
|
||||
transitionCtx->setColor = TransitionFade_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
play->transitionMode = 4;
|
||||
case TRANS_TYPE_FILL_WHITE2:
|
||||
case TRANS_TYPE_FILL_WHITE:
|
||||
play->transitionMode = TRANS_MODE_FILL_WHITE_INIT;
|
||||
break;
|
||||
case 11:
|
||||
play->transitionMode = 10;
|
||||
case TRANS_TYPE_INSTANT:
|
||||
play->transitionMode = TRANS_MODE_INSTANT;
|
||||
break;
|
||||
case 12:
|
||||
play->transitionMode = 7;
|
||||
case TRANS_TYPE_FILL_BROWN:
|
||||
play->transitionMode = TRANS_MODE_FILL_BROWN_INIT;
|
||||
break;
|
||||
case 14:
|
||||
play->transitionMode = 12;
|
||||
case TRANS_TYPE_SANDSTORM_PERSIST:
|
||||
play->transitionMode = TRANS_MODE_SANDSTORM_INIT;
|
||||
break;
|
||||
case 15:
|
||||
play->transitionMode = 14;
|
||||
case TRANS_TYPE_SANDSTORM_END:
|
||||
play->transitionMode = TRANS_MODE_SANDSTORM_END_INIT;
|
||||
break;
|
||||
case 16:
|
||||
play->transitionMode = 16;
|
||||
case TRANS_TYPE_CS_BLACK_FILL:
|
||||
play->transitionMode = TRANS_MODE_CS_BLACK_FILL_INIT;
|
||||
break;
|
||||
default:
|
||||
Fault_AddHungupAndCrash(__FILE__, __LINE__);
|
||||
@@ -200,10 +201,10 @@ void Play_Destroy(GameState* thisx) {
|
||||
gTrnsnUnkState = 0;
|
||||
}
|
||||
|
||||
if (play->transitionMode == 3) {
|
||||
if (play->transitionMode == TRANS_MODE_INSTANCE_RUNNING) {
|
||||
play->transitionCtx.destroy(&play->transitionCtx.data);
|
||||
func_800BC88C(play);
|
||||
play->transitionMode = 0;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
}
|
||||
|
||||
ShrinkWindow_Destroy();
|
||||
@@ -229,7 +230,7 @@ void GivePlayerRandoRewardSongOfTime(PlayState* play, RandomizerCheck check) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(play, player) &&
|
||||
!Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransitionType == 0xFF && !gSaveContext.pendingIceTrapCount) {
|
||||
!Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT && !gSaveContext.pendingIceTrapCount) {
|
||||
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
|
||||
GiveItemEntryWithoutActor(play, getItemEntry);
|
||||
player->pendingFlag.flagID = 0x1F;
|
||||
@@ -442,7 +443,7 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(PlayState* play, RandomizerCheck
|
||||
if (meetsRequirements && LINK_IS_ADULT &&
|
||||
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TEMPLE_OF_TIME) &&
|
||||
!Flags_GetTreasure(play, 0x1E) && player != NULL && !Player_InBlockingCsMode(play, player) &&
|
||||
play->sceneLoadFlag == 0) {
|
||||
play->transitionTrigger == TRANS_TRIGGER_OFF) {
|
||||
GetItemEntry getItem = Randomizer_GetItemFromKnownCheck(check, GI_ARROW_LIGHT);
|
||||
if (GiveItemEntryWithoutActor(play, getItem)) {
|
||||
player->pendingFlag.flagID = 0x1E;
|
||||
@@ -624,12 +625,12 @@ void Play_Init(GameState* thisx) {
|
||||
PreRender_SetValuesSave(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0);
|
||||
PreRender_SetValues(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
|
||||
gTrnsnUnkState = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
|
||||
if (CVarGetInteger("gSceneTransitions", 255)!= 255){
|
||||
play->transitionMode = CVarGetInteger("gSceneTransitions", 0);
|
||||
gSaveContext.nextTransitionType = CVarGetInteger("gSceneTransitions", 0);
|
||||
play->fadeTransition = CVarGetInteger("gSceneTransitions", 0);
|
||||
play->transitionType = CVarGetInteger("gSceneTransitions", 0);
|
||||
}
|
||||
|
||||
FrameAdvance_Init(&play->frameAdvCtx);
|
||||
@@ -637,21 +638,21 @@ void Play_Init(GameState* thisx) {
|
||||
Matrix_Init(&play->state);
|
||||
play->state.main = Play_Main;
|
||||
play->state.destroy = Play_Destroy;
|
||||
play->sceneLoadFlag = -0x14;
|
||||
play->transitionTrigger = TRANS_TRIGGER_END;
|
||||
play->unk_11E16 = 0xFF;
|
||||
play->unk_11E18 = 0;
|
||||
play->unk_11DE9 = 0;
|
||||
|
||||
if (gSaveContext.gameMode != 1) {
|
||||
if (gSaveContext.nextTransitionType == 0xFF) {
|
||||
play->fadeTransition =
|
||||
if (gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) {
|
||||
play->transitionType =
|
||||
(gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field >> 7) & 0x7F; // Fade In
|
||||
} else {
|
||||
play->fadeTransition = gSaveContext.nextTransitionType;
|
||||
gSaveContext.nextTransitionType = 0xFF;
|
||||
play->transitionType = gSaveContext.nextTransitionType;
|
||||
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
|
||||
}
|
||||
} else {
|
||||
play->fadeTransition = 6;
|
||||
play->transitionType = TRANS_TYPE_FADE_BLACK_SLOW;
|
||||
}
|
||||
|
||||
ShrinkWindow_Init();
|
||||
@@ -808,8 +809,8 @@ void Play_Update(PlayState* play) {
|
||||
gSegments[2] = VIRTUAL_TO_PHYSICAL(play->sceneSegment);
|
||||
|
||||
if (FrameAdvance_Update(&play->frameAdvCtx, &input[1])) {
|
||||
if ((play->transitionMode == 0) && (play->sceneLoadFlag != 0)) {
|
||||
play->transitionMode = 1;
|
||||
if ((play->transitionMode == TRANS_MODE_OFF) && (play->transitionTrigger != TRANS_TRIGGER_OFF)) {
|
||||
play->transitionMode = TRANS_MODE_SETUP;
|
||||
}
|
||||
|
||||
// Gameplay stats: Count button presses
|
||||
@@ -858,8 +859,8 @@ void Play_Update(PlayState* play) {
|
||||
|
||||
if (play->transitionMode) {
|
||||
switch (play->transitionMode) {
|
||||
case 1:
|
||||
if (play->sceneLoadFlag != -0x14) {
|
||||
case TRANS_MODE_SETUP:
|
||||
if (play->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
s16 sp6E = 0;
|
||||
Interface_ChangeAlpha(1);
|
||||
|
||||
@@ -870,7 +871,7 @@ void Play_Update(PlayState* play) {
|
||||
if (!(gEntranceTable[play->nextEntranceIndex + sp6E].field & 0x8000)) { // Continue BGM Off
|
||||
// "Sound initalized. 111"
|
||||
osSyncPrintf("\n\n\nサウンドイニシャル来ました。111");
|
||||
if ((play->fadeTransition < 56) && !Environment_IsForcedSequenceDisabled()) {
|
||||
if ((play->transitionType < TRANS_TYPE_MAX) && !Environment_IsForcedSequenceDisabled()) {
|
||||
// "Sound initalized. 222"
|
||||
osSyncPrintf("\n\n\nサウンドイニシャル来ました。222");
|
||||
func_800F6964(0x14);
|
||||
@@ -880,58 +881,59 @@ void Play_Update(PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
if (CREG(11) == 0) {
|
||||
func_800BC5E0(play, play->fadeTransition);
|
||||
if (!R_TRANS_DBG_ENABLED) {
|
||||
Gameplay_SetupTransition(play, play->transitionType);
|
||||
} else {
|
||||
func_800BC5E0(play, CREG(12));
|
||||
Gameplay_SetupTransition(play, R_TRANS_DBG_TYPE);
|
||||
}
|
||||
|
||||
if (play->transitionMode >= 4) {
|
||||
if (play->transitionMode >= TRANS_MODE_FILL_WHITE_INIT) {
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
case TRANS_MODE_INSTANCE_INIT:
|
||||
play->transitionCtx.init(&play->transitionCtx.data);
|
||||
|
||||
// Circle Transition Types
|
||||
if ((play->transitionCtx.transitionType >> 5) == 1) {
|
||||
play->transitionCtx.setType(&play->transitionCtx.data,
|
||||
play->transitionCtx.transitionType | 0x80);
|
||||
play->transitionCtx.transitionType | TC_SET_PARAMS);
|
||||
}
|
||||
|
||||
gSaveContext.transWipeSpeed = 14;
|
||||
if ((play->transitionCtx.transitionType == 8) ||
|
||||
(play->transitionCtx.transitionType == 9)) {
|
||||
if ((play->transitionCtx.transitionType == TRANS_TYPE_WIPE_FAST) ||
|
||||
(play->transitionCtx.transitionType == TRANS_TYPE_FILL_WHITE2)) {
|
||||
gSaveContext.transWipeSpeed = 28;
|
||||
}
|
||||
|
||||
gSaveContext.transFadeDuration = 60;
|
||||
if ((play->transitionCtx.transitionType == 4) ||
|
||||
(play->transitionCtx.transitionType == 5)) {
|
||||
if ((play->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_FAST) ||
|
||||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST)) {
|
||||
gSaveContext.transFadeDuration = 20;
|
||||
} else if ((play->transitionCtx.transitionType == 6) ||
|
||||
(play->transitionCtx.transitionType == 7)) {
|
||||
} else if ((play->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_SLOW) ||
|
||||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW)) {
|
||||
gSaveContext.transFadeDuration = 150;
|
||||
} else if (play->transitionCtx.transitionType == 17) {
|
||||
} else if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT) {
|
||||
gSaveContext.transFadeDuration = 2;
|
||||
}
|
||||
|
||||
if ((play->transitionCtx.transitionType == 3) ||
|
||||
(play->transitionCtx.transitionType == 5) ||
|
||||
(play->transitionCtx.transitionType == 7) ||
|
||||
(play->transitionCtx.transitionType == 13) ||
|
||||
(play->transitionCtx.transitionType == 17)) {
|
||||
if ((play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE) ||
|
||||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST) ||
|
||||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW) ||
|
||||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) ||
|
||||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT)) {
|
||||
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(160, 160, 160, 255));
|
||||
if (play->transitionCtx.setEnvColor != NULL) {
|
||||
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
|
||||
RGBA8(160, 160, 160, 255));
|
||||
}
|
||||
} else if (play->transitionCtx.transitionType == 18) {
|
||||
} else if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_GREEN) {
|
||||
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(140, 140, 100, 255));
|
||||
if (play->transitionCtx.setEnvColor != NULL) {
|
||||
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
|
||||
RGBA8(140, 140, 100, 255));
|
||||
}
|
||||
} else if (play->transitionCtx.transitionType == 19) {
|
||||
} else if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_BLUE) {
|
||||
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(70, 100, 110, 255));
|
||||
if (play->transitionCtx.setEnvColor != NULL) {
|
||||
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
|
||||
@@ -944,7 +946,7 @@ void Play_Update(PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
if (play->sceneLoadFlag == -0x14) {
|
||||
if (play->transitionTrigger == TRANS_TRIGGER_END) {
|
||||
play->transitionCtx.setType(&play->transitionCtx.data, 1);
|
||||
} else {
|
||||
play->transitionCtx.setType(&play->transitionCtx.data, 2);
|
||||
@@ -952,22 +954,22 @@ void Play_Update(PlayState* play) {
|
||||
|
||||
play->transitionCtx.start(&play->transitionCtx);
|
||||
|
||||
if (play->transitionCtx.transitionType == 13) {
|
||||
play->transitionMode = 11;
|
||||
if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) {
|
||||
play->transitionMode = TRANS_MODE_INSTANCE_WAIT;
|
||||
} else {
|
||||
play->transitionMode = 3;
|
||||
play->transitionMode = TRANS_MODE_INSTANCE_RUNNING;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case TRANS_MODE_INSTANCE_RUNNING:
|
||||
if (play->transitionCtx.isDone(&play->transitionCtx) != 0) {
|
||||
if (play->transitionCtx.transitionType >= 56) {
|
||||
if (play->sceneLoadFlag == -0x14) {
|
||||
if (play->transitionCtx.transitionType >= TRANS_TYPE_MAX) {
|
||||
if (play->transitionTrigger == TRANS_TRIGGER_END) {
|
||||
play->transitionCtx.destroy(&play->transitionCtx);
|
||||
func_800BC88C(play);
|
||||
play->transitionMode = 0;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
}
|
||||
} else if (play->sceneLoadFlag != -0x14) {
|
||||
} else if (play->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
play->state.running = 0;
|
||||
if (gSaveContext.gameMode != 2) {
|
||||
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
|
||||
@@ -981,7 +983,7 @@ void Play_Update(PlayState* play) {
|
||||
} else {
|
||||
play->transitionCtx.destroy(&play->transitionCtx);
|
||||
func_800BC88C(play);
|
||||
play->transitionMode = 0;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
if (gTrnsnUnkState == 3) {
|
||||
TransitionUnk_Destroy(&sTrnsnUnk);
|
||||
gTrnsnUnkState = 0;
|
||||
@@ -991,7 +993,7 @@ void Play_Update(PlayState* play) {
|
||||
// Transition end for standard transitions
|
||||
GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum);
|
||||
}
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
} else {
|
||||
play->transitionCtx.update(&play->transitionCtx.data, R_UPDATE_RATE);
|
||||
}
|
||||
@@ -999,104 +1001,104 @@ void Play_Update(PlayState* play) {
|
||||
}
|
||||
|
||||
switch (play->transitionMode) {
|
||||
case 4:
|
||||
case TRANS_MODE_FILL_WHITE_INIT:
|
||||
D_801614C8 = 0;
|
||||
play->envCtx.fillScreen = true;
|
||||
play->envCtx.screenFillColor[0] = 160;
|
||||
play->envCtx.screenFillColor[1] = 160;
|
||||
play->envCtx.screenFillColor[2] = 160;
|
||||
if (play->sceneLoadFlag != -0x14) {
|
||||
if (play->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
play->envCtx.screenFillColor[3] = 0;
|
||||
play->transitionMode = 5;
|
||||
play->transitionMode = TRANS_MODE_FILL_IN;
|
||||
} else {
|
||||
play->envCtx.screenFillColor[3] = 255;
|
||||
play->transitionMode = 6;
|
||||
play->transitionMode = TRANS_MODE_FILL_OUT;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
case TRANS_MODE_FILL_IN:
|
||||
play->envCtx.screenFillColor[3] = (D_801614C8 / 20.0f) * 255.0f;
|
||||
if (D_801614C8 >= 20 && 1) {
|
||||
play->state.running = 0;
|
||||
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
|
||||
gSaveContext.entranceIndex = play->nextEntranceIndex;
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
} else {
|
||||
D_801614C8++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
case TRANS_MODE_FILL_OUT:
|
||||
play->envCtx.screenFillColor[3] = (1 - D_801614C8 / 20.0f) * 255.0f;
|
||||
if (D_801614C8 >= 20 && 1) {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
play->envCtx.fillScreen = false;
|
||||
} else {
|
||||
D_801614C8++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case TRANS_MODE_FILL_BROWN_INIT:
|
||||
D_801614C8 = 0;
|
||||
play->envCtx.fillScreen = true;
|
||||
play->envCtx.screenFillColor[0] = 170;
|
||||
play->envCtx.screenFillColor[1] = 160;
|
||||
play->envCtx.screenFillColor[2] = 150;
|
||||
if (play->sceneLoadFlag != -0x14) {
|
||||
if (play->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
play->envCtx.screenFillColor[3] = 0;
|
||||
play->transitionMode = 5;
|
||||
play->transitionMode = TRANS_MODE_FILL_IN;
|
||||
} else {
|
||||
play->envCtx.screenFillColor[3] = 255;
|
||||
play->transitionMode = 6;
|
||||
play->transitionMode = TRANS_MODE_FILL_OUT;
|
||||
}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
if (play->sceneLoadFlag != -0x14) {
|
||||
case TRANS_MODE_INSTANT:
|
||||
if (play->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
play->state.running = 0;
|
||||
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
|
||||
gSaveContext.entranceIndex = play->nextEntranceIndex;
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
} else {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
case TRANS_MODE_INSTANCE_WAIT:
|
||||
if (gSaveContext.cutsceneTransitionControl != 0) {
|
||||
play->transitionMode = 3;
|
||||
play->transitionMode = TRANS_MODE_INSTANCE_RUNNING;
|
||||
}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
if (play->sceneLoadFlag != -0x14) {
|
||||
play->envCtx.sandstormState = 1;
|
||||
play->transitionMode = 13;
|
||||
case TRANS_MODE_SANDSTORM_INIT:
|
||||
if (play->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
play->envCtx.sandstormState = SANDSTORM_FILL;
|
||||
play->transitionMode = TRANS_MODE_SANDSTORM;
|
||||
} else {
|
||||
play->envCtx.sandstormState = 2;
|
||||
play->envCtx.sandstormState = SANDSTORM_UNFILL;
|
||||
play->envCtx.sandstormPrimA = 255;
|
||||
play->envCtx.sandstormEnvA = 255;
|
||||
play->transitionMode = 13;
|
||||
play->transitionMode = TRANS_MODE_SANDSTORM;
|
||||
}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
case TRANS_MODE_SANDSTORM:
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
if (play->sceneLoadFlag == -0x14) {
|
||||
if (play->transitionTrigger == TRANS_TRIGGER_END) {
|
||||
if (play->envCtx.sandstormPrimA < 110) {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
|
||||
// Transition end for sandstorm effect (delayed until effect is finished)
|
||||
GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum);
|
||||
@@ -1106,34 +1108,34 @@ void Play_Update(PlayState* play) {
|
||||
play->state.running = 0;
|
||||
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
|
||||
gSaveContext.entranceIndex = play->nextEntranceIndex;
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
if (play->sceneLoadFlag == -0x14) {
|
||||
play->envCtx.sandstormState = 4;
|
||||
case TRANS_MODE_SANDSTORM_END_INIT:
|
||||
if (play->transitionTrigger == TRANS_TRIGGER_END) {
|
||||
play->envCtx.sandstormState = SANDSTORM_DISSIPATE;
|
||||
play->envCtx.sandstormPrimA = 255;
|
||||
play->envCtx.sandstormEnvA = 255;
|
||||
// "It's here!!!!!!!!!"
|
||||
LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!");
|
||||
play->transitionMode = 15;
|
||||
play->transitionMode = TRANS_MODE_SANDSTORM_END;
|
||||
} else {
|
||||
play->transitionMode = 12;
|
||||
play->transitionMode = TRANS_MODE_SANDSTORM_INIT;
|
||||
}
|
||||
break;
|
||||
|
||||
case 15:
|
||||
case TRANS_MODE_SANDSTORM_END:
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
if (play->sceneLoadFlag == -0x14) {
|
||||
if (play->transitionTrigger == TRANS_TRIGGER_END) {
|
||||
if (play->envCtx.sandstormPrimA <= 0) {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
|
||||
// Transition end for sandstorm effect (delayed until effect is finished)
|
||||
GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum);
|
||||
@@ -1141,24 +1143,24 @@ void Play_Update(PlayState* play) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
case TRANS_MODE_CS_BLACK_FILL_INIT:
|
||||
D_801614C8 = 0;
|
||||
play->envCtx.fillScreen = true;
|
||||
play->envCtx.screenFillColor[0] = 0;
|
||||
play->envCtx.screenFillColor[1] = 0;
|
||||
play->envCtx.screenFillColor[2] = 0;
|
||||
play->envCtx.screenFillColor[3] = 255;
|
||||
play->transitionMode = 17;
|
||||
play->transitionMode = TRANS_MODE_CS_BLACK_FILL;
|
||||
break;
|
||||
|
||||
case 17:
|
||||
case TRANS_MODE_CS_BLACK_FILL:
|
||||
if (gSaveContext.cutsceneTransitionControl != 0) {
|
||||
play->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl;
|
||||
if (gSaveContext.cutsceneTransitionControl < 0x65) {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
play->sceneLoadFlag = 0;
|
||||
play->transitionMode = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
play->transitionMode = TRANS_MODE_OFF;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1546,8 +1548,8 @@ void Play_Draw(PlayState* play) {
|
||||
gSPDisplayList(OVERLAY_DISP++, gfxP);
|
||||
gSPGrayscale(gfxP++, false);
|
||||
|
||||
if ((play->transitionMode == 3) || (play->transitionMode == 11) ||
|
||||
(play->transitionCtx.transitionType >= 56)) {
|
||||
if ((play->transitionMode == TRANS_MODE_INSTANCE_RUNNING) || (play->transitionMode == TRANS_MODE_INSTANCE_WAIT) ||
|
||||
(play->transitionCtx.transitionType >= TRANS_TYPE_MAX)) {
|
||||
View view;
|
||||
|
||||
View_Init(&view, gfxCtx);
|
||||
@@ -1709,7 +1711,7 @@ void Play_Draw(PlayState* play) {
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(88) != 0)) {
|
||||
if (play->envCtx.sandstormState != 0) {
|
||||
if (play->envCtx.sandstormState != SANDSTORM_OFF) {
|
||||
Environment_DrawSandstorm(play, play->envCtx.sandstormState);
|
||||
}
|
||||
}
|
||||
@@ -2253,14 +2255,14 @@ void Play_TriggerVoidOut(PlayState* play) {
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = play->actorCtx.flags.tempSwch;
|
||||
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = play->actorCtx.flags.tempCollect;
|
||||
gSaveContext.respawnFlag = 1;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
|
||||
play->fadeTransition = 2;
|
||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
}
|
||||
|
||||
void Play_LoadToLastEntrance(PlayState* play) {
|
||||
gSaveContext.respawnFlag = -1;
|
||||
play->sceneLoadFlag = 0x14;
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
|
||||
if ((play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_INTERIOR) || (play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR) ||
|
||||
(play->sceneNum == SCENE_INSIDE_GANONS_CASTLE_COLLAPSE) || (play->sceneNum == SCENE_GANON_BOSS)) {
|
||||
@@ -2273,7 +2275,7 @@ void Play_LoadToLastEntrance(PlayState* play) {
|
||||
play->nextEntranceIndex = gSaveContext.entranceIndex;
|
||||
}
|
||||
|
||||
play->fadeTransition = 2;
|
||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
}
|
||||
|
||||
void Play_TriggerRespawn(PlayState* play) {
|
||||
|
||||
Reference in New Issue
Block a user