mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-20 05:36:55 -04:00
Fog
This commit is contained in:
+1
-1
@@ -2686,7 +2686,7 @@ void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors) {
|
||||
|
||||
// spAC = phi_s1;
|
||||
Actor_DrawLensOverlay(&spAC, play->actorCtx.lensMaskSize);
|
||||
phi_s1_2 = func_801660B8(play, spAC);
|
||||
phi_s1_2 = Play_SetFog(play, spAC);
|
||||
|
||||
for (spB4 = 0; spB4 < numActors; spB4++, actors++) {
|
||||
Actor_Draw(play, *actors);
|
||||
|
||||
+1
-1
@@ -837,7 +837,7 @@ void GetItem_DrawRemains(PlayState* play, s16 drawId) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDrawItemTable[drawId].drawResources[0]);
|
||||
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void func_800AE5A0(PlayState* play) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
@@ -105,7 +105,7 @@ void func_800AE8EC(PlayState* play) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
POLY_XLU_DISP = func_801660B8(play, POLY_XLU_DISP);
|
||||
POLY_XLU_DISP = Play_SetFog(play, POLY_XLU_DISP);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -819,7 +819,7 @@ void EnItem00_DrawSprite(EnItem00* this, PlayState* play) {
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
if (this->actor.params == ITEM00_NUTS_10) {
|
||||
texIndex = 6;
|
||||
|
||||
+7
-7
@@ -251,7 +251,7 @@ void Lights_FreeNode(LightNode* light) {
|
||||
void LightContext_Init(PlayState* play, LightContext* lightCtx) {
|
||||
LightContext_InitList(play, lightCtx);
|
||||
LightContext_SetAmbientColor(lightCtx, 80, 80, 80);
|
||||
func_80102544(lightCtx, 0, 0, 0, 0x3E4, 0x3200);
|
||||
LightContext_SetFogProperties(lightCtx, 0, 0, 0, 0x3E4, 0x3200);
|
||||
bzero(&sLightsBuffer, sizeof(LightsBuffer));
|
||||
}
|
||||
|
||||
@@ -261,12 +261,12 @@ void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b) {
|
||||
lightCtx->ambient.b = b;
|
||||
}
|
||||
|
||||
void func_80102544(LightContext* lightCtx, u8 a1, u8 a2, u8 a3, s16 numLights, s16 sp16) {
|
||||
lightCtx->unk7 = a1;
|
||||
lightCtx->unk8 = a2;
|
||||
lightCtx->unk9 = a3;
|
||||
lightCtx->unkA = numLights;
|
||||
lightCtx->unkC = sp16;
|
||||
void LightContext_SetFogProperties(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->fogNear = near;
|
||||
lightCtx->fogFar = far;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+9
-8
@@ -387,11 +387,11 @@ void Play_ClearTransition(PlayState* this) {
|
||||
this->transitionCtx.transitionType = -1;
|
||||
}
|
||||
|
||||
Gfx* func_801660B8(PlayState* this, Gfx* gfx) {
|
||||
s32 phi_v1 = this->lightCtx.unkC * (5.0f / 64.0f);
|
||||
Gfx* Play_SetFog(PlayState* this, Gfx* gfx) {
|
||||
s32 fogFar = this->lightCtx.fogFar * (5.0f / 64.0f);
|
||||
|
||||
return Gfx_SetFogWithSync(gfx, this->lightCtx.unk7, this->lightCtx.unk8, this->lightCtx.unk9, 0,
|
||||
this->lightCtx.unkA, (phi_v1 <= 1000) ? 1000 : phi_v1);
|
||||
return Gfx_SetFogWithSync(gfx, this->lightCtx.fogColor.r, this->lightCtx.fogColor.g, this->lightCtx.fogColor.b, 0,
|
||||
this->lightCtx.fogNear, (fogFar <= 1000) ? 1000 : fogFar);
|
||||
}
|
||||
|
||||
void Play_Destroy(GameState* thisx) {
|
||||
@@ -1158,7 +1158,8 @@ void Play_Draw(PlayState* this) {
|
||||
if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.curRoom.mesh->type0.type == 1)) {
|
||||
func_8012CF0C(gfxCtx, 0, 1, 0, 0, 0);
|
||||
} else {
|
||||
func_8012CF0C(gfxCtx, 1, 1, this->lightCtx.unk7, this->lightCtx.unk8, this->lightCtx.unk9);
|
||||
func_8012CF0C(gfxCtx, 1, 1, this->lightCtx.fogColor.r, this->lightCtx.fogColor.g,
|
||||
this->lightCtx.fogColor.b);
|
||||
}
|
||||
} else {
|
||||
func_8012CF0C(gfxCtx, 0, 0, 0, 0, 0);
|
||||
@@ -1184,11 +1185,11 @@ void Play_Draw(PlayState* this) {
|
||||
|
||||
ShrinkWindow_Draw(gfxCtx);
|
||||
|
||||
POLY_OPA_DISP = func_801660B8(this, POLY_OPA_DISP);
|
||||
POLY_XLU_DISP = func_801660B8(this, POLY_XLU_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(this, POLY_OPA_DISP);
|
||||
POLY_XLU_DISP = Play_SetFog(this, POLY_XLU_DISP);
|
||||
|
||||
// fogFar
|
||||
var_fv0 = this->lightCtx.unkC;
|
||||
var_fv0 = this->lightCtx.fogFar;
|
||||
if (var_fv0 > 12800.0f) {
|
||||
var_fv0 = 12800.0f;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ void func_801229A0(PlayState* play, Player* player) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if ((gSaveContext.jinxTimer != 0) || (player->invincibilityTimer > 0)) {
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
|
||||
+5
-5
@@ -777,19 +777,19 @@ Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
|
||||
|
||||
if (n >= 997) {
|
||||
if (n >= 1000) {
|
||||
gSPFogFactor(gfx + 1, 0, 0); // gSPFogPosition(gfx++, ?, ?)
|
||||
gSPFogFactor(&gfx[1], 0, 0); // gSPFogPosition(gfx++, ?, ?)
|
||||
} else {
|
||||
gSPFogFactor(gfx + 1, 0x7FFF, 0x8100); // gSPFogPosition(gfx++, ?, ?)
|
||||
gSPFogFactor(&gfx[1], 0x7FFF, 0x8100); // gSPFogPosition(gfx++, ?, ?)
|
||||
}
|
||||
} else {
|
||||
if (n < 0) {
|
||||
gSPFogFactor(gfx + 1, 0, 255); // gSPFogPosition(gfx++, ?, ?)
|
||||
gSPFogFactor(&gfx[1], 0, 255); // gSPFogPosition(gfx++, ?, ?)
|
||||
} else {
|
||||
gSPFogPosition(gfx + 1, n, f);
|
||||
gSPFogPosition(&gfx[1], n, f);
|
||||
}
|
||||
}
|
||||
|
||||
return gfx + 2;
|
||||
return &gfx[2];
|
||||
}
|
||||
|
||||
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f) {
|
||||
|
||||
@@ -1392,7 +1392,7 @@ void Boss02_Twinmold_Draw(Actor* thisx, PlayState* play2) {
|
||||
}
|
||||
|
||||
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, &this->actor);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
spA4 = 0.0f;
|
||||
spA0 = 0.0f;
|
||||
@@ -1427,7 +1427,7 @@ void Boss02_Twinmold_Draw(Actor* thisx, PlayState* play2) {
|
||||
if (sp98 < this->unk_01BC[phi_v0].y) {
|
||||
gSPDisplayList(POLY_OPA_DISP++, D_809DFA9C[i]);
|
||||
}
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
}
|
||||
|
||||
if (i == 21) {
|
||||
|
||||
@@ -2274,7 +2274,7 @@ void Boss03_Draw(Actor* thisx, PlayState* play) {
|
||||
Matrix_Translate(0.0f, -600.0f, 0.0f, MTXMODE_APPLY);
|
||||
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
Boss03_OverrideLimbDraw, Boss03_PostLimbDraw, &this->actor);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
}
|
||||
|
||||
this->unk_2BC = 0;
|
||||
|
||||
@@ -828,7 +828,7 @@ void Boss04_Draw(Actor* thisx, PlayState* play) {
|
||||
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
Boss04_OverrideLimbDraw, Boss04_PostLimbDraw, &this->actor);
|
||||
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
if (this->actionFunc != func_809EC568) {
|
||||
func_8012C448(play->state.gfxCtx);
|
||||
|
||||
@@ -1024,9 +1024,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.unk7;
|
||||
this->fogG = play->lightCtx.unk8;
|
||||
this->fogB = play->lightCtx.unk9;
|
||||
this->fogR = play->lightCtx.fogColor.r;
|
||||
this->fogG = play->lightCtx.fogColor.g;
|
||||
this->fogB = play->lightCtx.fogColor.b;
|
||||
|
||||
if ((play->sceneId == SCENE_LOST_WOODS) && (gSaveContext.sceneLayer == 1)) {
|
||||
this->alpha = 0;
|
||||
@@ -1594,9 +1594,9 @@ void DmStk_UpdateCutscenes(DmStk* this, PlayState* play) {
|
||||
this->fadeInState++;
|
||||
}
|
||||
|
||||
this->fogR = play->lightCtx.unk7 * this->fogScale;
|
||||
this->fogG = play->lightCtx.unk8 * this->fogScale;
|
||||
this->fogB = play->lightCtx.unk9 * this->fogScale;
|
||||
this->fogR = play->lightCtx.fogColor.r * this->fogScale;
|
||||
this->fogG = play->lightCtx.fogColor.g * this->fogScale;
|
||||
this->fogB = play->lightCtx.fogColor.b * this->fogScale;
|
||||
} else if (this->fadeInState == SK_FADE_IN_STATE_INCREASE_FOG) {
|
||||
if (this->fogN < 996) {
|
||||
this->fogN += 10;
|
||||
@@ -1894,7 +1894,7 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
|
||||
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, this->fogR, this->fogG, this->fogB, this->fogA,
|
||||
this->fogN, this->fogF);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gSkullKidMajorasMask1DL);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
} else {
|
||||
gSPDisplayList(POLY_OPA_DISP++, gSkullKidMajorasMask1DL);
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ void func_80AFE4AC(Actor* thisx, PlayState* play) {
|
||||
func_8012C2DC(play->state.gfxCtx);
|
||||
func_8012C28C(play->state.gfxCtx);
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gDropRecoveryHeartTex));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -266,7 +266,7 @@ void func_80AFE584(Actor* thisx, PlayState* play) {
|
||||
void func_80AFE650(Actor* thisx, PlayState* play) {
|
||||
func_8012C28C(play->state.gfxCtx);
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gDropBombTex));
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -784,7 +784,7 @@ void EnFall_LodMoon_Draw(Actor* thisx, PlayState* play) {
|
||||
gSPDisplayList(POLY_OPA_DISP++, gLodmoonEyesDL);
|
||||
gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gLodmoonMoonDL);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -1448,7 +1448,7 @@ void func_80964950(PlayState* play, EnFuUnkStruct* ptr, s32 len) {
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP);
|
||||
|
||||
for (i = 0; i < len; i++, ptr++) {
|
||||
|
||||
@@ -1137,7 +1137,7 @@ void func_80B5E1D8(PlayState* play, EnOtUnkStruct* arg1, s32 arg2) {
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP);
|
||||
|
||||
for (i = 0; i < arg2; i++, arg1++) {
|
||||
|
||||
@@ -458,7 +458,7 @@ void EnTanron3_Draw(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnTanron3_OverrideLimbDraw, NULL, &this->actor);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ void func_80A90D34(EnTest6* this, PlayState* play, EnTest6Struct* ptr) {
|
||||
if (ptr->unk_00 != 0) {
|
||||
Matrix_Translate(ptr->unk_08 * ptr->unk_04, ptr->unk_0C, ptr->unk_10 * ptr->unk_04, MTXMODE_NEW);
|
||||
Matrix_Scale(ptr->unk_04 * 0.02f, ptr->unk_04 * 0.02f, ptr->unk_04 * 0.02f, MTXMODE_APPLY);
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80A9402C[ptr->unk_00]));
|
||||
|
||||
@@ -259,7 +259,7 @@ void EnTg_DrawHearts(PlayState* play, EnTgHeartEffect* effect, s32 numEffects) {
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP);
|
||||
|
||||
for (i = 0; i < numEffects; i++, effect++) {
|
||||
|
||||
@@ -570,7 +570,7 @@ void func_80A5A184(Actor* thisx, PlayState* play2) {
|
||||
}
|
||||
}
|
||||
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
||||
@@ -769,7 +769,7 @@ void EnZob_Draw(Actor* thisx, PlayState* play) {
|
||||
func_80BA0F64, func_80BA0FAC, &this->actor);
|
||||
|
||||
if (this->unk_2F4 & 0x20) {
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
|
||||
@@ -761,7 +761,7 @@ void EnZos_Draw(Actor* thisx, PlayState* play) {
|
||||
func_80BBC4E4, func_80BBC500, &this->actor);
|
||||
|
||||
if (this->unk_2B6 & 0x40) {
|
||||
POLY_OPA_DISP = func_801660B8(play, POLY_OPA_DISP);
|
||||
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
|
||||
Reference in New Issue
Block a user