1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 14:31:17 +00:00

Add "do {} while (0);" to CLOSE_DISPS (#2025)

This commit is contained in:
cadmic 2024-08-10 15:48:27 -07:00 committed by GitHub
parent d495436190
commit 9eec8af498
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 37 additions and 159 deletions

View file

@ -764,11 +764,11 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
static u32 D_8098CF94;
static Vec3f D_8098CF98;
PlayState* play2 = (PlayState*)play;
s16 i;
f32 temp_f22;
DemoKankyo* this = (DemoKankyo*)thisx;
Gfx* disp;
Player* player = GET_PLAYER(play);
Player* player = GET_PLAYER(play2);
Vec3f camPos;
f32 translateX;
f32 translateY;
@ -800,7 +800,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
&this->unk_150[i].unk_1C) != 0) {
this->unk_150[i].unk_22++;
}
if (play->sceneId == SCENE_TEMPLE_OF_TIME && play->csCtx.curFrame == 25) {
if (play2->sceneId == SCENE_TEMPLE_OF_TIME && play2->csCtx.curFrame == 25) {
this->unk_150[i].unk_22++;
}
} else {
@ -810,7 +810,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
&this->unk_150[i].unk_1C) != 0) {
this->unk_150[i].unk_22++;
}
if (D_8098CF84 < play->csCtx.curFrame && this->actor.params == DEMOKANKYO_WARP_OUT) {
if (D_8098CF84 < play2->csCtx.curFrame && this->actor.params == DEMOKANKYO_WARP_OUT) {
this->unk_150[i].unk_22++;
}
}
@ -820,11 +820,11 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
case 2:
if (this->actor.params == DEMOKANKYO_WARP_OUT) {
if (i == 0) {
Environment_WarpSongLeave(play);
Environment_WarpSongLeave(play2);
this->unk_150[i].unk_22++;
}
} else if (i + 1 == this->sparkleCounter && play->csCtx.state == CS_STATE_IDLE) {
Interface_SetSubTimerToFinalSecond(play);
} else if (i + 1 == this->sparkleCounter && play2->csCtx.state == CS_STATE_IDLE) {
Interface_SetSubTimerToFinalSecond(play2);
Actor_Kill(&this->actor);
}
break;
@ -862,7 +862,6 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
translateZ = this->unk_150[i].unk_C.z + this->unk_150[i].unk_0.z;
if (this->unk_150[i].unk_22 < 2) {
disp = (Gfx*)(uintptr_t)gEffFlash1DL; // necessary to match but probably fake
if (linkAge != LINK_AGE_ADULT) {
Matrix_Translate(translateX, translateY, translateZ, MTXMODE_NEW);
} else {
@ -873,9 +872,9 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
this->unk_150[i].unk_18 * (0.018f * temp_f22), MTXMODE_APPLY);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, 255);
if (this->actor.params == DEMOKANKYO_WARP_OUT) {
gDPSetEnvColor(POLY_XLU_DISP++, sWarpSparkleEnvColors[play->msgCtx.lastPlayedSong].r,
sWarpSparkleEnvColors[play->msgCtx.lastPlayedSong].g,
sWarpSparkleEnvColors[play->msgCtx.lastPlayedSong].b, 255);
gDPSetEnvColor(POLY_XLU_DISP++, sWarpSparkleEnvColors[play2->msgCtx.lastPlayedSong].r,
sWarpSparkleEnvColors[play2->msgCtx.lastPlayedSong].g,
sWarpSparkleEnvColors[play2->msgCtx.lastPlayedSong].b, 255);
} else {
s8 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data;
@ -883,11 +882,11 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) {
sWarpSparkleEnvColors[respawnData].g, sWarpSparkleEnvColors[respawnData].b, 255);
}
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
Matrix_Mult(&play2->billboardMtxF, MTXMODE_APPLY);
Matrix_RotateZ(DEG_TO_RAD(this->unk_150[i].unk_24), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_demo_kankyo.c", 2011),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, disp);
gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL);
this->unk_150[i].unk_24 += 0x190;
}
}