z_kankyo pt 1 (#1377)

* z64environment.h

* remove todo

* Cleanup

* data + bss + 2 functions

* Bring over simple functions

* Remove lerp comment

* code functions csv

* Remove docs changes

* ZBufValToFixedPoint

* Remove leading 0's

* SEGMENT macros

* eventDayCount

* format

* z64bombers_notebook.h

* fix merge

* Comments

---------

Co-authored-by: angie <angheloalf95@gmail.com>
This commit is contained in:
Derek Hensley
2023-10-04 22:08:08 -07:00
committed by GitHub
parent d3104be63c
commit 03d1a794e1
73 changed files with 1895 additions and 884 deletions
+1
View File
@@ -1,3 +1,4 @@
#include "prevent_bss_reordering.h"
#include "z64.h"
#include "regs.h"
#include "functions.h"
+1
View File
@@ -1,3 +1,4 @@
#include "prevent_bss_reordering.h"
#include "z64.h"
#include "regs.h"
#include "functions.h"
+1 -1
View File
@@ -12,7 +12,7 @@ void SaveContext_Init(void) {
gSaveContext.nextCutsceneIndex = 0xFFEF;
gSaveContext.cutsceneTrigger = 0;
gSaveContext.chamberCutsceneNum = 0;
gSaveContext.nextDayTime = 0xFFFF;
gSaveContext.nextDayTime = NEXT_TIME_NONE;
gSaveContext.skyboxTime = 0;
gSaveContext.dogIsLost = true;
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
+25 -18
View File
@@ -1,6 +1,4 @@
#include "PR/ultratypes.h"
#include "prevent_bss_reordering.h"
#include "prevent_bss_reordering2.h"
// Variables are put before most headers as a hacky way to bypass bss reordering
struct CutsceneCamera;
@@ -13,6 +11,15 @@ static s16 sBssPad;
u8 gDisablePlayerCsModeStartPos;
s16 gDungeonBossWarpSceneId;
#include "prevent_bss_reordering.h"
#include "prevent_bss_reordering2.h"
// clang-format off
// Partial structs taken from "prevent_bss_reordering.h"
struct Dummy200 { int x; };
struct Dummy201 { int x; };
struct Dummy202 { int x; };
// clang-format on
#include "global.h"
#include "z64quake.h"
#include "z64rumble.h"
@@ -154,8 +161,8 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
switch (cmd->type) {
case CS_MISC_RAIN:
if (isFirstFrame) {
func_800FD78C(play);
play->envCtx.unk_F2[0] = 60;
Environment_PlayStormNatureAmbience(play);
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 60;
}
break;
@@ -163,19 +170,19 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
if (isFirstFrame) {
Audio_SetAmbienceChannelIO(AMBIENCE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0);
Environment_AddLightningBolts(play, 3);
D_801F4E68 = 1;
gLightningStrike.state = LIGHTNING_STRIKE_START;
}
break;
case CS_MISC_LIFT_FOG:
if (play->envCtx.lightSettings.zFar < 12800) {
play->envCtx.lightSettings.zFar += 35;
if (play->envCtx.adjLightSettings.zFar < 12800) {
play->envCtx.adjLightSettings.zFar += 35;
}
break;
case CS_MISC_CLOUDY_SKY:
if (isFirstFrame) {
play->envCtx.changeSkyboxState = 1;
play->envCtx.changeSkyboxState = CHANGE_SKYBOX_REQUESTED;
play->envCtx.skyboxConfig = 1;
play->envCtx.changeSkyboxNextConfig = 0;
play->envCtx.changeSkyboxTimer = 60;
@@ -238,16 +245,16 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
case CS_MISC_RED_PULSATING_LIGHTS:
if (play->state.frames & 8) {
if (play->envCtx.lightSettings.ambientColor[0] < 40) {
play->envCtx.lightSettings.ambientColor[0] += 2;
play->envCtx.lightSettings.diffuseColor1[1] -= 3;
play->envCtx.lightSettings.diffuseColor1[2] -= 3;
if (play->envCtx.adjLightSettings.ambientColor[0] < 40) {
play->envCtx.adjLightSettings.ambientColor[0] += 2;
play->envCtx.adjLightSettings.light1Color[1] -= 3;
play->envCtx.adjLightSettings.light1Color[2] -= 3;
}
} else {
if (play->envCtx.lightSettings.ambientColor[0] > 2) {
play->envCtx.lightSettings.ambientColor[0] -= 2;
play->envCtx.lightSettings.diffuseColor1[1] += 3;
play->envCtx.lightSettings.diffuseColor1[2] += 3;
if (play->envCtx.adjLightSettings.ambientColor[0] > 2) {
play->envCtx.adjLightSettings.ambientColor[0] -= 2;
play->envCtx.adjLightSettings.light1Color[1] += 3;
play->envCtx.adjLightSettings.light1Color[2] += 3;
}
}
break;
@@ -262,7 +269,7 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
case CS_MISC_SANDSTORM_FILL:
if (isFirstFrame) {
play->envCtx.sandstormState = 1;
play->envCtx.sandstormState = SANDSTORM_FILL;
}
Audio_PlaySfx_2(NA_SE_EV_SAND_STORM - SFX_FLAG);
break;
@@ -409,7 +416,7 @@ void CutsceneCmd_SetLightSetting(PlayState* play, CutsceneContext* csCtx, CsCmdL
play->envCtx.lightSettingOverride = cmd->settingPlusOne - 1;
play->envCtx.lightBlend = 1.0f;
} else {
play->envCtx.lightSettingOverride = 0xFF;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
}
}
}
+4 -4
View File
@@ -15,7 +15,7 @@ void GameOver_FadeLights(PlayState* play) {
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(play);
Environment_FadeInGameOverLights(play);
}
}
@@ -66,7 +66,7 @@ void GameOver_Update(PlayState* play) {
gSaveContext.nextHudVisibility = HUD_VISIBILITY_IDLE;
gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE;
gSaveContext.hudVisibilityTimer = 0;
Kankyo_InitGameOverLights(play);
Environment_InitGameOverLights(play);
sGameOverTimer = 20;
Rumble_Request(0.0f, 126, 124, 63);
gameOverCtx->state = GAMEOVER_DEATH_WAIT_GROUND;
@@ -92,7 +92,7 @@ void GameOver_Update(PlayState* play) {
case GAMEOVER_REVIVE_START:
gameOverCtx->state++; // GAMEOVER_REVIVE_RUMBLE
sGameOverTimer = 0;
Kankyo_InitGameOverLights(play);
Environment_InitGameOverLights(play);
ShrinkWindow_Letterbox_SetSizeTarget(32);
break;
@@ -119,7 +119,7 @@ void GameOver_Update(PlayState* play) {
break;
case GAMEOVER_REVIVE_FADE_OUT:
Kankyo_FadeOutGameOverLights(play);
Environment_FadeOutGameOverLights(play);
sGameOverTimer--;
if (sGameOverTimer == 0) {
gameOverCtx->state = GAMEOVER_INACTIVE;
+892 -63
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -663,7 +663,7 @@ void Lib_Vec3f_TranslateAndRotateY(Vec3f* translation, s16 rotAngle, Vec3f* src,
dst->z = translation->z + (src->z * cos - src->x * sin);
}
void Lib_LerpRGB(Color_RGB8* a, Color_RGB8* b, f32 t, Color_RGB8* dst) {
void Color_RGB8_Lerp(Color_RGB8* a, Color_RGB8* b, f32 t, Color_RGB8* dst) {
f32 aF;
aF = a->r;
+7 -7
View File
@@ -257,15 +257,15 @@ void LightContext_Init(PlayState* play, LightContext* lightCtx) {
}
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 LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 near, s16 far) {
lightCtx->fogColor.r = r;
lightCtx->fogColor.g = g;
lightCtx->fogColor.b = b;
lightCtx->fogColor[0] = r;
lightCtx->fogColor[1] = g;
lightCtx->fogColor[2] = b;
lightCtx->fogNear = near;
lightCtx->zFar = far;
}
@@ -274,7 +274,7 @@ void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 near, s16
* 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(PlayState* play, LightContext* lightCtx) {
+1 -1
View File
@@ -5432,7 +5432,7 @@ void Interface_StartMoonCrash(PlayState* play) {
}
gSaveContext.save.day = 4;
gSaveContext.save.daysElapsed = 4;
gSaveContext.save.eventDayCount = 4;
gSaveContext.save.time = CLOCK_TIME(6, 0) + 10;
play->nextEntrance = ENTRANCE(TERMINA_FIELD, 12);
gSaveContext.nextCutsceneIndex = 0;
+25 -25
View File
@@ -1,3 +1,4 @@
#include "prevent_bss_reordering.h"
#include "z64.h"
#include "regs.h"
#include "functions.h"
@@ -360,8 +361,8 @@ void Play_ClearTransition(PlayState* this) {
Gfx* Play_SetFog(PlayState* this, Gfx* gfx) {
s32 fogFar = this->lightCtx.zFar * (5.0f / 64.0f);
return Gfx_SetFogWithSync(gfx, this->lightCtx.fogColor.r, this->lightCtx.fogColor.g, this->lightCtx.fogColor.b, 0,
this->lightCtx.fogNear, ((fogFar <= 1000) ? 1000 : fogFar));
return Gfx_SetFogWithSync(gfx, this->lightCtx.fogColor[0], this->lightCtx.fogColor[1], this->lightCtx.fogColor[2],
0, this->lightCtx.fogNear, ((fogFar <= 1000) ? 1000 : fogFar));
}
void Play_Destroy(GameState* thisx) {
@@ -524,7 +525,7 @@ void Play_UpdateWaterCamera(PlayState* this, Camera* camera) {
}
func_801A3EC0(0x20);
func_800F6834(this, lightIndex);
Environment_EnableUnderwaterLights(this, lightIndex);
if ((sQuakeIndex == -1) || (Quake_GetTimeLeft(sQuakeIndex) == 10)) {
s16 quakeIndex = Quake_Request(camera, QUAKE_TYPE_5);
@@ -553,7 +554,7 @@ void Play_UpdateWaterCamera(PlayState* this, Camera* camera) {
if (sQuakeIndex != 0) {
Quake_RemoveRequest(sQuakeIndex);
}
func_800F694C(this);
Environment_DisableUnderwaterLights(this);
func_801A3EC0(0);
}
}
@@ -585,20 +586,20 @@ void Play_UpdateTransition(PlayState* this) {
!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) ||
((this->nextEntrance == ENTRANCE(ROAD_TO_IKANA, 1)) &&
!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE))) &&
(!func_800FE590(this) || (Entrance_GetSceneId(this->nextEntrance + sceneLayer) < 0) ||
(!Environment_IsFinalHours(this) || (Entrance_GetSceneId(this->nextEntrance + sceneLayer) < 0) ||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_FINAL_HOURS))) {
func_801A4058(20);
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
}
if (func_800FD768()) {
if (Environment_IsForcedSequenceDisabled()) {
func_801A4058(20);
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
}
if (func_800FE590(this) && (Entrance_GetSceneId(this->nextEntrance + sceneLayer) >= 0) &&
if (Environment_IsFinalHours(this) && (Entrance_GetSceneId(this->nextEntrance + sceneLayer) >= 0) &&
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS)) {
func_801A41C8(20);
}
@@ -824,10 +825,10 @@ void Play_UpdateTransition(PlayState* this) {
case TRANS_MODE_SANDSTORM_INIT:
if (this->transitionTrigger != TRANS_TRIGGER_END) {
this->envCtx.sandstormState = 1;
this->envCtx.sandstormState = SANDSTORM_FILL;
this->transitionMode = TRANS_MODE_SANDSTORM;
} else {
this->envCtx.sandstormState = 2;
this->envCtx.sandstormState = SANDSTORM_UNFILL;
this->envCtx.sandstormPrimA = 255;
this->envCtx.sandstormEnvA = 255;
this->transitionMode = TRANS_MODE_SANDSTORM;
@@ -856,7 +857,7 @@ void Play_UpdateTransition(PlayState* this) {
case TRANS_MODE_SANDSTORM_END_INIT:
if (this->transitionTrigger == TRANS_TRIGGER_END) {
this->envCtx.sandstormState = 4;
this->envCtx.sandstormState = SANDSTORM_DISSIPATE;
this->envCtx.sandstormPrimA = 255;
this->envCtx.sandstormEnvA = 255;
@@ -1144,8 +1145,8 @@ void Play_DrawMain(PlayState* this) {
if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.curRoom.roomShape->base.type == ROOM_SHAPE_TYPE_IMAGE)) {
func_8012CF0C(gfxCtx, false, true, 0, 0, 0);
} else {
func_8012CF0C(gfxCtx, true, true, this->lightCtx.fogColor.r, this->lightCtx.fogColor.g,
this->lightCtx.fogColor.b);
func_8012CF0C(gfxCtx, true, true, this->lightCtx.fogColor[0], this->lightCtx.fogColor[1],
this->lightCtx.fogColor[2]);
}
} else {
func_8012CF0C(gfxCtx, false, false, 0, 0, 0);
@@ -1292,7 +1293,7 @@ void Play_DrawMain(PlayState* this) {
}
}
func_800FE390(this);
Environment_Draw(this);
}
sp268 = LightContext_NewLights(&this->lightCtx, gfxCtx);
@@ -1324,8 +1325,7 @@ void Play_DrawMain(PlayState* this) {
}
}
// envCtx.precipitation[PRECIP_RAIN_CUR]
if (this->envCtx.unk_F2[1] != 0) {
if (this->envCtx.precipitation[PRECIP_RAIN_CUR] != 0) {
Environment_DrawRain(this, &this->view, gfxCtx);
}
}
@@ -1339,7 +1339,7 @@ void Play_DrawMain(PlayState* this) {
}
if (1) {
if (!this->envCtx.sunMoonDisabled) {
if (!this->envCtx.sunDisabled) {
sp25C.x = this->view.eye.x + this->envCtx.sunPos.x;
sp25C.y = this->view.eye.y + this->envCtx.sunPos.y;
sp25C.z = this->view.eye.z + this->envCtx.sunPos.z;
@@ -1367,7 +1367,7 @@ void Play_DrawMain(PlayState* this) {
}
if (1) {
if (this->envCtx.sandstormState != 0) {
if (this->envCtx.sandstormState != SANDSTORM_OFF) {
Environment_DrawSandstorm(this, this->envCtx.sandstormState);
}
}
@@ -1440,7 +1440,7 @@ SkipPostWorldDraw:
}
if (!sp25B) {
func_800FE3E0(this);
Environment_DrawSkyboxStars(this);
}
CLOSE_DISPS(gfxCtx);
@@ -2217,7 +2217,7 @@ void Play_Init(GameState* thisx) {
gSaveContext.save.cutsceneIndex = 0;
}
if (gSaveContext.nextDayTime != 0xFFFF) {
if (gSaveContext.nextDayTime != NEXT_TIME_NONE) {
gSaveContext.save.time = gSaveContext.nextDayTime;
gSaveContext.skyboxTime = gSaveContext.nextDayTime;
}
@@ -2250,14 +2250,14 @@ void Play_Init(GameState* thisx) {
KaleidoScopeCall_Init(this);
Interface_Init(this);
if (gSaveContext.nextDayTime != 0xFFFF) {
if (gSaveContext.nextDayTime == 0x8000) {
if (gSaveContext.nextDayTime != NEXT_TIME_NONE) {
if (gSaveContext.nextDayTime == NEXT_TIME_DAY) {
gSaveContext.save.day++;
gSaveContext.save.daysElapsed++;
gSaveContext.save.eventDayCount++;
gSaveContext.dogIsLost = true;
gSaveContext.nextDayTime = -2;
gSaveContext.nextDayTime = NEXT_TIME_DAY_SET;
} else {
gSaveContext.nextDayTime = -3;
gSaveContext.nextDayTime = NEXT_TIME_NIGHT_SET;
}
}
@@ -2348,7 +2348,7 @@ void Play_Init(GameState* thisx) {
CutsceneManager_StoreCamera(&this->mainCamera);
Interface_SetSceneRestrictions(this);
func_800FB758(this);
Environment_PlaySceneSequence(this);
gSaveContext.seqId = this->sequenceCtx.seqId;
gSaveContext.ambienceId = this->sequenceCtx.ambienceId;
AnimationContext_Update(this, &this->animationCtx);
+4 -4
View File
@@ -581,12 +581,12 @@ s32 Room_HandleLoadCallbacks(PlayState* play, RoomContext* roomCtx) {
Actor_SpawnTransitionActors(play, &play->actorCtx);
if (((play->sceneId != SCENE_IKANA) || (roomCtx->curRoom.num != 1)) && (play->sceneId != SCENE_IKNINSIDE)) {
play->envCtx.lightSettingOverride = 0xFF;
play->envCtx.unk_E0 = 0;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_NONE;
}
func_800FEAB0();
if (!func_800FE4B8(play)) {
func_800FD858(play);
if (Environment_GetStormState(play) == STORM_STATE_OFF) {
Environment_StopStormNatureAmbience(play);
}
} else {
return 0;
+5 -5
View File
@@ -255,7 +255,7 @@ void Scene_CommandRoomBehavior(PlayState* play, SceneCmd* cmd) {
play->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
play->msgCtx.unk12044 = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1;
play->roomCtx.curRoom.enablePosLights = (cmd->roomBehavior.gpFlag2 >> 0xB) & 1;
play->envCtx.unk_E2 = (cmd->roomBehavior.gpFlag2 >> 0xC) & 1;
play->envCtx.stormState = (cmd->roomBehavior.gpFlag2 >> 0xC) & 1;
}
// SceneTableEntry Header Command 0x0A: Mesh Header
@@ -386,7 +386,7 @@ void Scene_CommandSkyboxSettings(PlayState* play, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x12: Skybox Disables
void Scene_CommandSkyboxDisables(PlayState* play, SceneCmd* cmd) {
play->envCtx.skyboxDisabled = cmd->skyboxDisables.unk4;
play->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk5;
play->envCtx.sunDisabled = cmd->skyboxDisables.unk5;
}
// SceneTableEntry Header Command 0x10: Time Settings
@@ -436,9 +436,9 @@ void Scene_CommandWindSettings(PlayState* play, SceneCmd* cmd) {
s8 temp2 = cmd->windSettings.vertical;
s8 temp3 = cmd->windSettings.south;
play->envCtx.windDir.x = temp1;
play->envCtx.windDir.y = temp2;
play->envCtx.windDir.z = temp3;
play->envCtx.windDirection.x = temp1;
play->envCtx.windDirection.y = temp2;
play->envCtx.windDirection.z = temp3;
play->envCtx.windSpeed = cmd->windSettings.clothIntensity;
}
+3 -3
View File
@@ -430,7 +430,7 @@ void Sram_SaveEndOfCycle(PlayState* play) {
u8 item;
gSaveContext.save.timeSpeedOffset = 0;
gSaveContext.save.daysElapsed = 0;
gSaveContext.save.eventDayCount = 0;
gSaveContext.save.day = 0;
gSaveContext.save.time = CLOCK_TIME(6, 0) - 1;
@@ -650,7 +650,7 @@ void Sram_SaveEndOfCycle(PlayState* play) {
void Sram_IncrementDay(void) {
if (CURRENT_DAY <= 3) {
gSaveContext.save.day++;
gSaveContext.save.daysElapsed++;
gSaveContext.save.eventDayCount++;
}
gSaveContext.save.saveInfo.bombersCaughtNum = 0;
@@ -918,7 +918,7 @@ u16 sSaveDefaultChecksum = 0;
*/
void Sram_InitNewSave(void) {
gSaveContext.save.playerForm = PLAYER_FORM_HUMAN;
gSaveContext.save.daysElapsed = 0;
gSaveContext.save.eventDayCount = 0;
gSaveContext.save.day = 0;
gSaveContext.save.time = CLOCK_TIME(6, 0) - 1;
Sram_ResetSave();
@@ -338,8 +338,8 @@ void func_808B7A90(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
func_800FE7A8(D_808B82F0, &sp2C);
func_800FE7A8(D_808B8300, &sp28);
Environment_LerpSandstormColors(D_808B82F0, &sp2C);
Environment_LerpSandstormColors(D_808B8300, &sp28);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, sp2C.r, sp2C.g, sp2C.b, 255);
gDPSetEnvColor(POLY_XLU_DISP++, sp28.r, sp28.g, sp28.b, 255);
@@ -358,15 +358,15 @@ void func_808B7B54(Actor* thisx, PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_800FE7A8(D_808B8310, &sp50);
func_800FE7A8(D_808B8330, &sp4C);
Environment_LerpSandstormColors(D_808B8310, &sp50);
Environment_LerpSandstormColors(D_808B8330, &sp4C);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, sp50.r, sp50.g, sp50.b, 255);
gDPSetEnvColor(POLY_XLU_DISP++, sp4C.r, sp4C.g, sp4C.b, 255);
gSPDisplayList(POLY_XLU_DISP++, object_posthouse_obj_DL_000A50);
func_800FE7A8(D_808B8320, &sp50);
func_800FE7A8(D_808B8340, &sp4C);
Environment_LerpSandstormColors(D_808B8320, &sp50);
Environment_LerpSandstormColors(D_808B8340, &sp4C);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, sp50.r, sp50.g, sp50.b, 255);
gDPSetEnvColor(POLY_XLU_DISP++, sp4C.r, sp4C.g, sp4C.b, 255);
+2 -2
View File
@@ -1320,7 +1320,7 @@ void Boss02_Static_Update(Actor* thisx, PlayState* play) {
Boss02* this = THIS;
this->giantModeScaleFactor = sGiantModeScaleFactor;
play->envCtx.sandstormState = 0xD;
play->envCtx.sandstormState = SANDSTORM_D;
if (sBlueWarp != NULL) {
this->fogNear = KREG(23) + -15.0f;
@@ -1828,7 +1828,7 @@ void Boss02_HandleGiantsMaskCutscene(Boss02* this, PlayState* play) {
Actor_SetScale(&player->actor, this->playerScale);
}
play->envCtx.lightSettings.fogNear = this->fogNear;
play->envCtx.adjLightSettings.fogNear = this->fogNear;
// Switches from the "normal" variation of the arena to the "giant" variation (or vice versa)
// at the appropriate point in the Giant's Mask cutscene.
+10 -10
View File
@@ -431,26 +431,26 @@ void Boss06_Update(Actor* thisx, PlayState* play) {
if (this->unk_1E4 > 0.0f) {
if (ENBOSS06_GET_PARAMS(&this->actor) == 0) {
D_801F4E32 = 1;
D_801F4E38.x = this->actor.world.pos.x + this->unk_1B0;
D_801F4E38.y = this->actor.world.pos.y + 80.0f + this->unk_1B4 + this->unk_1AC;
D_801F4E38.z = this->actor.world.pos.z;
gCustomLensFlare1On = true;
gCustomLensFlare1Pos.x = this->actor.world.pos.x + this->unk_1B0;
gCustomLensFlare1Pos.y = this->actor.world.pos.y + 80.0f + this->unk_1B4 + this->unk_1AC;
gCustomLensFlare1Pos.z = this->actor.world.pos.z;
D_801F4E44 = this->unk_1E4;
D_801F4E48 = 10.0f;
D_801F4E4C = 0;
} else {
D_801F4E4E = 1;
D_801F4E50.x = this->actor.world.pos.x + this->unk_1B0;
D_801F4E50.y = this->actor.world.pos.y + 80.0f + this->unk_1B4 + this->unk_1AC;
D_801F4E50.z = this->actor.world.pos.z;
gCustomLensFlare2On = true;
gCustomLensFlare2Pos.x = this->actor.world.pos.x + this->unk_1B0;
gCustomLensFlare2Pos.y = this->actor.world.pos.y + 80.0f + this->unk_1B4 + this->unk_1AC;
gCustomLensFlare2Pos.z = this->actor.world.pos.z;
D_801F4E5C = this->unk_1E4;
D_801F4E60 = 10.0f;
D_801F4E64 = 0;
}
} else if (ENBOSS06_GET_PARAMS(&this->actor) == 0) {
D_801F4E32 = 0;
gCustomLensFlare1On = false;
} else {
D_801F4E4E = 0;
gCustomLensFlare2On = false;
}
if ((this->unk_1C8 != 0) && (this->unk_1C8 != 0)) {
@@ -335,10 +335,10 @@ void DemoEffect_DrawLight(Actor* thisx, PlayState* play2) {
CLOSE_DISPS(play->state.gfxCtx);
D_801F4E32 = 1;
D_801F4E38.x = thisx->world.pos.x;
D_801F4E38.y = thisx->world.pos.y;
D_801F4E38.z = thisx->world.pos.z;
gCustomLensFlare1On = true;
gCustomLensFlare1Pos.x = thisx->world.pos.x;
gCustomLensFlare1Pos.y = thisx->world.pos.y;
gCustomLensFlare1Pos.z = thisx->world.pos.z;
D_801F4E44 = thisx->scale.x * 60.0f;
D_801F4E48 = thisx->scale.x * 50.0f;
@@ -56,21 +56,21 @@ void DemoKakyo_LostWoodsSparkleActionFunc(DemoKankyo* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (play->roomCtx.unk7A[1] != 0) {
if (play->envCtx.unk_F2[3] != 0) {
play->envCtx.unk_F2[3]--;
if (play->envCtx.precipitation[PRECIP_SNOW_MAX] != 0) {
play->envCtx.precipitation[PRECIP_SNOW_MAX]--;
} else {
Actor_Kill(&this->actor);
}
} else if (play->envCtx.unk_F2[3] < DEMOKANKYO_EFFECT_COUNT) {
play->envCtx.unk_F2[3] += 16;
} else if (play->envCtx.precipitation[PRECIP_SNOW_MAX] < DEMOKANKYO_EFFECT_COUNT) {
play->envCtx.precipitation[PRECIP_SNOW_MAX] += 16;
}
// note: DemoKankyo can crash if placed in an area that snows (ObjectKankyo)
// because they both use unk_F2 as an effect counter,
// because they both use PRECIP_SNOW_MAX precipitation as an effect counter,
// causing DemoKankyo to write beyond its efffect array boundry
// this crash can occur if the two actors are in different scenes connected by an exit
// e.g. if you add DemoKankyo to GoronShrine, you will crash entering/leaving through door
for (i = 0; i < play->envCtx.unk_F2[3]; i++) {
for (i = 0; i < play->envCtx.precipitation[PRECIP_SNOW_MAX]; i++) {
repositionLimit = 130.0f;
eyeToAt.x = play->view.at.x - play->view.eye.x;
@@ -304,8 +304,8 @@ void DemoKakyo_MoonSparklesActionFunc(DemoKankyo* this, PlayState* play) {
s32 pad1;
Vec3f worldPos;
if (play->envCtx.unk_F2[3] < DEMOKANKYO_EFFECT_COUNT) {
play->envCtx.unk_F2[3] += 16;
if (play->envCtx.precipitation[PRECIP_SNOW_MAX] < DEMOKANKYO_EFFECT_COUNT) {
play->envCtx.precipitation[PRECIP_SNOW_MAX] += 16;
}
eyeToAt.x = play->view.at.x - play->view.eye.x;
@@ -318,7 +318,7 @@ void DemoKakyo_MoonSparklesActionFunc(DemoKankyo* this, PlayState* play) {
halfScreenHeight = SCREEN_HEIGHT / 2;
for (i = 0; i < play->envCtx.unk_F2[3]; i++) {
for (i = 0; i < play->envCtx.precipitation[PRECIP_SNOW_MAX]; i++) {
switch (this->effects[i].state) {
case DEMO_KANKYO_STATE_INIT:
this->effects[i].posBase.x = play->view.eye.x + (eyeToAtNormX * halfScreenHeight);
@@ -511,7 +511,7 @@ void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, PlayState* play2) {
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gSun1Tex));
gSPDisplayList(POLY_XLU_DISP++, gSunSparkleMaterialDL);
for (i = 0; i < play->envCtx.unk_F2[3]; i++) {
for (i = 0; i < play->envCtx.precipitation[PRECIP_SNOW_MAX]; i++) {
worldPos.x = this->effects[i].posBase.x + this->effects[i].posOffset.x;
worldPos.y = this->effects[i].posBase.y + this->effects[i].posOffset.y;
worldPos.z = this->effects[i].posBase.z + this->effects[i].posOffset.z;
@@ -601,7 +601,7 @@ void DemoKankyo_DrawMoonAndGiant(Actor* thisx, PlayState* play2) {
Gfx_SetupDL25_Xlu(gfxCtx);
for (i = 0; i < play->envCtx.unk_F2[3]; i++) {
for (i = 0; i < play->envCtx.precipitation[PRECIP_SNOW_MAX]; i++) {
worldPos.x = this->effects[i].posBase.x + this->effects[i].posOffset.x;
worldPos.y = this->effects[i].posBase.y + this->effects[i].posOffset.y;
worldPos.z = this->effects[i].posBase.z + this->effects[i].posOffset.z;
@@ -499,8 +499,8 @@ void func_80C17468(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
func_800FE7A8(D_80C17824, &sp2C);
func_800FE7A8(D_80C17834, &sp28);
Environment_LerpSandstormColors(D_80C17824, &sp2C);
Environment_LerpSandstormColors(D_80C17834, &sp28);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, sp2C.r, sp2C.g, sp2C.b, 255);
gDPSetEnvColor(POLY_XLU_DISP++, sp28.r, sp28.g, sp28.b, 255);
+6 -5
View File
@@ -110,12 +110,13 @@ void func_80A1F75C(DmHina* this, PlayState* play) {
Math_SmoothStepToF(&this->unk14C, 1.0f, 0.4f, 0.05f, 0.001f);
this->unk17F = this->unk14C * 255.0f;
this->unk150 = Math_SinS(play->state.frames * 0x1F40);
for (i = 0; i < 3; i++) {
play->envCtx.lightSettings.ambientColor[i] = play->envCtx.lightSettings.fogColor[i] =
play->envCtx.lightSettings.diffuseColor1[i] = -255.0f * this->unk14C;
for (i = 0; i < ARRAY_COUNT(play->envCtx.adjLightSettings.light1Color); i++) {
play->envCtx.adjLightSettings.ambientColor[i] = play->envCtx.adjLightSettings.fogColor[i] =
play->envCtx.adjLightSettings.light1Color[i] = -255.0f * this->unk14C;
}
play->envCtx.lightSettings.fogNear = -500.0f * this->unk14C;
if (play->envCtx.lightSettings.fogNear < -300) {
play->envCtx.adjLightSettings.fogNear = -500.0f * this->unk14C;
if (play->envCtx.adjLightSettings.fogNear < -300) {
play->roomCtx.curRoom.segment = NULL;
}
break;
+6 -6
View File
@@ -1073,9 +1073,9 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
this->deflectCount = 0;
this->maskType = SK_MASK_TYPE_NORMAL;
this->animIndex = SK_ANIM_IDLE;
this->fogR = play->lightCtx.fogColor.r;
this->fogG = play->lightCtx.fogColor.g;
this->fogB = play->lightCtx.fogColor.b;
this->fogR = play->lightCtx.fogColor[0];
this->fogG = play->lightCtx.fogColor[1];
this->fogB = play->lightCtx.fogColor[2];
if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneLayer == 1)) {
this->alpha = 0;
@@ -1643,9 +1643,9 @@ void DmStk_HandleCutscene(DmStk* this, PlayState* play) {
this->fadeInState++;
}
this->fogR = play->lightCtx.fogColor.r * this->fogScale;
this->fogG = play->lightCtx.fogColor.g * this->fogScale;
this->fogB = play->lightCtx.fogColor.b * this->fogScale;
this->fogR = play->lightCtx.fogColor[0] * this->fogScale;
this->fogG = play->lightCtx.fogColor[1] * this->fogScale;
this->fogB = play->lightCtx.fogColor[2] * this->fogScale;
} else if (this->fadeInState == SK_FADE_IN_STATE_INCREASE_FOG) {
if (this->fogN < 996) {
this->fogN += 10;
@@ -178,10 +178,9 @@ void DoorWarp1_Destroy(Actor* thisx, PlayState* play) {
LightContext_RemoveLight(play, &play->lightCtx, this->unk_1DC);
LightContext_RemoveLight(play, &play->lightCtx, this->unk_1F0);
for (i = 0; i < ARRAY_COUNT(play->envCtx.lightSettings.diffuseColor1); i++) {
play->envCtx.lightSettings.diffuseColor1[i] = 0;
play->envCtx.lightSettings.fogColor[i] = play->envCtx.lightSettings.diffuseColor1[i];
play->envCtx.lightSettings.ambientColor[i] = play->envCtx.lightSettings.diffuseColor1[i];
for (i = 0; i < ARRAY_COUNT(play->envCtx.adjLightSettings.light1Color); i++) {
play->envCtx.adjLightSettings.ambientColor[i] = play->envCtx.adjLightSettings.fogColor[i] =
play->envCtx.adjLightSettings.light1Color[i] = 0;
}
if (this->unk_1D3 != 0) {
@@ -781,7 +780,6 @@ void func_808BA550(DoorWarp1* this, PlayState* play) {
Player* player2 = GET_PLAYER(play);
Player* player = GET_PLAYER(play);
s16 i;
s32 temp_f16;
f32 temp_f0;
f32 temp_f2;
s32 temp;
@@ -869,16 +867,13 @@ void func_808BA550(DoorWarp1* this, PlayState* play) {
if (1) {}
temp_f0 = 1.0f - ((f32)(D_808BC000 - this->unk_1D0) / ((D_808BC000 - tempS) + 100));
if (temp_f0 > 0.0f) {
temp_f16 = -255.0f * temp_f0;
for (i = 0; i < 3; i++) {
play->envCtx.lightSettings.diffuseColor1[i] = temp_f16;
play->envCtx.lightSettings.fogColor[i] = temp_f16;
play->envCtx.lightSettings.ambientColor[i] = temp_f16;
for (i = 0; i < ARRAY_COUNT(play->envCtx.adjLightSettings.light1Color); i++) {
play->envCtx.adjLightSettings.ambientColor[i] = play->envCtx.adjLightSettings.fogColor[i] =
play->envCtx.adjLightSettings.light1Color[i] = -255.0f * temp_f0;
}
play->envCtx.lightSettings.fogNear = -500.0f * temp_f0;
if (play->envCtx.lightSettings.fogNear < -300) {
play->envCtx.adjLightSettings.fogNear = -500.0f * temp_f0;
if (play->envCtx.adjLightSettings.fogNear < -300) {
play->roomCtx.curRoom.segment = NULL;
}
}
@@ -81,7 +81,7 @@ void func_80A4C5CC(EffChange* this, PlayState* play) {
if (func_80183DE0(&this->skeletonInfo)) {
Actor_Kill(&this->actor);
CutsceneManager_Stop(CS_ID_GLOBAL_ELEGY);
func_800FD2B4(play, 0.0f, 850.0f, 0.2f, 0.0f);
Environment_AdjustLights(play, 0.0f, 850.0f, 0.2f, 0.0f);
return;
}
@@ -108,7 +108,7 @@ void func_80A4C5CC(EffChange* this, PlayState* play) {
} else if (phi_fv0 < 0.0f) {
phi_fv0 = 0.0f;
}
func_800FD2B4(play, phi_fv0, 850.0f, 0.2f, 0.0f);
Environment_AdjustLights(play, phi_fv0, 850.0f, 0.2f, 0.0f);
if (CutsceneManager_GetCurrentCsId() != CS_ID_GLOBAL_ELEGY) {
if (CutsceneManager_IsNext(CS_ID_GLOBAL_ELEGY)) {
CutsceneManager_Start(CS_ID_GLOBAL_ELEGY, &this->actor);
@@ -153,8 +153,8 @@ void EffKamejimaWave_Draw(Actor* thisx, PlayState* play) {
Color_RGBA8 primColor;
Color_RGBA8 envColor;
func_800FE7A8(sPrimColors, &primColor);
func_800FE7A8(sEnvColors, &envColor);
Environment_LerpSandstormColors(sPrimColors, &primColor);
Environment_LerpSandstormColors(sEnvColors, &envColor);
EffKamejimaWave_SetVtxAlpha(sVtxAlpha);
OPEN_DISPS(play->state.gfxCtx);
@@ -475,7 +475,7 @@ void EnAob01_BeforeRace_StartRace(EnAob01* this, PlayState* play) {
SET_WEEKEVENTREG(WEEKEVENTREG_KICKOUT_WAIT);
CLEAR_WEEKEVENTREG(WEEKEVENTREG_KICKOUT_TIME_PASSED);
this->stateFlags |= ENAOB01_FLAG_STARTED_RACE;
func_800FD750(NA_BGM_HORSE);
Environment_ForcePlaySequence(NA_BGM_HORSE);
play->nextEntrance = ENTRANCE(DOGGY_RACETRACK, 1);
play->transitionType = TRANS_TYPE_64;
gSaveContext.nextTransitionType = TRANS_TYPE_64;
+2 -2
View File
@@ -1526,7 +1526,7 @@ void func_80A97AB4(EnAz* this, PlayState* play) {
if (play->msgCtx.choiceIndex == 0) {
Audio_PlaySfx_MessageDecide();
play->msgCtx.msgMode = MSGMODE_PAUSED;
func_800FD750(NA_BGM_TIMED_MINI_GAME);
Environment_ForcePlaySequence(NA_BGM_TIMED_MINI_GAME);
func_80A94AB8(this, play, 1);
func_80A979DC(this, play);
} else {
@@ -1571,7 +1571,7 @@ void func_80A97C4C(EnAz* this, PlayState* play) {
func_80A97410(this, play);
if ((this->unk_2FA == 1) || (this->unk_2FA == 3) || (this->unk_2FA == 6) || (this->unk_2FA == 8)) {
CLEAR_WEEKEVENTREG(WEEKEVENTREG_24_01);
func_800FD750(NA_BGM_TIMED_MINI_GAME);
Environment_ForcePlaySequence(NA_BGM_TIMED_MINI_GAME);
play->nextEntrance = Entrance_CreateFromSpawn(1);
gSaveContext.nextCutsceneIndex = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -1009,7 +1009,7 @@ void EnBigslime_CallMinislime(EnBigslime* this, PlayState* play) {
EnBigslime_UpdateCameraIntroCs(this, play, 25);
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
EnBigslime_InitFallMinislime(this);
play->envCtx.lightSettingOverride = 0xFF;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
this->callTimer = 35;
func_800B7298(play, &this->actor, PLAYER_CSMODE_4);
}
@@ -1989,7 +1989,7 @@ void EnBigslime_Melt(EnBigslime* this, PlayState* play) {
if (this->meltCounter == 100) {
EnBigslime_SetTargetVtxFromPreFrozen(this);
} else if (this->meltCounter == 50) {
play->envCtx.lightSettingOverride = 0xFF;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
}
}
@@ -2777,7 +2777,7 @@ void EnBigslime_UpdateBigslime(Actor* thisx, PlayState* play) {
Vec3f vtxMin;
if (play->envCtx.lightSettingOverride == 3) {
play->envCtx.lightSettingOverride = 0xFF;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
}
Audio_SetSfxUnderwaterReverb(true);
@@ -2822,7 +2822,7 @@ void EnBigslime_UpdateGekko(Actor* thisx, PlayState* play) {
s32 pad;
if (play->envCtx.lightSettingOverride == 3) {
play->envCtx.lightSettingOverride = 0xFF;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
}
Audio_SetSfxUnderwaterReverb(false);
+16 -16
View File
@@ -356,28 +356,28 @@ void EnBom_Explode(EnBom* this, PlayState* play) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider2.base);
}
if (play->envCtx.lightSettings.diffuseColor1[0] != 0) {
play->envCtx.lightSettings.diffuseColor1[0] -= 25;
if (play->envCtx.adjLightSettings.light1Color[0] != 0) {
play->envCtx.adjLightSettings.light1Color[0] -= 25;
}
if (play->envCtx.lightSettings.diffuseColor1[1] != 0) {
play->envCtx.lightSettings.diffuseColor1[1] -= 25;
if (play->envCtx.adjLightSettings.light1Color[1] != 0) {
play->envCtx.adjLightSettings.light1Color[1] -= 25;
}
if (play->envCtx.lightSettings.diffuseColor1[2] != 0) {
play->envCtx.lightSettings.diffuseColor1[2] -= 25;
if (play->envCtx.adjLightSettings.light1Color[2] != 0) {
play->envCtx.adjLightSettings.light1Color[2] -= 25;
}
if (play->envCtx.lightSettings.ambientColor[0] != 0) {
play->envCtx.lightSettings.ambientColor[0] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[0] != 0) {
play->envCtx.adjLightSettings.ambientColor[0] -= 25;
}
if (play->envCtx.lightSettings.ambientColor[1] != 0) {
play->envCtx.lightSettings.ambientColor[1] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[1] != 0) {
play->envCtx.adjLightSettings.ambientColor[1] -= 25;
}
if (play->envCtx.lightSettings.ambientColor[2] != 0) {
play->envCtx.lightSettings.ambientColor[2] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[2] != 0) {
play->envCtx.adjLightSettings.ambientColor[2] -= 25;
}
if (this->timer == 0) {
@@ -550,10 +550,10 @@ void EnBom_Update(Actor* thisx, PlayState* play) {
CLEAR_TAG_PARAMS(this->isPowderKeg));
Actor_RequestQuakeAndRumble(thisx, play, sQuakeY[this->isPowderKeg],
sQuakeDurations[this->isPowderKeg]);
play->envCtx.lightSettings.diffuseColor1[0] = play->envCtx.lightSettings.diffuseColor1[1] =
play->envCtx.lightSettings.diffuseColor1[2] = 250;
play->envCtx.lightSettings.ambientColor[0] = play->envCtx.lightSettings.ambientColor[1] =
play->envCtx.lightSettings.ambientColor[2] = 250;
play->envCtx.adjLightSettings.light1Color[0] = play->envCtx.adjLightSettings.light1Color[1] =
play->envCtx.adjLightSettings.light1Color[2] = 250;
play->envCtx.adjLightSettings.ambientColor[0] = play->envCtx.adjLightSettings.ambientColor[1] =
play->envCtx.adjLightSettings.ambientColor[2] = 250;
Camera_AddQuake(&play->mainCamera, 2, 11, 8);
thisx->params = BOMB_TYPE_EXPLOSION;
this->timer = 10;
+16 -16
View File
@@ -273,28 +273,28 @@ void func_808AEFD4(EnBombf* this, PlayState* play) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
}
if (play->envCtx.lightSettings.diffuseColor1[0] != 0) {
play->envCtx.lightSettings.diffuseColor1[0] -= 25;
if (play->envCtx.adjLightSettings.light1Color[0] != 0) {
play->envCtx.adjLightSettings.light1Color[0] -= 25;
}
if (play->envCtx.lightSettings.diffuseColor1[1] != 0) {
play->envCtx.lightSettings.diffuseColor1[1] -= 25;
if (play->envCtx.adjLightSettings.light1Color[1] != 0) {
play->envCtx.adjLightSettings.light1Color[1] -= 25;
}
if (play->envCtx.lightSettings.diffuseColor1[2] != 0) {
play->envCtx.lightSettings.diffuseColor1[2] -= 25;
if (play->envCtx.adjLightSettings.light1Color[2] != 0) {
play->envCtx.adjLightSettings.light1Color[2] -= 25;
}
if (play->envCtx.lightSettings.ambientColor[0] != 0) {
play->envCtx.lightSettings.ambientColor[0] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[0] != 0) {
play->envCtx.adjLightSettings.ambientColor[0] -= 25;
}
if (play->envCtx.lightSettings.ambientColor[1] != 0) {
play->envCtx.lightSettings.ambientColor[1] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[1] != 0) {
play->envCtx.adjLightSettings.ambientColor[1] -= 25;
}
if (play->envCtx.lightSettings.ambientColor[2] != 0) {
play->envCtx.lightSettings.ambientColor[2] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[2] != 0) {
play->envCtx.adjLightSettings.ambientColor[2] -= 25;
}
if (this->timer == 0) {
@@ -414,10 +414,10 @@ void EnBombf_Update(Actor* thisx, PlayState* play) {
CLEAR_TAG_PARAMS(CLEAR_TAG_SMALL_EXPLOSION));
Actor_PlaySfx(&this->actor, NA_SE_IT_BOMB_EXPLOSION);
play->envCtx.lightSettings.diffuseColor1[0] = play->envCtx.lightSettings.diffuseColor1[1] =
play->envCtx.lightSettings.diffuseColor1[2] = 250;
play->envCtx.lightSettings.ambientColor[0] = play->envCtx.lightSettings.ambientColor[1] =
play->envCtx.lightSettings.ambientColor[2] = 250;
play->envCtx.adjLightSettings.light1Color[0] = play->envCtx.adjLightSettings.light1Color[1] =
play->envCtx.adjLightSettings.light1Color[2] = 250;
play->envCtx.adjLightSettings.ambientColor[0] = play->envCtx.adjLightSettings.ambientColor[1] =
play->envCtx.adjLightSettings.ambientColor[2] = 250;
Camera_AddQuake(&play->mainCamera, 2, 11, 8);
@@ -563,7 +563,7 @@ void func_8089B580(EnDinofos* this, PlayState* play) {
}
if ((play->sceneId == SCENE_MITURIN) && Animation_OnFrame(&this->skelAnime, 55.0f)) {
play->envCtx.lightSettingOverride = 0xFF;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
}
if (SkelAnime_Update(&this->skelAnime)) {
@@ -1118,7 +1118,7 @@ void func_8089CF00(EnDinofos* this, PlayState* play) {
Animation_PlayOnce(&this->skelAnime, &gDinolfosFireEndAnim);
this->colliderJntSph.base.atFlags &= ~AT_ON;
if (play->sceneId == SCENE_MITURIN) {
play->envCtx.lightSettingOverride = 255;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
}
this->actionFunc = func_8089CF70;
}
@@ -1289,7 +1289,7 @@ s32 func_8089D60C(EnDinofos* this, PlayState* play) {
func_8089ACEC(this, play);
func_8089AD70(this);
if (play->sceneId == SCENE_MITURIN) {
play->envCtx.lightSettingOverride = 255;
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
}
this->colliderQuad.base.atFlags &= ~(AT_ON | AT_BOUNCED);
+3 -3
View File
@@ -1323,7 +1323,7 @@ void func_8088FC34(EnElf* this, PlayState* play) {
} else {
Math_StepToF(&this->unk_240, 1.0f, 0.05f);
}
func_800FD2B4(play, SQ(this->unk_240), player->actor.projectedPos.z + 780.0f, 0.2f, 0.5f);
Environment_AdjustLights(play, SQ(this->unk_240), player->actor.projectedPos.z + 780.0f, 0.2f, 0.5f);
}
}
@@ -1521,8 +1521,8 @@ void func_8089010C(Actor* thisx, PlayState* play) {
this->elfMsg = NULL;
this->timer++;
if ((this->unk_240 >= 0.0f) &&
func_800FD2B4(play, SQ(this->unk_240) * this->unk_240, player->actor.projectedPos.z + 780.0f, 0.2f, 0.5f)) {
if ((this->unk_240 >= 0.0f) && Environment_AdjustLights(play, SQ(this->unk_240) * this->unk_240,
player->actor.projectedPos.z + 780.0f, 0.2f, 0.5f)) {
Math_StepToF(&this->unk_240, -0.05f, 0.05f);
}
@@ -169,10 +169,10 @@ void EnEncount3_Update(Actor* thisx, PlayState* play2) {
this->unk164 = this->unk160 / 60.0f;
if (this->unk164 != 0.0f) {
play->envCtx.lightSettings.fogNear = (960 - play->envCtx.unk_C4.fogNear) * this->unk164;
play->envCtx.lightSettings.fogColor[0] = (40.0f - play->envCtx.unk_C4.fogColor[0]) * this->unk164;
play->envCtx.lightSettings.fogColor[1] = (10.0f - play->envCtx.unk_C4.fogColor[1]) * this->unk164;
play->envCtx.lightSettings.fogColor[2] = (0.0f - play->envCtx.unk_C4.fogColor[2]) * this->unk164;
play->envCtx.adjLightSettings.fogNear = (960 - play->envCtx.lightSettings.fogNear) * this->unk164;
play->envCtx.adjLightSettings.fogColor[0] = (40.0f - play->envCtx.lightSettings.fogColor[0]) * this->unk164;
play->envCtx.adjLightSettings.fogColor[1] = (10.0f - play->envCtx.lightSettings.fogColor[1]) * this->unk164;
play->envCtx.adjLightSettings.fogColor[2] = (0.0f - play->envCtx.lightSettings.fogColor[2]) * this->unk164;
}
}
@@ -5314,8 +5314,8 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
Cutscene_StopManual(play, &play->csCtx);
D_8090CD4C = 0;
sSubCamId = SUB_CAM_ID_DONE;
func_800F6834(play, 0);
play->envCtx.lightSettings.fogNear = 0;
Environment_EnableUnderwaterLights(play, 0);
play->envCtx.adjLightSettings.fogNear = 0;
player->unk_B28 = -5;
D_80917200 = 5;
break;
@@ -5356,8 +5356,8 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
D_8090CD4C = 0;
sSubCamId = SUB_CAM_ID_DONE;
D_8090CD50 = 30;
func_800F6834(play, 0);
play->envCtx.lightSettings.fogNear = 0;
Environment_EnableUnderwaterLights(play, 0);
play->envCtx.adjLightSettings.fogNear = 0;
}
break;
@@ -5460,8 +5460,8 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
D_80917200 = 5;
D_8090CD54 = 0;
D_809171F6 = 20;
func_800F6834(play, 0);
play->envCtx.lightSettings.fogNear = 0;
Environment_EnableUnderwaterLights(play, 0);
play->envCtx.adjLightSettings.fogNear = 0;
}
}
}
@@ -5476,15 +5476,15 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
Math_ApproachF(&sSubCamVelFactor, 1.0f, 1.0f, 0.02f);
if (sSubCamEye.y <= (WATER_SURFACE_Y(play) + 1.0f)) {
func_800F6834(play, 1);
Environment_EnableUnderwaterLights(play, 1);
if (D_809171CA != 0) {
play->envCtx.lightSettings.fogNear = -0xB2;
play->envCtx.adjLightSettings.fogNear = -178;
} else {
play->envCtx.lightSettings.fogNear = -0x2E;
play->envCtx.adjLightSettings.fogNear = -46;
}
} else {
func_800F6834(play, 0);
play->envCtx.lightSettings.fogNear = 0;
Environment_EnableUnderwaterLights(play, 0);
play->envCtx.adjLightSettings.fogNear = 0;
}
}
@@ -5534,10 +5534,10 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
if (Rand_ZeroOne() < 0.5f) {
D_8090CCD4 = Rand_ZeroFloat(10.0f) + 5.0f;
play->envCtx.unk_E1 = 1;
play->envCtx.stormRequest = STORM_REQUEST_START;
} else {
D_8090CCD4 = 0;
play->envCtx.unk_E1 = 2;
play->envCtx.stormRequest = STORM_REQUEST_STOP;
}
}
@@ -5568,8 +5568,8 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
Math_ApproachZeroF(&D_8090CCD8, 1.0f, 2.0f);
}
play->envCtx.lightSettings.diffuseColor1[0] = play->envCtx.lightSettings.diffuseColor1[1] =
play->envCtx.lightSettings.diffuseColor1[2] = D_8090CCD8;
play->envCtx.adjLightSettings.light1Color[0] = play->envCtx.adjLightSettings.light1Color[1] =
play->envCtx.adjLightSettings.light1Color[2] = D_8090CCD8;
if ((u8)D_8090CCD0 > 0) {
s32 pad;
+18 -18
View File
@@ -996,46 +996,46 @@ s32 func_80963810(PlayState* play, Vec3f pos) {
s32 func_809638F8(PlayState* play) {
s32 ret = true;
if (play->envCtx.lightSettings.diffuseColor1[0] > 25) {
play->envCtx.lightSettings.diffuseColor1[0] -= 25;
if (play->envCtx.adjLightSettings.light1Color[0] > 25) {
play->envCtx.adjLightSettings.light1Color[0] -= 25;
ret = false;
} else {
play->envCtx.lightSettings.diffuseColor1[0] = 0;
play->envCtx.adjLightSettings.light1Color[0] = 0;
}
if (play->envCtx.lightSettings.diffuseColor1[1] > 25) {
play->envCtx.lightSettings.diffuseColor1[1] -= 25;
if (play->envCtx.adjLightSettings.light1Color[1] > 25) {
play->envCtx.adjLightSettings.light1Color[1] -= 25;
ret = false;
} else {
play->envCtx.lightSettings.diffuseColor1[1] = 0;
play->envCtx.adjLightSettings.light1Color[1] = 0;
}
if (play->envCtx.lightSettings.diffuseColor1[2] > 25) {
play->envCtx.lightSettings.diffuseColor1[2] -= 25;
if (play->envCtx.adjLightSettings.light1Color[2] > 25) {
play->envCtx.adjLightSettings.light1Color[2] -= 25;
ret = false;
} else {
play->envCtx.lightSettings.diffuseColor1[2] = 0;
play->envCtx.adjLightSettings.light1Color[2] = 0;
}
if (play->envCtx.lightSettings.ambientColor[0] > 25) {
play->envCtx.lightSettings.ambientColor[0] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[0] > 25) {
play->envCtx.adjLightSettings.ambientColor[0] -= 25;
ret = false;
} else {
play->envCtx.lightSettings.ambientColor[0] = 0;
play->envCtx.adjLightSettings.ambientColor[0] = 0;
}
if (play->envCtx.lightSettings.ambientColor[1] > 25) {
play->envCtx.lightSettings.ambientColor[1] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[1] > 25) {
play->envCtx.adjLightSettings.ambientColor[1] -= 25;
ret = false;
} else {
play->envCtx.lightSettings.ambientColor[1] = 0;
play->envCtx.adjLightSettings.ambientColor[1] = 0;
}
if (play->envCtx.lightSettings.ambientColor[2] > 25) {
play->envCtx.lightSettings.ambientColor[2] -= 25;
if (play->envCtx.adjLightSettings.ambientColor[2] > 25) {
play->envCtx.adjLightSettings.ambientColor[2] -= 25;
ret = false;
} else {
play->envCtx.lightSettings.ambientColor[2] = 0;
play->envCtx.adjLightSettings.ambientColor[2] = 0;
}
return ret;
}
+1 -1
View File
@@ -364,7 +364,7 @@ void func_80B0FD8C(EnGb2* this, PlayState* play) {
}
void func_80B0FE18(PlayState* play) {
func_800FD750(NA_BGM_MINI_BOSS);
Environment_ForcePlaySequence(NA_BGM_MINI_BOSS);
play->nextEntrance = ENTRANCE(GHOST_HUT, 1);
play->transitionType = TRANS_TYPE_64;
gSaveContext.nextTransitionType = TRANS_TYPE_64;
+1 -1
View File
@@ -1066,7 +1066,7 @@ void EnGs_Update(Actor* thisx, PlayState* play) {
Math_StepToF(&this->unk_200, 1.0f, 0.02f);
}
func_80997AFC(this->unk_194, &this->unk_1F7);
Lib_LerpRGB(&this->unk_1F4, &this->unk_1F7, this->unk_200, &this->unk_1FA);
Color_RGB8_Lerp(&this->unk_1F4, &this->unk_1F7, this->unk_200, &this->unk_1FA);
if (this->unk_200 >= 1.0f) {
this->unk_1F4 = this->unk_1FA;
}
+3 -3
View File
@@ -62,10 +62,10 @@ void EnHata_Update(Actor* thisx, PlayState* play2) {
this->skelAnime.playSpeed = 2.75f * phi_fv0;
this->skelAnime.playSpeed += 1.0f + Rand_ZeroFloat(1.25f);
sp34.x = play->envCtx.windDir.x;
sp34.y = play->envCtx.windDir.y + ((1.0f - phi_fv0) * 240.0f);
sp34.x = play->envCtx.windDirection.x;
sp34.y = play->envCtx.windDirection.y + ((1.0f - phi_fv0) * 240.0f);
sp34.y = CLAMP(sp34.y, -118.0f, 118.0f);
sp34.z = play->envCtx.windDir.z;
sp34.z = play->envCtx.windDirection.z;
phi_fv0 = CLAMP(phi_fv0, 0.1f, 0.4f);
Math_ApproachF(&this->unk_2A4.x, sp34.x, phi_fv0, 1000.0f);
+2 -2
View File
@@ -879,7 +879,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) {
case 0x3475:
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_START);
func_800FD750(NA_BGM_HORSE);
Environment_ForcePlaySequence(NA_BGM_HORSE);
play->nextEntrance = ENTRANCE(GORMAN_TRACK, 5);
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -1176,7 +1176,7 @@ s32 func_808F4414(PlayState* play, EnIn* this, s32 arg2) {
case 0x3475:
SET_WEEKEVENTREG_HORSE_RACE_STATE(WEEKEVENTREG_HORSE_RACE_STATE_START);
func_800FD750(NA_BGM_HORSE);
Environment_ForcePlaySequence(NA_BGM_HORSE);
play->nextEntrance = ENTRANCE(GORMAN_TRACK, 5);
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -750,7 +750,7 @@ void EnInvadepohDemo_Ufo_Draw(EnInvadepohDemo* this, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
if (EnInvadepohDemo_Ufo_ShouldDrawLensFlare(play, &flashPos)) {
func_800F9824(play, &play->envCtx, &play->view, play->state.gfxCtx, flashPos, 20.0f, 9.0f, 0, 0);
Environment_DrawLensFlare(play, &play->envCtx, &play->view, play->state.gfxCtx, flashPos, 20.0f, 9.0f, 0, 0);
}
}
@@ -203,7 +203,7 @@ void EnMThunder_Destroy(Actor* thisx, PlayState* play) {
}
void EnMThunder_AdjustLights(PlayState* play, f32 arg1) {
func_800FD2B4(play, arg1, 850.0f, 0.2f, 0.0f);
Environment_AdjustLights(play, arg1, 850.0f, 0.2f, 0.0f);
}
void EnMThunder_Spin_AttackNoMagic(EnMThunder* this, PlayState* play) {
@@ -318,7 +318,7 @@ void EnMttag_RaceStart(EnMttag* this, PlayState* play) {
Interface_StartTimer(TIMER_ID_MINIGAME_2, 0);
play->interfaceCtx.minigameState = MINIGAME_STATE_COUNTDOWN_SETUP_3;
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_GORON_RACE | SEQ_FLAG_ASYNC);
play->envCtx.unk_E4 = 0xFE;
play->envCtx.timeSeqState = TIMESEQ_REQUEST;
player->stateFlags1 &= ~PLAYER_STATE1_20;
} else if ((this->timer < 60) && (play->interfaceCtx.minigameState == MINIGAME_STATE_COUNTDOWN_GO)) {
this->timer = 0;
+1 -1
View File
@@ -366,7 +366,7 @@ s32 func_80BC01DC(Actor* thisx, PlayState* play) {
gSaveContext.save.time = CLOCK_TIME(8, 0);
Sram_IncrementDay();
} else {
func_800FE658(120.0f);
Environment_SetTimeJump(120.0f);
}
this->behaviour++;
@@ -41,7 +41,7 @@ void EnOkarinaEffect_Destroy(Actor* thisx, PlayState* play) {
void EnOkarinaEffect_Init(Actor* thisx, PlayState* play) {
EnOkarinaEffect* this = THIS;
if (play->envCtx.unk_F2[1]) {
if (play->envCtx.precipitation[PRECIP_RAIN_CUR] != 0) {
Actor_Kill(&this->actor);
}
EnOkarinaEffect_SetupAction(this, func_8096B104);
@@ -49,10 +49,10 @@ void EnOkarinaEffect_Init(Actor* thisx, PlayState* play) {
void func_8096B104(EnOkarinaEffect* this, PlayState* play) {
this->unk144 = 0x50;
play->envCtx.unk_F2[4] = 0x3C;
D_801F4E70 = 501.0f;
play->envCtx.unk_E3 = 2;
func_800FD78C(play);
play->envCtx.precipitation[PRECIP_SOS_MAX] = 60;
gLightningStrike.delayTimer = 501.0f;
play->envCtx.lightningState = LIGHTNING_LAST;
Environment_PlayStormNatureAmbience(play);
EnOkarinaEffect_SetupAction(this, func_8096B174);
}
@@ -65,11 +65,11 @@ void func_8096B174(EnOkarinaEffect* this, PlayState* play) {
}
void func_8096B1FC(EnOkarinaEffect* this, PlayState* play) {
if (play->envCtx.unk_F2[4]) {
if (play->envCtx.precipitation[PRECIP_SOS_MAX] != 0) {
if ((play->state.frames & 3) == 0) {
play->envCtx.unk_F2[4]--;
if (play->envCtx.unk_F2[4] == 8) {
func_800FD858(play);
play->envCtx.precipitation[PRECIP_SOS_MAX]--;
if (play->envCtx.precipitation[PRECIP_SOS_MAX] == 8) {
Environment_StopStormNatureAmbience(play);
}
}
} else {
+2 -2
View File
@@ -459,8 +459,8 @@ void func_80B5C3D8(EnOt* this, PlayState* play) {
this->unk_360->actor.shape.rot.y = BINANG_ROT180(temp);
if (this->unk_740 < 1.0f) {
Lib_LerpRGB(&D_80B5E408, &D_80B5E40C, this->unk_740, &this->unk_744);
Lib_LerpRGB(&D_80B5E408, &D_80B5E40C, this->unk_740, &this->unk_360->unk_744);
Color_RGB8_Lerp(&D_80B5E408, &D_80B5E40C, this->unk_740, &this->unk_744);
Color_RGB8_Lerp(&D_80B5E408, &D_80B5E40C, this->unk_740, &this->unk_360->unk_744);
Math_StepToF(&this->unk_740, 1.0f, 0.05f);
}
@@ -782,7 +782,7 @@ s32 func_80A3FBE8(EnTest3* this, PlayState* play) {
CutsceneManager_SetReturnCamera(CAM_ID_MAIN);
Environment_StartTime();
if (((void)0, gSaveContext.save.time) > CLOCK_TIME(6, 0)) {
func_800FE658(TIME_TO_MINUTES_ALT_F(fabsf((s16) - ((void)0, gSaveContext.save.time))));
Environment_SetTimeJump(TIME_TO_MINUTES_ALT_F(fabsf((s16) - ((void)0, gSaveContext.save.time))));
}
if (play->actorCtx.flags & ACTORCTX_FLAG_6) {
SET_WEEKEVENTREG(WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT);
+22 -22
View File
@@ -60,8 +60,8 @@ void func_80A41D70(EnTest4* this, PlayState* play) {
}
Interface_NewDay(play, CURRENT_DAY);
D_801BDBC8 = 0xFE;
func_800FB758(play);
gSceneSeqState = SCENESEQ_MORNING;
Environment_PlaySceneSequence(play);
func_800FEAF4(&play->envCtx);
this->actionFunc = func_80A42AB8;
}
@@ -97,8 +97,8 @@ void func_80A41FA4(EnTest4* this, PlayState* play) {
gSaveContext.save.time = CLOCK_TIME(6, 0);
Interface_NewDay(play, CURRENT_DAY);
Message_DisplaySceneTitleCard(play, sDayMessages2[CURRENT_DAY - 1]);
D_801BDBC8 = 0xFE;
func_800FB758(play);
gSceneSeqState = SCENESEQ_MORNING;
Environment_PlaySceneSequence(play);
func_800FEAF4(&play->envCtx);
this->actionFunc = func_80A42AB8;
}
@@ -324,7 +324,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) {
} else {
gSaveContext.save.day = 1;
dayTemp = gSaveContext.save.day;
gSaveContext.save.daysElapsed = dayTemp;
gSaveContext.save.eventDayCount = dayTemp;
this->csIdIndex = 1;
this->unk_146 = gSaveContext.save.time;
this->actionFunc = func_80A42AB8;
@@ -517,38 +517,38 @@ void func_80A42F20(EnTest4* this, PlayState* play) {
void func_80A430C8(EnTest4* this, PlayState* play) {
if ((CURRENT_DAY == 2) && (gSaveContext.save.time >= CLOCK_TIME(7, 0)) &&
(gSaveContext.save.time < CLOCK_TIME(17, 30)) && (play->envCtx.unk_F2[2] == 0)) {
(gSaveContext.save.time < CLOCK_TIME(17, 30)) && (play->envCtx.precipitation[PRECIP_SNOW_CUR] == 0)) {
// rain?
gWeatherMode = 1;
func_800FD78C(play);
play->envCtx.unk_E3 = 1;
play->envCtx.unk_F2[0] = 0x3C;
gWeatherMode = WEATHER_MODE_1;
Environment_PlayStormNatureAmbience(play);
play->envCtx.lightningState = LIGHTNING_ON;
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 60;
} else {
if (play->envCtx.unk_F2[0] != 0) {
if (play->envCtx.precipitation[PRECIP_RAIN_MAX] != 0) {
if ((play->state.frames % 4) == 0) {
play->envCtx.unk_F2[0]--;
if ((play->envCtx.unk_F2[0]) == 8) {
func_800FD858(play);
play->envCtx.precipitation[PRECIP_RAIN_MAX]--;
if ((play->envCtx.precipitation[PRECIP_RAIN_MAX]) == 8) {
Environment_StopStormNatureAmbience(play);
}
}
}
}
if (gWeatherMode == 1) {
if (gWeatherMode == WEATHER_MODE_1) {
this->state = TEST4_STATE_1;
}
}
void func_80A431C8(EnTest4* this, PlayState* play) {
if (((gSaveContext.save.time >= CLOCK_TIME(17, 30)) && (gSaveContext.save.time < CLOCK_TIME(23, 0)) &&
(play->envCtx.unk_F2[0] != 0)) ||
(play->envCtx.unk_F2[2] != 0)) {
gWeatherMode = 0;
play->envCtx.unk_E3 = 2;
(play->envCtx.precipitation[PRECIP_RAIN_MAX] != 0)) ||
(play->envCtx.precipitation[PRECIP_SNOW_CUR] != 0)) {
gWeatherMode = WEATHER_MODE_CLEAR;
play->envCtx.lightningState = LIGHTNING_LAST;
}
if (gWeatherMode == 0) {
if (gWeatherMode == WEATHER_MODE_CLEAR) {
this->state = TEST4_STATE_0;
}
}
@@ -557,7 +557,7 @@ void func_80A4323C(EnTest4* this, PlayState* play) {
s32 temp_v0 = (this->actor.params >> 0xA) * 0x64;
if (temp_v0 > 0) {
D_801F4E7A = temp_v0;
gSkyboxNumStars = temp_v0;
}
}
@@ -568,7 +568,7 @@ void EnTest4_Update(Actor* thisx, PlayState* play) {
if (!(player->stateFlags1 & PLAYER_STATE1_2)) {
this->actionFunc(this, play);
if (func_800FE4B8(play) != 0) {
if (Environment_GetStormState(play) != STORM_STATE_OFF) {
switch (this->state) {
case TEST4_STATE_0:
func_80A430C8(this, play);
+15 -15
View File
@@ -375,24 +375,24 @@ void EnTest6_Destroy(Actor* thisx, PlayState* play2) {
EnTest6* this = THIS;
s32 i;
play->envCtx.lightSettings.ambientColor[0] = 0;
play->envCtx.lightSettings.ambientColor[1] = 0;
play->envCtx.lightSettings.ambientColor[2] = 0;
play->envCtx.adjLightSettings.ambientColor[0] = 0;
play->envCtx.adjLightSettings.ambientColor[1] = 0;
play->envCtx.adjLightSettings.ambientColor[2] = 0;
play->envCtx.lightSettings.diffuseColor1[0] = 0;
play->envCtx.lightSettings.diffuseColor1[1] = 0;
play->envCtx.lightSettings.diffuseColor1[2] = 0;
play->envCtx.adjLightSettings.light1Color[0] = 0;
play->envCtx.adjLightSettings.light1Color[1] = 0;
play->envCtx.adjLightSettings.light1Color[2] = 0;
play->envCtx.lightSettings.diffuseColor2[0] = 0;
play->envCtx.lightSettings.diffuseColor2[1] = 0;
play->envCtx.lightSettings.diffuseColor2[2] = 0;
play->envCtx.adjLightSettings.light2Color[0] = 0;
play->envCtx.adjLightSettings.light2Color[1] = 0;
play->envCtx.adjLightSettings.light2Color[2] = 0;
play->envCtx.lightSettings.fogColor[0] = 0;
play->envCtx.lightSettings.fogColor[1] = 0;
play->envCtx.lightSettings.fogColor[2] = 0;
play->envCtx.adjLightSettings.fogColor[0] = 0;
play->envCtx.adjLightSettings.fogColor[1] = 0;
play->envCtx.adjLightSettings.fogColor[2] = 0;
play->envCtx.lightSettings.fogNear = 0;
play->envCtx.lightSettings.zFar = 0;
play->envCtx.adjLightSettings.fogNear = 0;
play->envCtx.adjLightSettings.zFar = 0;
play->envCtx.fillScreen = false;
@@ -425,7 +425,7 @@ void EnTest6_StartCutscene(EnTest6* this, PlayState* play) {
break;
default:
gSaveContext.save.daysElapsed = 0;
gSaveContext.save.eventDayCount = 0;
gSaveContext.save.day = 0;
gSaveContext.save.time = CLOCK_TIME(6, 0) - 1;
EnTest6_SetupAction(this, EnTest6_SharedSoTCutscene);
@@ -987,6 +987,7 @@ void EnTest7_Draw(Actor* thisx, PlayState* play) {
func_80AF14FC(play, this->unk_15C);
if (this->unk_144 & 4) {
func_800F9824(play, &play->envCtx, &play->view, play->state.gfxCtx, this->actor.world.pos, 70.0f, 5.0f, 0, 0);
Environment_DrawLensFlare(play, &play->envCtx, &play->view, play->state.gfxCtx, this->actor.world.pos, 70.0f,
5.0f, 0, 0);
}
}
+1 -1
View File
@@ -324,7 +324,7 @@ void func_80AECB6C(EnTk* this, PlayState* play) {
}
if (R_TIME_SPEED != 0.0f) {
this->skelAnime.playSpeed = (f32)func_800FE620(play) / R_TIME_SPEED;
this->skelAnime.playSpeed = (f32)Environment_GetTimeSpeed(play) / R_TIME_SPEED;
} else {
this->skelAnime.playSpeed = 0.0f;
}
@@ -77,7 +77,7 @@ void func_8089F014(EnViewer* this, PlayState* play, f32 arg2) {
arg2 = 0.0f;
}
play->envCtx.lightSettingOverride = 0;
play->envCtx.unk_E0 = 2;
play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_FULL_CONTROL;
play->envCtx.lightSetting = this->actor.world.rot.x;
play->envCtx.prevLightSetting = this->actor.world.rot.z;
play->envCtx.lightBlend = arg2;
@@ -87,11 +87,11 @@ void func_8089F0A0(EnViewer* this, PlayState* play) {
Player* player = GET_PLAYER(play);
D_8089F3E4++;
if ((D_8089F3E4 == D_8089F3E0) && (play->envCtx.lightSettingOverride != 255)) {
play->envCtx.lightSettingOverride = 255;
play->envCtx.unk_E0 = 0;
if ((D_8089F3E4 == D_8089F3E0) && (play->envCtx.lightSettingOverride != LIGHT_SETTING_OVERRIDE_NONE)) {
play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE;
play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_NONE;
play->envCtx.lightBlend = 1.0f;
func_800FAAB4(
Environment_ChangeLightSetting(
play, SurfaceType_GetLightSettingIndex(&play->colCtx, player->actor.floorPoly, player->actor.floorBgId));
play->envCtx.lightBlend = 1.0f;
play->envCtx.prevLightSetting = play->envCtx.lightSetting;
@@ -47,12 +47,6 @@ ActorInit En_Weather_Tag_InitVars = {
(ActorFunc)EnWeatherTag_Draw,
};
extern f32 D_801F4E74;
extern u8 D_801BDBB8;
extern u8 D_801BDBB4;
extern u8 D_801F4E30;
extern s16 D_801F4E7A;
void EnWeatherTag_SetupAction(EnWeatherTag* this, EnWeatherTagActionFunc func) {
this->actionFunc = func;
}
@@ -131,17 +125,17 @@ u8 func_80966608(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4,
if (WEATHER_TAG_RANGE100(&this->actor) > Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
if (play->envCtx.lightConfig == play->envCtx.changeLightNextConfig) {
D_801BDBB8 = 1;
if (!(play->envCtx.lightMode == 0) ||
gInterruptSongOfStorms = true;
if (!(play->envCtx.lightMode == LIGHT_MODE_TIME) ||
((play->envCtx.lightConfig != 1) && !play->envCtx.changeLightEnabled)) {
D_801BDBB8 = 0;
gInterruptSongOfStorms = false;
if (gWeatherMode != weatherMode) {
gWeatherMode = weatherMode;
play->envCtx.changeLightEnabled = true;
play->envCtx.lightConfig = lightConfig;
play->envCtx.changeLightNextConfig = changeLightNextConfig;
D_801BDBB4 = changeLightNextConfig;
gLightConfigAfterUnderwater = changeLightNextConfig;
play->envCtx.changeDuration = changeDuration;
play->envCtx.changeLightTimer = play->envCtx.changeDuration;
}
@@ -161,16 +155,16 @@ u8 func_80966758(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4,
if (WEATHER_TAG_RANGE100(&this->actor) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
if (play->envCtx.lightConfig == play->envCtx.changeLightNextConfig) {
D_801BDBB8 = 1;
if (!(play->envCtx.lightMode == 0) ||
gInterruptSongOfStorms = true;
if (!(play->envCtx.lightMode == LIGHT_MODE_TIME) ||
((play->envCtx.lightConfig != 1) && !play->envCtx.changeLightEnabled)) {
D_801BDBB8 = 0;
gWeatherMode = 0;
gInterruptSongOfStorms = false;
gWeatherMode = WEATHER_MODE_CLEAR;
play->envCtx.changeLightEnabled = true;
play->envCtx.lightConfig = lightConfig;
play->envCtx.changeLightNextConfig = changeLightNextConfig;
D_801BDBB4 = changeLightNextConfig;
gLightConfigAfterUnderwater = changeLightNextConfig;
play->envCtx.changeDuration = changeDuration;
play->envCtx.changeLightTimer = play->envCtx.changeDuration;
returnVal = 1;
@@ -201,11 +195,11 @@ void func_8096689C(EnWeatherTag* this, PlayState* play) {
play->envCtx.windSpeed = (this->actor.world.rot.z * partialResult) + 30.0f;
if (partialResult > 0.01f) {
play->envCtx.sandstormState = 8;
play->envCtx.sandstormState = SANDSTORM_8;
D_801F4E30 = 0x9B;
} else if (play->envCtx.sandstormState == 8) {
} else if (play->envCtx.sandstormState == SANDSTORM_8) {
D_801F4E30 = 0;
play->envCtx.sandstormState = 9;
play->envCtx.sandstormState = SANDSTORM_9;
}
}
@@ -243,7 +237,7 @@ void EnWeatherTag_Die(EnWeatherTag* this, PlayState* play) {
// poisoned swamp: placed behind the water fall from ikana
// this tag stops spawning after STT cleared?
void func_80966B08(EnWeatherTag* this, PlayState* play) {
if (func_80966608(this, play, 0, 0, play->envCtx.lightConfig, 5, 100, 2) || (gWeatherMode == 2)) {
if (func_80966608(this, play, 0, 0, play->envCtx.lightConfig, 5, 100, 2) || (gWeatherMode == WEATHER_MODE_2)) {
play->skyboxId = SKYBOX_3;
EnWeatherTag_SetupAction(this, func_80966D20);
} else if (D_801F4E74 <= 0.01f) {
@@ -315,7 +309,7 @@ void func_80966D20(EnWeatherTag* this, PlayState* play) {
EnWeatherTag_SetupAction(this, func_80966B08);
}
if (gWeatherMode != 2) {
if (gWeatherMode != WEATHER_MODE_2) {
EnWeatherTag_SetupAction(this, func_80966B08);
}
}
@@ -325,7 +319,7 @@ void func_80966D20(EnWeatherTag* this, PlayState* play) {
// path to goron village winter, winter mountain village
void func_80966E0C(EnWeatherTag* this, PlayState* play) {
if (func_80966608(this, play, 0, 1, 0, 2, 60, 3)) {
play->envCtx.unk_F2[3] = 0x80;
play->envCtx.precipitation[PRECIP_SNOW_MAX] = 128;
EnWeatherTag_SetupAction(this, func_80966E84);
}
}
@@ -333,7 +327,7 @@ void func_80966E0C(EnWeatherTag* this, PlayState* play) {
// WEATHERTAG_TYPE_WINTERFOG 2
void func_80966E84(EnWeatherTag* this, PlayState* play) {
if (func_80966758(this, play, 1, 0, 2, 0, 60)) {
play->envCtx.unk_F2[3] = 0;
play->envCtx.precipitation[PRECIP_SNOW_MAX] = 0;
EnWeatherTag_SetupAction(this, func_80966E0C);
}
}
@@ -343,8 +337,8 @@ void func_80966E84(EnWeatherTag* this, PlayState* play) {
// wait if you enter the scene through a room instead of fog you get a flash rain shower
void func_80966EF0(EnWeatherTag* this, PlayState* play) {
if (func_80966608(this, play, 0, 1, 0, 2, 100, 4)) {
func_800FD78C(play);
play->envCtx.unk_F2[0] = 60;
Environment_PlayStormNatureAmbience(play);
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 60;
EnWeatherTag_SetupAction(this, func_80966F74);
}
}
@@ -352,8 +346,8 @@ void func_80966EF0(EnWeatherTag* this, PlayState* play) {
// WEATHERTAG_TYPE_UNK3 2
void func_80966F74(EnWeatherTag* this, PlayState* play) {
if (func_80966758(this, play, 1, 0, 2, 0, 100)) {
func_800FD858(play);
play->envCtx.unk_F2[0] = 0;
Environment_StopStormNatureAmbience(play);
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 0;
EnWeatherTag_SetupAction(this, func_80966EF0);
}
}
@@ -365,7 +359,7 @@ void func_80966FEC(EnWeatherTag* this, PlayState* play) {
// weirdly, not the same as the other param lookup used in the rest of the file, which is float
s32 distance = WEATHER_TAG_RANGE100INT(&this->actor);
if (distance > 0) {
D_801F4E7A = distance;
gSkyboxNumStars = distance;
}
if ((play->sceneId == SCENE_KAIZOKU) && (play->actorCtx.flags & ACTORCTX_FLAG_1)) {
@@ -410,9 +404,9 @@ void EnWeatherTag_DoNothing(EnWeatherTag* this, PlayState* play) {
// these two are isolated, they call themselves but nothing calls them?
void EnWeatherTag_Unused_809671B8(EnWeatherTag* this, PlayState* play) {
if (func_80966608(this, play, 0, 1, 0, 4, 100, 5)) {
func_800FD78C(play);
play->envCtx.unk_E3 = 1;
play->envCtx.unk_F2[0] = 60;
Environment_PlayStormNatureAmbience(play);
play->envCtx.lightningState = LIGHTNING_ON;
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 60;
EnWeatherTag_SetupAction(this, EnWeatherTag_Unused_80967250);
}
}
@@ -420,9 +414,9 @@ void EnWeatherTag_Unused_809671B8(EnWeatherTag* this, PlayState* play) {
// these two are isolated, they call themselves but nothing calls them
void EnWeatherTag_Unused_80967250(EnWeatherTag* this, PlayState* play) {
if (func_80966758(this, play, 1, 0, 4, 0, 100)) {
func_800FD858(play);
play->envCtx.unk_E3 = 2;
play->envCtx.unk_F2[0] = 0;
Environment_StopStormNatureAmbience(play);
play->envCtx.lightningState = LIGHTNING_LAST;
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 0;
EnWeatherTag_SetupAction(this, EnWeatherTag_Unused_809671B8);
}
}
@@ -442,20 +436,20 @@ void func_809672DC(EnWeatherTag* this, PlayState* play) {
range = WEATHER_TAG_RANGE100(&this->actor);
if (distance < range) {
play->envCtx.sandstormState = 6;
play->envCtx.sandstormState = SANDSTORM_6;
strength = 1.0f - (distance / range);
if (0.8f < strength) {
strength = 1.0f;
}
D_801F4E30 = (200.0f * strength);
} else {
if (play->envCtx.sandstormState == 6) {
if (play->envCtx.sandstormState == SANDSTORM_6) {
D_801F4E30 = 0;
play->envCtx.sandstormState = 7;
play->envCtx.sandstormState = SANDSTORM_7;
}
}
Math_SmoothStepToS(&play->envCtx.lightSettings.fogNear, (s16)(-40.0f * strength), 1, 1, 1);
Math_SmoothStepToS(&play->envCtx.adjLightSettings.fogNear, -40.0f * strength, 1, 1, 1);
}
// WEATHERTAG_TYPE_LOCALDAY2RAIN: rain proximity as approaching rainy scene
@@ -466,19 +460,19 @@ void func_809674C8(EnWeatherTag* this, PlayState* play) {
if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(&this->actor)) {
if (CURRENT_DAY == 2) {
if ((gSaveContext.save.time >= CLOCK_TIME(7, 0)) && (gSaveContext.save.time < CLOCK_TIME(17, 30)) &&
(play->envCtx.unk_F2[2] == 0)) {
(play->envCtx.precipitation[PRECIP_SNOW_CUR] == 0)) {
gWeatherMode = 1;
func_800FD78C(play);
play->envCtx.unk_F2[4] = 0x20;
gWeatherMode = WEATHER_MODE_1;
Environment_PlayStormNatureAmbience(play);
play->envCtx.precipitation[PRECIP_SOS_MAX] = 32;
EnWeatherTag_SetupAction(this, func_80967608);
}
}
} else {
if ((play->envCtx.unk_F2[4] != 0) && !(play->state.frames & 3)) {
play->envCtx.unk_F2[4]--;
if ((play->envCtx.unk_F2[4]) == 8) {
func_800FD858(play);
if ((play->envCtx.precipitation[PRECIP_SOS_MAX] != 0) && !(play->state.frames & 3)) {
play->envCtx.precipitation[PRECIP_SOS_MAX]--;
if ((play->envCtx.precipitation[PRECIP_SOS_MAX]) == 8) {
Environment_StopStormNatureAmbience(play);
}
}
}
@@ -488,7 +482,7 @@ void func_809674C8(EnWeatherTag* this, PlayState* play) {
void func_80967608(EnWeatherTag* this, PlayState* play) {
if ((WEATHER_TAG_RANGE100(&this->actor) + 10.0f) <
Actor_WorldDistXZToActor(&GET_PLAYER(play)->actor, &this->actor)) {
gWeatherMode = 0;
gWeatherMode = WEATHER_MODE_CLEAR;
EnWeatherTag_SetupAction(this, func_809674C8);
}
}
@@ -119,19 +119,19 @@ void EnWizFire_Destroy(Actor* thisx, PlayState* play) {
EnWizFire* this = THIS;
if (this->type == EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE) {
play->envCtx.lightSettings.fogColor[2] = 0;
play->envCtx.lightSettings.fogColor[1] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.fogColor[0] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.diffuseColor2[2] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.diffuseColor2[1] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.diffuseColor2[0] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.diffuseColor1[2] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.diffuseColor1[1] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.diffuseColor1[0] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.ambientColor[2] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.ambientColor[1] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.ambientColor[0] = play->envCtx.lightSettings.fogColor[2];
play->envCtx.lightSettings.fogNear = play->envCtx.lightSettings.fogColor[2];
play->envCtx.adjLightSettings.fogColor[2] = 0;
play->envCtx.adjLightSettings.fogColor[1] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.fogColor[0] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.light2Color[2] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.light2Color[1] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.light2Color[0] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.light1Color[2] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.light1Color[1] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.light1Color[0] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.ambientColor[2] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.ambientColor[1] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.ambientColor[0] = play->envCtx.adjLightSettings.fogColor[2];
play->envCtx.adjLightSettings.fogNear = play->envCtx.adjLightSettings.fogColor[2];
}
Collider_DestroyCylinder(play, &this->collider);
@@ -518,38 +518,39 @@ void EnWizFire_Update(Actor* thisx, PlayState* play2) {
fogNear = 968.0f;
}
play->envCtx.lightSettings.fogNear = (fogNear - (s16)play->envCtx.unk_C4.fogNear) * this->blendScaleFrac;
play->envCtx.adjLightSettings.fogNear =
(fogNear - (s16)play->envCtx.lightSettings.fogNear) * this->blendScaleFrac;
play->envCtx.lightSettings.ambientColor[0] =
((f32)lightSettingsColors[index].r - play->envCtx.unk_C4.ambientColor[0]) * this->blendScaleFrac;
play->envCtx.lightSettings.ambientColor[1] =
((f32)lightSettingsColors[index].g - play->envCtx.unk_C4.ambientColor[1]) * this->blendScaleFrac;
play->envCtx.lightSettings.ambientColor[2] =
((f32)lightSettingsColors[index].b - play->envCtx.unk_C4.ambientColor[2]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.ambientColor[0] =
((f32)lightSettingsColors[index].r - play->envCtx.lightSettings.ambientColor[0]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.ambientColor[1] =
((f32)lightSettingsColors[index].g - play->envCtx.lightSettings.ambientColor[1]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.ambientColor[2] =
((f32)lightSettingsColors[index].b - play->envCtx.lightSettings.ambientColor[2]) * this->blendScaleFrac;
index++;
play->envCtx.lightSettings.diffuseColor1[0] =
((f32)lightSettingsColors[index].r - play->envCtx.unk_C4.diffuseColor1[0]) * this->blendScaleFrac;
play->envCtx.lightSettings.diffuseColor1[1] =
((f32)lightSettingsColors[index].g - play->envCtx.unk_C4.diffuseColor1[1]) * this->blendScaleFrac;
play->envCtx.lightSettings.diffuseColor1[2] =
((f32)lightSettingsColors[index].b - play->envCtx.unk_C4.diffuseColor1[2]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.light1Color[0] =
((f32)lightSettingsColors[index].r - play->envCtx.lightSettings.light1Color[0]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.light1Color[1] =
((f32)lightSettingsColors[index].g - play->envCtx.lightSettings.light1Color[1]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.light1Color[2] =
((f32)lightSettingsColors[index].b - play->envCtx.lightSettings.light1Color[2]) * this->blendScaleFrac;
index++;
play->envCtx.lightSettings.diffuseColor2[0] =
((f32)lightSettingsColors[index].r - play->envCtx.unk_C4.diffuseColor[0]) * this->blendScaleFrac;
play->envCtx.lightSettings.diffuseColor2[1] =
((f32)lightSettingsColors[index].g - play->envCtx.unk_C4.diffuseColor[1]) * this->blendScaleFrac;
play->envCtx.lightSettings.diffuseColor2[2] =
((f32)lightSettingsColors[index].b - play->envCtx.unk_C4.diffuseColor[2]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.light2Color[0] =
((f32)lightSettingsColors[index].r - play->envCtx.lightSettings.light2Color[0]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.light2Color[1] =
((f32)lightSettingsColors[index].g - play->envCtx.lightSettings.light2Color[1]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.light2Color[2] =
((f32)lightSettingsColors[index].b - play->envCtx.lightSettings.light2Color[2]) * this->blendScaleFrac;
index++;
play->envCtx.lightSettings.fogColor[0] =
((f32)lightSettingsColors[index].r - play->envCtx.unk_C4.fogColor[0]) * this->blendScaleFrac;
play->envCtx.lightSettings.fogColor[1] =
((f32)lightSettingsColors[index].g - play->envCtx.unk_C4.fogColor[1]) * this->blendScaleFrac;
play->envCtx.lightSettings.fogColor[2] =
((f32)lightSettingsColors[index].b - play->envCtx.unk_C4.fogColor[2]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.fogColor[0] =
((f32)lightSettingsColors[index].r - play->envCtx.lightSettings.fogColor[0]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.fogColor[1] =
((f32)lightSettingsColors[index].g - play->envCtx.lightSettings.fogColor[1]) * this->blendScaleFrac;
play->envCtx.adjLightSettings.fogColor[2] =
((f32)lightSettingsColors[index].b - play->envCtx.lightSettings.fogColor[2]) * this->blendScaleFrac;
}
}
@@ -328,7 +328,7 @@ void ObjEtcetera_Update(Actor* thisx, PlayState* play) {
if (floorBgId == BGCHECK_SCENE) {
floorPoly = this->dyna.actor.floorPoly;
if ((floorPoly != NULL) && (this->burrowFlag & 1)) {
func_800FAAB4(play, SurfaceType_GetLightSettingIndex(&play->colCtx, floorPoly, floorBgId));
Environment_ChangeLightSetting(play, SurfaceType_GetLightSettingIndex(&play->colCtx, floorPoly, floorBgId));
}
}
@@ -55,11 +55,11 @@ void func_808DBEB0(ObjectKankyo* this, PlayState* play) {
D_808DE5B0 = 0.0f;
this->unk_144 = Rand_ZeroOne() * 360.0f;
this->unk_148 = Rand_ZeroOne() * 360.0f;
if (play->envCtx.unk_F2[2] == 128) {
if (play->envCtx.precipitation[PRECIP_SNOW_CUR] == 128) {
D_808DE5B0 = 1.0f;
this->unk_114E = 1;
for (i = 0; i < play->envCtx.unk_F2[2]; i++) {
for (i = 0; i < play->envCtx.precipitation[PRECIP_SNOW_CUR]; i++) {
this->unk_14C[i].unk_10 = Rand_ZeroOne() * -200.0f;
}
} else {
@@ -107,7 +107,7 @@ void ObjectKankyo_Init(Actor* thisx, PlayState* play) {
break;
case 2:
play->envCtx.unk_F2[2] = 0x80;
play->envCtx.precipitation[PRECIP_SNOW_CUR] = 128;
func_808DBFB0(this, play);
break;
@@ -180,16 +180,16 @@ void func_808DC18C(ObjectKankyo* this, PlayState* play) {
magnitude = play->envCtx.windSpeed / 60.0f;
magnitude = CLAMP(magnitude, 0.0f, 1.0f);
sp30.x = play->envCtx.windDir.x * magnitude;
sp30.y = play->envCtx.windDir.y + 100.0f;
sp30.z = play->envCtx.windDir.z * magnitude;
sp30.x = play->envCtx.windDirection.x * magnitude;
sp30.y = play->envCtx.windDirection.y + 100.0f;
sp30.z = play->envCtx.windDirection.z * magnitude;
this->unk_14C[2].unk_00 = 0x4000 - Math_Vec3f_Pitch(&gZeroVec3f, &sp30);
this->unk_14C[2].unk_04 = Math_Vec3f_Yaw(&gZeroVec3f, &sp30) + 0x8000;
}
void func_808DC454(ObjectKankyo* this, PlayState* play) {
s16 i;
u32 tempI;
s32 pad1;
f32 phi_f20;
f32 spD0;
f32 spCC;
@@ -214,7 +214,7 @@ void func_808DC454(ObjectKankyo* this, PlayState* play) {
spCC = y / magnitude;
spC8 = z / magnitude;
for (i = 0; i < play->envCtx.unk_F2[2]; i++) {
for (i = 0; i < play->envCtx.precipitation[PRECIP_SNOW_CUR]; i++) {
switch (this->unk_14C[i].unk_1C) {
case 0:
this->unk_14C[i].unk_00 = play->view.eye.x + (spD0 * 120.0f);
@@ -231,14 +231,13 @@ void func_808DC454(ObjectKankyo* this, PlayState* play) {
this->unk_14C[i].unk_10 = temp_f22;
} else {
this->unk_14C[i].unk_10 += temp_f22;
tempI = i;
if (play->envCtx.unk_F2[2] == (tempI + 1)) {
if (play->envCtx.precipitation[PRECIP_SNOW_CUR] == ((u32)i + 1)) {
this->unk_114E = 0;
}
}
this->unk_14C[i].unk_14 = (Rand_ZeroOne() - 0.5f) * (2.0f * temp_120);
if (play->envCtx.unk_F2[4] == 0) {
if (play->envCtx.precipitation[PRECIP_SOS_MAX] == 0) {
this->unk_14C[i].unk_18 = (Rand_ZeroOne() * 3.0f) + 1.0f;
} else {
this->unk_14C[i].unk_18 = (Rand_ZeroOne() * 3.0f) + 8.0f;
@@ -251,14 +250,14 @@ void func_808DC454(ObjectKankyo* this, PlayState* play) {
temp_f28 = play->view.eye.y + (spCC * 120.0f);
temp_f30 = play->view.eye.z + (spC8 * 120.0f);
magnitude =
sqrtf((f32)SQ(play->envCtx.windDir.x) + SQ(play->envCtx.windDir.y) + SQ(play->envCtx.windDir.z));
magnitude = sqrtf((f32)SQ(play->envCtx.windDirection.x) + SQ(play->envCtx.windDirection.y) +
SQ(play->envCtx.windDirection.z));
if (magnitude == 0.0f) {
magnitude = 0.001f;
}
spC4 = -play->envCtx.windDir.x / magnitude;
spC0 = -play->envCtx.windDir.y / magnitude;
spBC = -play->envCtx.windDir.z / magnitude;
spC4 = -play->envCtx.windDirection.x / magnitude;
spC0 = -play->envCtx.windDirection.y / magnitude;
spBC = -play->envCtx.windDirection.z / magnitude;
if (i == 0) {
this->unk_144 += 0.049999997f * Rand_ZeroOne();
@@ -318,13 +317,13 @@ void func_808DC454(ObjectKankyo* this, PlayState* play) {
}
void func_808DCB7C(ObjectKankyo* this, PlayState* play) {
if (play->envCtx.unk_F2[2] < play->envCtx.unk_F2[3]) {
if (play->envCtx.precipitation[PRECIP_SNOW_CUR] < play->envCtx.precipitation[PRECIP_SNOW_MAX]) {
if ((play->state.frames % 16) == 0) {
play->envCtx.unk_F2[2] += 2;
play->envCtx.precipitation[PRECIP_SNOW_CUR] += 2;
}
} else if (play->envCtx.unk_F2[3] < play->envCtx.unk_F2[2]) {
} else if (play->envCtx.precipitation[PRECIP_SNOW_MAX] < play->envCtx.precipitation[PRECIP_SNOW_CUR]) {
if ((play->state.frames % 16) == 0) {
play->envCtx.unk_F2[2] -= 2;
play->envCtx.precipitation[PRECIP_SNOW_CUR] -= 2;
}
}
func_808DC454(this, play);
@@ -333,24 +332,24 @@ void func_808DCB7C(ObjectKankyo* this, PlayState* play) {
void func_808DCBF8(ObjectKankyo* this, PlayState* play) {
f32 temp_f0;
if ((play->envCtx.unk_F2[2] > 0) && (this->unk_114C == 0)) {
if ((play->envCtx.precipitation[PRECIP_SNOW_CUR] > 0) && (this->unk_114C == 0)) {
if ((play->state.frames % 16) == 0) {
play->envCtx.unk_F2[2] -= 9;
if ((s8)play->envCtx.unk_F2[2] < 0) {
play->envCtx.unk_F2[2] = 0;
play->envCtx.precipitation[PRECIP_SNOW_CUR] -= 9;
if ((s8)play->envCtx.precipitation[PRECIP_SNOW_CUR] < 0) {
play->envCtx.precipitation[PRECIP_SNOW_CUR] = 0;
}
}
}
temp_f0 = (f32)play->envCtx.unk_F2[2] / 128;
temp_f0 = (f32)play->envCtx.precipitation[PRECIP_SNOW_CUR] / 128;
temp_f0 = CLAMP(temp_f0, 0.0f, 1.0f);
if (temp_f0 > 0.01f) {
D_801F4E30 = 155.0f * temp_f0;
play->envCtx.sandstormState = 10;
play->envCtx.sandstormState = SANDSTORM_A;
} else {
D_801F4E30 = 0;
play->envCtx.sandstormState = 10;
play->envCtx.sandstormState = SANDSTORM_A;
}
func_808DC454(this, play);
}
@@ -413,14 +412,14 @@ void func_808DCDB4(ObjectKankyo* this, PlayState* play) {
temp_f28 = play->view.eye.y + (spA8 * 120.0f);
temp_f18 = play->view.eye.z + (spA4 * 120.0f);
magnitude =
sqrtf((f32)SQ(play->envCtx.windDir.x) + SQ(play->envCtx.windDir.y) + SQ(play->envCtx.windDir.z));
magnitude = sqrtf((f32)SQ(play->envCtx.windDirection.x) + SQ(play->envCtx.windDirection.y) +
SQ(play->envCtx.windDirection.z));
if (magnitude == 0.0f) {
magnitude = 0.001f;
}
spA0 = -play->envCtx.windDir.x / magnitude;
sp9C = -play->envCtx.windDir.z / magnitude;
spA0 = -play->envCtx.windDirection.x / magnitude;
sp9C = -play->envCtx.windDirection.z / magnitude;
if (i == 0) {
this->unk_144 += 0.049999997f * Rand_ZeroOne();
@@ -512,7 +511,7 @@ void func_808DD3C8(Actor* thisx, PlayState* play2) {
f32 temp_f2;
f32 tempf;
if ((play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_UNDERWATER) || ((u8)play->envCtx.unk_E2 == 0)) {
if ((play->cameraPtrs[CAM_ID_MAIN]->stateFlags & CAM_STATE_UNDERWATER) || ((u8)play->envCtx.stormState == 0)) {
return;
}
@@ -525,14 +524,14 @@ void func_808DD3C8(Actor* thisx, PlayState* play2) {
temp_f0 = CLAMP(temp_f0, 0.0f, 1.0f);
Math_SmoothStepToF(&D_808DE5B0, temp_f0, 0.2f, 0.1f, 0.001f);
sp68 = play->envCtx.unk_F2[2];
sp68 = play->envCtx.precipitation[PRECIP_SNOW_CUR];
sp68 *= D_808DE5B0;
if ((play->envCtx.unk_F2[2] >= 32) && (sp68 < 32)) {
if ((play->envCtx.precipitation[PRECIP_SNOW_CUR] >= 32) && (sp68 < 32)) {
sp68 = 32;
}
} else {
sp68 = play->envCtx.unk_F2[2];
sp68 = play->envCtx.precipitation[PRECIP_SNOW_CUR];
}
for (i = 0; i < sp68; i++) {
@@ -654,7 +653,7 @@ void func_808DDE9C(Actor* thisx, PlayState* play2) {
Player* player = GET_PLAYER(play);
s32 i;
u8 phi_s5;
u16 end = play->envCtx.unk_F2[1];
u16 end = play->envCtx.precipitation[PRECIP_RAIN_CUR];
f32 temp_f12;
f32 temp_f20;
f32 temp_f22;
@@ -144,7 +144,7 @@ void OceffSpot_Update(Actor* thisx, PlayState* play) {
temp = (2.0f - this->unk16C) * this->unk16C;
func_800FD2B4(play, temp * 0.5f, 880.0f, 0.2f, 0.9f);
Environment_AdjustLights(play, temp * 0.5f, 880.0f, 0.2f, 0.9f);
Lights_PointNoGlowSetInfo(&this->lightInfo1, this->actor.world.pos.x, this->actor.world.pos.y + 55.0f,
this->actor.world.pos.z, (s32)(255.0f * temp), (s32)(255.0f * temp), (s32)(200.0f * temp),
+24 -23
View File
@@ -522,7 +522,7 @@ FloorEffect sPlayerFloorEffect;
Input* sPlayerControlInput;
s32 sPlayerUseHeldItem; // When true, the current held item is used. Is reset to false every frame.
s32 sPlayerHeldItemButtonIsHeldDown; // Indicates if the button for the current held item is held down.
EnvLightSettings D_80862B50; // backup of play->envCtx.lightSettings
AdjLightSettings D_80862B50; // backup of lay->envCtx.adjLightSettings
s32 D_80862B6C; // this->skelAnime.moveFlags // sPlayerSkelMoveFlags?
s32 func_8082DA90(PlayState* play) {
@@ -6284,7 +6284,7 @@ s32 func_80835DF8(PlayState* play, Player* this, CollisionPoly** outPoly, s32* o
f32 yIntersect = func_80835CD8(play, this, &D_8085D100, &pos, outPoly, outBgId);
if ((*outBgId == BGCHECK_SCENE) && (fabsf(this->actor.world.pos.y - yIntersect) < 10.0f)) {
func_800FAAB4(play, SurfaceType_GetLightSettingIndex(&play->colCtx, *outPoly, *outBgId));
Environment_ChangeLightSetting(play, SurfaceType_GetLightSettingIndex(&play->colCtx, *outPoly, *outBgId));
return true;
}
return false;
@@ -7323,7 +7323,7 @@ void func_808388B8(PlayState* play, Player* this, PlayerTransformation playerFor
gSaveContext.save.playerForm = playerForm;
this->stateFlags1 |= PLAYER_STATE1_2;
D_80862B50 = play->envCtx.lightSettings;
D_80862B50 = play->envCtx.adjLightSettings;
this->actor.velocity.y = 0.0f;
Actor_DeactivateLens(play);
}
@@ -11243,7 +11243,8 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) {
func_801A3CF4(SurfaceType_GetEcho(&play->colCtx, floorPoly, this->actor.floorBgId));
if (this->actor.floorBgId == BGCHECK_SCENE) {
func_800FAAB4(play, SurfaceType_GetLightSettingIndex(&play->colCtx, floorPoly, this->actor.floorBgId));
Environment_ChangeLightSetting(
play, SurfaceType_GetLightSettingIndex(&play->colCtx, floorPoly, this->actor.floorBgId));
} else {
DynaPoly_SetPlayerAbove(&play->colCtx, this->actor.floorBgId);
}
@@ -11838,9 +11839,9 @@ void func_80844784(PlayState* play, Player* this) {
}
if (play->envCtx.windSpeed >= 50.0f) {
temp_fa0 = play->envCtx.windDir.x;
temp_fa1 = play->envCtx.windDir.y;
temp_ft4 = play->envCtx.windDir.z;
temp_fa0 = play->envCtx.windDirection.x;
temp_fa1 = play->envCtx.windDirection.y;
temp_ft4 = play->envCtx.windDirection.z;
temp_fv0_2 = sqrtf(SQ(temp_fa0) + SQ(temp_fa1) + SQ(temp_ft4));
if (temp_fv0_2 != 0.0f) {
@@ -12617,7 +12618,7 @@ void Player_Draw(Actor* thisx, PlayState* play) {
CLAMP_MIN(spB8, spB4) * this->actor.scale.z * 1.15f, MTXMODE_APPLY);
Matrix_RotateXS(this->actor.shape.rot.x, MTXMODE_APPLY);
Scene_SetRenderModeXlu(play, 0, 1);
Lib_LerpRGB(&D_8085D580, &D_8085D584, this->unk_B10[0], &spBC);
Color_RGB8_Lerp(&D_8085D580, &D_8085D584, this->unk_B10[0], &spBC);
gDPSetEnvColor(POLY_OPA_DISP++, spBC.r, spBC.g, spBC.b, 255);
@@ -17838,14 +17839,14 @@ void func_80854EFC(PlayState* play, f32 arg1, struct_8085D848_unk_00* arg2) {
u8* new_var;
s32 pad[4];
new_var = play->envCtx.unk_C4.diffuseColor1;
sp70.fogNear = play->envCtx.unk_C4.fogNear;
sp70.fogColor[0] = play->envCtx.unk_C4.fogColor[0];
sp70.fogColor[1] = play->envCtx.unk_C4.fogColor[1];
sp70.fogColor[2] = play->envCtx.unk_C4.fogColor[2];
sp70.ambientColor[0] = play->envCtx.unk_C4.ambientColor[0];
sp70.ambientColor[1] = play->envCtx.unk_C4.ambientColor[1];
sp70.ambientColor[2] = play->envCtx.unk_C4.ambientColor[2];
new_var = play->envCtx.lightSettings.light1Color;
sp70.fogNear = play->envCtx.lightSettings.fogNear;
sp70.fogColor[0] = play->envCtx.lightSettings.fogColor[0];
sp70.fogColor[1] = play->envCtx.lightSettings.fogColor[1];
sp70.fogColor[2] = play->envCtx.lightSettings.fogColor[2];
sp70.ambientColor[0] = play->envCtx.lightSettings.ambientColor[0];
sp70.ambientColor[1] = play->envCtx.lightSettings.ambientColor[1];
sp70.ambientColor[2] = play->envCtx.lightSettings.ambientColor[2];
if (arg1 <= 1.0f) {
arg1 -= 0.0f;
@@ -17876,13 +17877,13 @@ void func_80854EFC(PlayState* play, f32 arg1, struct_8085D848_unk_00* arg2) {
var_t4 = D_8085D844;
}
play->envCtx.lightSettings.fogNear =
((s16)((var_v1->fogNear - var_t0->fogNear) * arg1) + var_t0->fogNear) - play->envCtx.unk_C4.fogNear;
play->envCtx.adjLightSettings.fogNear =
((s16)((var_v1->fogNear - var_t0->fogNear) * arg1) + var_t0->fogNear) - play->envCtx.lightSettings.fogNear;
func_80854CD0(arg1, play->envCtx.lightSettings.fogColor, var_v1->fogColor, var_t0->fogColor,
play->envCtx.unk_C4.fogColor, play->envCtx.lightSettings.ambientColor, var_v1->ambientColor,
var_t0->ambientColor, play->envCtx.unk_C4.ambientColor, play->envCtx.lightSettings.diffuseColor1,
var_t3, var_t4, new_var);
func_80854CD0(arg1, play->envCtx.adjLightSettings.fogColor, var_v1->fogColor, var_t0->fogColor,
play->envCtx.lightSettings.fogColor, play->envCtx.adjLightSettings.ambientColor, var_v1->ambientColor,
var_t0->ambientColor, play->envCtx.lightSettings.ambientColor,
play->envCtx.adjLightSettings.light1Color, var_t3, var_t4, new_var);
}
struct_8085D848 D_8085D848[] = {
@@ -18107,7 +18108,7 @@ void Player_Action_87(Player* this, PlayState* play) {
this->prevMask = this->currentMask;
this->csId = play->playerCsIds[PLAYER_CS_ID_MASK_TRANSFORMATION];
Player_StopCutscene(this);
play->envCtx.lightSettings = D_80862B50;
play->envCtx.adjLightSettings = D_80862B50;
func_8085B384(this, play);
return;
}
@@ -26,7 +26,7 @@ u32 EffectSsLightning_Init(PlayState* play, u32 index, EffectSs* this, void* ini
void EffectSsLightning_Update(PlayState* play, u32 index, EffectSs* this);
void EffectSsLightning_Draw(PlayState* play, u32 index, EffectSs* this);
TexturePtr sLightningTextures[] = {
static TexturePtr sLightningTextures[] = {
gEffLightning1Tex, gEffLightning2Tex, gEffLightning3Tex, gEffLightning4Tex,
gEffLightning5Tex, gEffLightning6Tex, gEffLightning7Tex, gEffLightning8Tex,
};
@@ -84,7 +84,7 @@ void DayTelop_Update(DayTelopState* this, GameState* thisx) {
SET_NEXT_GAMESTATE(&this->state, Play_Init, sizeof(PlayState));
gSaveContext.save.time = CLOCK_TIME(6, 0);
D_801BDBC8 = 0xFE;
gSceneSeqState = SCENESEQ_MORNING;
} else if (this->transitionCountdown == 90) {
this->fadeInState = DAYTELOP_HOURSTEXT_FADEIN;
this->alpha = 0;
@@ -2197,7 +2197,7 @@ void FileSelect_LoadGame(GameState* thisx) {
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
gSaveContext.cutsceneTrigger = 0;
gSaveContext.chamberCutsceneNum = 0;
gSaveContext.nextDayTime = 0xFFFF;
gSaveContext.nextDayTime = NEXT_TIME_NONE;
gSaveContext.retainWeatherMode = false;
gSaveContext.buttonStatus[EQUIP_SLOT_B] = BTN_ENABLED;
@@ -2489,7 +2489,7 @@ void FileSelect_InitContext(GameState* thisx) {
Skybox_Init(&this->state, &this->skyboxCtx, 1);
R_TIME_SPEED = 10;
envCtx->changeSkyboxState = 0;
envCtx->changeSkyboxState = CHANGE_SKYBOX_INACTIVE;
envCtx->changeSkyboxTimer = 0;
envCtx->changeLightEnabled = false;
envCtx->changeLightTimer = 0;
@@ -51,7 +51,7 @@ void MapSelect_LoadGame(MapSelectState* this, u32 entrance, s32 spawn) {
gSaveContext.respawn[RESPAWN_MODE_ZORA].entrance = 0xFF;
gSaveContext.respawn[RESPAWN_MODE_DEKU].entrance = 0xFF;
gSaveContext.respawn[RESPAWN_MODE_HUMAN].entrance = 0xFF;
gWeatherMode = 0;
gWeatherMode = WEATHER_MODE_CLEAR;
STOP_GAMESTATE(&this->state);
SET_NEXT_GAMESTATE(&this->state, Play_Init, sizeof(PlayState));