mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00:00
Decompile z_kankyo (#956)
* working * start color switch * progress * progress * progress on bgm func * progress * game over matched (except the rodata meme) * start update * progress * lightning docs done * progress * progress * progress * progress * progress * can compile at least * suns state, progress on kankyo_update * some new names * progress * progress * progress * new functions * cleanup * more matches * another match * now functional * format * better match * hugely improved update * cleanup/review * remove old changes * review2 * review3 * missed one * review4 * change asm filenames * update doorwarp1 * review5 * Kankyo_ -> Environment_ * format * merge master and format functions.h Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com> Co-authored-by: fig <fig02srl@gmail.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
This commit is contained in:
parent
50095d427c
commit
e51f50f0ff
139 changed files with 3478 additions and 6277 deletions
|
@ -229,7 +229,7 @@ void BgSpot00Hanebasi_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->fadeTransition = 4;
|
||||
} else if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 3000.0f, 0x7530)) {
|
||||
globalCtx->envCtx.gloomySkyEvent = 1;
|
||||
globalCtx->envCtx.gloomySkyMode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -238,20 +238,20 @@ void BgSpot00Hanebasi_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
u16 dayTime;
|
||||
s32 tmp;
|
||||
|
||||
if (D_8011FB40 == 50) {
|
||||
if (gTimeIncrement == 50) {
|
||||
tmp = 0xD556;
|
||||
|
||||
if (gSaveContext.dayTime >= 0xD557) {
|
||||
tmp = 0x1D556;
|
||||
}
|
||||
|
||||
D_8011FB40 = (tmp - gSaveContext.dayTime) * (1.0f / 350.0f);
|
||||
gTimeIncrement = (tmp - gSaveContext.dayTime) * (1.0f / 350.0f);
|
||||
}
|
||||
|
||||
dayTime = gSaveContext.dayTime;
|
||||
|
||||
if ((dayTime >= 0x2AAC) && (dayTime < 0x3000) && (gSaveContext.sceneSetupIndex == 5)) {
|
||||
D_8011FB40 = 0;
|
||||
gTimeIncrement = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ s32 func_808AB29C(BgSpot01Idohashira* this, GlobalContext* globalCtx) {
|
|||
|
||||
npcAction = BgSpot01Idohashira_GetNpcAction(globalCtx, 2);
|
||||
if (npcAction != NULL) {
|
||||
temp_f0 = func_8006F93C(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames);
|
||||
temp_f0 = Environment_LerpWeight(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames);
|
||||
initPos = this->dyna.actor.home.pos;
|
||||
endX = npcAction->endPos.x;
|
||||
tempY = ((kREG(10) + 1100.0f) / 10.0f) + npcAction->endPos.y;
|
||||
|
|
|
@ -298,8 +298,8 @@ void func_808AD450(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
lerp = func_8006F93C(globalCtx->csCtx.npcActions[2]->endFrame, globalCtx->csCtx.npcActions[2]->startFrame,
|
||||
globalCtx->csCtx.frames);
|
||||
lerp = Environment_LerpWeight(globalCtx->csCtx.npcActions[2]->endFrame,
|
||||
globalCtx->csCtx.npcActions[2]->startFrame, globalCtx->csCtx.frames);
|
||||
|
||||
// should be able to remove & 0xFFFF with some other change
|
||||
if ((globalCtx->csCtx.npcActions[2]->action & 0xFFFF) == 2) {
|
||||
|
|
|
@ -894,11 +894,11 @@ void BossDodongo_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Math_SmoothStepToF(&this->unk_240, 0.0f, 1, 10.0f, 0.0);
|
||||
}
|
||||
|
||||
if ((globalCtx->envCtx.unk_8C[1][2] == 0) && (globalCtx->envCtx.unk_8C[0][2] == 0)) {
|
||||
globalCtx->envCtx.unk_8C[1][0] = (u8)this->unk_240;
|
||||
globalCtx->envCtx.unk_8C[1][1] = (u8)(this->unk_240 * 0.1f);
|
||||
globalCtx->envCtx.unk_8C[0][0] = (u8)this->unk_240;
|
||||
globalCtx->envCtx.unk_8C[0][1] = (u8)(this->unk_240 * 0.1f);
|
||||
if ((globalCtx->envCtx.adjLight1Color[2] == 0) && (globalCtx->envCtx.adjAmbientColor[2] == 0)) {
|
||||
globalCtx->envCtx.adjLight1Color[0] = (u8)this->unk_240;
|
||||
globalCtx->envCtx.adjLight1Color[1] = (u8)(this->unk_240 * 0.1f);
|
||||
globalCtx->envCtx.adjAmbientColor[0] = (u8)this->unk_240;
|
||||
globalCtx->envCtx.adjAmbientColor[1] = (u8)(this->unk_240 * 0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -916,10 +916,10 @@ void BossDodongo_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Math_SmoothStepToF(&this->colorFilterMin, 900.0f, 1, 10.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterMax, 1099.0f, 1, 10.0f, 0.0);
|
||||
} else {
|
||||
Math_SmoothStepToF(&this->colorFilterR, globalCtx->lightCtx.unk_07, 1, 5.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterG, globalCtx->lightCtx.unk_08, 1.0f, 5.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterB, globalCtx->lightCtx.unk_09, 1.0f, 5.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterMin, globalCtx->lightCtx.unk_0A, 1.0, 5.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterR, globalCtx->lightCtx.fogColor[0], 1, 5.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterG, globalCtx->lightCtx.fogColor[1], 1.0f, 5.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterB, globalCtx->lightCtx.fogColor[2], 1.0f, 5.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterMin, globalCtx->lightCtx.fogNear, 1.0, 5.0f, 0.0);
|
||||
Math_SmoothStepToF(&this->colorFilterMax, 1000.0f, 1, 5.0f, 0.0);
|
||||
}
|
||||
|
||||
|
@ -1137,7 +1137,7 @@ void BossDodongo_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, BossDodongo_OverrideLimbDraw,
|
||||
BossDodongo_PostLimbDraw, this);
|
||||
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_dodongo.c", 3981);
|
||||
|
||||
|
|
|
@ -1644,7 +1644,7 @@ void BossFd_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
BossFd_DrawBody(globalCtx, this);
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd.c", 4243);
|
||||
}
|
||||
|
||||
|
|
|
@ -1213,7 +1213,7 @@ void BossFd2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, BossFd2_OverrideLimbDraw, BossFd2_PostLimbDraw, &this->actor);
|
||||
BossFd2_DrawMane(this, globalCtx);
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
}
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_fd2.c", 2688);
|
||||
}
|
||||
|
|
|
@ -712,11 +712,12 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
func_800A9F6C(0.0f, 0xFF, 0xA, 0x32);
|
||||
}
|
||||
if (this->unk_398 >= 229) {
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.unk_E2[0] = globalCtx->envCtx.unk_E2[1] = globalCtx->envCtx.unk_E2[2] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[3] = 0x64;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] =
|
||||
globalCtx->envCtx.screenFillColor[2] = 255;
|
||||
globalCtx->envCtx.screenFillColor[3] = 100;
|
||||
if (this->unk_398 == 234) {
|
||||
globalCtx->envCtx.unk_E1 = 0;
|
||||
globalCtx->envCtx.fillScreen = false;
|
||||
this->unk_39C = 24;
|
||||
this->unk_398 = 0;
|
||||
sp68 = player->actor.world.pos;
|
||||
|
@ -2078,13 +2079,13 @@ void BossGanon2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->unk_332--;
|
||||
}
|
||||
if ((globalCtx->envCtx.unk_D8 > 0.0f) && (this->unk_336 != 0)) {
|
||||
globalCtx->envCtx.unk_E9 = 1;
|
||||
globalCtx->envCtx.unk_EA[0] = 0xFF;
|
||||
globalCtx->envCtx.unk_EA[1] = 0xFF;
|
||||
globalCtx->envCtx.unk_EA[2] = 0xFF;
|
||||
globalCtx->envCtx.unk_EA[3] = (s16)(globalCtx->envCtx.unk_D8 * 200.0f);
|
||||
globalCtx->envCtx.customSkyboxFilter = 1;
|
||||
globalCtx->envCtx.skyboxFilterColor[0] = 255;
|
||||
globalCtx->envCtx.skyboxFilterColor[1] = 255;
|
||||
globalCtx->envCtx.skyboxFilterColor[2] = 255;
|
||||
globalCtx->envCtx.skyboxFilterColor[3] = (s16)(globalCtx->envCtx.unk_D8 * 200.0f);
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E9 = 0;
|
||||
globalCtx->envCtx.customSkyboxFilter = 0;
|
||||
}
|
||||
globalCtx->envCtx.unk_BF = 0;
|
||||
globalCtx->envCtx.unk_DC = 2;
|
||||
|
@ -2749,7 +2750,7 @@ void BossGanon2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, BossGanon2_OverrideLimbDraw, BossGanon2_PostLimbDraw,
|
||||
this);
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
BossGanon2_GenShadowTexture(shadowTexture, this, globalCtx);
|
||||
BossGanon2_DrawShadowTexture(shadowTexture, this, globalCtx);
|
||||
break;
|
||||
|
@ -2872,9 +2873,9 @@ void func_809060E8(GlobalContext* globalCtx) {
|
|||
f32 angle;
|
||||
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
spA0.x = globalCtx->envCtx.unk_2A;
|
||||
spA0.y = globalCtx->envCtx.unk_2B;
|
||||
spA0.z = globalCtx->envCtx.unk_2C;
|
||||
spA0.x = globalCtx->envCtx.dirLight1.params.dir.x;
|
||||
spA0.y = globalCtx->envCtx.dirLight1.params.dir.y;
|
||||
spA0.z = globalCtx->envCtx.dirLight1.params.dir.z;
|
||||
func_8002EABC(&effect->position, &globalCtx->view.eye, &spA0, globalCtx->state.gfxCtx);
|
||||
Matrix_Translate(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_Scale(0.03f, 0.03f, 0.03f, MTXMODE_APPLY);
|
||||
|
|
|
@ -1519,7 +1519,7 @@ void BossGanondrof_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, BossGanondrof_OverrideLimbDraw,
|
||||
BossGanondrof_PostLimbDraw, this);
|
||||
osSyncPrintf("DRAW 22\n");
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_boss_ganondrof.c", 3814);
|
||||
osSyncPrintf("DRAW END %d\n", this->actor.params);
|
||||
}
|
||||
|
|
|
@ -1198,57 +1198,57 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->blinkTimer != 0) {
|
||||
this->blinkTimer--;
|
||||
globalCtx->envCtx.unk_8C[0][0] += 40;
|
||||
globalCtx->envCtx.unk_8C[0][1] += 40;
|
||||
globalCtx->envCtx.unk_8C[0][2] += 80;
|
||||
globalCtx->envCtx.unk_8C[2][0] += 10;
|
||||
globalCtx->envCtx.unk_8C[2][1] += 10;
|
||||
globalCtx->envCtx.unk_8C[2][2] += 20;
|
||||
globalCtx->envCtx.adjAmbientColor[0] += 40;
|
||||
globalCtx->envCtx.adjAmbientColor[1] += 40;
|
||||
globalCtx->envCtx.adjAmbientColor[2] += 80;
|
||||
globalCtx->envCtx.adjFogColor[0] += 10;
|
||||
globalCtx->envCtx.adjFogColor[1] += 10;
|
||||
globalCtx->envCtx.adjFogColor[2] += 20;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_8C[0][0] -= 20;
|
||||
globalCtx->envCtx.unk_8C[0][1] -= 20;
|
||||
globalCtx->envCtx.unk_8C[0][2] -= 40;
|
||||
globalCtx->envCtx.unk_8C[2][0] -= 5;
|
||||
globalCtx->envCtx.unk_8C[2][1] -= 5;
|
||||
globalCtx->envCtx.unk_8C[2][2] -= 10;
|
||||
globalCtx->envCtx.adjAmbientColor[0] -= 20;
|
||||
globalCtx->envCtx.adjAmbientColor[1] -= 20;
|
||||
globalCtx->envCtx.adjAmbientColor[2] -= 40;
|
||||
globalCtx->envCtx.adjFogColor[0] -= 5;
|
||||
globalCtx->envCtx.adjFogColor[1] -= 5;
|
||||
globalCtx->envCtx.adjFogColor[2] -= 10;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[0][0] > 200) {
|
||||
globalCtx->envCtx.unk_8C[0][0] = 200;
|
||||
if (globalCtx->envCtx.adjAmbientColor[0] > 200) {
|
||||
globalCtx->envCtx.adjAmbientColor[0] = 200;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[0][1] > 200) {
|
||||
globalCtx->envCtx.unk_8C[0][1] = 200;
|
||||
if (globalCtx->envCtx.adjAmbientColor[1] > 200) {
|
||||
globalCtx->envCtx.adjAmbientColor[1] = 200;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[0][2] > 200) {
|
||||
globalCtx->envCtx.unk_8C[0][2] = 200;
|
||||
if (globalCtx->envCtx.adjAmbientColor[2] > 200) {
|
||||
globalCtx->envCtx.adjAmbientColor[2] = 200;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[2][0] > 70) {
|
||||
globalCtx->envCtx.unk_8C[2][0] = 70;
|
||||
if (globalCtx->envCtx.adjFogColor[0] > 70) {
|
||||
globalCtx->envCtx.adjFogColor[0] = 70;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[2][1] > 70) {
|
||||
globalCtx->envCtx.unk_8C[2][1] = 70;
|
||||
if (globalCtx->envCtx.adjFogColor[1] > 70) {
|
||||
globalCtx->envCtx.adjFogColor[1] = 70;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[2][2] > 140) {
|
||||
globalCtx->envCtx.unk_8C[2][2] = 140;
|
||||
if (globalCtx->envCtx.adjFogColor[2] > 140) {
|
||||
globalCtx->envCtx.adjFogColor[2] = 140;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[0][0] < 0) {
|
||||
globalCtx->envCtx.unk_8C[0][0] = 0;
|
||||
if (globalCtx->envCtx.adjAmbientColor[0] < 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[0] = 0;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[0][1] < 0) {
|
||||
globalCtx->envCtx.unk_8C[0][1] = 0;
|
||||
if (globalCtx->envCtx.adjAmbientColor[1] < 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[1] = 0;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[0][2] < 0) {
|
||||
globalCtx->envCtx.unk_8C[0][2] = 0;
|
||||
if (globalCtx->envCtx.adjAmbientColor[2] < 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[2] = 0;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[2][0] < 0) {
|
||||
globalCtx->envCtx.unk_8C[2][0] = 0;
|
||||
if (globalCtx->envCtx.adjFogColor[0] < 0) {
|
||||
globalCtx->envCtx.adjFogColor[0] = 0;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[2][1] < 0) {
|
||||
globalCtx->envCtx.unk_8C[2][1] = 0;
|
||||
if (globalCtx->envCtx.adjFogColor[1] < 0) {
|
||||
globalCtx->envCtx.adjFogColor[1] = 0;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_8C[2][2] < 0) {
|
||||
globalCtx->envCtx.unk_8C[2][2] = 0;
|
||||
if (globalCtx->envCtx.adjFogColor[2] < 0) {
|
||||
globalCtx->envCtx.adjFogColor[2] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1100,7 +1100,8 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
|
|||
((300 - indS1) * .0015f) + 0.13f);
|
||||
}
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1,
|
||||
this->actor.world.pos.x, -280.0f, this->actor.world.pos.z, 0, 0, 0, WARP_DUNGEON_ADULT);
|
||||
this->actor.world.pos.x, -280.0f, this->actor.world.pos.z, 0, 0, 0,
|
||||
WARP_DUNGEON_ADULT);
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_B_HEART, this->actor.world.pos.x + 200.0f,
|
||||
-280.0f, this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
Audio_QueueSeqCmd(0x21);
|
||||
|
@ -2437,9 +2438,9 @@ void BossMo_DrawTentacle(BossMo* this, GlobalContext* globalCtx) {
|
|||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_boss_mo.c", 6366);
|
||||
|
||||
sp110.x = globalCtx->envCtx.unk_2A;
|
||||
sp110.y = globalCtx->envCtx.unk_2B;
|
||||
sp110.z = globalCtx->envCtx.unk_2C;
|
||||
sp110.x = globalCtx->envCtx.dirLight1.params.dir.x;
|
||||
sp110.y = globalCtx->envCtx.dirLight1.params.dir.y;
|
||||
sp110.z = globalCtx->envCtx.dirLight1.params.dir.z;
|
||||
|
||||
Matrix_Push();
|
||||
|
||||
|
|
|
@ -585,10 +585,10 @@ void BossTw_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
}
|
||||
}
|
||||
|
||||
this->fogR = globalCtx->lightCtx.unk_07;
|
||||
this->fogG = globalCtx->lightCtx.unk_08;
|
||||
this->fogB = globalCtx->lightCtx.unk_09;
|
||||
this->fogNear = globalCtx->lightCtx.unk_0A;
|
||||
this->fogR = globalCtx->lightCtx.fogColor[0];
|
||||
this->fogG = globalCtx->lightCtx.fogColor[1];
|
||||
this->fogB = globalCtx->lightCtx.fogColor[2];
|
||||
this->fogNear = globalCtx->lightCtx.fogNear;
|
||||
this->fogFar = 1000.0f;
|
||||
}
|
||||
|
||||
|
@ -2852,10 +2852,10 @@ void BossTw_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
s32 pad;
|
||||
|
||||
this->collider.base.colType = COLTYPE_HIT3;
|
||||
Math_ApproachF(&this->fogR, globalCtx->lightCtx.unk_07, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogG, globalCtx->lightCtx.unk_08, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogB, globalCtx->lightCtx.unk_09, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogNear, globalCtx->lightCtx.unk_0A, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogR, globalCtx->lightCtx.fogColor[0], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogG, globalCtx->lightCtx.fogColor[1], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogB, globalCtx->lightCtx.fogColor[2], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogNear, globalCtx->lightCtx.fogNear, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogFar, 1000.0f, 1.0f, 10.0f);
|
||||
this->work[CS_TIMER_1]++;
|
||||
this->work[CS_TIMER_2]++;
|
||||
|
@ -2979,10 +2979,10 @@ void BossTw_TwinrovaUpdate(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
this->unk_5F8 = 0;
|
||||
this->collider.base.colType = COLTYPE_HIT3;
|
||||
|
||||
Math_ApproachF(&this->fogR, globalCtx->lightCtx.unk_07, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogG, globalCtx->lightCtx.unk_08, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogB, globalCtx->lightCtx.unk_09, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogNear, globalCtx->lightCtx.unk_0A, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogR, globalCtx->lightCtx.fogColor[0], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogG, globalCtx->lightCtx.fogColor[1], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogB, globalCtx->lightCtx.fogColor[2], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogNear, globalCtx->lightCtx.fogNear, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->fogFar, 1000.0f, 1.0f, 10.0f);
|
||||
|
||||
this->work[CS_TIMER_1]++;
|
||||
|
@ -3529,7 +3529,7 @@ void BossTw_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, BossTw_OverrideLimbDraw, BossTw_PostLimbDraw, this);
|
||||
Matrix_Pop();
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
}
|
||||
|
||||
if (this->actor.params == TW_KOTAKE) {
|
||||
|
@ -3888,8 +3888,8 @@ void BossTw_TwinrovaDraw(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Matrix_Pop();
|
||||
|
||||
Matrix_MultVec3f(&D_8094A9EC, &this->beamOrigin);
|
||||
POLY_OPA_DISP = Gfx_SetFog2(POLY_OPA_DISP, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08,
|
||||
globalCtx->lightCtx.unk_09, 0, globalCtx->lightCtx.unk_0A, 1000);
|
||||
POLY_OPA_DISP = Gfx_SetFog2(POLY_OPA_DISP, globalCtx->lightCtx.fogColor[0], globalCtx->lightCtx.fogColor[1],
|
||||
globalCtx->lightCtx.fogColor[2], 0, globalCtx->lightCtx.fogNear, 1000);
|
||||
}
|
||||
|
||||
BossTw_DrawEffects(globalCtx);
|
||||
|
|
|
@ -508,33 +508,33 @@ void BossVa_Tumor(GlobalContext* globalCtx, BossVa* this, s32 count, s16 scale,
|
|||
}
|
||||
|
||||
void BossVa_SetSparkEnv(GlobalContext* globalCtx) {
|
||||
globalCtx->envCtx.unk_8C[0][0] = 0xA;
|
||||
globalCtx->envCtx.unk_8C[0][1] = 0xA;
|
||||
globalCtx->envCtx.unk_8C[0][2] = 0xA;
|
||||
globalCtx->envCtx.unk_8C[1][0] = 0x73;
|
||||
globalCtx->envCtx.unk_8C[1][1] = 0x41;
|
||||
globalCtx->envCtx.unk_8C[1][2] = 0x64;
|
||||
globalCtx->envCtx.unk_8C[2][0] = 0x78;
|
||||
globalCtx->envCtx.unk_8C[2][1] = 0x78;
|
||||
globalCtx->envCtx.unk_8C[2][2] = 0x46;
|
||||
globalCtx->envCtx.adjAmbientColor[0] = 0xA;
|
||||
globalCtx->envCtx.adjAmbientColor[1] = 0xA;
|
||||
globalCtx->envCtx.adjAmbientColor[2] = 0xA;
|
||||
globalCtx->envCtx.adjLight1Color[0] = 0x73;
|
||||
globalCtx->envCtx.adjLight1Color[1] = 0x41;
|
||||
globalCtx->envCtx.adjLight1Color[2] = 0x64;
|
||||
globalCtx->envCtx.adjFogColor[0] = 0x78;
|
||||
globalCtx->envCtx.adjFogColor[1] = 0x78;
|
||||
globalCtx->envCtx.adjFogColor[2] = 0x46;
|
||||
}
|
||||
|
||||
void BossVa_SetDeathEnv(GlobalContext* globalCtx) {
|
||||
globalCtx->envCtx.unk_8C[2][0] = 0xDC;
|
||||
globalCtx->envCtx.unk_8C[2][1] = 0xDC;
|
||||
globalCtx->envCtx.unk_8C[2][2] = 0x96;
|
||||
globalCtx->envCtx.unk_9E = -0x3E8;
|
||||
globalCtx->envCtx.unk_A0 = -0x384;
|
||||
globalCtx->envCtx.unk_8C[0][0] = 0xC8;
|
||||
globalCtx->envCtx.unk_8C[0][1] = 0xC8;
|
||||
globalCtx->envCtx.unk_8C[0][2] = 0xC8;
|
||||
globalCtx->envCtx.unk_8C[1][0] = 0xD7;
|
||||
globalCtx->envCtx.unk_8C[1][1] = 0xA5;
|
||||
globalCtx->envCtx.unk_8C[1][2] = 0xC8;
|
||||
globalCtx->envCtx.unk_E2[0] = 0xDC;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xDC;
|
||||
globalCtx->envCtx.unk_E2[2] = 0x96;
|
||||
globalCtx->envCtx.unk_E2[3] = 0x64;
|
||||
globalCtx->envCtx.adjFogColor[0] = 0xDC;
|
||||
globalCtx->envCtx.adjFogColor[1] = 0xDC;
|
||||
globalCtx->envCtx.adjFogColor[2] = 0x96;
|
||||
globalCtx->envCtx.adjFogNear = -0x3E8;
|
||||
globalCtx->envCtx.adjFogFar = -0x384;
|
||||
globalCtx->envCtx.adjAmbientColor[0] = 0xC8;
|
||||
globalCtx->envCtx.adjAmbientColor[1] = 0xC8;
|
||||
globalCtx->envCtx.adjAmbientColor[2] = 0xC8;
|
||||
globalCtx->envCtx.adjLight1Color[0] = 0xD7;
|
||||
globalCtx->envCtx.adjLight1Color[1] = 0xA5;
|
||||
globalCtx->envCtx.adjLight1Color[2] = 0xC8;
|
||||
globalCtx->envCtx.screenFillColor[0] = 0xDC;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0xDC;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0x96;
|
||||
globalCtx->envCtx.screenFillColor[3] = 0x64;
|
||||
}
|
||||
|
||||
EnBoom* BossVa_FindBoomerang(GlobalContext* globalCtx) {
|
||||
|
@ -630,7 +630,8 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
warpId = ACTOR_DOOR_WARP1;
|
||||
}
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, warpId, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 0, 0, 0, 0); //! params could be WARP_DUNGEON_CHILD however this can also spawn Ru1
|
||||
this->actor.world.pos.z, 0, 0, 0,
|
||||
0); //! params could be WARP_DUNGEON_CHILD however this can also spawn Ru1
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_B_HEART, this->actor.world.pos.x + 160.0f,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
sDoorState = 100;
|
||||
|
@ -642,10 +643,10 @@ void BossVa_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
sCsState = INTRO_CALL_BARI;
|
||||
sDoorState = 100;
|
||||
func_8002DF54(globalCtx, &this->actor, 1);
|
||||
globalCtx->envCtx.unk_E2[0] = 0xDC;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xDC;
|
||||
globalCtx->envCtx.unk_E2[2] = 0xBE;
|
||||
globalCtx->envCtx.unk_E2[3] = 0xD2;
|
||||
globalCtx->envCtx.screenFillColor[0] = 0xDC;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0xDC;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0xBE;
|
||||
globalCtx->envCtx.screenFillColor[3] = 0xD2;
|
||||
func_80064520(globalCtx, &globalCtx->csCtx);
|
||||
sCsCamera = Gameplay_CreateSubCamera(globalCtx);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);
|
||||
|
@ -778,10 +779,10 @@ void BossVa_BodyIntro(BossVa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
case INTRO_START:
|
||||
globalCtx->envCtx.unk_E2[0] = 0xDC;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xDC;
|
||||
globalCtx->envCtx.unk_E2[2] = 0xBE;
|
||||
globalCtx->envCtx.unk_E2[3] = 0xD2;
|
||||
globalCtx->envCtx.screenFillColor[0] = 0xDC;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0xDC;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0xBE;
|
||||
globalCtx->envCtx.screenFillColor[3] = 0xD2;
|
||||
func_8002DF54(globalCtx, &this->actor, 8);
|
||||
player->actor.world.rot.y = player->actor.shape.rot.y = 0x7FFF;
|
||||
sCsState++;
|
||||
|
@ -1552,9 +1553,10 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->unk_1AC = Math_Vec3f_Yaw(&sCameraEye, &sCameraNextAt) - 0x100;
|
||||
this->unk_1B0 = 15;
|
||||
globalCtx->envCtx.unk_E2[0] = globalCtx->envCtx.unk_E2[1] = globalCtx->envCtx.unk_E2[2] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[3] = 0;
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] =
|
||||
globalCtx->envCtx.screenFillColor[2] = 0xFF;
|
||||
globalCtx->envCtx.screenFillColor[3] = 0;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
sCsState++;
|
||||
case DEATH_BODY_TUMORS:
|
||||
this->unk_1AC += 0x100;
|
||||
|
@ -1652,7 +1654,7 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
case DEATH_FINISH:
|
||||
Rand_CenteredFloat(0.5f);
|
||||
globalCtx->envCtx.unk_E1 = 0;
|
||||
globalCtx->envCtx.fillScreen = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1671,8 +1673,8 @@ void BossVa_BodyDeath(BossVa* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->vaBodySpinRate, 0, 1, 0xC8, 0);
|
||||
Math_SmoothStepToS(&this->vaCamRotMod, 0, 1, 0xC8, 0);
|
||||
Math_SmoothStepToS(&this->bodyGlow, 200, 1, 10, 0);
|
||||
if (globalCtx->envCtx.unk_E2[3] != 0) {
|
||||
globalCtx->envCtx.unk_E2[3] -= 50;
|
||||
if (globalCtx->envCtx.screenFillColor[3] != 0) {
|
||||
globalCtx->envCtx.screenFillColor[3] -= 50;
|
||||
}
|
||||
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
|
||||
|
@ -2818,22 +2820,22 @@ void BossVa_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
BossVa_UpdateEffects(globalCtx);
|
||||
|
||||
for (i = 2; i >= 0; i--) {
|
||||
if ((globalCtx->envCtx.unk_8C[0][i] - 1) > 0) {
|
||||
globalCtx->envCtx.unk_8C[0][i] -= 1;
|
||||
if ((globalCtx->envCtx.adjAmbientColor[i] - 1) > 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[i] -= 1;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_8C[0][i] = 0;
|
||||
globalCtx->envCtx.adjAmbientColor[i] = 0;
|
||||
}
|
||||
|
||||
if ((globalCtx->envCtx.unk_8C[1][i] - 10) > 0) {
|
||||
globalCtx->envCtx.unk_8C[1][i] -= 10;
|
||||
if ((globalCtx->envCtx.adjLight1Color[i] - 10) > 0) {
|
||||
globalCtx->envCtx.adjLight1Color[i] -= 10;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_8C[1][i] = 0;
|
||||
globalCtx->envCtx.adjLight1Color[i] = 0;
|
||||
}
|
||||
|
||||
if ((globalCtx->envCtx.unk_8C[2][i] - 10) > 0) {
|
||||
globalCtx->envCtx.unk_8C[2][i] -= 10;
|
||||
if ((globalCtx->envCtx.adjFogColor[i] - 10) > 0) {
|
||||
globalCtx->envCtx.adjFogColor[i] -= 10;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_8C[2][i] = 0;
|
||||
globalCtx->envCtx.adjFogColor[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3187,17 +3189,17 @@ void BossVa_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
switch (this->actor.params) {
|
||||
case BOSSVA_BODY:
|
||||
if (globalCtx->envCtx.unk_9E != 0) {
|
||||
globalCtx->envCtx.unk_9E += 0x15E;
|
||||
if (globalCtx->envCtx.unk_9E > 0) {
|
||||
globalCtx->envCtx.unk_9E = 0;
|
||||
if (globalCtx->envCtx.adjFogNear != 0) {
|
||||
globalCtx->envCtx.adjFogNear += 0x15E;
|
||||
if (globalCtx->envCtx.adjFogNear > 0) {
|
||||
globalCtx->envCtx.adjFogNear = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_A0 != 0) {
|
||||
globalCtx->envCtx.unk_A0 += 0x15E;
|
||||
if (globalCtx->envCtx.unk_A0 > 0) {
|
||||
globalCtx->envCtx.unk_A0 = 0;
|
||||
if (globalCtx->envCtx.adjFogFar != 0) {
|
||||
globalCtx->envCtx.adjFogFar += 0x15E;
|
||||
if (globalCtx->envCtx.adjFogFar > 0) {
|
||||
globalCtx->envCtx.adjFogFar = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -811,7 +811,7 @@ void func_809691BC(Demo6K* this, GlobalContext* globalCtx, s32 params) {
|
|||
endPos.y = csAction->endPos.y;
|
||||
endPos.z = csAction->endPos.z;
|
||||
|
||||
temp = func_8006F93C(csAction->endFrame, csAction->startFrame, globalCtx->csCtx.frames);
|
||||
temp = Environment_LerpWeight(csAction->endFrame, csAction->startFrame, globalCtx->csCtx.frames);
|
||||
|
||||
this->actor.world.pos.x = (((endPos.x - startPos.x) * temp) + startPos.x);
|
||||
this->actor.world.pos.y = (((endPos.y - startPos.y) * temp) + startPos.y);
|
||||
|
|
|
@ -172,7 +172,8 @@ void DemoDu_CsFireMedallion_SpawnDoorWarp(DemoDu* this, GlobalContext* globalCtx
|
|||
f32 posY = this->actor.world.pos.y;
|
||||
f32 posZ = this->actor.world.pos.z;
|
||||
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, WARP_SAGES);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0,
|
||||
WARP_SAGES);
|
||||
}
|
||||
|
||||
// Gives the Fire Medallion to Link.
|
||||
|
@ -445,7 +446,7 @@ void DemoDu_CsGoronsRuby_DaruniaFalling(DemoDu* this, GlobalContext* globalCtx)
|
|||
Vec3f* pos = &this->actor.world.pos;
|
||||
|
||||
if (npcAction != NULL) {
|
||||
f32 traveledPercent = func_8006F93C(npcAction->endFrame, npcAction->startFrame, csCtx->frames);
|
||||
f32 traveledPercent = Environment_LerpWeight(npcAction->endFrame, npcAction->startFrame, csCtx->frames);
|
||||
|
||||
startPos.x = npcAction->startPos.x;
|
||||
startPos.y = npcAction->startPos.y;
|
||||
|
|
|
@ -128,8 +128,9 @@ void DemoEffect_SetupUpdate(DemoEffect* this, DemoEffectFunc updateFunc) {
|
|||
* Gives a number on the range of 0.0f - 1.0f representing current cutscene action completion percentage.
|
||||
*/
|
||||
f32 DemoEffect_InterpolateCsFrames(GlobalContext* globalCtx, s32 csActionId) {
|
||||
f32 interpolated = func_8006F93C(globalCtx->csCtx.npcActions[csActionId]->endFrame,
|
||||
globalCtx->csCtx.npcActions[csActionId]->startFrame, globalCtx->csCtx.frames);
|
||||
f32 interpolated =
|
||||
Environment_LerpWeight(globalCtx->csCtx.npcActions[csActionId]->endFrame,
|
||||
globalCtx->csCtx.npcActions[csActionId]->startFrame, globalCtx->csCtx.frames);
|
||||
if (interpolated > 1.0f) {
|
||||
interpolated = 1.0f;
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) {
|
|||
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
|
||||
npcAction = csCtx->npcActions[func_8097C870(this)];
|
||||
if (npcAction != NULL) {
|
||||
temp_ret = func_8006F93C(npcAction->endFrame, npcAction->startFrame, csCtx->frames);
|
||||
temp_ret = Environment_LerpWeight(npcAction->endFrame, npcAction->startFrame, csCtx->frames);
|
||||
startPos.x = npcAction->startPos.x;
|
||||
startPos.y = npcAction->startPos.y;
|
||||
startPos.z = npcAction->startPos.z;
|
||||
|
|
|
@ -334,7 +334,8 @@ void func_8097E744(DemoGt* this, GlobalContext* globalCtx, u32 actionIdx) {
|
|||
f32 someFloat;
|
||||
|
||||
if (npcAction != NULL) {
|
||||
someFloat = func_8006F9BC(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, 8, 0);
|
||||
someFloat =
|
||||
Environment_LerpWeightAccelDecel(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, 8, 0);
|
||||
startX = npcAction->startPos.x;
|
||||
startY = npcAction->startPos.y;
|
||||
startZ = npcAction->startPos.z;
|
||||
|
@ -579,7 +580,7 @@ void func_8097F280(DemoGt* this, GlobalContext* globalCtx) {
|
|||
unk198[0]++;
|
||||
unk198[1]--;
|
||||
} else if (globalCtx->csCtx.frames < 170) {
|
||||
temp_f0 = func_8006F9BC(170, 160, globalCtx->csCtx.frames, 0, 0);
|
||||
temp_f0 = Environment_LerpWeightAccelDecel(170, 160, globalCtx->csCtx.frames, 0, 0);
|
||||
|
||||
unk178[0] = (temp_f0 * -63.0f) + 163.0f;
|
||||
unk178[1] = (temp_f0 * -155.0f) + 255.0f;
|
||||
|
@ -817,7 +818,7 @@ void func_8097FDDC(DemoGt* this, GlobalContext* globalCtx) {
|
|||
unk198[0]++;
|
||||
unk198[1]--;
|
||||
} else if (globalCtx->csCtx.frames < 620) {
|
||||
f32 temp_f0 = func_8006F9BC(620, 610, globalCtx->csCtx.frames, 0, 0);
|
||||
f32 temp_f0 = Environment_LerpWeightAccelDecel(620, 610, globalCtx->csCtx.frames, 0, 0);
|
||||
|
||||
unk178[0] = (temp_f0 * (-13.0f)) + 163.0f;
|
||||
unk178[1] = (temp_f0 * (-43.0f)) + 193.0f;
|
||||
|
|
|
@ -305,7 +305,8 @@ void func_80985358(DemoIm* this, GlobalContext* globalCtx) {
|
|||
f32 posY = this->actor.world.pos.y;
|
||||
f32 posZ = this->actor.world.pos.z;
|
||||
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, WARP_SAGES);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0,
|
||||
WARP_SAGES);
|
||||
}
|
||||
|
||||
void func_809853B4(DemoIm* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -174,8 +174,6 @@ static s16 D_8098CF80;
|
|||
static s16 sRainScale;
|
||||
static s16 D_8098CF84;
|
||||
|
||||
extern Mtx D_01000000; // perspective mtx
|
||||
|
||||
extern Gfx D_06000080[]; // rain DL
|
||||
extern Gfx D_06000DE0[]; // rocks DL
|
||||
extern Gfx D_06007440[]; // DoT DL left
|
||||
|
@ -305,19 +303,19 @@ void DemoKankyo_SetupType(DemoKankyo* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
break;
|
||||
case DEMOKANKYO_WARP_OUT:
|
||||
globalCtx->envCtx.unk_E2[0] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[2] = 0xFF;
|
||||
globalCtx->envCtx.unk_E1 = 0;
|
||||
globalCtx->envCtx.screenFillColor[0] = 0xFF;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0xFF;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0xFF;
|
||||
globalCtx->envCtx.fillScreen = false;
|
||||
if (this->warpTimer < 21 && this->warpTimer >= 15) {
|
||||
temp = (this->warpTimer - 15.0f) / 5.0f;
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.unk_E2[3] = 255 - 255 * temp;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255 - 255 * temp;
|
||||
}
|
||||
if (this->warpTimer < 15 && this->warpTimer >= 4) {
|
||||
temp = (this->warpTimer - 4.0f) / 10.0f;
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.unk_E2[3] = 255 * temp;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255 * temp;
|
||||
}
|
||||
if (this->warpTimer == 15) {
|
||||
player->actor.draw = NULL;
|
||||
|
@ -390,7 +388,7 @@ void DemoKankyo_SetRockPos(DemoKankyo* this, GlobalContext* globalCtx, s32 param
|
|||
endPos.x = csAction->endPos.x;
|
||||
endPos.y = csAction->endPos.y;
|
||||
endPos.z = csAction->endPos.z;
|
||||
temp_f0 = func_8006F93C(csAction->endFrame, csAction->startFrame, globalCtx->csCtx.frames);
|
||||
temp_f0 = Environment_LerpWeight(csAction->endFrame, csAction->startFrame, globalCtx->csCtx.frames);
|
||||
this->actor.world.pos.x = ((endPos.x - startPos.x) * temp_f0) + startPos.x;
|
||||
this->actor.world.pos.y = ((endPos.y - startPos.y) * temp_f0) + startPos.y;
|
||||
this->actor.world.pos.z = ((endPos.z - startPos.z) * temp_f0) + startPos.z;
|
||||
|
@ -822,7 +820,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, GlobalContext* globalCtx) {
|
|||
case 2:
|
||||
if (this->actor.params == DEMOKANKYO_WARP_OUT) {
|
||||
if (i == 0) {
|
||||
func_800776E4(globalCtx);
|
||||
Environment_WarpSongLeave(globalCtx);
|
||||
this->unk_150[i].unk_22++;
|
||||
}
|
||||
} else if (i + 1 == this->sparkleCounter && globalCtx->csCtx.state == CS_STATE_IDLE) {
|
||||
|
|
|
@ -229,7 +229,8 @@ void func_8098E86C(DemoSa* this, GlobalContext* globalCtx) {
|
|||
f32 posY = world->y;
|
||||
f32 posZ = world->z;
|
||||
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, WARP_SAGES);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0,
|
||||
WARP_SAGES);
|
||||
}
|
||||
|
||||
void func_8098E8C8(DemoSa* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -91,7 +91,8 @@ void DoorWarp1_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lowerLight);
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
globalCtx->envCtx.unk_8C[0][i] = globalCtx->envCtx.unk_8C[2][i] = globalCtx->envCtx.unk_8C[1][i] = 0;
|
||||
globalCtx->envCtx.adjAmbientColor[i] = globalCtx->envCtx.adjFogColor[i] = globalCtx->envCtx.adjLight1Color[i] =
|
||||
0;
|
||||
}
|
||||
//! @bug SkelAnime_Free is not called for crystal variants
|
||||
}
|
||||
|
@ -204,10 +205,10 @@ void DoorWarp1_SetupAdultDungeonWarp(DoorWarp1* this, GlobalContext* globalCtx)
|
|||
this->crystalAlpha = 0.0f;
|
||||
this->unk_19C = 0.0f;
|
||||
|
||||
Lights_PointNoGlowSetInfo(&this->upperLightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
200, 255, 255, 255);
|
||||
Lights_PointNoGlowSetInfo(&this->lowerLightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
200, 255, 255, 255);
|
||||
Lights_PointNoGlowSetInfo(&this->upperLightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 200, 255, 255, 255);
|
||||
Lights_PointNoGlowSetInfo(&this->lowerLightInfo, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, 200, 255, 255, 255);
|
||||
|
||||
DoorWarp1_SetupAction(this, func_8099A3A4);
|
||||
}
|
||||
|
@ -234,10 +235,11 @@ void DoorWarp1_SetupBlueCrystal(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
this->actor.shape.yOffset = 800.0f;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
globalCtx->envCtx.unk_8C[0][i] = globalCtx->envCtx.unk_8C[2][i] = globalCtx->envCtx.unk_8C[1][i] = -255;
|
||||
globalCtx->envCtx.adjAmbientColor[i] = globalCtx->envCtx.adjFogColor[i] = globalCtx->envCtx.adjLight1Color[i] =
|
||||
-255;
|
||||
}
|
||||
|
||||
globalCtx->envCtx.unk_9E = -500;
|
||||
globalCtx->envCtx.adjFogNear = -500;
|
||||
this->warpTimer = 30;
|
||||
this->unk_1B8 = 4000;
|
||||
DoorWarp1_SetupAction(this, DoorWarp1_BlueCrystal);
|
||||
|
@ -294,22 +296,22 @@ void DoorWarp1_BlueCrystal(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80999214(DoorWarp1* this, GlobalContext* globalCtx) {
|
||||
s32 temp_f4;
|
||||
f32 phi_f0;
|
||||
f32 darkness;
|
||||
s16 i;
|
||||
|
||||
Math_SmoothStepToF(&this->crystalAlpha, 255.0f, 0.2f, 5.0f, 0.1f);
|
||||
|
||||
phi_f0 = (f32)(40 - this->warpTimer) / 40.0f;
|
||||
phi_f0 = CLAMP_MIN(phi_f0, 0);
|
||||
darkness = (f32)(40 - this->warpTimer) / 40.0f;
|
||||
darkness = CLAMP_MIN(darkness, 0);
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
globalCtx->envCtx.unk_8C[0][i] = globalCtx->envCtx.unk_8C[2][i] =
|
||||
globalCtx->envCtx.unk_8C[1][i] = -255.0f * phi_f0;
|
||||
globalCtx->envCtx.adjAmbientColor[i] = globalCtx->envCtx.adjFogColor[i] = globalCtx->envCtx.adjLight1Color[i] =
|
||||
-255 * darkness;
|
||||
}
|
||||
globalCtx->envCtx.unk_9E = -500.0f * phi_f0;
|
||||
globalCtx->envCtx.adjFogNear = -500.0f * darkness;
|
||||
|
||||
this->warpTimer++;
|
||||
if (phi_f0 <= 0) {
|
||||
if (darkness <= 0) {
|
||||
DoorWarp1_SetupAction(this, func_80999348);
|
||||
}
|
||||
this->actor.shape.rot.y += 0x320;
|
||||
|
@ -780,20 +782,20 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
gSaveContext.nextTransition = 7;
|
||||
}
|
||||
if (this->warpTimer >= 141) {
|
||||
f32 phi_f0;
|
||||
f32 screenFillAlpha;
|
||||
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
phi_f0 = (f32)(this->warpTimer - 140) / 20.0f;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
screenFillAlpha = (f32)(this->warpTimer - 140) / 20.0f;
|
||||
|
||||
if (phi_f0 > 1.0f) {
|
||||
phi_f0 = 1.0f;
|
||||
if (screenFillAlpha > 1.0f) {
|
||||
screenFillAlpha = 1.0f;
|
||||
}
|
||||
globalCtx->envCtx.unk_E2[0] = 160;
|
||||
globalCtx->envCtx.unk_E2[1] = 160;
|
||||
globalCtx->envCtx.unk_E2[2] = 160;
|
||||
globalCtx->envCtx.unk_E2[3] = (u32)(255.0f * phi_f0);
|
||||
globalCtx->envCtx.screenFillColor[0] = 160;
|
||||
globalCtx->envCtx.screenFillColor[1] = 160;
|
||||
globalCtx->envCtx.screenFillColor[2] = 160;
|
||||
globalCtx->envCtx.screenFillColor[3] = (u32)(255.0f * screenFillAlpha);
|
||||
|
||||
osSyncPrintf("\nparcent=[%f]", phi_f0);
|
||||
osSyncPrintf("\nparcent=[%f]", screenFillAlpha);
|
||||
}
|
||||
Lights_PointNoGlowSetInfo(&this->upperLightInfo, (s16)player->actor.world.pos.x + 10.0f,
|
||||
(s16)player->actor.world.pos.y + 10.0f, (s16)player->actor.world.pos.z + 10.0f, 235, 255,
|
||||
|
@ -817,12 +819,12 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
s16 i;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
globalCtx->envCtx.unk_8C[0][i] = globalCtx->envCtx.unk_8C[2][i] =
|
||||
globalCtx->envCtx.unk_8C[1][i] = -255.0f * temp_f0_2;
|
||||
globalCtx->envCtx.adjAmbientColor[i] = globalCtx->envCtx.adjFogColor[i] =
|
||||
globalCtx->envCtx.adjLight1Color[i] = -255.0f * temp_f0_2;
|
||||
}
|
||||
|
||||
globalCtx->envCtx.unk_9E = -500.0f * temp_f0_2;
|
||||
if (globalCtx->envCtx.unk_9E < -300) {
|
||||
globalCtx->envCtx.adjFogNear = -500.0f * temp_f0_2;
|
||||
if (globalCtx->envCtx.adjFogNear < -300) {
|
||||
globalCtx->roomCtx.curRoom.segment = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -928,8 +930,8 @@ void DoorWarp1_DrawWarp(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_door_warp1.c", 2173);
|
||||
|
||||
temp_f0 = 1.0f - (2.0f - this->unk_194) / 1.7f;
|
||||
if (this->actor.params != WARP_YELLOW && this->actor.params != WARP_DESTINATION && this->actor.params != WARP_ORANGE &&
|
||||
this->actor.params != WARP_GREEN && this->actor.params != WARP_RED) {
|
||||
if (this->actor.params != WARP_YELLOW && this->actor.params != WARP_DESTINATION &&
|
||||
this->actor.params != WARP_ORANGE && this->actor.params != WARP_GREEN && this->actor.params != WARP_RED) {
|
||||
this->unk_19C += (s16)(temp_f0 * 15.0f);
|
||||
}
|
||||
if (this->actor.params == WARP_DESTINATION) {
|
||||
|
|
|
@ -181,28 +181,28 @@ void EnBom_Explode(EnBom* this, GlobalContext* globalCtx) {
|
|||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->explosionCollider.base);
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[1][0] != 0) {
|
||||
globalCtx->envCtx.unk_8C[1][0] -= 0x19;
|
||||
if (globalCtx->envCtx.adjLight1Color[0] != 0) {
|
||||
globalCtx->envCtx.adjLight1Color[0] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[1][1] != 0) {
|
||||
globalCtx->envCtx.unk_8C[1][1] -= 0x19;
|
||||
if (globalCtx->envCtx.adjLight1Color[1] != 0) {
|
||||
globalCtx->envCtx.adjLight1Color[1] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[1][2] != 0) {
|
||||
globalCtx->envCtx.unk_8C[1][2] -= 0x19;
|
||||
if (globalCtx->envCtx.adjLight1Color[2] != 0) {
|
||||
globalCtx->envCtx.adjLight1Color[2] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[0][0] != 0) {
|
||||
globalCtx->envCtx.unk_8C[0][0] -= 0x19;
|
||||
if (globalCtx->envCtx.adjAmbientColor[0] != 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[0] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[0][1] != 0) {
|
||||
globalCtx->envCtx.unk_8C[0][1] -= 0x19;
|
||||
if (globalCtx->envCtx.adjAmbientColor[1] != 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[1] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[0][2] != 0) {
|
||||
globalCtx->envCtx.unk_8C[0][2] -= 0x19;
|
||||
if (globalCtx->envCtx.adjAmbientColor[2] != 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[2] -= 25;
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
|
@ -315,8 +315,13 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
}
|
||||
|
||||
Audio_PlayActorSound2(thisx, NA_SE_IT_BOMB_EXPLOSION);
|
||||
globalCtx->envCtx.unk_8C[1][0] = globalCtx->envCtx.unk_8C[1][1] = globalCtx->envCtx.unk_8C[1][2] = 0xFA;
|
||||
globalCtx->envCtx.unk_8C[0][0] = globalCtx->envCtx.unk_8C[0][1] = globalCtx->envCtx.unk_8C[0][2] = 0xFA;
|
||||
|
||||
globalCtx->envCtx.adjLight1Color[0] = globalCtx->envCtx.adjLight1Color[1] =
|
||||
globalCtx->envCtx.adjLight1Color[2] = 250;
|
||||
|
||||
globalCtx->envCtx.adjAmbientColor[0] = globalCtx->envCtx.adjAmbientColor[1] =
|
||||
globalCtx->envCtx.adjAmbientColor[2] = 250;
|
||||
|
||||
Camera_AddQuake(&globalCtx->mainCamera, 2, 0xB, 8);
|
||||
thisx->params = BOMB_EXPLOSION;
|
||||
this->timer = 10;
|
||||
|
|
|
@ -276,28 +276,28 @@ void EnBombf_Explode(EnBombf* this, GlobalContext* globalCtx) {
|
|||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->explosionCollider.base);
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[1][0] != 0) {
|
||||
globalCtx->envCtx.unk_8C[1][0] -= 0x19;
|
||||
if (globalCtx->envCtx.adjLight1Color[0] != 0) {
|
||||
globalCtx->envCtx.adjLight1Color[0] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[1][1] != 0) {
|
||||
globalCtx->envCtx.unk_8C[1][1] -= 0x19;
|
||||
if (globalCtx->envCtx.adjLight1Color[1] != 0) {
|
||||
globalCtx->envCtx.adjLight1Color[1] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[1][2] != 0) {
|
||||
globalCtx->envCtx.unk_8C[1][2] -= 0x19;
|
||||
if (globalCtx->envCtx.adjLight1Color[2] != 0) {
|
||||
globalCtx->envCtx.adjLight1Color[2] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[0][0] != 0) {
|
||||
globalCtx->envCtx.unk_8C[0][0] -= 0x19;
|
||||
if (globalCtx->envCtx.adjAmbientColor[0] != 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[0] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[0][1] != 0) {
|
||||
globalCtx->envCtx.unk_8C[0][1] -= 0x19;
|
||||
if (globalCtx->envCtx.adjAmbientColor[1] != 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[1] -= 25;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_8C[0][2] != 0) {
|
||||
globalCtx->envCtx.unk_8C[0][2] -= 0x19;
|
||||
if (globalCtx->envCtx.adjAmbientColor[2] != 0) {
|
||||
globalCtx->envCtx.adjAmbientColor[2] -= 25;
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
|
@ -425,8 +425,10 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
Audio_PlayActorSound2(thisx, NA_SE_IT_BOMB_EXPLOSION);
|
||||
globalCtx->envCtx.unk_8C[1][0] = globalCtx->envCtx.unk_8C[1][1] = globalCtx->envCtx.unk_8C[1][2] = 0xFA;
|
||||
globalCtx->envCtx.unk_8C[0][0] = globalCtx->envCtx.unk_8C[0][1] = globalCtx->envCtx.unk_8C[0][2] = 0xFA;
|
||||
globalCtx->envCtx.adjLight1Color[0] = globalCtx->envCtx.adjLight1Color[1] =
|
||||
globalCtx->envCtx.adjLight1Color[2] = 250;
|
||||
globalCtx->envCtx.adjAmbientColor[0] = globalCtx->envCtx.adjAmbientColor[1] =
|
||||
globalCtx->envCtx.adjAmbientColor[2] = 250;
|
||||
Camera_AddQuake(&globalCtx->mainCamera, 2, 0xB, 8);
|
||||
thisx->params = BOMBFLOWER_EXPLOSION;
|
||||
this->timer = 10;
|
||||
|
|
|
@ -113,7 +113,7 @@ void EnDs_BrewOddPotion3(EnDs* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
Math_StepToF(&this->unk_1E4, 0, 0.03f);
|
||||
func_800773A8(globalCtx, this->unk_1E4 * (2.0f - this->unk_1E4), 0.0f, 0.1f, 1.0f);
|
||||
Environment_AdjustLights(globalCtx, this->unk_1E4 * (2.0f - this->unk_1E4), 0.0f, 0.1f, 1.0f);
|
||||
}
|
||||
|
||||
void EnDs_BrewOddPotion2(EnDs* this, GlobalContext* globalCtx) {
|
||||
|
@ -135,7 +135,7 @@ void EnDs_BrewOddPotion1(EnDs* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
Math_StepToF(&this->unk_1E4, 1.0f, 0.01f);
|
||||
func_800773A8(globalCtx, this->unk_1E4 * (2.0f - this->unk_1E4), 0.0f, 0.1f, 1.0f);
|
||||
Environment_AdjustLights(globalCtx, this->unk_1E4 * (2.0f - this->unk_1E4), 0.0f, 0.1f, 1.0f);
|
||||
}
|
||||
|
||||
void EnDs_OfferOddPotion(EnDs* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -1248,7 +1248,7 @@ void func_80A04F94(EnElf* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_2BC, 5, 0x1000, 0x400);
|
||||
this->timer++;
|
||||
Math_StepToF(&this->unk_2A4, 1.0f, 0.05f);
|
||||
func_800773A8(globalCtx, SQ(this->unk_2A4), player->actor.projectedPos.z + 780.0f, 0.2f, 0.5f);
|
||||
Environment_AdjustLights(globalCtx, SQ(this->unk_2A4), player->actor.projectedPos.z + 780.0f, 0.2f, 0.5f);
|
||||
}
|
||||
|
||||
// ask to talk to saria again
|
||||
|
@ -1429,7 +1429,8 @@ void func_80A053F0(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->unk_2A4 > 0.0f) {
|
||||
Math_StepToF(&this->unk_2A4, 0.0f, 0.05f);
|
||||
func_800773A8(globalCtx, SQ(this->unk_2A4) * this->unk_2A4, player->actor.projectedPos.z + 780.0f, 0.2f, 0.5f);
|
||||
Environment_AdjustLights(globalCtx, SQ(this->unk_2A4) * this->unk_2A4, player->actor.projectedPos.z + 780.0f,
|
||||
0.2f, 0.5f);
|
||||
}
|
||||
|
||||
// temp probably fake match
|
||||
|
@ -1547,7 +1548,7 @@ void EnElf_GetCutsceneNextPos(Vec3f* vec, GlobalContext* globalCtx, s32 action)
|
|||
endPos.y = npcAction->endPos.y;
|
||||
endPos.z = npcAction->endPos.z;
|
||||
|
||||
lerp = func_8006F93C(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames);
|
||||
lerp = Environment_LerpWeight(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames);
|
||||
|
||||
vec->x = ((endPos.x - startPos.x) * lerp) + startPos.x;
|
||||
vec->y = ((endPos.y - startPos.y) * lerp) + startPos.y;
|
||||
|
|
|
@ -269,16 +269,16 @@ void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
if (!this->isNotDeathMountain) {
|
||||
this->unk17C = this->envEffectsTimer / 60.0f;
|
||||
this->unk160 = this->unk17C * -50.0f;
|
||||
globalCtx->envCtx.unk_8C[0][0] = (s16)this->unk160 * -1.5f;
|
||||
globalCtx->envCtx.unk_8C[0][1] = globalCtx->envCtx.unk_8C[0][2] = this->unk160;
|
||||
globalCtx->envCtx.adjAmbientColor[0] = (s16)this->unk160 * -1.5f;
|
||||
globalCtx->envCtx.adjAmbientColor[1] = globalCtx->envCtx.adjAmbientColor[2] = this->unk160;
|
||||
this->unk168 = this->unk17C * -20.0f;
|
||||
globalCtx->envCtx.unk_8C[1][0] = (s16)this->unk168 * -1.5f;
|
||||
globalCtx->envCtx.unk_8C[1][1] = globalCtx->envCtx.unk_8C[1][2] = this->unk168;
|
||||
globalCtx->envCtx.adjLight1Color[0] = (s16)this->unk168 * -1.5f;
|
||||
globalCtx->envCtx.adjLight1Color[1] = globalCtx->envCtx.adjLight1Color[2] = this->unk168;
|
||||
this->unk170 = this->unk17C * -50.0f;
|
||||
globalCtx->envCtx.unk_9E = this->unk170;
|
||||
globalCtx->envCtx.unk_8C[2][0] = (u8)((160.0f - globalCtx->envCtx.unk_CF[0]) * this->unk17C);
|
||||
globalCtx->envCtx.unk_8C[2][1] = (u8)((160.0f - globalCtx->envCtx.unk_CF[1]) * this->unk17C);
|
||||
globalCtx->envCtx.unk_8C[2][2] = (u8)((150.0f - globalCtx->envCtx.unk_CF[2]) * this->unk17C);
|
||||
globalCtx->envCtx.adjFogNear = this->unk170;
|
||||
globalCtx->envCtx.adjFogColor[0] = (u8)((160.0f - globalCtx->envCtx.lightSettings.fogColor[0]) * this->unk17C);
|
||||
globalCtx->envCtx.adjFogColor[1] = (u8)((160.0f - globalCtx->envCtx.lightSettings.fogColor[1]) * this->unk17C);
|
||||
globalCtx->envCtx.adjFogColor[2] = (u8)((150.0f - globalCtx->envCtx.lightSettings.fogColor[2]) * this->unk17C);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ void EnFhgFire_LightningShock(EnFhgFire* this, GlobalContext* globalCtx) {
|
|||
void EnFhgFire_LightningBurst(EnFhgFire* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
globalCtx->envCtx.unk_E1 = 0x01;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
this->actor.shape.rot.y += 0x1000;
|
||||
|
||||
if (this->work[FHGFIRE_FX_TIMER] == 49) {
|
||||
|
@ -324,15 +324,16 @@ void EnFhgFire_LightningBurst(EnFhgFire* this, GlobalContext* globalCtx) {
|
|||
globalCtx->envCtx.unk_D6 = 0x14;
|
||||
}
|
||||
if (this->work[FHGFIRE_FX_TIMER] >= 48) {
|
||||
globalCtx->envCtx.unk_E2[0] = globalCtx->envCtx.unk_E2[1] = globalCtx->envCtx.unk_E2[2] = 0xFF;
|
||||
globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] =
|
||||
globalCtx->envCtx.screenFillColor[2] = 255;
|
||||
|
||||
if ((this->work[FHGFIRE_TIMER] % 2) != 0) {
|
||||
globalCtx->envCtx.unk_E2[3] = 0x46;
|
||||
globalCtx->envCtx.screenFillColor[3] = 70;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 0x00;
|
||||
globalCtx->envCtx.screenFillColor[3] = 0;
|
||||
}
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 0x00;
|
||||
globalCtx->envCtx.screenFillColor[3] = 0;
|
||||
}
|
||||
|
||||
if (this->work[FHGFIRE_TIMER] <= 20) {
|
||||
|
@ -352,7 +353,7 @@ void EnFhgFire_LightningBurst(EnFhgFire* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->work[FHGFIRE_TIMER] == 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
globalCtx->envCtx.unk_E1 = 0;
|
||||
globalCtx->envCtx.fillScreen = false;
|
||||
}
|
||||
|
||||
if (this->lensFlareTimer != 0) {
|
||||
|
@ -366,8 +367,10 @@ void EnFhgFire_LightningBurst(EnFhgFire* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
D_8015FCF0 = this->lensFlareOn;
|
||||
D_8015FCF8 = this->actor.world.pos;
|
||||
// Related to scene draw config 30, only used in BossGanon_Update and
|
||||
// loaded in z_kankyo
|
||||
gCustomLensFlareOn = this->lensFlareOn;
|
||||
gCustomLensFlarePos = this->actor.world.pos;
|
||||
D_8015FD06 = this->lensFlareScale;
|
||||
D_8015FD08 = 10.0f;
|
||||
D_8015FD0C = 0;
|
||||
|
|
|
@ -665,7 +665,7 @@ void EnFish_UpdateCutscene(EnFish* this, GlobalContext* globalCtx) {
|
|||
endPos.y = csAction->endPos.y;
|
||||
endPos.z = csAction->endPos.z;
|
||||
|
||||
progress = func_8006F93C(csAction->endFrame, csAction->startFrame, globalCtx->csCtx.frames);
|
||||
progress = Environment_LerpWeight(csAction->endFrame, csAction->startFrame, globalCtx->csCtx.frames);
|
||||
|
||||
this->actor.world.pos.x = (endPos.x - startPos.x) * progress + startPos.x;
|
||||
this->actor.world.pos.y = (endPos.y - startPos.y) * progress + startPos.y + D_80A17014;
|
||||
|
|
|
@ -97,7 +97,7 @@ u16 EnGo_GetTextID(GlobalContext* globalCtx, Actor* thisx) {
|
|||
if (gSaveContext.bgsFlag) {
|
||||
return 0x305E;
|
||||
} else if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_CLAIM_CHECK) {
|
||||
if (func_800775CC(globalCtx) >= 3) {
|
||||
if (Environment_GetBgsDayCount() >= 3) {
|
||||
return 0x305E;
|
||||
} else {
|
||||
return 0x305D;
|
||||
|
@ -992,7 +992,7 @@ void func_80A40C78(EnGo* this, GlobalContext* globalCtx) {
|
|||
this->actor.textId = 0x305C;
|
||||
func_8010B720(globalCtx, this->actor.textId);
|
||||
this->unk_1E0.unk_00 = 1;
|
||||
func_800775D8();
|
||||
Environment_ClearBgsDayCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1004,14 +1004,14 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, GlobalContext* globalCtx, Player* play
|
|||
|
||||
} else if (!gSaveContext.bgsFlag && (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK)) {
|
||||
if (func_8002F368(globalCtx) == EXCH_ITEM_CLAIM_CHECK) {
|
||||
if (func_800775CC() >= 3) {
|
||||
if (Environment_GetBgsDayCount() >= 3) {
|
||||
textId = 0x305E;
|
||||
} else {
|
||||
textId = 0x305D;
|
||||
}
|
||||
this->actor.textId = textId;
|
||||
} else {
|
||||
if (func_800775CC() >= 3) {
|
||||
if (Environment_GetBgsDayCount() >= 3) {
|
||||
textId = 0x3002;
|
||||
} else {
|
||||
textId = 0x305D;
|
||||
|
@ -1760,7 +1760,7 @@ void EnGo2_SetGetItem(EnGo2* this, GlobalContext* globalCtx) {
|
|||
this->unk_194.unk_00 = 0;
|
||||
switch (this->getItemId) {
|
||||
case GI_CLAIM_CHECK:
|
||||
func_800775D8();
|
||||
Environment_ClearBgsDayCount();
|
||||
EnGo2_GetItemAnimation(this, globalCtx);
|
||||
return;
|
||||
case GI_TUNIC_GORON:
|
||||
|
|
|
@ -88,19 +88,18 @@ void EnHata_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
f32 sin;
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
// Rotate to hang down by default
|
||||
this->limbs[FLAGPOLE_LIMB_FLAG_1_BASE].y = this->limbs[FLAGPOLE_LIMB_FLAG_2_BASE].y = -0x4000;
|
||||
windVec.x = globalCtx->envCtx.unk_A8;
|
||||
windVec.y = globalCtx->envCtx.unk_AA;
|
||||
windVec.z = globalCtx->envCtx.unk_AC;
|
||||
windVec.x = globalCtx->envCtx.windDirection.x;
|
||||
windVec.y = globalCtx->envCtx.windDirection.y;
|
||||
windVec.z = globalCtx->envCtx.windDirection.z;
|
||||
|
||||
if (globalCtx->envCtx.unk_B0 > 255.0f) {
|
||||
globalCtx->envCtx.unk_B0 = 255.0f;
|
||||
if (globalCtx->envCtx.windSpeed > 255.0f) {
|
||||
globalCtx->envCtx.windSpeed = 255.0f;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_B0 < 0.0f) {
|
||||
globalCtx->envCtx.unk_B0 = 0.0f;
|
||||
if (globalCtx->envCtx.windSpeed < 0.0f) {
|
||||
globalCtx->envCtx.windSpeed = 0.0f;
|
||||
}
|
||||
|
||||
if (Rand_ZeroOne() > 0.5f) {
|
||||
|
@ -112,13 +111,13 @@ void EnHata_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
// Mimic varying wind gusts
|
||||
sin = Math_SinS(this->unk_278) * 80.0f;
|
||||
pitch = -Math_Vec3f_Pitch(&zeroVec, &windVec);
|
||||
pitch = ((s32)((15000 - pitch) * (1.0f - (globalCtx->envCtx.unk_B0 / (255.0f - sin))))) + pitch;
|
||||
pitch = ((s32)((15000 - pitch) * (1.0f - (globalCtx->envCtx.windSpeed / (255.0f - sin))))) + pitch;
|
||||
Math_SmoothStepToS(&this->limbs[FLAGPOLE_LIMB_FLAG_1_HOIST_END_BASE].y, pitch, this->invScale, this->maxStep,
|
||||
this->minStep);
|
||||
this->limbs[FLAGPOLE_LIMB_FLAG_2_HOIST_END_BASE].y = this->limbs[FLAGPOLE_LIMB_FLAG_1_HOIST_END_BASE].y;
|
||||
this->limbs[FLAGPOLE_LIMB_FLAG_1_HOIST_END_BASE].z = -Math_Vec3f_Yaw(&zeroVec, &windVec);
|
||||
this->limbs[FLAGPOLE_LIMB_FLAG_2_HOIST_END_BASE].z = this->limbs[FLAGPOLE_LIMB_FLAG_1_HOIST_END_BASE].z;
|
||||
this->skelAnime.playSpeed = (Rand_ZeroFloat(1.25f) + 2.75f) * (globalCtx->envCtx.unk_B0 / 255.0f);
|
||||
this->skelAnime.playSpeed = (Rand_ZeroFloat(1.25f) + 2.75f) * (globalCtx->envCtx.windSpeed / 255.0f);
|
||||
}
|
||||
|
||||
s32 EnHata_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
|
||||
|
|
|
@ -126,7 +126,7 @@ void EnMThunder_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80A9F314(GlobalContext* globalCtx, f32 arg1) {
|
||||
func_800773A8(globalCtx, arg1, 850.0f, 0.2f, 0.0f);
|
||||
Environment_AdjustLights(globalCtx, arg1, 850.0f, 0.2f, 0.0f);
|
||||
}
|
||||
|
||||
void func_80A9F350(EnMThunder* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -313,7 +313,8 @@ void EnNb_SpawnBlueWarp(EnNb* this, GlobalContext* globalCtx) {
|
|||
f32 posY = this->actor.world.pos.y;
|
||||
f32 posZ = this->actor.world.pos.z;
|
||||
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, WARP_SAGES);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0,
|
||||
WARP_SAGES);
|
||||
}
|
||||
|
||||
void EnNb_GiveMedallion(EnNb* this, GlobalContext* globalCtx) {
|
||||
|
@ -588,7 +589,8 @@ void EnNb_SetPosInPortal(EnNb* this, GlobalContext* globalCtx) {
|
|||
Vec3f endPos;
|
||||
|
||||
if (csCmdNPCAction != NULL) {
|
||||
f0 = func_8006F9BC(csCmdNPCAction->endFrame, csCmdNPCAction->startFrame, globalCtx->csCtx.frames, 4, 4);
|
||||
f0 = Environment_LerpWeightAccelDecel(csCmdNPCAction->endFrame, csCmdNPCAction->startFrame,
|
||||
globalCtx->csCtx.frames, 4, 4);
|
||||
startPos.x = csCmdNPCAction->startPos.x;
|
||||
startPos.y = csCmdNPCAction->startPos.y;
|
||||
startPos.z = csCmdNPCAction->startPos.z;
|
||||
|
@ -1134,7 +1136,7 @@ void func_80AB359C(EnNb* this) {
|
|||
temp_t1 += 25;
|
||||
|
||||
if (temp_t1 >= this->movementTimer) {
|
||||
f0 = func_8006F9BC(temp_t1, 0, this->movementTimer, 3, 3);
|
||||
f0 = Environment_LerpWeightAccelDecel(temp_t1, 0, this->movementTimer, 3, 3);
|
||||
world->pos.x = initialPos->x + (f0 * (finalPos->x - initialPos->x));
|
||||
world->pos.y = initialPos->y + (f0 * (finalPos->y - initialPos->y));
|
||||
world->pos.z = initialPos->z + (f0 * (finalPos->z - initialPos->z));
|
||||
|
|
|
@ -38,11 +38,11 @@ void EnOkarinaEffect_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
EnOkarinaEffect* this = THIS;
|
||||
|
||||
globalCtx->envCtx.unk_F2[0] = 0;
|
||||
if ((D_8011FB30 != 4) && (D_8011FB30 != 5) && (globalCtx->envCtx.gloomySkyEvent == 1)) {
|
||||
globalCtx->envCtx.gloomySkyEvent = 2; // end gloomy sky
|
||||
if ((gWeatherMode != 4) && (gWeatherMode != 5) && (globalCtx->envCtx.gloomySkyMode == 1)) {
|
||||
globalCtx->envCtx.gloomySkyMode = 2; // end gloomy sky
|
||||
func_80077684(globalCtx);
|
||||
}
|
||||
globalCtx->envCtx.lightning = 2; // end lightning
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
}
|
||||
|
||||
void EnOkarinaEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
@ -53,19 +53,19 @@ void EnOkarinaEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ オカリナあらし効果ビカビカビカ〜 ☆☆☆☆☆ \n" VT_RST);
|
||||
osSyncPrintf("\n\n");
|
||||
if (globalCtx->envCtx.unk_EE[1] != 0) {
|
||||
Actor_Kill(&this->actor); // kill if an instance is already spawned
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
EnOkarinaEffect_SetupAction(this, EnOkarinaEffect_TriggerStorm);
|
||||
}
|
||||
|
||||
void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) {
|
||||
this->timer = 400; // 20 seconds
|
||||
globalCtx->envCtx.unk_F2[0] = 20; // rain intensity target
|
||||
globalCtx->envCtx.gloomySkyEvent = 1; // start gloomy sky
|
||||
if ((D_8011FB30 != 0) || globalCtx->envCtx.gloomySky != 0) {
|
||||
this->timer = 400; // 20 seconds
|
||||
globalCtx->envCtx.unk_F2[0] = 20; // rain intensity target
|
||||
globalCtx->envCtx.gloomySkyMode = 1; // start gloomy sky
|
||||
if ((gWeatherMode != 0) || globalCtx->envCtx.unk_17 != 0) {
|
||||
globalCtx->envCtx.unk_DE = 1;
|
||||
}
|
||||
globalCtx->envCtx.lightning = 1; // start lightning
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
func_80077624(globalCtx);
|
||||
EnOkarinaEffect_SetupAction(this, EnOkarinaEffect_ManageStorm);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
|
|||
(globalCtx->msgCtx.unk_E300 == 0) && (!FrameAdvance_IsEnabled(globalCtx)) &&
|
||||
((globalCtx->transitionMode == 0) || (gSaveContext.gameMode != 0))) ||
|
||||
(this->timer >= 250)) {
|
||||
if (globalCtx->envCtx.unk_1E != 0 || globalCtx->envCtx.unk_1F != 1) {
|
||||
if (globalCtx->envCtx.indoors || globalCtx->envCtx.unk_1F != 1) {
|
||||
this->timer--;
|
||||
}
|
||||
osSyncPrintf("\nthis->timer=[%d]", this->timer);
|
||||
|
@ -98,15 +98,15 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
|
|||
func_800F6D58(0xF, 1, 0);
|
||||
func_800F6D58(0xE, 1, 0);
|
||||
}
|
||||
osSyncPrintf("\n\n\nE_wether_flg=[%d]", D_8011FB30);
|
||||
osSyncPrintf("\nrain_evt_trg=[%d]\n\n", globalCtx->envCtx.gloomySkyEvent);
|
||||
if (D_8011FB30 == 0 && (globalCtx->envCtx.gloomySkyEvent == 1)) {
|
||||
globalCtx->envCtx.gloomySkyEvent = 2; // end gloomy sky
|
||||
osSyncPrintf("\n\n\nE_wether_flg=[%d]", gWeatherMode);
|
||||
osSyncPrintf("\nrain_evt_trg=[%d]\n\n", globalCtx->envCtx.gloomySkyMode);
|
||||
if (gWeatherMode == 0 && (globalCtx->envCtx.gloomySkyMode == 1)) {
|
||||
globalCtx->envCtx.gloomySkyMode = 2; // end gloomy sky
|
||||
} else {
|
||||
globalCtx->envCtx.gloomySkyEvent = 0;
|
||||
globalCtx->envCtx.gloomySkyMode = 0;
|
||||
globalCtx->envCtx.unk_DE = 0;
|
||||
}
|
||||
globalCtx->envCtx.lightning = 2; // end lightning
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -958,7 +958,7 @@ void func_80ACC00C(EnOwl* this, GlobalContext* globalCtx) {
|
|||
this->actionFunc = EnOwl_WaitDefault;
|
||||
this->unk_40A = 0;
|
||||
this->actionFlags |= 0x80;
|
||||
D_8011FB40 = 0;
|
||||
gTimeIncrement = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1348,8 +1348,8 @@ void func_80ACD130(EnOwl* this, GlobalContext* globalCtx, s32 idx) {
|
|||
}
|
||||
|
||||
f32 func_80ACD1C4(GlobalContext* globalCtx, s32 idx) {
|
||||
f32 ret = func_8006F93C(globalCtx->csCtx.npcActions[idx]->endFrame, globalCtx->csCtx.npcActions[idx]->startFrame,
|
||||
globalCtx->csCtx.frames);
|
||||
f32 ret = Environment_LerpWeight(globalCtx->csCtx.npcActions[idx]->endFrame,
|
||||
globalCtx->csCtx.npcActions[idx]->startFrame, globalCtx->csCtx.frames);
|
||||
|
||||
ret = CLAMP_MAX(ret, 1.0f);
|
||||
return ret;
|
||||
|
|
|
@ -172,8 +172,8 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
void EnRd_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnRd* this = THIS;
|
||||
|
||||
if (gSaveContext.unk_1422 != 0) {
|
||||
gSaveContext.unk_1422 = 0;
|
||||
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
}
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ void func_80AE3DE4(EnRd* this) {
|
|||
this->unk_31B = 1;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
if (gSaveContext.unk_1422 != 0) {
|
||||
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
|
||||
this->unk_318 = 1;
|
||||
this->unk_316 = 0x258;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT);
|
||||
|
@ -698,7 +698,7 @@ void func_80AE3ECC(EnRd* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
if (this->unk_316 == 0) {
|
||||
this->unk_318 = 0;
|
||||
gSaveContext.unk_1422 = 0;
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -740,7 +740,7 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) {
|
|||
s32 pad;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((gSaveContext.unk_1422 != 0) && (this->actor.shape.rot.x == 0) && (this->unk_318 == 0) &&
|
||||
if ((gSaveContext.sunsSongState != SUNSSONG_INACTIVE) && (this->actor.shape.rot.x == 0) && (this->unk_318 == 0) &&
|
||||
(this->unk_31B != 9) && (this->unk_31B != 10) && (this->unk_31B != 1)) {
|
||||
func_80AE3DE4(this);
|
||||
return;
|
||||
|
@ -794,8 +794,8 @@ void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
func_80AE4114(this, globalCtx);
|
||||
|
||||
if (gSaveContext.unk_1422 != 0 && this->unk_318 == 0) {
|
||||
gSaveContext.unk_1422 = 0;
|
||||
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE && this->unk_318 == 0) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
}
|
||||
|
||||
if (this->unk_31C != 6 && ((this->unk_31B != 11) || (this->unk_31C != 14))) {
|
||||
|
|
|
@ -248,7 +248,8 @@ void func_80AF29DC(EnRu2* this, GlobalContext* globalCtx) {
|
|||
f32 posY = thisx->world.pos.y;
|
||||
f32 posZ = thisx->world.pos.z;
|
||||
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, WARP_SAGES);
|
||||
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0,
|
||||
WARP_SAGES);
|
||||
}
|
||||
|
||||
void func_80AF2A38(EnRu2* this, GlobalContext* globalCtx) {
|
||||
|
@ -616,7 +617,7 @@ void func_80AF37CC(EnRu2* this) {
|
|||
f32 funcFloat;
|
||||
|
||||
this->unk_2C0++;
|
||||
funcFloat = func_8006F9BC((kREG(2) + 0x96) & 0xFFFF, 0, this->unk_2C0, 8, 0);
|
||||
funcFloat = Environment_LerpWeightAccelDecel((kREG(2) + 0x96) & 0xFFFF, 0, this->unk_2C0, 8, 0);
|
||||
this->actor.world.pos.y = this->actor.home.pos.y + (300.0f * funcFloat);
|
||||
}
|
||||
|
||||
|
|
|
@ -999,7 +999,7 @@ void EnSkj_WaitForSong(EnSkj* this, GlobalContext* globalCtx) {
|
|||
player->stateFlags2 |= 0x800000;
|
||||
} else {
|
||||
if (globalCtx->msgCtx.unk_E3EE >= 5) {
|
||||
gSaveContext.unk_1422 = 0;
|
||||
gSaveContext.sunsSongState = 0;
|
||||
if (gSaveContext.itemGetInf[1] & 0x40) {
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
player->unk_6A8 = &this->actor;
|
||||
|
|
|
@ -984,7 +984,7 @@ void func_80B0EEA4(GlobalContext* globalCtx) {
|
|||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_sw.c", 2205);
|
||||
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_sw.c", 2207);
|
||||
}
|
||||
|
|
|
@ -449,8 +449,8 @@ void EnTr_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
f32 func_80B23FDC(GlobalContext* globalCtx, s32 actionIndex) {
|
||||
f32 phi_f2 = func_8006F93C(globalCtx->csCtx.npcActions[actionIndex]->endFrame,
|
||||
globalCtx->csCtx.npcActions[actionIndex]->startFrame, globalCtx->csCtx.frames);
|
||||
f32 phi_f2 = Environment_LerpWeight(globalCtx->csCtx.npcActions[actionIndex]->endFrame,
|
||||
globalCtx->csCtx.npcActions[actionIndex]->startFrame, globalCtx->csCtx.frames);
|
||||
phi_f2 = CLAMP_MAX(phi_f2, 1.0f);
|
||||
return phi_f2;
|
||||
}
|
||||
|
|
|
@ -41,8 +41,6 @@ void func_80B2B8FC(EnViewer* this, GlobalContext* globalCtx);
|
|||
void func_80B2BA38(EnViewer* this, GlobalContext* globalCtx);
|
||||
void func_80B2C130(EnViewer* this, GlobalContext* globalCtx);
|
||||
|
||||
extern Mtx D_01000000;
|
||||
|
||||
static u8 D_80B2CEC0 = false;
|
||||
|
||||
const ActorInit En_Viewer_InitVars = {
|
||||
|
@ -710,8 +708,8 @@ void EnViewer_GetCutsceneNextPos(EnViewer* this, GlobalContext* globalCtx) {
|
|||
endPos.x = globalCtx->csCtx.npcActions[0]->endPos.x;
|
||||
endPos.y = globalCtx->csCtx.npcActions[0]->endPos.y;
|
||||
endPos.z = globalCtx->csCtx.npcActions[0]->endPos.z;
|
||||
interpolated = func_8006F93C(globalCtx->csCtx.npcActions[0]->endFrame,
|
||||
globalCtx->csCtx.npcActions[0]->startFrame, globalCtx->csCtx.frames);
|
||||
interpolated = Environment_LerpWeight(globalCtx->csCtx.npcActions[0]->endFrame,
|
||||
globalCtx->csCtx.npcActions[0]->startFrame, globalCtx->csCtx.frames);
|
||||
this->actor.world.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x;
|
||||
this->actor.world.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y;
|
||||
this->actor.world.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z;
|
||||
|
@ -725,8 +723,8 @@ void EnViewer_GetCutsceneNextPos(EnViewer* this, GlobalContext* globalCtx) {
|
|||
endPos.x = globalCtx->csCtx.npcActions[1]->endPos.x;
|
||||
endPos.y = globalCtx->csCtx.npcActions[1]->endPos.y;
|
||||
endPos.z = globalCtx->csCtx.npcActions[1]->endPos.z;
|
||||
interpolated = func_8006F93C(globalCtx->csCtx.npcActions[1]->endFrame,
|
||||
globalCtx->csCtx.npcActions[1]->startFrame, globalCtx->csCtx.frames);
|
||||
interpolated = Environment_LerpWeight(globalCtx->csCtx.npcActions[1]->endFrame,
|
||||
globalCtx->csCtx.npcActions[1]->startFrame, globalCtx->csCtx.frames);
|
||||
this->actor.world.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x;
|
||||
this->actor.world.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y;
|
||||
this->actor.world.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z;
|
||||
|
|
|
@ -136,17 +136,17 @@ u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, GlobalContext* global
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this->actor.params)) {
|
||||
if ((globalCtx->envCtx.unk_1E != 0) || !D_8011FB3C ||
|
||||
if ((globalCtx->envCtx.indoors != 0) || !gSkyboxBlendingEnabled ||
|
||||
(globalCtx->skyboxId != SKYBOX_NORMAL_SKY && globalCtx->envCtx.unk_1F == globalCtx->envCtx.unk_20)) {
|
||||
D_8011FB38 = 1;
|
||||
if (globalCtx->envCtx.gloomySkyEvent == 0 &&
|
||||
(globalCtx->envCtx.unk_1E != 0 || (globalCtx->envCtx.unk_1F != 1 && globalCtx->envCtx.unk_21 == 0))) {
|
||||
if (globalCtx->envCtx.gloomySkyMode == 0 &&
|
||||
(globalCtx->envCtx.indoors != 0 || (globalCtx->envCtx.unk_1F != 1 && globalCtx->envCtx.unk_21 == 0))) {
|
||||
D_8011FB38 = 0;
|
||||
if (D_8011FB30 != weatherMode) {
|
||||
D_8011FB30 = weatherMode;
|
||||
if (globalCtx->envCtx.gloomySkyEvent == 0) {
|
||||
if (gWeatherMode != weatherMode) {
|
||||
gWeatherMode = weatherMode;
|
||||
if (globalCtx->envCtx.gloomySkyMode == 0) {
|
||||
globalCtx->envCtx.unk_19 = 1;
|
||||
globalCtx->envCtx.gloomySky = arg2;
|
||||
globalCtx->envCtx.unk_17 = arg2;
|
||||
globalCtx->envCtx.unk_18 = arg3;
|
||||
globalCtx->envCtx.unk_1A = arg6;
|
||||
globalCtx->envCtx.unk_21 = 1;
|
||||
|
@ -160,7 +160,7 @@ u8 WeatherTag_CheckEnableWeatherEffect(EnWeatherTag* this, GlobalContext* global
|
|||
ret = true;
|
||||
}
|
||||
} else {
|
||||
if (D_8011FB40 != 0) {
|
||||
if (gTimeIncrement != 0) {
|
||||
gSaveContext.dayTime += 0x14;
|
||||
}
|
||||
}
|
||||
|
@ -176,15 +176,15 @@ u8 WeatherTag_CheckRestoreWeather(EnWeatherTag* this, GlobalContext* globalCtx,
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((WEATHER_TAG_RANGE100(this->actor.params) + 100.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
|
||||
if (globalCtx->envCtx.unk_1E != 0 || !D_8011FB3C ||
|
||||
if (globalCtx->envCtx.indoors != 0 || !gSkyboxBlendingEnabled ||
|
||||
(globalCtx->skyboxId != SKYBOX_NORMAL_SKY && globalCtx->envCtx.unk_1F == globalCtx->envCtx.unk_20)) {
|
||||
D_8011FB38 = 1;
|
||||
if ((globalCtx->envCtx.gloomySkyEvent == 0) &&
|
||||
(globalCtx->envCtx.unk_1E != 0 || (globalCtx->envCtx.unk_1F != 1 && globalCtx->envCtx.unk_21 == 0))) {
|
||||
if ((globalCtx->envCtx.gloomySkyMode == 0) &&
|
||||
(globalCtx->envCtx.indoors != 0 || (globalCtx->envCtx.unk_1F != 1 && globalCtx->envCtx.unk_21 == 0))) {
|
||||
D_8011FB38 = 0;
|
||||
D_8011FB30 = 0;
|
||||
gWeatherMode = 0;
|
||||
globalCtx->envCtx.unk_19 = 1;
|
||||
globalCtx->envCtx.gloomySky = arg2;
|
||||
globalCtx->envCtx.unk_17 = arg2;
|
||||
globalCtx->envCtx.unk_18 = arg3;
|
||||
globalCtx->envCtx.unk_1A = arg6;
|
||||
globalCtx->envCtx.unk_21 = 1;
|
||||
|
@ -196,7 +196,7 @@ u8 WeatherTag_CheckRestoreWeather(EnWeatherTag* this, GlobalContext* globalCtx,
|
|||
|
||||
ret = true;
|
||||
}
|
||||
} else if (D_8011FB40 != 0) {
|
||||
} else if (gTimeIncrement != 0) {
|
||||
gSaveContext.dayTime += 0x14;
|
||||
}
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ void EnWeatherTag_EnabledRainLakeHylia(EnWeatherTag* this, GlobalContext* global
|
|||
void EnWeatherTag_DisabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckEnableWeatherEffect(this, globalCtx, 0, 1, 0, 4, 100, 5)) {
|
||||
func_80077624(globalCtx);
|
||||
globalCtx->envCtx.lightning = 1;
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
globalCtx->envCtx.unk_EE[0] = 30;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledCloudyRainThunderKakariko);
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ void EnWeatherTag_DisabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalCo
|
|||
void EnWeatherTag_EnabledCloudyRainThunderKakariko(EnWeatherTag* this, GlobalContext* globalCtx) {
|
||||
if (WeatherTag_CheckRestoreWeather(this, globalCtx, 1, 0, 4, 0, 100)) {
|
||||
func_80077684(globalCtx);
|
||||
globalCtx->envCtx.lightning = 2;
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledCloudyRainThunderKakariko);
|
||||
}
|
||||
|
@ -291,11 +291,11 @@ void EnWeatherTag_SetSandstormIntensity(EnWeatherTag* this, GlobalContext* globa
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this->actor.params)) {
|
||||
Math_SmoothStepToS(&globalCtx->envCtx.unk_9E, -0x50, 1, 2, 1);
|
||||
Math_SmoothStepToS(&globalCtx->envCtx.unk_A0, -0x7D0, 1, 50, 1);
|
||||
Math_SmoothStepToS(&globalCtx->envCtx.adjFogNear, -0x50, 1, 2, 1);
|
||||
Math_SmoothStepToS(&globalCtx->envCtx.adjFogFar, -0x7D0, 1, 50, 1);
|
||||
} else {
|
||||
Math_SmoothStepToS(&globalCtx->envCtx.unk_9E, 0, 1, 1, 1);
|
||||
Math_SmoothStepToS(&globalCtx->envCtx.unk_A0, 0, 1, 25, 1);
|
||||
Math_SmoothStepToS(&globalCtx->envCtx.adjFogNear, 0, 1, 1, 1);
|
||||
Math_SmoothStepToS(&globalCtx->envCtx.adjFogFar, 0, 1, 25, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ void EnWeatherTag_DisabledRainThunder(EnWeatherTag* this, GlobalContext* globalC
|
|||
|
||||
if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(this->actor.params)) {
|
||||
func_80077624(globalCtx);
|
||||
globalCtx->envCtx.lightning = 1;
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_ON;
|
||||
globalCtx->envCtx.unk_EE[0] = 25;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_EnabledRainThunder);
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ void EnWeatherTag_EnabledRainThunder(EnWeatherTag* this, GlobalContext* globalCt
|
|||
|
||||
if ((WEATHER_TAG_RANGE100(this->actor.params) + 10.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
|
||||
func_80077684(globalCtx);
|
||||
globalCtx->envCtx.lightning = 2;
|
||||
globalCtx->envCtx.lightningMode = LIGHTNING_MODE_LAST;
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
globalCtx->envCtx.unk_EE[1] = 10;
|
||||
EnWeatherTag_SetupAction(this, EnWeatherTag_DisabledRainThunder);
|
||||
|
|
|
@ -173,7 +173,8 @@ void func_80B3C620(EnXc* this, GlobalContext* globalCtx, s32 npcActionIdx) {
|
|||
f32 unk;
|
||||
|
||||
if (npcAction != NULL) {
|
||||
unk = func_8006F9BC(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, 0, 0);
|
||||
unk =
|
||||
Environment_LerpWeightAccelDecel(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, 0, 0);
|
||||
startX = npcAction->startPos.x;
|
||||
startY = npcAction->startPos.y;
|
||||
startZ = npcAction->startPos.z;
|
||||
|
@ -1392,7 +1393,8 @@ void func_80B3F534(GlobalContext* globalCtx) {
|
|||
u16 frameCount = csCtx->frames;
|
||||
|
||||
if (frameCount == 310) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DOOR_WARP1, -1044.0f, -1243.0f, 7458.0f, 0, 0, 0, WARP_DESTINATION);
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DOOR_WARP1, -1044.0f, -1243.0f, 7458.0f, 0, 0, 0,
|
||||
WARP_DESTINATION);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -377,11 +377,11 @@ void func_80B4B010(EnZl1* this, GlobalContext* globalCtx) {
|
|||
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, this->unk_1E8, CAM_STAT_ACTIVE);
|
||||
func_800C0808(globalCtx, this->unk_1E8, player, CAM_SET_FREE0);
|
||||
globalCtx->envCtx.unk_E2[0] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[2] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[3] = 0x18;
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.screenFillColor[0] = 255;
|
||||
globalCtx->envCtx.screenFillColor[1] = 255;
|
||||
globalCtx->envCtx.screenFillColor[2] = 255;
|
||||
globalCtx->envCtx.screenFillColor[3] = 24;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &vec1, &vec2);
|
||||
Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 30.0f);
|
||||
ShrinkWindow_SetVal(0x20);
|
||||
|
@ -435,7 +435,7 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
case 1:
|
||||
if ((func_8010BDBC(msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
|
||||
globalCtx->envCtx.unk_E1 = 0;
|
||||
globalCtx->envCtx.fillScreen = false;
|
||||
Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &sp74, &sp68);
|
||||
Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 25.0f);
|
||||
player->actor.world.pos = sp58;
|
||||
|
|
|
@ -692,7 +692,8 @@ void func_80B500E0(EnZl2* this, GlobalContext* globalCtx) {
|
|||
f32 someFloat;
|
||||
|
||||
if (npcAction != NULL) {
|
||||
someFloat = func_8006F9BC(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, 8, 8);
|
||||
someFloat =
|
||||
Environment_LerpWeightAccelDecel(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, 8, 8);
|
||||
startX = npcAction->startPos.x;
|
||||
startY = npcAction->startPos.y;
|
||||
startZ = npcAction->startPos.z;
|
||||
|
@ -716,7 +717,8 @@ void func_80B501E8(EnZl2* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (npcAction != NULL) {
|
||||
this->actor.shape.shadowAlpha = this->alpha =
|
||||
(1.0f - func_8006F93C(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames)) * 255.0f;
|
||||
(1.0f - Environment_LerpWeight(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames)) *
|
||||
255.0f;
|
||||
func_80B501C4(this, this->alpha);
|
||||
}
|
||||
}
|
||||
|
@ -1457,7 +1459,8 @@ void func_80B51DA4(EnZl2* this, GlobalContext* globalCtx) {
|
|||
f32 someFloat;
|
||||
|
||||
if (npcAction != NULL) {
|
||||
someFloat = func_8006F9BC(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, 0, 8);
|
||||
someFloat =
|
||||
Environment_LerpWeightAccelDecel(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, 0, 8);
|
||||
startX = npcAction->startPos.x;
|
||||
startY = npcAction->startPos.y;
|
||||
startZ = npcAction->startPos.z;
|
||||
|
|
|
@ -1045,8 +1045,8 @@ void func_80B559C4(EnZl3* this) {
|
|||
Vec3f* thisPos = &this->actor.world.pos;
|
||||
Vec3f* unk_32C = &this->unk_32C;
|
||||
Vec3f* unk_338 = &this->unk_338;
|
||||
f32 temp_f0 =
|
||||
func_8006F9BC(Animation_GetLastFrame(&gZelda2Anime2Anim_005248), 0, (s32)this->skelAnime.curFrame, 3, 3);
|
||||
f32 temp_f0 = Environment_LerpWeightAccelDecel(Animation_GetLastFrame(&gZelda2Anime2Anim_005248), 0,
|
||||
(s32)this->skelAnime.curFrame, 3, 3);
|
||||
|
||||
thisPos->x = unk_32C->x + (temp_f0 * (unk_338->x - unk_32C->x));
|
||||
thisPos->z = unk_32C->z + (temp_f0 * (unk_338->z - unk_32C->z));
|
||||
|
@ -1959,7 +1959,7 @@ void func_80B57CB4(EnZl3* this, GlobalContext* globalCtx) {
|
|||
f32 temp_f0;
|
||||
|
||||
this->unk_344 += 1;
|
||||
temp_f0 = func_8006F9BC(this->unk_346, 0, this->unk_344, 3, 3);
|
||||
temp_f0 = Environment_LerpWeightAccelDecel(this->unk_346, 0, this->unk_344, 3, 3);
|
||||
thisPos->x = unk_348->x + (temp_f0 * (unk_354->x - unk_348->x));
|
||||
thisPos->y = (unk_348->y + (temp_f0 * (unk_354->y - unk_348->y))) + this->unk_360;
|
||||
thisPos->z = unk_348->z + (temp_f0 * (unk_354->z - unk_348->z));
|
||||
|
@ -2262,7 +2262,7 @@ void func_80B58C08(EnZl3* this, GlobalContext* globalCtx) {
|
|||
unk_344 = this->unk_344;
|
||||
unk_346 = this->unk_346;
|
||||
sp28 = unk_346 - kREG(11) - 2;
|
||||
temp_f0 = func_8006F9BC(unk_346, 0, unk_344, 3, 0);
|
||||
temp_f0 = Environment_LerpWeightAccelDecel(unk_346, 0, unk_344, 3, 0);
|
||||
|
||||
thisPos->x = unk_348->x + (temp_f0 * (unk_354->x - unk_348->x));
|
||||
thisPos->y = (unk_348->y + (temp_f0 * (unk_354->y - unk_348->y))) + this->unk_360;
|
||||
|
|
|
@ -451,9 +451,9 @@ void EnfHG_SetupApproach(EnfHG* this, GlobalContext* globalCtx, s16 paintingInde
|
|||
this->actor.scale.z = 0.001f;
|
||||
this->approachRate = 0.0f;
|
||||
|
||||
this->warpColorFilterR = globalCtx->lightCtx.unk_07;
|
||||
this->warpColorFilterG = globalCtx->lightCtx.unk_08;
|
||||
this->warpColorFilterB = globalCtx->lightCtx.unk_09;
|
||||
this->warpColorFilterR = globalCtx->lightCtx.fogColor[0];
|
||||
this->warpColorFilterG = globalCtx->lightCtx.fogColor[1];
|
||||
this->warpColorFilterB = globalCtx->lightCtx.fogColor[2];
|
||||
this->warpColorFilterUnk1 = 0.0f;
|
||||
this->warpColorFilterUnk2 = 0.0f;
|
||||
this->turnRot = 0;
|
||||
|
@ -513,9 +513,9 @@ void EnfHG_Attack(EnfHG* this, GlobalContext* globalCtx) {
|
|||
Math_ApproachF(&this->warpColorFilterB, 255.0f, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterUnk1, -60.0f, 1.0f, 5.0f);
|
||||
} else {
|
||||
Math_ApproachF(&this->warpColorFilterR, globalCtx->lightCtx.unk_07, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterG, globalCtx->lightCtx.unk_07, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterB, globalCtx->lightCtx.unk_07, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterR, globalCtx->lightCtx.fogColor[0], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterG, globalCtx->lightCtx.fogColor[0], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterB, globalCtx->lightCtx.fogColor[0], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterUnk1, 0.0f, 1.0f, 5.0f);
|
||||
if (this->timers[1] == 29) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FANTOM_MASIC2);
|
||||
|
@ -586,9 +586,9 @@ void EnfHG_Damage(EnfHG* this, GlobalContext* globalCtx) {
|
|||
|
||||
osSyncPrintf("REVISE !!\n");
|
||||
SkelAnime_Update(&this->skin.skelAnime);
|
||||
Math_ApproachF(&this->warpColorFilterR, globalCtx->lightCtx.unk_07, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterG, globalCtx->lightCtx.unk_07, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterB, globalCtx->lightCtx.unk_07, 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterR, globalCtx->lightCtx.fogColor[0], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterG, globalCtx->lightCtx.fogColor[0], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterB, globalCtx->lightCtx.fogColor[0], 1.0f, 10.0f);
|
||||
Math_ApproachF(&this->warpColorFilterUnk1, 0.0f, 1.0f, 5.0f);
|
||||
Math_ApproachF(&this->actor.scale.z, 0.011499999f, 1.0f, 0.002f);
|
||||
if (this->timers[0] != 0) {
|
||||
|
@ -727,6 +727,6 @@ void EnfHG_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
(u32)this->warpColorFilterB, 0, (s32)this->warpColorFilterUnk1 + 995,
|
||||
(s32)this->warpColorFilterUnk2 + 1000);
|
||||
func_800A6330(&this->actor, globalCtx, &this->skin, EnfHG_Noop, 0x23);
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_fhg.c", 2480);
|
||||
}
|
||||
|
|
|
@ -865,7 +865,7 @@ void Fishing_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
D_80B7A684 = 20;
|
||||
globalCtx->specialEffects = sFishingEffects;
|
||||
D_8011FB40 = 1;
|
||||
gTimeIncrement = 1;
|
||||
D_80B7E0AC = 0;
|
||||
D_80B7E0A6 = 10;
|
||||
|
||||
|
@ -5347,8 +5347,8 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
func_80064534(globalCtx, &globalCtx->csCtx);
|
||||
D_80B7A6CC = 0;
|
||||
sCameraId = 0;
|
||||
func_80070600(globalCtx, 0);
|
||||
globalCtx->envCtx.unk_9E = 0;
|
||||
Environment_EnableUnderwaterLights(globalCtx, 0);
|
||||
globalCtx->envCtx.adjFogNear = 0;
|
||||
player->unk_860 = -5;
|
||||
D_80B7E0B0 = 5;
|
||||
break;
|
||||
|
@ -5391,8 +5391,8 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
D_80B7A6CC = 0;
|
||||
sCameraId = 0;
|
||||
D_80B7A6D0 = 30;
|
||||
func_80070600(globalCtx, 0);
|
||||
globalCtx->envCtx.unk_9E = 0;
|
||||
Environment_EnableUnderwaterLights(globalCtx, 0);
|
||||
globalCtx->envCtx.adjFogNear = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5497,8 +5497,8 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
D_80B7E0B0 = 5;
|
||||
D_80B7A6D4 = 0;
|
||||
D_80B7E0A6 = 20;
|
||||
func_80070600(globalCtx, 0);
|
||||
globalCtx->envCtx.unk_9E = 0;
|
||||
Environment_EnableUnderwaterLights(globalCtx, 0);
|
||||
globalCtx->envCtx.adjFogNear = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5513,15 +5513,15 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Math_ApproachF(&D_80B7FECC, 1.0f, 1.0f, 0.02f);
|
||||
|
||||
if (sCameraEye.y <= (WATER_SURFACE_Y(globalCtx) + 1.0f)) {
|
||||
func_80070600(globalCtx, 1);
|
||||
Environment_EnableUnderwaterLights(globalCtx, 1);
|
||||
if (D_80B7E076 != 0) {
|
||||
globalCtx->envCtx.unk_9E = -0xB2;
|
||||
globalCtx->envCtx.adjFogNear = -0xB2;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_9E = -0x2E;
|
||||
globalCtx->envCtx.adjFogNear = -0x2E;
|
||||
}
|
||||
} else {
|
||||
func_80070600(globalCtx, 0);
|
||||
globalCtx->envCtx.unk_9E = 0;
|
||||
Environment_EnableUnderwaterLights(globalCtx, 0);
|
||||
globalCtx->envCtx.adjFogNear = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5565,9 +5565,9 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
if (sREG(15) != 0) {
|
||||
if (D_80B7A654 != (sREG(15) - 1)) {
|
||||
if (D_80B7A654 == 0) {
|
||||
globalCtx->envCtx.gloomySkyEvent = 1;
|
||||
globalCtx->envCtx.gloomySkyMode = 1;
|
||||
} else {
|
||||
globalCtx->envCtx.gloomySkyEvent = 2;
|
||||
globalCtx->envCtx.gloomySkyMode = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5575,10 +5575,10 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
}
|
||||
|
||||
if (sREG(14) == 1) {
|
||||
globalCtx->envCtx.gloomySkyEvent = 1;
|
||||
globalCtx->envCtx.gloomySkyMode = 1;
|
||||
}
|
||||
if (sREG(14) == -1) {
|
||||
globalCtx->envCtx.gloomySkyEvent = 2;
|
||||
globalCtx->envCtx.gloomySkyMode = 2;
|
||||
}
|
||||
|
||||
sREG(14) = 0;
|
||||
|
@ -5596,10 +5596,10 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
D_80B7A654 = (u8)Rand_ZeroFloat(10.0f) + 5;
|
||||
globalCtx->envCtx.gloomySkyEvent = 1;
|
||||
globalCtx->envCtx.gloomySkyMode = 1;
|
||||
} else {
|
||||
D_80B7A654 = 0;
|
||||
globalCtx->envCtx.gloomySkyEvent = 2;
|
||||
globalCtx->envCtx.gloomySkyMode = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5631,7 +5631,8 @@ void Fishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
Math_ApproachZeroF(&D_80B7A658, 1.0f, 2.0f);
|
||||
}
|
||||
|
||||
globalCtx->envCtx.unk_8C[1][0] = globalCtx->envCtx.unk_8C[1][1] = globalCtx->envCtx.unk_8C[1][2] = D_80B7A658;
|
||||
globalCtx->envCtx.adjLight1Color[0] = globalCtx->envCtx.adjLight1Color[1] = globalCtx->envCtx.adjLight1Color[2] =
|
||||
D_80B7A658;
|
||||
|
||||
if ((u8)D_80B7A650 > 0) {
|
||||
s32 pad;
|
||||
|
|
|
@ -137,29 +137,33 @@ void MagicDark_DiamondUpdate(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
void MagicDark_DimLighting(GlobalContext* globalCtx, f32 intensity) {
|
||||
s32 i;
|
||||
f32 temp_f0;
|
||||
f32 phi_f0;
|
||||
f32 colorScale;
|
||||
f32 fogScale;
|
||||
|
||||
if (globalCtx->roomCtx.curRoom.unk_03 != 5) {
|
||||
intensity = CLAMP_MIN(intensity, 0.0f);
|
||||
intensity = CLAMP_MAX(intensity, 1.0f);
|
||||
phi_f0 = intensity - 0.2f;
|
||||
fogScale = intensity - 0.2f;
|
||||
|
||||
if (intensity < 0.2f) {
|
||||
phi_f0 = 0.0f;
|
||||
fogScale = 0.0f;
|
||||
}
|
||||
globalCtx->envCtx.unk_9E = (850.0f - globalCtx->envCtx.unk_D2) * phi_f0;
|
||||
|
||||
globalCtx->envCtx.adjFogNear = (850.0f - globalCtx->envCtx.lightSettings.fogNear) * fogScale;
|
||||
|
||||
if (intensity == 0.0f) {
|
||||
for (i = 0; i < ARRAY_COUNT(globalCtx->envCtx.unk_8C[2]); i++) {
|
||||
globalCtx->envCtx.unk_8C[2][i] = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(globalCtx->envCtx.adjFogColor); i++) {
|
||||
globalCtx->envCtx.adjFogColor[i] = 0;
|
||||
}
|
||||
} else {
|
||||
temp_f0 = intensity * 5.0f;
|
||||
if (temp_f0 > 1.0f) {
|
||||
temp_f0 = 1.0f;
|
||||
colorScale = intensity * 5.0f;
|
||||
|
||||
if (colorScale > 1.0f) {
|
||||
colorScale = 1.0f;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(globalCtx->envCtx.unk_8C[2]); i++) {
|
||||
globalCtx->envCtx.unk_8C[2][i] = -(s16)(globalCtx->envCtx.unk_CF[i] * temp_f0);
|
||||
for (i = 0; i < ARRAY_COUNT(globalCtx->envCtx.adjFogColor); i++) {
|
||||
globalCtx->envCtx.adjFogColor[i] = -(s16)(globalCtx->envCtx.lightSettings.fogColor[i] * colorScale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ void ObjectKankyo_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void ObjectKankyo_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjectKankyo_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
extern UNK_TYPE D_01000000;
|
||||
extern UNK_TYPE D_06009620;
|
||||
|
||||
/*
|
||||
|
|
|
@ -82,9 +82,9 @@ void OceffSpot_End(OceffSpot* this, GlobalContext* globalCtx) {
|
|||
this->unk_174 -= 0.05f;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
if (D_8011FB40 != 400 && globalCtx->msgCtx.unk_E40E == 0 && (gSaveContext.eventInf[0] & 0xF) != 1) {
|
||||
if (gTimeIncrement != 400 && globalCtx->msgCtx.unk_E40E == 0 && (gSaveContext.eventInf[0] & 0xF) != 1) {
|
||||
if (globalCtx->msgCtx.unk_E3F0 != 0x31 || globalCtx->msgCtx.unk_E3EE != 8) {
|
||||
gSaveContext.unk_1422 = 1;
|
||||
gSaveContext.sunsSongState = SUNSSONG_START;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
// Sun's Song Flag
|
||||
osSyncPrintf("z_oceff_spot 太陽の歌フラグ\n");
|
||||
|
@ -133,7 +133,7 @@ void OceffSpot_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actor.world.pos.y += 5.0f;
|
||||
|
||||
temp = (2.0f - this->unk_174) * this->unk_174;
|
||||
func_800773A8(globalCtx, temp * 0.5F, 880.0f, 0.2f, 0.9f);
|
||||
Environment_AdjustLights(globalCtx, temp * 0.5F, 880.0f, 0.2f, 0.9f);
|
||||
|
||||
Lights_PointNoGlowSetInfo(&this->lightInfo1, (s16)this->actor.world.pos.x, (s16)this->actor.world.pos.y + 55.0f,
|
||||
(s16)this->actor.world.pos.z, (s32)(255.0f * temp), (s32)(255.0f * temp),
|
||||
|
|
|
@ -182,9 +182,9 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) {
|
|||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
if (!(this->actor.xzDistToPlayer > 120.0f) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) {
|
||||
cylinderPos.x = player->bodyPartsPos[7].x + globalCtx->envCtx.unk_04.x * (1.0f / 6.0f);
|
||||
cylinderPos.y = player->bodyPartsPos[7].y - 30.0f + globalCtx->envCtx.unk_04.y * (1.0f / 6.0f);
|
||||
cylinderPos.z = player->bodyPartsPos[7].z + globalCtx->envCtx.unk_04.z * (1.0f / 6.0f);
|
||||
cylinderPos.x = player->bodyPartsPos[7].x + globalCtx->envCtx.sunPos.x * (1.0f / 6.0f);
|
||||
cylinderPos.y = player->bodyPartsPos[7].y - 30.0f + globalCtx->envCtx.sunPos.y * (1.0f / 6.0f);
|
||||
cylinderPos.z = player->bodyPartsPos[7].z + globalCtx->envCtx.sunPos.z * (1.0f / 6.0f);
|
||||
|
||||
this->hitboxPos = cylinderPos;
|
||||
|
||||
|
|
|
@ -3912,11 +3912,26 @@ s32 func_80838FB8(GlobalContext* globalCtx, Player* this) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s32 bgId) {
|
||||
static s16 D_808544F8[] = {
|
||||
0x045B, 0x0482, 0x0340, 0x044B, 0x02A2, 0x0201, 0x03B8, 0x04EE, 0x03C0, 0x0463, 0x01CD, 0x0394, 0x0340, 0x057C,
|
||||
};
|
||||
static u8 D_80854514[] = { 11, 9, 3, 5, 7, 0 };
|
||||
s16 D_808544F8[] = {
|
||||
0x045B, // DMT from Magic Fairy Fountain
|
||||
0x0482, // DMC from Double Defense Fairy Fountain
|
||||
0x0340, // Hyrule Castle from Dins Fire Fairy Fountain
|
||||
0x044B, // Kakariko from Potion Shop
|
||||
0x02A2, // Market (child day) from Potion Shop
|
||||
0x0201, // Kakariko from Bazaar
|
||||
0x03B8, // Market (child day) from Bazaar
|
||||
0x04EE, // Kakariko from House of Skulltulas
|
||||
0x03C0, // Back Alley (day) from Bombchu Shop
|
||||
0x0463, // Kakariko from Shooting Gallery
|
||||
0x01CD, // Market (child day) from Shooting Gallery
|
||||
0x0394, // Zoras Fountain from Farores Wind Fairy Fountain
|
||||
0x0340, // Hyrule Castle from Dins Fire Fairy Fountain
|
||||
0x057C, // Desert Colossus from Nayrus Love Fairy Fountain
|
||||
};
|
||||
|
||||
u8 D_80854514[] = { 11, 9, 3, 5, 7, 0 };
|
||||
|
||||
s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u32 bgId) {
|
||||
s32 sp3C;
|
||||
s32 temp;
|
||||
s32 sp34;
|
||||
|
@ -10444,7 +10459,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
func_8084A0E8(globalCtx, this, lod, gCullBackDList, overrideLimbDraw);
|
||||
|
||||
if (this->invincibilityTimer > 0) {
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
}
|
||||
|
||||
if (this->stateFlags2 & 0x4000) {
|
||||
|
@ -11901,7 +11916,7 @@ void func_8084E3C4(Player* this, GlobalContext* globalCtx) {
|
|||
this->stateFlags2 |= 0x8000000;
|
||||
|
||||
if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0xF) == NULL) {
|
||||
func_800776E4(globalCtx);
|
||||
Environment_WarpSongLeave(globalCtx);
|
||||
}
|
||||
|
||||
gSaveContext.seqIndex = 0xFF;
|
||||
|
|
|
@ -28,8 +28,6 @@ EffectSsInit Effect_Ss_Dead_Dd_InitVars = {
|
|||
EffectSsDeadDd_Init,
|
||||
};
|
||||
|
||||
extern Mtx D_01000000;
|
||||
|
||||
u32 EffectSsDeadDd_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx) {
|
||||
s32 i;
|
||||
EffectSsDeadDdInitParams* initParams = (EffectSsDeadDdInitParams*)initParamsx;
|
||||
|
@ -116,7 +114,7 @@ void EffectSsDeadDd_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||
gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
|
||||
PRIMITIVE, 0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffBurnMark1DL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gLensFlareCircleDL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_eff_ss_dead_dd.c", 259);
|
||||
|
|
|
@ -103,7 +103,7 @@ void EffectSsDeadDs_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
|||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
|
||||
PRIMITIVE, 0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffBurnMark1DL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gLensFlareCircleDL);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead_ds.c", 255);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) {
|
|||
gSaveContext.seqIndex = 0xFF;
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
gSaveContext.showTitleCard = true;
|
||||
D_8011FB30 = 0;
|
||||
gWeatherMode = 0;
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ void Select_PrintCutsceneSetting(SelectContext* this, GfxPrint* printer, u16 csI
|
|||
break;
|
||||
};
|
||||
|
||||
gSaveContext.environmentTime = gSaveContext.dayTime;
|
||||
gSaveContext.skyboxTime = gSaveContext.dayTime;
|
||||
GfxPrint_Printf(printer, "Stage:\x8C%s", label);
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ void Title_Draw(TitleContext* this) {
|
|||
gSPTextureRectangle(POLY_OPA_DISP++, 388, y << 2, 1156, (y + 2) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
func_8007672C(this->state.gfxCtx, 0, 0, 0, (s16)this->coverAlpha, 2);
|
||||
Environment_FillScreen(this->state.gfxCtx, 0, 0, 0, (s16)this->coverAlpha, FILL_SCREEN_XLU);
|
||||
|
||||
sTitleRotY += 300;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue