1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-29 00:06:33 +00:00
This commit is contained in:
Sirius902 2020-11-14 20:31:51 -08:00
parent 1cc2c8ddd1
commit 7bb8372d8d
2 changed files with 41 additions and 40 deletions

View file

@ -65,16 +65,16 @@ f32 D_80876AD0[] = { M_PI / 2, -M_PI / 2, 0.0f, M_PI };
#include "z_bg_ganon_otyuka_gfx.c"
static CamData gCameraDataList[] = { { 0, 0, 0 } };
static CamData sCameraDataList[] = { { 0, 0, 0 } };
static UNK_TYPE gSurfaceTypeList[] = {
static UNK_TYPE sSurfaceTypeList[] = {
0x00000000,
0x000007C0,
0x00000000,
0x000007C2,
};
static CollisionPoly gPolyList[] = {
static CollisionPoly sPolyList[] = {
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02 }, { 32767, 0, 0 }, -60 },
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03 }, { 32767, 0, 0 }, -60 },
{ { 0x00, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x04 }, { 0, 0, -32767 }, -60 },
@ -87,14 +87,14 @@ static CollisionPoly gPolyList[] = {
{ { 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07 }, { 0, 32767, 0 }, 0 },
};
static Vec3s gVtxList[] = {
static Vec3s sVtxList[] = {
{ 60, 0, 60 }, { 60, -60, 60 }, { 60, -60, -60 }, { 60, 0, -60 },
{ -60, -60, -60 }, { -60, 0, -60 }, { -60, -60, 60 }, { -60, 0, 60 },
};
static CollisionHeader gColHeader = {
{ -60, -60, -60 }, { 60, 0, 60 }, ARRAY_COUNT(gVtxList), gVtxList, ARRAY_COUNT(gPolyList),
gPolyList, gSurfaceTypeList, gCameraDataList, 0, NULL,
static CollisionHeader sColHeader = {
{ -60, -60, -60 }, { 60, 0, 60 }, ARRAY_COUNT(sVtxList), sVtxList, ARRAY_COUNT(sPolyList),
sPolyList, sSurfaceTypeList, sCameraDataList, 0, NULL,
};
void BgGanonOtyuka_Init(Actor* thisx, GlobalContext* globalCtx) {
@ -104,7 +104,7 @@ void BgGanonOtyuka_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyInfo_SetActorMove(&this->dyna, 0);
DynaPolyInfo_Alloc(&gColHeader, &colHeader);
DynaPolyInfo_Alloc(&sColHeader, &colHeader);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
if (thisx->params != 0x23) {
@ -147,7 +147,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx* phi_s1;
Camera* camera = Gameplay_GetCamera(globalCtx, 0);
Actor* actor;
BgGanonOtyuka* otyuka;
BgGanonOtyuka* platform;
BossGanon* ganondorf;
f32 spBC = -30.0f;
@ -176,21 +176,21 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
while (actor != NULL) {
if (actor->id == ACTOR_BG_GANON_OTYUKA) {
otyuka = (BgGanonOtyuka*)actor;
platform = (BgGanonOtyuka*)actor;
if (otyuka->dyna.actor.projectedPos.z > spBC) {
if (camera->eye.y > otyuka->dyna.actor.posRot.pos.y) {
if (platform->dyna.actor.projectedPos.z > spBC) {
if (camera->eye.y > platform->dyna.actor.posRot.pos.y) {
phi_s2 = D_808773B0;
} else {
phi_s2 = D_80877408;
}
Matrix_Translate(otyuka->dyna.actor.posRot.pos.x, otyuka->dyna.actor.posRot.pos.y,
otyuka->dyna.actor.posRot.pos.z, MTXMODE_NEW);
Matrix_Translate(platform->dyna.actor.posRot.pos.x, platform->dyna.actor.posRot.pos.y,
platform->dyna.actor.posRot.pos.z, MTXMODE_NEW);
phi_s1 = NULL;
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) {
if (platform->unk_16A != 0) {
Matrix_RotateX(((f32)platform->dyna.actor.shape.rot.x / 0x8000) * M_PI, MTXMODE_APPLY);
Matrix_RotateZ(((f32)platform->dyna.actor.shape.rot.z / 0x8000) * M_PI, MTXMODE_APPLY);
if (camera->eye.y > platform->dyna.actor.posRot.pos.y) {
phi_s1 = D_80877408;
} else {
phi_s1 = D_808773B0;
@ -205,7 +205,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
for (i = 0; i < ARRAY_COUNT(D_80876A64); i++) {
if ((D_80876A64[i] & otyuka->unk_16C) != 0) {
if ((D_80876A64[i] & platform->unk_16C) != 0) {
Matrix_Push();
Matrix_Translate(D_80876AA0[i].x, 0.0f, D_80876AA0[i].z, MTXMODE_APPLY);
Matrix_RotateY(D_80876AD0[i], MTXMODE_APPLY);
@ -226,23 +226,24 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) {
actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
while (actor != NULL) {
if (actor->id == ACTOR_BG_GANON_OTYUKA) {
otyuka = (BgGanonOtyuka*)actor;
platform = (BgGanonOtyuka*)actor;
if ((otyuka->dyna.actor.projectedPos.z > -30.0f) && (otyuka->unk_16E != 0)) {
if ((platform->dyna.actor.projectedPos.z > -30.0f) && (platform->unk_16E != 0)) {
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, otyuka->unk_16D * 4, 0, 32, 64, 1,
otyuka->unk_16D * 4, 0, 32, 64));
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, platform->unk_16D * 4, 0, 32, 64, 1,
platform->unk_16D * 4, 0, 32, 64));
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, otyuka->primR, otyuka->primG, otyuka->primB, 0);
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);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, platform->primR, platform->primG, platform->primB, 0);
gDPSetEnvColor(POLY_XLU_DISP++, platform->envR, platform->envG, platform->envB, 128);
Matrix_Translate(platform->dyna.actor.posRot.pos.x, 0.0f, platform->dyna.actor.posRot.pos.z,
MTXMODE_NEW);
for (i = 0; i < ARRAY_COUNT(D_80876A64); i++) {
if ((D_80876A64[i] & otyuka->unk_16B) != 0) {
if ((D_80876A64[i] & platform->unk_16B) != 0) {
Matrix_Push();
Matrix_Translate(D_80876AA0[i].x, 0.0f, D_80876AA0[i].z, 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, platform->yScale * 0.3f, 0.3f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++,
Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 847),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View file

@ -2,7 +2,7 @@
extern Gfx D_08000000[];
static UNK_TYPE gPlatformTexture[] = {
static UNK_TYPE sPlatformTexture[] = {
0x19033187, 0x39C74207, 0x4A495247, 0x5A494A09, 0x498749C5, 0x5A476247, 0x62076287, 0x734F8393, 0x6A8B6A09,
0x5A495207, 0x49C54A89, 0x4A895289, 0x5AC95A89, 0x5A4B5A8B, 0x5A896249, 0x52095207, 0x19033185, 0x420949C7,
0x52095207, 0x5A075A45, 0x41C749C5, 0x62075207, 0x62896A49, 0x6B4F7B51, 0x62C75A49, 0x52095247, 0x4A475249,
@ -65,7 +65,7 @@ static UNK_TYPE gPlatformTexture[] = {
// probably unused?
static UNK_TYPE D_808772E0[] = { 0x00000000, 0x00000000 };
static Vtx gVertices1[] = {
static Vtx sVertices1[] = {
VTX(60, 0, 60, 2048, -1024, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(60, 0, -60, 0, -1024, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(-60, 0, -60, 0, 1024, 0xFF, 0xFF, 0xFF, 0xFF),
@ -76,7 +76,7 @@ Gfx D_80877328[] = {
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPLoadTextureBlock(gPlatformTexture, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_MIRROR | G_TX_WRAP,
gsDPLoadTextureBlock(sPlatformTexture, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_MIRROR | G_TX_WRAP,
G_TX_MIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, 1, COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED),
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
@ -88,12 +88,12 @@ Gfx D_80877328[] = {
};
Gfx D_808773B0[] = {
gsSPVertex(gVertices1, ARRAY_COUNT(gVertices1), 0),
gsSPVertex(sVertices1, ARRAY_COUNT(sVertices1), 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSPEndDisplayList(),
};
static Vtx gVertices2[] = {
static Vtx sVertices2[] = {
VTX(60, -60, 60, 2048, -1024, 0x32, 0x32, 0x32, 0xFF),
VTX(60, -60, -60, 0, -1024, 0x32, 0x32, 0x32, 0xFF),
VTX(-60, -60, -60, 0, 1024, 0x32, 0x32, 0x32, 0xFF),
@ -101,12 +101,12 @@ static Vtx gVertices2[] = {
};
Gfx D_80877408[] = {
gsSPVertex(gVertices2, ARRAY_COUNT(gVertices2), 0),
gsSPVertex(sVertices2, ARRAY_COUNT(sVertices2), 0),
gsSP2Triangles(0, 2, 1, 0, 0, 3, 2, 0),
gsSPEndDisplayList(),
};
static Vtx gVertices3[] = {
static Vtx sVertices3[] = {
VTX(-60, 0, 0, 2048, -1024, 0xFF, 0xFF, 0xFF, 0xFF),
VTX(-60, -60, 0, 2048, 1024, 0x32, 0x32, 0x32, 0xFF),
VTX(60, -60, 0, 0, 1024, 0x32, 0x32, 0x32, 0xFF),
@ -114,12 +114,12 @@ static Vtx gVertices3[] = {
};
Gfx D_80877460[] = {
gsSPVertex(gVertices3, ARRAY_COUNT(gVertices3), 0),
gsSPVertex(sVertices3, ARRAY_COUNT(sVertices3), 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSPEndDisplayList(),
};
static UNK_TYPE gFlashTexture[] = {
static UNK_TYPE sFlashTexture[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000001, 0x00000000, 0x00000102, 0x01000001, 0x00000000, 0x00000000, 0x00010000, 0x00000000,
0x00000001, 0x00000000, 0x00000204, 0x02000101, 0x00000000, 0x00000000, 0x00010101, 0x00000001, 0x00000001,
@ -179,7 +179,7 @@ static UNK_TYPE gFlashTexture[] = {
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
};
static Vtx gVertices4[] = {
static Vtx sVertices4[] = {
VTX(-180, 300, 0, 256, 0, 0xFF, 0xFF, 0xFF, 0xFF), VTX(-360, 0, 0, 0, 2048, 0xFF, 0xFF, 0xFF, 0x00),
VTX(-180, 0, 0, 256, 2048, 0xFF, 0xFF, 0xFF, 0xFF), VTX(-360, 300, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0x00),
VTX(180, 300, 0, 768, 0, 0xFF, 0xFF, 0xFF, 0xFF), VTX(180, 0, 0, 768, 2048, 0xFF, 0xFF, 0xFF, 0xFF),
@ -190,7 +190,7 @@ Gfx D_80877CF8[] = {
gsDPPipeSync(),
gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPLoadTextureBlock(gFlashTexture, G_IM_FMT_I, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
gsDPLoadTextureBlock(sFlashTexture, G_IM_FMT_I, G_IM_SIZ_8b, 32, 64, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, 15, 1),
gsDPTileSync(),
gsDPSetTile(G_IM_FMT_I, G_IM_SIZ_8b, 4, 0x0000, 1, 0, G_TX_NOMIRROR | G_TX_CLAMP, 6, 14, G_TX_NOMIRROR | G_TX_WRAP,
@ -201,7 +201,7 @@ Gfx D_80877CF8[] = {
gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_SURF2),
gsSPClearGeometryMode(G_CULL_BACK | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
gsSPDisplayList(D_08000000),
gsSPVertex(gVertices4, 8, 0),
gsSPVertex(sVertices4, 8, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 3, 1, 0),
gsSP2Triangles(4, 2, 5, 0, 4, 0, 2, 0),
gsSP2Triangles(6, 4, 5, 0, 6, 7, 4, 0),