1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-29 03:34:07 +00:00

Cleanup BgGanonOtyuka_Draw

This commit is contained in:
Sirius902 2020-11-14 20:25:57 -08:00
parent aec2bb45ba
commit 1cc2c8ddd1

View file

@ -148,21 +148,23 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
Camera* camera = Gameplay_GetCamera(globalCtx, 0); Camera* camera = Gameplay_GetCamera(globalCtx, 0);
Actor* actor; Actor* actor;
BgGanonOtyuka* otyuka; BgGanonOtyuka* otyuka;
BossGanon* ganon; BossGanon* ganondorf;
f32 spBC = -30.0f; f32 spBC = -30.0f;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 702); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 702);
actor = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first; actor = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first;
while (actor != NULL) { while (actor != NULL) {
if ((actor->id == ACTOR_BOSS_GANON) && (actor->params == 0)) { if ((actor->id == ACTOR_BOSS_GANON)) {
ganon = (BossGanon*)actor; ganondorf = (BossGanon*)actor;
if (ganon->unk_198 != 0) { if (ganondorf->actor.params == 0) {
spBC = -2000.0f; if (ganondorf->unk_198 != 0) {
spBC = -2000.0f;
}
break;
} }
break;
} }
actor = actor->next; actor = actor->next;
@ -173,42 +175,46 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
while (actor != NULL) { while (actor != NULL) {
if ((actor->id == ACTOR_BG_GANON_OTYUKA) && (actor->projectedPos.z > spBC)) { if (actor->id == ACTOR_BG_GANON_OTYUKA) {
otyuka = (BgGanonOtyuka*)actor; otyuka = (BgGanonOtyuka*)actor;
if (camera->eye.y > actor->posRot.pos.y) { if (otyuka->dyna.actor.projectedPos.z > spBC) {
phi_s2 = D_808773B0; if (camera->eye.y > otyuka->dyna.actor.posRot.pos.y) {
} else { phi_s2 = D_808773B0;
phi_s2 = D_80877408;
}
Matrix_Translate(actor->posRot.pos.x, actor->posRot.pos.y, actor->posRot.pos.z, MTXMODE_NEW);
phi_s1 = NULL;
if (otyuka->unk_16A != 0) {
Matrix_RotateX(((f32)actor->shape.rot.x / 0x8000) * M_PI, MTXMODE_APPLY);
Matrix_RotateZ(((f32)actor->shape.rot.z / 0x8000) * M_PI, MTXMODE_APPLY);
if (camera->eye.y > actor->posRot.pos.y) {
phi_s1 = D_80877408;
} else { } else {
phi_s1 = D_808773B0; phi_s2 = D_80877408;
} }
} Matrix_Translate(otyuka->dyna.actor.posRot.pos.x, otyuka->dyna.actor.posRot.pos.y,
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 766), otyuka->dyna.actor.posRot.pos.z, MTXMODE_NEW);
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); phi_s1 = NULL;
gSPDisplayList(POLY_OPA_DISP++, phi_s2); if (otyuka->unk_16A != 0) {
Matrix_RotateX(((f32)otyuka->dyna.actor.shape.rot.x / 0x8000) * M_PI, MTXMODE_APPLY);
Matrix_RotateZ(((f32)otyuka->dyna.actor.shape.rot.z / 0x8000) * M_PI, MTXMODE_APPLY);
if (camera->eye.y > otyuka->dyna.actor.posRot.pos.y) {
phi_s1 = D_80877408;
} else {
phi_s1 = D_808773B0;
}
}
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 766),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, phi_s2);
if (phi_s1 != NULL) { if (phi_s1 != NULL) {
gSPDisplayList(POLY_OPA_DISP++, phi_s1); gSPDisplayList(POLY_OPA_DISP++, phi_s1);
} }
for (i = 0; i < ARRAY_COUNT(D_80876A64); i++) { for (i = 0; i < ARRAY_COUNT(D_80876A64); i++) {
if ((D_80876A64[i] & ((BgGanonOtyuka*)actor)->unk_16C) != 0) { if ((D_80876A64[i] & otyuka->unk_16C) != 0) {
Matrix_Push(); Matrix_Push();
Matrix_Translate(D_80876AA0[i].x, 0.0f, D_80876AA0[i].z, MTXMODE_APPLY); Matrix_Translate(D_80876AA0[i].x, 0.0f, D_80876AA0[i].z, MTXMODE_APPLY);
Matrix_RotateY(D_80876AD0[i], MTXMODE_APPLY); Matrix_RotateY(D_80876AD0[i], MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 785), gSPMatrix(POLY_OPA_DISP++,
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 785),
gSPDisplayList(POLY_OPA_DISP++, D_80877460); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Matrix_Pull(); gSPDisplayList(POLY_OPA_DISP++, D_80877460);
Matrix_Pull();
}
} }
} }
} }
@ -219,28 +225,30 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D84(globalCtx->state.gfxCtx); func_80093D84(globalCtx->state.gfxCtx);
actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
while (actor != NULL) { while (actor != NULL) {
if ((actor->id == ACTOR_BG_GANON_OTYUKA) && (actor->projectedPos.z > -30.0f) && if (actor->id == ACTOR_BG_GANON_OTYUKA) {
(((BgGanonOtyuka*)actor)->unk_16E != 0)) {
otyuka = (BgGanonOtyuka*)actor; otyuka = (BgGanonOtyuka*)actor;
gSPSegment(POLY_XLU_DISP++, 0x08, if ((otyuka->dyna.actor.projectedPos.z > -30.0f) && (otyuka->unk_16E != 0)) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, otyuka->unk_16D * 4, 0, 32, 64, 1, gSPSegment(POLY_XLU_DISP++, 0x08,
otyuka->unk_16D * 4, 0, 32, 64)); Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, otyuka->unk_16D * 4, 0, 32, 64, 1,
gDPPipeSync(POLY_XLU_DISP++); otyuka->unk_16D * 4, 0, 32, 64));
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, otyuka->primR, otyuka->primG, otyuka->primB, 0); gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, otyuka->envR, otyuka->envG, otyuka->envB, 128); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, otyuka->primR, otyuka->primG, otyuka->primB, 0);
Matrix_Translate(actor->posRot.pos.x, 0.0f, actor->posRot.pos.z, MTXMODE_NEW); gDPSetEnvColor(POLY_XLU_DISP++, otyuka->envR, otyuka->envG, otyuka->envB, 128);
Matrix_Translate(otyuka->dyna.actor.posRot.pos.x, 0.0f, otyuka->dyna.actor.posRot.pos.z, MTXMODE_NEW);
for (i = 0; i < ARRAY_COUNT(D_80876A64); i++) { for (i = 0; i < ARRAY_COUNT(D_80876A64); i++) {
if ((D_80876A64[i] & otyuka->unk_16B) != 0) { if ((D_80876A64[i] & otyuka->unk_16B) != 0) {
Matrix_Push(); Matrix_Push();
Matrix_Translate(D_80876AA0[i].x, 0.0f, D_80876AA0[i].z, MTXMODE_APPLY); Matrix_Translate(D_80876AA0[i].x, 0.0f, D_80876AA0[i].z, MTXMODE_APPLY);
Matrix_RotateY(D_80876AD0[i], MTXMODE_APPLY); Matrix_RotateY(D_80876AD0[i], MTXMODE_APPLY);
Matrix_Scale(0.3f, otyuka->yScale * 0.3f, 0.3f, MTXMODE_APPLY); Matrix_Scale(0.3f, otyuka->yScale * 0.3f, 0.3f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 847), gSPMatrix(POLY_XLU_DISP++,
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 847),
gSPDisplayList(POLY_XLU_DISP++, D_80877CF8); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Matrix_Pull(); gSPDisplayList(POLY_XLU_DISP++, D_80877CF8);
Matrix_Pull();
}
} }
} }
} }