mirror of
https://github.com/zeldaret/oot
synced 2026-05-28 08:25:22 -04: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:
+2
-2
@@ -26,7 +26,7 @@ void osSyncPrintf(const char* fmt, ...) {
|
||||
va_start(args, fmt);
|
||||
|
||||
_Printf(is_proutSyncPrintf, NULL, fmt, args);
|
||||
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ void rmonPrintf(const char* fmt, ...) {
|
||||
va_start(args, fmt);
|
||||
|
||||
_Printf(is_proutSyncPrintf, NULL, fmt, args);
|
||||
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -1355,9 +1355,9 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) {
|
||||
Gfx* displayListHead;
|
||||
Gfx* displayList;
|
||||
|
||||
lightDir.x = globalCtx->envCtx.unk_2A;
|
||||
lightDir.y = globalCtx->envCtx.unk_2B;
|
||||
lightDir.z = globalCtx->envCtx.unk_2C;
|
||||
lightDir.x = globalCtx->envCtx.dirLight1.params.dir.x;
|
||||
lightDir.y = globalCtx->envCtx.dirLight1.params.dir.y;
|
||||
lightDir.z = globalCtx->envCtx.dirLight1.params.dir.z;
|
||||
|
||||
if (HREG(80) == 6) {
|
||||
osSyncPrintf("z_actor.c 3637 game_play->view.eye=[%f(%f) %f %f]\n", globalCtx->view.eye.x,
|
||||
@@ -1386,9 +1386,9 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) {
|
||||
Gfx* displayListHead;
|
||||
Gfx* displayList;
|
||||
|
||||
lightDir.x = globalCtx->envCtx.unk_2A;
|
||||
lightDir.y = globalCtx->envCtx.unk_2B;
|
||||
lightDir.z = globalCtx->envCtx.unk_2C;
|
||||
lightDir.x = globalCtx->envCtx.dirLight1.params.dir.x;
|
||||
lightDir.y = globalCtx->envCtx.dirLight1.params.dir.y;
|
||||
lightDir.z = globalCtx->envCtx.dirLight1.params.dir.z;
|
||||
|
||||
hilite = func_8002EB44(&actor->world.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -3568,9 +3568,9 @@ void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s1
|
||||
Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) {
|
||||
Vec3f lightDir;
|
||||
|
||||
lightDir.x = globalCtx->envCtx.unk_2A;
|
||||
lightDir.y = globalCtx->envCtx.unk_2B;
|
||||
lightDir.z = globalCtx->envCtx.unk_2C;
|
||||
lightDir.x = globalCtx->envCtx.dirLight1.params.dir.x;
|
||||
lightDir.y = globalCtx->envCtx.dirLight1.params.dir.y;
|
||||
lightDir.z = globalCtx->envCtx.dirLight1.params.dir.z;
|
||||
|
||||
return func_8002EABC(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -3578,9 +3578,9 @@ Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) {
|
||||
Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) {
|
||||
Vec3f lightDir;
|
||||
|
||||
lightDir.x = globalCtx->envCtx.unk_2A;
|
||||
lightDir.y = globalCtx->envCtx.unk_2B;
|
||||
lightDir.z = globalCtx->envCtx.unk_2C;
|
||||
lightDir.x = globalCtx->envCtx.dirLight1.params.dir.x;
|
||||
lightDir.y = globalCtx->envCtx.dirLight1.params.dir.y;
|
||||
lightDir.z = globalCtx->envCtx.dirLight1.params.dir.z;
|
||||
|
||||
return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
+11
-11
@@ -547,7 +547,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) {
|
||||
|
||||
if (waterY < chkPos->y) {
|
||||
// the water's y position is below the check position
|
||||
// the aka the position is NOT in the water.
|
||||
// meaning the position is NOT in the water.
|
||||
return BGCHECK_Y_MIN;
|
||||
}
|
||||
|
||||
@@ -1778,7 +1778,7 @@ s32 Camera_Normal2(Camera* camera) {
|
||||
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
bgChk.pos = *eyeNext;
|
||||
if ((camera->globalCtx->envCtx.skyDisabled == 0) || norm2->interfaceFlags & 0x10) {
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled || norm2->interfaceFlags & 0x10) {
|
||||
Camera_BGCheckInfo(camera, at, &bgChk);
|
||||
*eye = bgChk.pos;
|
||||
} else {
|
||||
@@ -2110,7 +2110,7 @@ s32 Camera_Parallel1(Camera* camera) {
|
||||
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spA8);
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
sp6C.pos = *eyeNext;
|
||||
if (camera->globalCtx->envCtx.skyDisabled == 0 || para1->interfaceFlags & 0x10) {
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled || para1->interfaceFlags & 0x10) {
|
||||
Camera_BGCheckInfo(camera, at, &sp6C);
|
||||
*eye = sp6C.pos;
|
||||
} else {
|
||||
@@ -2903,7 +2903,7 @@ s32 Camera_Battle1(Camera* camera) {
|
||||
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spB4);
|
||||
spBC.pos = *eyeNext;
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
if (camera->globalCtx->envCtx.skyDisabled == 0 || batt1->flags & 1) {
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled || batt1->flags & 1) {
|
||||
Camera_BGCheckInfo(camera, at, &spBC);
|
||||
} else if (batt1->flags & 2) {
|
||||
func_80043F94(camera, at, &spBC);
|
||||
@@ -3225,7 +3225,7 @@ s32 Camera_KeepOn1(Camera* camera) {
|
||||
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spD8);
|
||||
sp8C.pos = *eyeNext;
|
||||
if (camera->status == CAM_STAT_ACTIVE) {
|
||||
if ((camera->globalCtx->envCtx.skyDisabled == 0) || keep1->interfaceFlags & 1) {
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled || keep1->interfaceFlags & 1) {
|
||||
Camera_BGCheckInfo(camera, at, &sp8C);
|
||||
} else if (keep1->interfaceFlags & 2) {
|
||||
func_80043F94(camera, at, &sp8C);
|
||||
@@ -4205,7 +4205,7 @@ s32 Camera_Subj3(Camera* camera) {
|
||||
*eye = *eyeNext;
|
||||
anim->animTimer--;
|
||||
|
||||
if (camera->globalCtx->envCtx.skyDisabled == 0) {
|
||||
if (!camera->globalCtx->envCtx.skyboxDisabled) {
|
||||
Camera_BGCheck(camera, at, eye);
|
||||
} else {
|
||||
func_80044340(camera, at, eye);
|
||||
@@ -7047,7 +7047,7 @@ void Camera_PrintSettings(Camera* camera) {
|
||||
s32 Camera_CheckWater(Camera* camera) {
|
||||
f32 waterY;
|
||||
s16 newQuakeId;
|
||||
s32 waterBoxProp;
|
||||
s32 waterLightsIndex;
|
||||
s32* waterPrevCamSetting = &camera->waterPrevCamSetting;
|
||||
s16 waterCamIdx;
|
||||
s16* quakeId = (s16*)&camera->waterQuakeId;
|
||||
@@ -7115,12 +7115,12 @@ s32 Camera_CheckWater(Camera* camera) {
|
||||
}
|
||||
}
|
||||
|
||||
if (waterY = Camera_GetWaterSurface(camera, &camera->eye, &waterBoxProp), waterY != BGCHECK_Y_MIN) {
|
||||
if (waterY = Camera_GetWaterSurface(camera, &camera->eye, &waterLightsIndex), waterY != BGCHECK_Y_MIN) {
|
||||
camera->waterYPos = waterY;
|
||||
if (!(camera->unk_14C & 0x100)) {
|
||||
camera->unk_14C |= 0x100;
|
||||
osSyncPrintf("kankyo changed water, sound on\n");
|
||||
func_80070600(camera->globalCtx, waterBoxProp);
|
||||
Environment_EnableUnderwaterLights(camera->globalCtx, waterLightsIndex);
|
||||
camera->unk_150 = 0x50;
|
||||
}
|
||||
|
||||
@@ -7152,7 +7152,7 @@ s32 Camera_CheckWater(Camera* camera) {
|
||||
if (camera->unk_14C & 0x100) {
|
||||
camera->unk_14C &= ~0x100;
|
||||
osSyncPrintf("kankyo changed water off, sound off\n");
|
||||
func_800706A0(camera->globalCtx);
|
||||
Environment_DisableUnderwaterLights(camera->globalCtx);
|
||||
if (*quakeId != 0) {
|
||||
Quake_RemoveFromIdx(*quakeId);
|
||||
}
|
||||
@@ -7567,7 +7567,7 @@ void Camera_Finish(Camera* camera) {
|
||||
|
||||
camera->childCamIdx = camera->parentCamIdx = SUBCAM_FREE;
|
||||
camera->timer = -1;
|
||||
camera->globalCtx->envCtx.unk_E1 = 0;
|
||||
camera->globalCtx->envCtx.fillScreen = false;
|
||||
|
||||
Gameplay_ClearCamera(camera->globalCtx, camera->thisIdx);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ void SaveContext_Init(void) {
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
gSaveContext.chamberCutsceneNum = 0;
|
||||
gSaveContext.nextDayTime = 0xFFFF;
|
||||
gSaveContext.environmentTime = 0;
|
||||
gSaveContext.skyboxTime = 0;
|
||||
gSaveContext.dogIsLost = true;
|
||||
gSaveContext.nextTransition = 0xFF;
|
||||
gSaveContext.unk_13EE = 50;
|
||||
|
||||
@@ -10,7 +10,7 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
u16 doActionOffset;
|
||||
u8 temp;
|
||||
|
||||
gSaveContext.unk_1422 = 0;
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gSaveContext.unk_13E8 = gSaveContext.unk_13EA = 0;
|
||||
|
||||
View_Init(&interfaceCtx->view, globalCtx->state.gfxCtx);
|
||||
|
||||
+53
-53
@@ -170,7 +170,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
||||
return;
|
||||
}
|
||||
|
||||
temp = func_8006F93C(cmd->endFrame - 1, cmd->startFrame, csCtx->frames);
|
||||
temp = Environment_LerpWeight(cmd->endFrame - 1, cmd->startFrame, csCtx->frames);
|
||||
|
||||
if (csCtx->frames == cmd->startFrame) {
|
||||
sp3F = 1;
|
||||
@@ -187,9 +187,9 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
||||
case 2:
|
||||
if (sp3F != 0) {
|
||||
func_800F6D58(0xF, 0, 0);
|
||||
func_800753C4(globalCtx, 3);
|
||||
Environment_AddLightningBolts(globalCtx, 3);
|
||||
if (1) {}
|
||||
D_8015FD70 = 1;
|
||||
gLightningStrike.state = LIGHTNING_STRIKE_START;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -201,14 +201,14 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (globalCtx->envCtx.unk_A0 < 0x3200) {
|
||||
globalCtx->envCtx.unk_A0 += 0x23;
|
||||
if (globalCtx->envCtx.adjFogFar < 12800) {
|
||||
globalCtx->envCtx.adjFogFar += 35;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (sp3F != 0) {
|
||||
globalCtx->envCtx.unk_19 = 1;
|
||||
globalCtx->envCtx.gloomySky = 1;
|
||||
globalCtx->envCtx.unk_17 = 1;
|
||||
globalCtx->envCtx.unk_18 = 0;
|
||||
globalCtx->envCtx.unk_1A = 0x3C;
|
||||
globalCtx->envCtx.unk_21 = 1;
|
||||
@@ -279,12 +279,12 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
||||
break;
|
||||
case 18:
|
||||
globalCtx->envCtx.unk_EE[0] = 0;
|
||||
globalCtx->envCtx.gloomySkyEvent = 2;
|
||||
globalCtx->envCtx.gloomySkyMode = 2;
|
||||
if (gSaveContext.dayTime < 0x4AAB) {
|
||||
gSaveContext.dayTime += 30;
|
||||
}
|
||||
if (globalCtx->envCtx.unk_EE[1] == 0) {
|
||||
D_8011FB30 = 0;
|
||||
gWeatherMode = 0;
|
||||
func_800F6D58(14, 1, 0);
|
||||
}
|
||||
break;
|
||||
@@ -331,16 +331,16 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
||||
break;
|
||||
case 27:
|
||||
if (globalCtx->state.frames & 8) {
|
||||
if (globalCtx->envCtx.unk_8C[0][0] < 40) {
|
||||
globalCtx->envCtx.unk_8C[0][0] += 2;
|
||||
globalCtx->envCtx.unk_8C[1][1] -= 3;
|
||||
globalCtx->envCtx.unk_8C[1][2] -= 3;
|
||||
if (globalCtx->envCtx.adjAmbientColor[0] < 40) {
|
||||
globalCtx->envCtx.adjAmbientColor[0] += 2;
|
||||
globalCtx->envCtx.adjLight1Color[1] -= 3;
|
||||
globalCtx->envCtx.adjLight1Color[2] -= 3;
|
||||
}
|
||||
} else {
|
||||
if (globalCtx->envCtx.unk_8C[0][0] > 2) {
|
||||
globalCtx->envCtx.unk_8C[0][0] -= 2;
|
||||
globalCtx->envCtx.unk_8C[1][1] += 3;
|
||||
globalCtx->envCtx.unk_8C[1][2] += 3;
|
||||
if (globalCtx->envCtx.adjAmbientColor[0] > 2) {
|
||||
globalCtx->envCtx.adjAmbientColor[0] -= 2;
|
||||
globalCtx->envCtx.adjLight1Color[1] += 3;
|
||||
globalCtx->envCtx.adjLight1Color[2] += 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -358,18 +358,18 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
|
||||
break;
|
||||
case 32:
|
||||
if (sp3F != 0) {
|
||||
globalCtx->envCtx.unk_E6 = 1;
|
||||
globalCtx->envCtx.sandstormState = 1;
|
||||
}
|
||||
func_800788CC(NA_SE_EV_SAND_STORM - SFX_FLAG);
|
||||
break;
|
||||
case 33:
|
||||
gSaveContext.unk_1422 = 1;
|
||||
gSaveContext.sunsSongState = SUNSSONG_START;
|
||||
break;
|
||||
case 34:
|
||||
if (IS_DAY) {
|
||||
gSaveContext.dayTime -= D_8011FB40;
|
||||
gSaveContext.dayTime -= gTimeIncrement;
|
||||
} else {
|
||||
gSaveContext.dayTime -= D_8011FB40 * 2;
|
||||
gSaveContext.dayTime -= gTimeIncrement * 2;
|
||||
}
|
||||
break;
|
||||
case 35:
|
||||
@@ -433,7 +433,7 @@ void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTim
|
||||
temp2 = (cmd->minute + 1) / (360.0f / 0x4000);
|
||||
|
||||
gSaveContext.dayTime = temp1 + temp2;
|
||||
gSaveContext.environmentTime = temp1 + temp2;
|
||||
gSaveContext.skyboxTime = temp1 + temp2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1174,7 +1174,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
|
||||
break;
|
||||
case 119:
|
||||
gSaveContext.dayTime = 0x8000;
|
||||
gSaveContext.environmentTime = 0x8000;
|
||||
gSaveContext.skyboxTime = 0x8000;
|
||||
globalCtx->nextEntranceIndex = 0x05F0;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
globalCtx->fadeTransition = 3;
|
||||
@@ -1188,17 +1188,17 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
|
||||
f32 temp;
|
||||
|
||||
if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames <= cmd->endFrame)) {
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
temp = func_8006F93C(cmd->endFrame, cmd->startFrame, csCtx->frames);
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
temp = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames);
|
||||
|
||||
switch (cmd->base) {
|
||||
case 1:
|
||||
case 5:
|
||||
globalCtx->envCtx.unk_E2[0] = 0xA0;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xA0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0xA0;
|
||||
globalCtx->envCtx.screenFillColor[0] = 160;
|
||||
globalCtx->envCtx.screenFillColor[1] = 160;
|
||||
globalCtx->envCtx.screenFillColor[2] = 160;
|
||||
if (cmd->base == 1) {
|
||||
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255.0f * temp;
|
||||
if ((temp == 0.0f) && (gSaveContext.entranceIndex == 0x006B)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
@@ -1211,40 +1211,40 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
|
||||
func_800788CC(NA_SE_EV_WHITE_OUT);
|
||||
}
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
||||
globalCtx->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 6:
|
||||
globalCtx->envCtx.unk_E2[0] = 0;
|
||||
globalCtx->envCtx.unk_E2[1] = 0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0xFF;
|
||||
globalCtx->envCtx.screenFillColor[0] = 0;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0;
|
||||
globalCtx->envCtx.screenFillColor[2] = 255;
|
||||
if (cmd->base == 2) {
|
||||
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255.0f * temp;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
||||
globalCtx->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 7:
|
||||
globalCtx->envCtx.unk_E2[0] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[1] = 0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0;
|
||||
globalCtx->envCtx.screenFillColor[0] = 255;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0;
|
||||
if (cmd->base == 3) {
|
||||
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
||||
globalCtx->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255.0f * temp;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 8:
|
||||
globalCtx->envCtx.unk_E2[0] = 0;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xFF;
|
||||
globalCtx->envCtx.unk_E2[2] = 0;
|
||||
globalCtx->envCtx.screenFillColor[0] = 0;
|
||||
globalCtx->envCtx.screenFillColor[1] = 255;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0;
|
||||
if (cmd->base == 4) {
|
||||
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
||||
globalCtx->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255.0f * temp;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
@@ -1252,23 +1252,23 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
globalCtx->envCtx.unk_E2[0] = 0;
|
||||
globalCtx->envCtx.unk_E2[1] = 0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0;
|
||||
globalCtx->envCtx.screenFillColor[0] = 0;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0;
|
||||
if (cmd->base == 10) {
|
||||
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
||||
globalCtx->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255.0f * temp;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
gSaveContext.unk_1410 = 255.0f - (155.0f * temp);
|
||||
break;
|
||||
case 13:
|
||||
globalCtx->envCtx.unk_E2[0] = 0;
|
||||
globalCtx->envCtx.unk_E2[1] = 0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0;
|
||||
globalCtx->envCtx.unk_E2[3] = 255.0f - ((1.0f - temp) * 155.0f);
|
||||
globalCtx->envCtx.screenFillColor[0] = 0;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255.0f - ((1.0f - temp) * 155.0f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void func_80026608(GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 159);
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 164);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ void func_80026A6C(GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 217);
|
||||
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
POLY_XLU_DISP = func_800BC8A0(globalCtx, POLY_XLU_DISP);
|
||||
POLY_XLU_DISP = Gameplay_SetFog(globalCtx, POLY_XLU_DISP);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_eff_ss_dead.c", 222);
|
||||
}
|
||||
|
||||
@@ -1036,7 +1036,7 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_item00.c", 1594);
|
||||
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
|
||||
if (this->actor.params == ITEM00_BOMBS_SPECIAL) {
|
||||
texIndex = 1;
|
||||
|
||||
@@ -7,7 +7,7 @@ void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) {
|
||||
|
||||
/**
|
||||
* Frame advance allows you to advance through the game one frame at a time on command.
|
||||
* To enable, hold R and press Dpad Down on the provided controller.
|
||||
* To enable, hold R and press Dpad Down on the specified controller.
|
||||
* To advance a frame, hold Z and press R.
|
||||
* Holding Z and R will advance a frame every half second.
|
||||
*
|
||||
|
||||
@@ -9,7 +9,7 @@ void GameOver_FadeInLights(GlobalContext* globalCtx) {
|
||||
|
||||
if ((gameOverCtx->state >= GAMEOVER_DEATH_WAIT_GROUND && gameOverCtx->state < GAMEOVER_REVIVE_START) ||
|
||||
(gameOverCtx->state >= GAMEOVER_REVIVE_RUMBLE && gameOverCtx->state < GAMEOVER_REVIVE_FADE_OUT)) {
|
||||
Kankyo_FadeInGameOverLights(globalCtx);
|
||||
Environment_FadeInGameOverLights(globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
|
||||
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0;
|
||||
|
||||
Kankyo_InitGameOverLights(globalCtx);
|
||||
Environment_InitGameOverLights(globalCtx);
|
||||
D_80153D80 = 20;
|
||||
if (1) {}
|
||||
v90 = VREG(90);
|
||||
@@ -103,7 +103,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
case GAMEOVER_REVIVE_START:
|
||||
gameOverCtx->state++;
|
||||
D_80153D80 = 0;
|
||||
Kankyo_InitGameOverLights(globalCtx);
|
||||
Environment_InitGameOverLights(globalCtx);
|
||||
ShrinkWindow_SetVal(0x20);
|
||||
return;
|
||||
|
||||
@@ -139,7 +139,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
|
||||
break;
|
||||
|
||||
case GAMEOVER_REVIVE_FADE_OUT:
|
||||
Kankyo_FadeOutGameOverLights(globalCtx);
|
||||
Environment_FadeOutGameOverLights(globalCtx);
|
||||
D_80153D80--;
|
||||
|
||||
if (D_80153D80 == 0) {
|
||||
|
||||
+2448
-43
File diff suppressed because it is too large
Load Diff
+11
-11
@@ -198,29 +198,29 @@ s32 Lights_FreeNode(LightNode* light) {
|
||||
void LightContext_Init(GlobalContext* globalCtx, LightContext* lightCtx) {
|
||||
LightContext_InitList(globalCtx, lightCtx);
|
||||
LightContext_SetAmbientColor(lightCtx, 80, 80, 80);
|
||||
func_8007A698(lightCtx, 0, 0, 0, 0x3E4, 0x3200);
|
||||
LightContext_SetFog(lightCtx, 0, 0, 0, 996, 12800);
|
||||
bzero(&sLightsBuffer, sizeof(sLightsBuffer));
|
||||
}
|
||||
|
||||
void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b) {
|
||||
lightCtx->ambient.r = r;
|
||||
lightCtx->ambient.g = g;
|
||||
lightCtx->ambient.b = b;
|
||||
lightCtx->ambientColor[0] = r;
|
||||
lightCtx->ambientColor[1] = g;
|
||||
lightCtx->ambientColor[2] = b;
|
||||
}
|
||||
|
||||
void func_8007A698(LightContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 numLights, s16 arg5) {
|
||||
lightCtx->unk_07 = arg1;
|
||||
lightCtx->unk_08 = arg2;
|
||||
lightCtx->unk_09 = arg3;
|
||||
lightCtx->unk_0A = numLights;
|
||||
lightCtx->unk_0C = arg5;
|
||||
void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 fogNear, s16 fogFar) {
|
||||
lightCtx->fogColor[0] = r;
|
||||
lightCtx->fogColor[1] = g;
|
||||
lightCtx->fogColor[2] = b;
|
||||
lightCtx->fogNear = fogNear;
|
||||
lightCtx->fogFar = fogFar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate a new Lights group and initilize the ambient color with that provided by LightContext
|
||||
*/
|
||||
Lights* LightContext_NewLights(LightContext* lightCtx, GraphicsContext* gfxCtx) {
|
||||
return Lights_New(gfxCtx, lightCtx->ambient.r, lightCtx->ambient.g, lightCtx->ambient.b);
|
||||
return Lights_New(gfxCtx, lightCtx->ambientColor[0], lightCtx->ambientColor[1], lightCtx->ambientColor[2]);
|
||||
}
|
||||
|
||||
void LightContext_InitList(GlobalContext* globalCtx, LightContext* lightCtx) {
|
||||
|
||||
@@ -212,8 +212,8 @@ void Map_InitRoomData(GlobalContext* globalCtx, s16 room) {
|
||||
interfaceCtx->mapRoomNum = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.unk_1422 != 2) {
|
||||
gSaveContext.unk_1422 = 0;
|
||||
if (gSaveContext.sunsSongState != SUNSSONG_SPEED_TIME) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ void Map_Update(GlobalContext* globalCtx) {
|
||||
osSyncPrintf("階層切替=%x\n", interfaceCtx->mapRoomNum);
|
||||
osSyncPrintf(VT_RST);
|
||||
Map_InitData(globalCtx, interfaceCtx->mapRoomNum);
|
||||
gSaveContext.unk_1422 = 0;
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
Map_SavePlayerInitialInfo(globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
+16
-14
@@ -3789,7 +3789,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
void Interface_Update(GlobalContext* globalCtx) {
|
||||
static u8 D_80125B60 = 0;
|
||||
static s16 D_80125B64 = 0;
|
||||
static s16 sPrevTimeIncrement = 0;
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
@@ -4098,30 +4098,32 @@ void Interface_Update(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.unk_1422 != 0) {
|
||||
if ((msgCtx->unk_E3F0 != 0x31) && (gSaveContext.unk_1422 == 1)) {
|
||||
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
|
||||
// exit out of ocarina mode after suns song finishes playing
|
||||
if ((msgCtx->unk_E3F0 != 0x31) && (gSaveContext.sunsSongState == SUNSSONG_START)) {
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_02 != 0) {
|
||||
if (gSaveContext.unk_1422 != 2) {
|
||||
// handle suns song in areas where time moves
|
||||
if (globalCtx->envCtx.timeIncrement != 0) {
|
||||
if (gSaveContext.sunsSongState != SUNSSONG_SPEED_TIME) {
|
||||
D_80125B60 = 0;
|
||||
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) {
|
||||
D_80125B60 = 1;
|
||||
}
|
||||
|
||||
gSaveContext.unk_1422 = 2;
|
||||
D_80125B64 = D_8011FB40;
|
||||
D_8011FB40 = 400;
|
||||
gSaveContext.sunsSongState = SUNSSONG_SPEED_TIME;
|
||||
sPrevTimeIncrement = gTimeIncrement;
|
||||
gTimeIncrement = 400;
|
||||
} else if (D_80125B60 == 0) {
|
||||
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) {
|
||||
gSaveContext.unk_1422 = 0;
|
||||
D_8011FB40 = D_80125B64;
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gTimeIncrement = sPrevTimeIncrement;
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
}
|
||||
} else if (gSaveContext.dayTime > 0xC001) {
|
||||
gSaveContext.unk_1422 = 0;
|
||||
D_8011FB40 = D_80125B64;
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gTimeIncrement = sPrevTimeIncrement;
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
}
|
||||
} else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) {
|
||||
@@ -4145,12 +4147,12 @@ void Interface_Update(GlobalContext* globalCtx) {
|
||||
gSaveContext.respawnFlag = -2;
|
||||
globalCtx->nextEntranceIndex = gSaveContext.entranceIndex;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
gSaveContext.unk_1422 = 0;
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
func_800F6964(30);
|
||||
gSaveContext.seqIndex = 0xFF;
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
} else {
|
||||
gSaveContext.unk_1422 = 3;
|
||||
gSaveContext.sunsSongState = SUNSSONG_SPECIAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+76
-77
@@ -135,9 +135,9 @@ void func_800BC88C(GlobalContext* globalCtx) {
|
||||
globalCtx->transitionCtx.transitionType = -1;
|
||||
}
|
||||
|
||||
Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* gfx) {
|
||||
return Gfx_SetFog2(gfx, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08, globalCtx->lightCtx.unk_09, 0,
|
||||
globalCtx->lightCtx.unk_0A, 1000);
|
||||
Gfx* Gameplay_SetFog(GlobalContext* globalCtx, Gfx* gfx) {
|
||||
return Gfx_SetFog2(gfx, globalCtx->lightCtx.fogColor[0], globalCtx->lightCtx.fogColor[1],
|
||||
globalCtx->lightCtx.fogColor[2], 0, globalCtx->lightCtx.fogNear, 1000);
|
||||
}
|
||||
|
||||
void Gameplay_Destroy(GameState* thisx) {
|
||||
@@ -246,7 +246,7 @@ void Gameplay_Init(GameState* thisx) {
|
||||
|
||||
if (gSaveContext.nextDayTime != 0xFFFFU) {
|
||||
gSaveContext.dayTime = gSaveContext.nextDayTime;
|
||||
gSaveContext.environmentTime = gSaveContext.nextDayTime;
|
||||
gSaveContext.skyboxTime = gSaveContext.nextDayTime;
|
||||
}
|
||||
|
||||
if (gSaveContext.dayTime > 0xC000 || gSaveContext.dayTime < 0x4555) {
|
||||
@@ -306,8 +306,8 @@ void Gameplay_Init(GameState* thisx) {
|
||||
|
||||
if (gSaveContext.nextDayTime != 0xFFFF) {
|
||||
if (gSaveContext.nextDayTime == 0x8001) {
|
||||
gSaveContext.numDays++;
|
||||
gSaveContext.unk_18++;
|
||||
gSaveContext.totalDays++;
|
||||
gSaveContext.bgsDayCount++;
|
||||
gSaveContext.dogIsLost = true;
|
||||
if (Inventory_ReplaceItem(globalCtx, ITEM_WEIRD_EGG, ITEM_CHICKEN) ||
|
||||
Inventory_ReplaceItem(globalCtx, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO)) {
|
||||
@@ -606,21 +606,21 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
switch (globalCtx->transitionMode) {
|
||||
case 4:
|
||||
D_801614C8 = 0;
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.unk_E2[0] = 0xA0;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xA0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0xA0;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
globalCtx->envCtx.screenFillColor[0] = 160;
|
||||
globalCtx->envCtx.screenFillColor[1] = 160;
|
||||
globalCtx->envCtx.screenFillColor[2] = 160;
|
||||
if (globalCtx->sceneLoadFlag != -0x14) {
|
||||
globalCtx->envCtx.unk_E2[3] = 0;
|
||||
globalCtx->envCtx.screenFillColor[3] = 0;
|
||||
globalCtx->transitionMode = 5;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 0xFF;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255;
|
||||
globalCtx->transitionMode = 6;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
globalCtx->envCtx.unk_E2[3] = (D_801614C8 / 20.0f) * 255.0f;
|
||||
globalCtx->envCtx.screenFillColor[3] = (D_801614C8 / 20.0f) * 255.0f;
|
||||
if (D_801614C8 >= 20 && 1) {
|
||||
globalCtx->state.running = 0;
|
||||
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
|
||||
@@ -633,13 +633,13 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
break;
|
||||
|
||||
case 6:
|
||||
globalCtx->envCtx.unk_E2[3] = (1 - D_801614C8 / 20.0f) * 255.0f;
|
||||
globalCtx->envCtx.screenFillColor[3] = (1 - D_801614C8 / 20.0f) * 255.0f;
|
||||
if (D_801614C8 >= 20 && 1) {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
globalCtx->envCtx.unk_E1 = 0;
|
||||
globalCtx->envCtx.fillScreen = false;
|
||||
} else {
|
||||
D_801614C8++;
|
||||
}
|
||||
@@ -647,15 +647,15 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
|
||||
case 7:
|
||||
D_801614C8 = 0;
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.unk_E2[0] = 0xAA;
|
||||
globalCtx->envCtx.unk_E2[1] = 0xA0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0x96;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
globalCtx->envCtx.screenFillColor[0] = 170;
|
||||
globalCtx->envCtx.screenFillColor[1] = 160;
|
||||
globalCtx->envCtx.screenFillColor[2] = 150;
|
||||
if (globalCtx->sceneLoadFlag != -0x14) {
|
||||
globalCtx->envCtx.unk_E2[3] = 0;
|
||||
globalCtx->envCtx.screenFillColor[3] = 0;
|
||||
globalCtx->transitionMode = 5;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 0xFF;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255;
|
||||
globalCtx->transitionMode = 6;
|
||||
}
|
||||
break;
|
||||
@@ -683,12 +683,12 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
|
||||
case 12:
|
||||
if (globalCtx->sceneLoadFlag != -0x14) {
|
||||
globalCtx->envCtx.unk_E6 = 1;
|
||||
globalCtx->envCtx.sandstormState = 1;
|
||||
globalCtx->transitionMode = 13;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E6 = 2;
|
||||
globalCtx->envCtx.unk_E7 = 0xFF;
|
||||
globalCtx->envCtx.unk_E8 = 0xFF;
|
||||
globalCtx->envCtx.sandstormState = 2;
|
||||
globalCtx->envCtx.sandstormPrimA = 255;
|
||||
globalCtx->envCtx.sandstormEnvA = 255;
|
||||
globalCtx->transitionMode = 13;
|
||||
}
|
||||
break;
|
||||
@@ -697,14 +697,14 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
if (globalCtx->sceneLoadFlag == -0x14) {
|
||||
if (globalCtx->envCtx.unk_E7 < 0x6E) {
|
||||
if (globalCtx->envCtx.sandstormPrimA < 110) {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
}
|
||||
} else {
|
||||
if (globalCtx->envCtx.unk_E8 == 0xFF) {
|
||||
if (globalCtx->envCtx.sandstormEnvA == 255) {
|
||||
globalCtx->state.running = 0;
|
||||
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
|
||||
gSaveContext.entranceIndex = globalCtx->nextEntranceIndex;
|
||||
@@ -716,9 +716,9 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
|
||||
case 14:
|
||||
if (globalCtx->sceneLoadFlag == -0x14) {
|
||||
globalCtx->envCtx.unk_E6 = 4;
|
||||
globalCtx->envCtx.unk_E7 = 0xFF;
|
||||
globalCtx->envCtx.unk_E8 = 0xFF;
|
||||
globalCtx->envCtx.sandstormState = 4;
|
||||
globalCtx->envCtx.sandstormPrimA = 255;
|
||||
globalCtx->envCtx.sandstormEnvA = 255;
|
||||
// "It's here!!!!!!!!!"
|
||||
LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!", "../z_play.c", 3471);
|
||||
globalCtx->transitionMode = 15;
|
||||
@@ -731,7 +731,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
||||
&D_801333E8);
|
||||
if (globalCtx->sceneLoadFlag == -0x14) {
|
||||
if (globalCtx->envCtx.unk_E7 <= 0) {
|
||||
if (globalCtx->envCtx.sandstormPrimA <= 0) {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
@@ -742,17 +742,17 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
|
||||
case 16:
|
||||
D_801614C8 = 0;
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.unk_E2[0] = 0;
|
||||
globalCtx->envCtx.unk_E2[1] = 0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0;
|
||||
globalCtx->envCtx.unk_E2[3] = 0xFF;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
globalCtx->envCtx.screenFillColor[0] = 0;
|
||||
globalCtx->envCtx.screenFillColor[1] = 0;
|
||||
globalCtx->envCtx.screenFillColor[2] = 0;
|
||||
globalCtx->envCtx.screenFillColor[3] = 255;
|
||||
globalCtx->transitionMode = 17;
|
||||
break;
|
||||
|
||||
case 17:
|
||||
if (gSaveContext.unk_1410 != 0) {
|
||||
globalCtx->envCtx.unk_E2[3] = gSaveContext.unk_1410;
|
||||
globalCtx->envCtx.screenFillColor[3] = gSaveContext.unk_1410;
|
||||
if (gSaveContext.unk_1410 < 0x65) {
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
@@ -813,11 +813,12 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||
osSyncPrintf("FINISH=%d\n", globalCtx->actorCtx.freezeFlashTimer);
|
||||
if ((globalCtx->actorCtx.freezeFlashTimer > 0) &&
|
||||
((globalCtx->actorCtx.freezeFlashTimer % 2) != 0)) {
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
globalCtx->envCtx.unk_E2[0] = globalCtx->envCtx.unk_E2[1] = globalCtx->envCtx.unk_E2[2] = 150;
|
||||
globalCtx->envCtx.unk_E2[3] = 80;
|
||||
globalCtx->envCtx.fillScreen = true;
|
||||
globalCtx->envCtx.screenFillColor[0] = globalCtx->envCtx.screenFillColor[1] =
|
||||
globalCtx->envCtx.screenFillColor[2] = 150;
|
||||
globalCtx->envCtx.screenFillColor[3] = 80;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E1 = 0;
|
||||
globalCtx->envCtx.fillScreen = false;
|
||||
}
|
||||
} else {
|
||||
if (1 && HREG(63)) {
|
||||
@@ -1031,8 +1032,8 @@ skip:
|
||||
LOG_NUM("1", 1, "../z_play.c", 3816);
|
||||
}
|
||||
|
||||
func_80070C24(globalCtx, &globalCtx->envCtx, &globalCtx->lightCtx, &globalCtx->pauseCtx, &globalCtx->msgCtx,
|
||||
&globalCtx->gameOverCtx, globalCtx->state.gfxCtx);
|
||||
Environment_Update(globalCtx, &globalCtx->envCtx, &globalCtx->lightCtx, &globalCtx->pauseCtx, &globalCtx->msgCtx,
|
||||
&globalCtx->gameOverCtx, globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
void Gameplay_DrawOverlayElements(GlobalContext* globalCtx) {
|
||||
@@ -1081,10 +1082,10 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
func_80095248(gfxCtx, 0, 0, 0);
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(82) != 0)) {
|
||||
POLY_OPA_DISP = func_800BC8A0(globalCtx, POLY_OPA_DISP);
|
||||
POLY_XLU_DISP = func_800BC8A0(globalCtx, POLY_XLU_DISP);
|
||||
POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP);
|
||||
POLY_XLU_DISP = Gameplay_SetFog(globalCtx, POLY_XLU_DISP);
|
||||
|
||||
func_800AA460(&globalCtx->view, globalCtx->view.fovy, globalCtx->view.zNear, globalCtx->lightCtx.unk_0C);
|
||||
func_800AA460(&globalCtx->view, globalCtx->view.fovy, globalCtx->view.zNear, globalCtx->lightCtx.fogFar);
|
||||
func_800AAA50(&globalCtx->view, 15);
|
||||
|
||||
Matrix_MtxToMtxF(&globalCtx->view.viewing, &globalCtx->mf_11DA0);
|
||||
@@ -1092,12 +1093,8 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
Matrix_Mult(&globalCtx->mf_11D60, MTXMODE_NEW);
|
||||
Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY);
|
||||
Matrix_Get(&globalCtx->mf_11D60);
|
||||
globalCtx->mf_11DA0.mf[3][2] = 0.0f;
|
||||
globalCtx->mf_11DA0.mf[3][1] = 0.0f;
|
||||
globalCtx->mf_11DA0.mf[3][0] = 0.0f;
|
||||
globalCtx->mf_11DA0.mf[2][3] = 0.0f;
|
||||
globalCtx->mf_11DA0.mf[1][3] = 0.0f;
|
||||
globalCtx->mf_11DA0.mf[0][3] = 0.0f;
|
||||
globalCtx->mf_11DA0.mf[0][3] = globalCtx->mf_11DA0.mf[1][3] = globalCtx->mf_11DA0.mf[2][3] =
|
||||
globalCtx->mf_11DA0.mf[3][0] = globalCtx->mf_11DA0.mf[3][1] = globalCtx->mf_11DA0.mf[3][2] = 0.0f;
|
||||
Matrix_Transpose(&globalCtx->mf_11DA0);
|
||||
globalCtx->unk_11DE0 = Matrix_MtxFToMtx(Matrix_CheckFloats(&globalCtx->mf_11DA0, "../z_play.c", 4005),
|
||||
Graph_Alloc(gfxCtx, sizeof(Mtx)));
|
||||
@@ -1165,12 +1162,12 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(83) != 0)) {
|
||||
if (globalCtx->skyboxId && (globalCtx->skyboxId != SKYBOX_UNSET_1D) &&
|
||||
!globalCtx->envCtx.skyDisabled) {
|
||||
!globalCtx->envCtx.skyboxDisabled) {
|
||||
if ((globalCtx->skyboxId == SKYBOX_NORMAL_SKY) ||
|
||||
(globalCtx->skyboxId == SKYBOX_CUTSCENE_MAP)) {
|
||||
func_8006FC88(globalCtx->skyboxId, &globalCtx->envCtx, &globalCtx->skyboxCtx);
|
||||
Environment_UpdateSkybox(globalCtx->skyboxId, &globalCtx->envCtx, &globalCtx->skyboxCtx);
|
||||
SkyboxDraw_Draw(&globalCtx->skyboxCtx, gfxCtx, globalCtx->skyboxId,
|
||||
globalCtx->envCtx.unk_13, globalCtx->view.eye.x, globalCtx->view.eye.y,
|
||||
globalCtx->envCtx.skyboxBlend, globalCtx->view.eye.x, globalCtx->view.eye.y,
|
||||
globalCtx->view.eye.z);
|
||||
} else if (globalCtx->skyboxCtx.unk_140 == 0) {
|
||||
SkyboxDraw_Draw(&globalCtx->skyboxCtx, gfxCtx, globalCtx->skyboxId, 0,
|
||||
@@ -1181,17 +1178,17 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(90) & 2)) {
|
||||
if (!globalCtx->envCtx.sunMoonDisabled) {
|
||||
func_800730DC(globalCtx);
|
||||
Environment_DrawSunAndMoon(globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(90) & 1)) {
|
||||
func_80074D6C(globalCtx);
|
||||
Environment_DrawSkyboxFilters(globalCtx);
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(90) & 4)) {
|
||||
func_800750C0(globalCtx);
|
||||
func_8007542C(globalCtx, 0);
|
||||
Environment_UpdateLightningStrike(globalCtx);
|
||||
Environment_DrawLightning(globalCtx, 0);
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(90) & 8)) {
|
||||
@@ -1226,11 +1223,11 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (globalCtx->envCtx.unk_EE[1] != 0) {
|
||||
func_80074704(globalCtx, &globalCtx->view, gfxCtx);
|
||||
Environment_DrawRain(globalCtx, &globalCtx->view, gfxCtx);
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(84) != 0)) {
|
||||
func_8007672C(gfxCtx, 0, 0, 0, globalCtx->unk_11E18, 1);
|
||||
Environment_FillScreen(gfxCtx, 0, 0, 0, globalCtx->unk_11E18, FILL_SCREEN_OPA);
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(85) != 0)) {
|
||||
@@ -1239,23 +1236,26 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(86) != 0)) {
|
||||
if (!globalCtx->envCtx.sunMoonDisabled) {
|
||||
sp21C.x = globalCtx->view.eye.x + globalCtx->envCtx.unk_04.x;
|
||||
sp21C.y = globalCtx->view.eye.y + globalCtx->envCtx.unk_04.y;
|
||||
sp21C.z = globalCtx->view.eye.z + globalCtx->envCtx.unk_04.z;
|
||||
func_80073988(globalCtx, &globalCtx->envCtx, &globalCtx->view, gfxCtx, sp21C, 0);
|
||||
sp21C.x = globalCtx->view.eye.x + globalCtx->envCtx.sunPos.x;
|
||||
sp21C.y = globalCtx->view.eye.y + globalCtx->envCtx.sunPos.y;
|
||||
sp21C.z = globalCtx->view.eye.z + globalCtx->envCtx.sunPos.z;
|
||||
Environment_DrawSunLensFlare(globalCtx, &globalCtx->envCtx, &globalCtx->view, gfxCtx, sp21C, 0);
|
||||
}
|
||||
func_80075E68(globalCtx);
|
||||
Environment_DrawCustomLensFlare(globalCtx);
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(87) != 0)) {
|
||||
if (MREG(64) != 0) {
|
||||
func_8007672C(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68), 3);
|
||||
Environment_FillScreen(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68),
|
||||
FILL_SCREEN_OPA | FILL_SCREEN_XLU);
|
||||
}
|
||||
|
||||
switch (globalCtx->envCtx.unk_E1) {
|
||||
switch (globalCtx->envCtx.fillScreen) {
|
||||
case 1:
|
||||
func_8007672C(gfxCtx, globalCtx->envCtx.unk_E2[0], globalCtx->envCtx.unk_E2[1],
|
||||
globalCtx->envCtx.unk_E2[2], globalCtx->envCtx.unk_E2[3], 3);
|
||||
Environment_FillScreen(
|
||||
gfxCtx, globalCtx->envCtx.screenFillColor[0], globalCtx->envCtx.screenFillColor[1],
|
||||
globalCtx->envCtx.screenFillColor[2], globalCtx->envCtx.screenFillColor[3],
|
||||
FILL_SCREEN_OPA | FILL_SCREEN_XLU);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1263,8 +1263,8 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((HREG(80) != 10) || (HREG(88) != 0)) {
|
||||
if (globalCtx->envCtx.unk_E6 != 0) {
|
||||
func_80076934(globalCtx, globalCtx->envCtx.unk_E6);
|
||||
if (globalCtx->envCtx.sandstormState != 0) {
|
||||
Environment_DrawSandstorm(globalCtx, globalCtx->envCtx.sandstormState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1274,7 +1274,6 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
if ((R_PAUSE_MENU_MODE == 1) || (gTrnsnUnkState == 1)) {
|
||||
Gfx* sp70 = OVERLAY_DISP;
|
||||
s32 pad[4];
|
||||
|
||||
globalCtx->pauseBgPreRender.fbuf = gfxCtx->curFrameBuffer;
|
||||
globalCtx->pauseBgPreRender.fbufSave = (u16*)gZBuffer;
|
||||
@@ -1303,7 +1302,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
||||
Camera_Update(GET_ACTIVE_CAM(globalCtx));
|
||||
func_800AB944(&globalCtx->view);
|
||||
globalCtx->view.unk_124 = 0;
|
||||
if (globalCtx->skyboxId && (globalCtx->skyboxId != SKYBOX_UNSET_1D) && !globalCtx->envCtx.skyDisabled) {
|
||||
if (globalCtx->skyboxId && (globalCtx->skyboxId != SKYBOX_UNSET_1D) && !globalCtx->envCtx.skyboxDisabled) {
|
||||
SkyboxDraw_UpdateMatrix(&globalCtx->skyboxCtx, globalCtx->view.eye.x, globalCtx->view.eye.y,
|
||||
globalCtx->view.eye.z);
|
||||
}
|
||||
@@ -1439,9 +1438,9 @@ void* Gameplay_LoadFile(GlobalContext* globalCtx, RomFile* file) {
|
||||
return allocp;
|
||||
}
|
||||
|
||||
void Gameplay_InitSkybox(GlobalContext* globalCtx, s16 skyboxId) {
|
||||
void Gameplay_InitEnvironment(GlobalContext* globalCtx, s16 skyboxId) {
|
||||
Skybox_Init(globalCtx, &globalCtx->skyboxCtx, skyboxId);
|
||||
func_8006F140(globalCtx, &globalCtx->envCtx, 0);
|
||||
Environment_Init(globalCtx, &globalCtx->envCtx, 0);
|
||||
}
|
||||
|
||||
void Gameplay_InitScene(GlobalContext* globalCtx, s32 spawn) {
|
||||
@@ -1460,7 +1459,7 @@ void Gameplay_InitScene(GlobalContext* globalCtx, s32 spawn) {
|
||||
YREG(15) = 0;
|
||||
gSaveContext.worldMapArea = 0;
|
||||
Scene_ExecuteCommands(globalCtx, globalCtx->sceneSegment);
|
||||
Gameplay_InitSkybox(globalCtx, globalCtx->skyboxId);
|
||||
Gameplay_InitEnvironment(globalCtx, globalCtx->skyboxId);
|
||||
}
|
||||
|
||||
void Gameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s32 spawn) {
|
||||
|
||||
+19
-18
@@ -847,51 +847,52 @@ Gfx gEmptyDL[] = {
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
|
||||
if (f == n) {
|
||||
f++;
|
||||
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far) {
|
||||
if (far == near) {
|
||||
far++;
|
||||
}
|
||||
ASSERT(n != f, "n != f", "../z_rcp.c", 1155);
|
||||
|
||||
ASSERT(near != far, "n != f", "../z_rcp.c", 1155);
|
||||
|
||||
gDPSetFogColor(gfx++, r, g, b, a);
|
||||
|
||||
if (n >= 1000) {
|
||||
if (near >= 1000) {
|
||||
gSPFogFactor(gfx++, 0, 0);
|
||||
} else if (n >= 997) {
|
||||
} else if (near >= 997) {
|
||||
gSPFogFactor(gfx++, 0x7FFF, 0x8100);
|
||||
} else if (n < 0) {
|
||||
} else if (near < 0) {
|
||||
gSPFogFactor(gfx++, 0, 255);
|
||||
} else {
|
||||
gSPFogPosition(gfx++, n, f);
|
||||
gSPFogPosition(gfx++, near, far);
|
||||
}
|
||||
|
||||
return gfx;
|
||||
}
|
||||
|
||||
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
|
||||
if (f == n) {
|
||||
f++;
|
||||
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far) {
|
||||
if (far == near) {
|
||||
far++;
|
||||
}
|
||||
ASSERT(n != f, "n != f", "../z_rcp.c", 1187);
|
||||
ASSERT(near != far, "n != f", "../z_rcp.c", 1187);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetFogColor(gfx++, r, g, b, a);
|
||||
|
||||
if (n >= 1000) {
|
||||
if (near >= 1000) {
|
||||
gSPFogFactor(gfx++, 0, 0);
|
||||
} else if (n >= 997) {
|
||||
} else if (near >= 997) {
|
||||
gSPFogFactor(gfx++, 0x7FFF, 0x8100);
|
||||
} else if (n < 0) {
|
||||
} else if (near < 0) {
|
||||
gSPFogFactor(gfx++, 0, 255);
|
||||
} else {
|
||||
gSPFogPosition(gfx++, n, f);
|
||||
gSPFogPosition(gfx++, near, far);
|
||||
}
|
||||
|
||||
return gfx;
|
||||
}
|
||||
|
||||
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
|
||||
return Gfx_SetFog(gfx, r, g, b, a, n, f);
|
||||
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far) {
|
||||
return Gfx_SetFog(gfx, r, g, b, a, near, far);
|
||||
}
|
||||
|
||||
Gfx* Gfx_CallSetupDLImpl(Gfx* gfx, u32 i) {
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &sp90, &sp84, &sp80);
|
||||
if (-(f32)polygonDlist->unk_06 < sp84.z) {
|
||||
temp_f2 = sp84.z - polygonDlist->unk_06;
|
||||
if (temp_f2 < globalCtx->lightCtx.unk_0C) {
|
||||
if (temp_f2 < globalCtx->lightCtx.fogFar) {
|
||||
phi_v0 = spB4;
|
||||
spA4->unk_00 = polygonDlist;
|
||||
spA4->unk_04 = temp_f2;
|
||||
|
||||
+30
-41
@@ -343,67 +343,63 @@ void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
// Scene Command 0x11: Skybox Settings
|
||||
void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->skyboxId = cmd->skyboxSettings.skyboxId;
|
||||
globalCtx->envCtx.gloomySky = globalCtx->envCtx.unk_18 = cmd->skyboxSettings.unk_05;
|
||||
globalCtx->envCtx.unk_1E = cmd->skyboxSettings.unk_06;
|
||||
globalCtx->envCtx.unk_17 = globalCtx->envCtx.unk_18 = cmd->skyboxSettings.unk_05;
|
||||
globalCtx->envCtx.indoors = cmd->skyboxSettings.unk_06;
|
||||
}
|
||||
|
||||
// Scene Command 0x12: Skybox Disables
|
||||
void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->envCtx.skyDisabled = cmd->skyboxDisables.unk_04;
|
||||
globalCtx->envCtx.skyboxDisabled = cmd->skyboxDisables.unk_04;
|
||||
globalCtx->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk_05;
|
||||
}
|
||||
|
||||
// Scene Command 0x10: Time Settings
|
||||
void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
u32 dayTime;
|
||||
|
||||
if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) {
|
||||
gSaveContext.environmentTime = gSaveContext.dayTime =
|
||||
((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / (360.0f / 0x4000);
|
||||
gSaveContext.skyboxTime = gSaveContext.dayTime =
|
||||
((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / ((f32)(24 * 60) / 0x10000);
|
||||
}
|
||||
|
||||
if (cmd->timeSettings.unk_06 != 0xFF) {
|
||||
globalCtx->envCtx.unk_02 = cmd->timeSettings.unk_06;
|
||||
globalCtx->envCtx.timeIncrement = cmd->timeSettings.unk_06;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_02 = 0;
|
||||
globalCtx->envCtx.timeIncrement = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.unk_1422 == 0) {
|
||||
D_8011FB40 = globalCtx->envCtx.unk_02;
|
||||
if (gSaveContext.sunsSongState == SUNSSONG_INACTIVE) {
|
||||
gTimeIncrement = globalCtx->envCtx.timeIncrement;
|
||||
}
|
||||
|
||||
dayTime = gSaveContext.dayTime;
|
||||
globalCtx->envCtx.unk_04.x = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.dayTime;
|
||||
globalCtx->envCtx.unk_04.y = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.dayTime;
|
||||
globalCtx->envCtx.unk_04.z = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.x = -(Math_SinS(((void)0, gSaveContext.dayTime) - 0x8000) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.y = (Math_CosS(((void)0, gSaveContext.dayTime) - 0x8000) * 120.0f) * 25.0f;
|
||||
globalCtx->envCtx.sunPos.z = (Math_CosS(((void)0, gSaveContext.dayTime) - 0x8000) * 20.0f) * 25.0f;
|
||||
|
||||
if (((globalCtx->envCtx.unk_02 == 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) ||
|
||||
if (((globalCtx->envCtx.timeIncrement == 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) ||
|
||||
(gSaveContext.entranceIndex == 0x0604)) {
|
||||
gSaveContext.environmentTime = gSaveContext.dayTime;
|
||||
if ((gSaveContext.environmentTime >= 0x2AAC) && (gSaveContext.environmentTime < 0x4555)) {
|
||||
gSaveContext.environmentTime = 0x3556;
|
||||
} else if ((gSaveContext.environmentTime >= 0x4555) && (gSaveContext.environmentTime < 0x5556)) {
|
||||
gSaveContext.environmentTime = 0x5556;
|
||||
} else if ((gSaveContext.environmentTime >= 0xAAAB) && (gSaveContext.environmentTime < 0xB556)) {
|
||||
gSaveContext.environmentTime = 0xB556;
|
||||
} else if ((gSaveContext.environmentTime >= 0xC001) && (gSaveContext.environmentTime < 0xCAAC)) {
|
||||
gSaveContext.environmentTime = 0xCAAC;
|
||||
gSaveContext.skyboxTime = ((void)0, gSaveContext.dayTime);
|
||||
if ((gSaveContext.skyboxTime >= 0x2AAC) && (gSaveContext.skyboxTime < 0x4555)) {
|
||||
gSaveContext.skyboxTime = 0x3556;
|
||||
} else if ((gSaveContext.skyboxTime >= 0x4555) && (gSaveContext.skyboxTime < 0x5556)) {
|
||||
gSaveContext.skyboxTime = 0x5556;
|
||||
} else if ((gSaveContext.skyboxTime >= 0xAAAB) && (gSaveContext.skyboxTime < 0xB556)) {
|
||||
gSaveContext.skyboxTime = 0xB556;
|
||||
} else if ((gSaveContext.skyboxTime >= 0xC001) && (gSaveContext.skyboxTime < 0xCAAC)) {
|
||||
gSaveContext.skyboxTime = 0xCAAC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Scene Command 0x05: Wind Settings
|
||||
void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
s8 temp1 = cmd->windSettings.unk_04;
|
||||
s8 temp2 = cmd->windSettings.unk_05;
|
||||
s8 temp3 = cmd->windSettings.unk_06;
|
||||
s8 x = cmd->windSettings.x;
|
||||
s8 y = cmd->windSettings.y;
|
||||
s8 z = cmd->windSettings.z;
|
||||
|
||||
globalCtx->envCtx.unk_A8 = temp1;
|
||||
globalCtx->envCtx.unk_AA = temp2;
|
||||
globalCtx->envCtx.unk_AC = temp3;
|
||||
globalCtx->envCtx.unk_B0 = cmd->windSettings.unk_07;
|
||||
globalCtx->envCtx.windDirection.x = x;
|
||||
globalCtx->envCtx.windDirection.y = y;
|
||||
globalCtx->envCtx.windDirection.z = z;
|
||||
|
||||
globalCtx->envCtx.windSpeed = cmd->windSettings.unk_07;
|
||||
}
|
||||
|
||||
// Scene Command 0x13: Exit List
|
||||
@@ -501,13 +497,6 @@ void (*gSceneCmdHandlers[])(GlobalContext*, SceneCmd*) = {
|
||||
func_80099140, func_8009918C, func_8009934C, func_800991A0, func_800993C0,
|
||||
};
|
||||
|
||||
#define ROM_FILE(name) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd }
|
||||
#define ROM_FILE_EMPTY(name) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomStart }
|
||||
#define ROM_FILE_UNSET \
|
||||
{ 0 }
|
||||
|
||||
RomFile sNaviMsgFiles[] = {
|
||||
ROM_FILE(elf_message_field),
|
||||
ROM_FILE(elf_message_ydan),
|
||||
|
||||
@@ -1088,10 +1088,10 @@ void func_80099BD8(GlobalContext* globalCtx) {
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 5145);
|
||||
|
||||
if (gSaveContext.sceneSetupIndex == 5) {
|
||||
D_8015FCF0 = 1;
|
||||
D_8015FCF8.x = -20.0f;
|
||||
D_8015FCF8.y = 1220.0f;
|
||||
D_8015FCF8.z = -684.0f;
|
||||
gCustomLensFlareOn = true;
|
||||
gCustomLensFlarePos.x = -20.0f;
|
||||
gCustomLensFlarePos.y = 1220.0f;
|
||||
gCustomLensFlarePos.z = -684.0f;
|
||||
D_8015FD06 = 10;
|
||||
D_8015FD08 = 8.0f;
|
||||
D_8015FD0C = 200;
|
||||
|
||||
+8
-8
@@ -63,8 +63,8 @@ typedef struct {
|
||||
/* 0x08 */ s32 cutsceneIndex;
|
||||
/* 0x0C */ u16 dayTime; // "zelda_time"
|
||||
/* 0x10 */ s32 nightFlag;
|
||||
/* 0x14 */ s32 numDays;
|
||||
/* 0x18 */ s32 unk_18; // increments with numDays, gets reset by goron for bgs and one other use
|
||||
/* 0x14 */ s32 totalDays;
|
||||
/* 0x18 */ s32 unk_18; // increments with totalDays, gets reset by goron for bgs and one other use
|
||||
/* 0x1C */ SaveInfo info; // "information"
|
||||
} Save; // size = 0x1354
|
||||
|
||||
@@ -161,8 +161,8 @@ void Sram_InitNewSave(void) {
|
||||
SaveContext* temp = &gSaveContext;
|
||||
|
||||
bzero(&SAVE_INFO, sizeof(SaveInfo));
|
||||
gSaveContext.numDays = 0;
|
||||
gSaveContext.unk_18 = 0;
|
||||
gSaveContext.totalDays = 0;
|
||||
gSaveContext.bgsDayCount = 0;
|
||||
|
||||
SAVE_PLAYER_DATA = sNewSavePlayerData;
|
||||
gSaveContext.equips = sNewSaveEquips;
|
||||
@@ -250,8 +250,8 @@ void Sram_InitDebugSave(void) {
|
||||
SaveContext* temp = &gSaveContext;
|
||||
|
||||
bzero(&SAVE_INFO, sizeof(SaveInfo));
|
||||
gSaveContext.numDays = 0;
|
||||
gSaveContext.unk_18 = 0;
|
||||
gSaveContext.totalDays = 0;
|
||||
gSaveContext.bgsDayCount = 0;
|
||||
|
||||
SAVE_PLAYER_DATA = sDebugSavePlayerData;
|
||||
gSaveContext.equips = sDebugSaveEquips;
|
||||
@@ -561,8 +561,8 @@ void Sram_VerifyAndLoadAllSaves(FileChooseContext* fileChooseCtx, SramContext* s
|
||||
// note that gSaveContext.dayTime is not actually the sizeof(s32)
|
||||
bzero(&gSaveContext.dayTime, sizeof(s32));
|
||||
bzero(&gSaveContext.nightFlag, sizeof(s32));
|
||||
bzero(&gSaveContext.numDays, sizeof(s32));
|
||||
bzero(&gSaveContext.unk_18, sizeof(s32));
|
||||
bzero(&gSaveContext.totalDays, sizeof(s32));
|
||||
bzero(&gSaveContext.bgsDayCount, sizeof(s32));
|
||||
|
||||
if (!slotNum) {
|
||||
Sram_InitDebugSave();
|
||||
|
||||
+30
-36
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
#include "z64environment.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ s32 unk_0;
|
||||
@@ -11,17 +12,7 @@ typedef struct {
|
||||
|
||||
extern Struct_8012AF0C D_8012AF0C[6];
|
||||
extern Struct_8012AF0C D_8012AEBC[4];
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 unk_0; // start
|
||||
/* 0x02 */ u16 unk_2; // end
|
||||
/* 0x04 */ u8 unk_4;
|
||||
/* 0x05 */ u8 unk_5; // img idx 1
|
||||
/* 0x06 */ u8 unk_6; // img idx 2
|
||||
/* 0x07 */ char unk_7[0x1];
|
||||
} Struct_8011FC1C; // size = 0x8
|
||||
|
||||
extern Struct_8011FC1C D_8011FC1C[8][9];
|
||||
extern struct_8011FC1C D_8011FC1C[][9];
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 unk_0; // start
|
||||
@@ -30,8 +21,6 @@ typedef struct {
|
||||
/* 0x0C */ u32 unk_C; // pal end
|
||||
} Struct_8011FD3C; // size = 0x10
|
||||
|
||||
extern Struct_8011FD3C D_8011FD3C[];
|
||||
|
||||
s32 func_800ADBB0(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32, UNK_TYPE, UNK_TYPE, UNK_TYPE, UNK_TYPE, UNK_TYPE, s32,
|
||||
s32);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box/func_800ADBB0.s")
|
||||
@@ -85,64 +74,69 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox
|
||||
switch (skyboxId) {
|
||||
case SKYBOX_NORMAL_SKY:
|
||||
phi_v1 = 0;
|
||||
if (gSaveContext.unk_13C3 != 0 && gSaveContext.sceneSetupIndex < 4 && D_8011FB30 > 0 && D_8011FB30 < 6) {
|
||||
if (gSaveContext.unk_13C3 != 0 && gSaveContext.sceneSetupIndex < 4 && gWeatherMode > 0 &&
|
||||
gWeatherMode < 6) {
|
||||
phi_v1 = 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; i++) {
|
||||
if (gSaveContext.environmentTime >= D_8011FC1C[phi_v1][i].unk_0 &&
|
||||
(gSaveContext.environmentTime < D_8011FC1C[phi_v1][i].unk_2 ||
|
||||
D_8011FC1C[phi_v1][i].unk_2 == 0xFFFF)) {
|
||||
globalCtx->envCtx.unk_10 = sp41 = D_8011FC1C[phi_v1][i].unk_5;
|
||||
globalCtx->envCtx.unk_11 = sp40 = D_8011FC1C[phi_v1][i].unk_6;
|
||||
if (D_8011FC1C[phi_v1][i].unk_4 != 0) {
|
||||
globalCtx->envCtx.unk_13 =
|
||||
func_8006F93C(D_8011FC1C[phi_v1][i].unk_2, D_8011FC1C[phi_v1][i].unk_0,
|
||||
((void)0, gSaveContext.environmentTime)) *
|
||||
if (gSaveContext.skyboxTime >= D_8011FC1C[phi_v1][i].startTime &&
|
||||
(gSaveContext.skyboxTime < D_8011FC1C[phi_v1][i].endTime ||
|
||||
D_8011FC1C[phi_v1][i].endTime == 0xFFFF)) {
|
||||
globalCtx->envCtx.skybox1Index = sp41 = D_8011FC1C[phi_v1][i].skybox1Index;
|
||||
globalCtx->envCtx.skybox2Index = sp40 = D_8011FC1C[phi_v1][i].skybox2Index;
|
||||
if (D_8011FC1C[phi_v1][i].blend != 0) {
|
||||
globalCtx->envCtx.skyboxBlend =
|
||||
Environment_LerpWeight(D_8011FC1C[phi_v1][i].endTime, D_8011FC1C[phi_v1][i].startTime,
|
||||
((void)0, gSaveContext.skyboxTime)) *
|
||||
255.0f;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_13 = 0;
|
||||
globalCtx->envCtx.skyboxBlend = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
size = D_8011FD3C[sp41].unk_4 - D_8011FD3C[sp41].unk_0;
|
||||
size = gSkyboxFiles[sp41].file.vromEnd - gSkyboxFiles[sp41].file.vromStart;
|
||||
skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1054);
|
||||
ASSERT(skyboxCtx->staticSegments[0] != NULL, "vr_box->vr_box_staticSegment[0] != NULL", "../z_vr_box.c",
|
||||
1055);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], D_8011FD3C[sp41].unk_0, size, "../z_vr_box.c", 1058);
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[0], gSkyboxFiles[sp41].file.vromStart, size, "../z_vr_box.c",
|
||||
1058);
|
||||
|
||||
size = D_8011FD3C[sp40].unk_4 - D_8011FD3C[sp40].unk_0;
|
||||
size = gSkyboxFiles[sp40].file.vromEnd - gSkyboxFiles[sp40].file.vromStart;
|
||||
skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, size, "../z_vr_box.c", 1060);
|
||||
ASSERT(skyboxCtx->staticSegments[1] != NULL, "vr_box->vr_box_staticSegment[1] != NULL", "../z_vr_box.c",
|
||||
1061);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], D_8011FD3C[sp40].unk_0, size, "../z_vr_box.c", 1064);
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[1], gSkyboxFiles[sp40].file.vromStart, size, "../z_vr_box.c",
|
||||
1064);
|
||||
|
||||
// reorderings in the rest of this case
|
||||
|
||||
if (((u8)(sp41 & 4) >> 2) != (sp41 & 1)) {
|
||||
size = D_8011FD3C[sp41].unk_C - D_8011FD3C[sp41].unk_8;
|
||||
size = gSkyboxFiles[sp41].pallete.vromEnd - gSkyboxFiles[sp41].pallete.vromStart;
|
||||
skyboxCtx->staticSegments[2] = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1072);
|
||||
|
||||
ASSERT(skyboxCtx->staticSegments[2] != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c",
|
||||
1073);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[2], D_8011FD3C[sp41].unk_8, size, "../z_vr_box.c", 1075);
|
||||
DmaMgr_SendRequest1((u32)skyboxCtx->staticSegments[2] + size, D_8011FD3C[sp40].unk_8, size,
|
||||
"../z_vr_box.c", 1077);
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[2], gSkyboxFiles[sp41].pallete.vromStart, size,
|
||||
"../z_vr_box.c", 1075);
|
||||
DmaMgr_SendRequest1((u32)skyboxCtx->staticSegments[2] + size, gSkyboxFiles[sp40].pallete.vromStart,
|
||||
size, "../z_vr_box.c", 1077);
|
||||
} else {
|
||||
size = D_8011FD3C[sp41].unk_C - D_8011FD3C[sp41].unk_8;
|
||||
size = gSkyboxFiles[sp41].pallete.vromEnd - gSkyboxFiles[sp41].pallete.vromStart;
|
||||
skyboxCtx->staticSegments[2] = GameState_Alloc(&globalCtx->state, size * 2, "../z_vr_box.c", 1085);
|
||||
|
||||
ASSERT(skyboxCtx->staticSegments[2] != NULL, "vr_box->vr_box_staticSegment[2] != NULL", "../z_vr_box.c",
|
||||
1086);
|
||||
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[2], D_8011FD3C[sp40].unk_8, size, "../z_vr_box.c", 1088);
|
||||
DmaMgr_SendRequest1((u32)skyboxCtx->staticSegments[2] + size, D_8011FD3C[sp41].unk_8, size,
|
||||
"../z_vr_box.c", 1090);
|
||||
DmaMgr_SendRequest1(skyboxCtx->staticSegments[2], gSkyboxFiles[sp40].pallete.vromStart, size,
|
||||
"../z_vr_box.c", 1088);
|
||||
DmaMgr_SendRequest1((u32)skyboxCtx->staticSegments[2] + size, gSkyboxFiles[sp41].pallete.vromStart,
|
||||
size, "../z_vr_box.c", 1090);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) {
|
||||
return Matrix_ToMtx(sSkyboxDrawMatrix, "../z_vr_box_draw.c", 42);
|
||||
}
|
||||
|
||||
void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 alpha, f32 x, f32 y, f32 z) {
|
||||
void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) {
|
||||
OPEN_DISPS(gfxCtx, "../z_vr_box_draw.c", 52);
|
||||
|
||||
func_800945A0(gfxCtx);
|
||||
@@ -20,7 +20,7 @@ void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyb
|
||||
gSPSegment(POLY_OPA_DISP++, 0x8, skyboxCtx->staticSegments[1]);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x9, skyboxCtx->staticSegments[2]);
|
||||
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0x00, 0x00, 0, 0, 0, alpha);
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0x00, 0x00, 0, 0, 0, blend);
|
||||
gSPTexture(POLY_OPA_DISP++, 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON);
|
||||
|
||||
sSkyboxDrawMatrix = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user