1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 14:34:32 +00:00

Decompile object_syokudai and object_ydan_objects (#699)

* add deku and torch objects

* why git?
This commit is contained in:
Zelllll 2021-02-17 13:42:59 -06:00 committed by GitHub
parent ad751f02d2
commit f57e0467d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 63 additions and 58 deletions

View file

@ -5,6 +5,7 @@
*/
#include "z_bg_ydan_hasi.h"
#include "objects/object_ydan_objects/object_ydan_objects.h"
#define FLAGS 0x00000030
@ -38,12 +39,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
static Gfx* D_808BEC24[] = { 0x06007508, 0x06005DE0, 0x06005018 };
extern CollisionHeader D_06005780;
extern CollisionHeader D_06007798;
extern Gfx* D_06005DE0[];
void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad1;
BgYdanHasi* this = THIS;
@ -66,14 +61,14 @@ void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) {
} else {
if (thisx->params == 0) {
// Moving platform on the water in B1
CollisionHeader_GetVirtual(&D_06007798, &colHeader);
CollisionHeader_GetVirtual(&gDTSlidingPlatformCol, &colHeader);
thisx->scale.z = 0.15f;
thisx->scale.x = 0.15f;
thisx->world.pos.y = (waterBox->ySurface + 20.0f);
this->actionFunc = BgYdanHasi_UpdateFloatingBlock;
} else {
// 3 platforms on 2F
CollisionHeader_GetVirtual(&D_06005780, &colHeader);
CollisionHeader_GetVirtual(&gDTRisingPlatformsCol, &colHeader);
thisx->draw = NULL;
this->actionFunc = BgYdanHasi_SetupThreeBlocks;
Actor_SetFocus(thisx, 40.0f);
@ -189,10 +184,11 @@ void BgYdanHasi_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgYdanHasi_Draw(Actor* thisx, GlobalContext* globalCtx) {
static Gfx* dLists[] = { gDTSlidingPlatformDL, gDTWaterPlaneDL, gDTRisingPlatformsDL };
BgYdanHasi* this = THIS;
if (this->dyna.actor.params == 0 || this->dyna.actor.params == 2) {
Gfx_DrawDListOpa(globalCtx, D_808BEC24[this->dyna.actor.params]);
Gfx_DrawDListOpa(globalCtx, dLists[this->dyna.actor.params]);
return;
}
@ -205,7 +201,7 @@ void BgYdanHasi_Draw(Actor* thisx, GlobalContext* globalCtx) {
globalCtx->gameplayFrames & 0x7F, 0x20, 0x20));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ydan_hasi.c", 592),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, &D_06005DE0);
gSPDisplayList(POLY_XLU_DISP++, gDTWaterPlaneDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_ydan_hasi.c", 597);
}

View file

@ -1,10 +1,11 @@
/*
* File: z_bg_ydan_maruta.c
* Overlay: ovl_Bg_Ydan_Maruta
* Description: Rotating spike log in Deku Tree
* Description: Rotating spike log and falling ladder in Deku Tree
*/
#include "z_bg_ydan_maruta.h"
#include "objects/object_ydan_objects/object_ydan_objects.h"
#define FLAGS 0x00000000
@ -75,10 +76,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
extern CollisionHeader D_060066A8;
extern Gfx D_06008D88[];
extern Gfx D_06006570[];
void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
BgYdanMaruta* this = THIS;
@ -102,7 +99,7 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) {
} else {
triInit = &sTrisElementsInit[1];
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&D_060066A8, &colHeader);
CollisionHeader_GetVirtual(&gDTFallingLadderCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader);
thisx->home.pos.y += -280.0f;
if (Flags_GetSwitch(globalCtx, this->unk_168)) {
@ -207,8 +204,8 @@ void BgYdanMaruta_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgYdanMaruta* this = THIS;
if (this->dyna.actor.params == 0) {
Gfx_DrawDListOpa(globalCtx, D_06008D88);
Gfx_DrawDListOpa(globalCtx, gDTRollingSpikeTrapDL);
} else {
Gfx_DrawDListOpa(globalCtx, D_06006570);
Gfx_DrawDListOpa(globalCtx, gDTFallingLadderDL);
}
}

View file

@ -1,4 +1,11 @@
/*
* File: z_bg_ydan_sp.c
* Overlay: ovl_Bg_Ydan_Sp
* Description: Webs
*/
#include "z_bg_ydan_sp.h"
#include "objects/object_ydan_objects/object_ydan_objects.h"
#define FLAGS 0x00000000
@ -14,12 +21,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, GlobalContext* globalCtx);
void BgYdanSp_BurnWallWeb(BgYdanSp* this, GlobalContext* globalCtx);
void BgYdanSp_WallWebIdle(BgYdanSp* this, GlobalContext* globalCtx);
extern Gfx D_060061B0[];
extern Gfx D_06003850[];
extern Gfx D_06005F40[];
extern CollisionHeader D_06006050;
extern CollisionHeader D_06006460;
extern CollisionHeader gDTWebWallCol;
typedef enum {
/* 0 */ WEB_FLOOR,
@ -100,7 +102,7 @@ void BgYdanSp_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitTris(globalCtx, &this->trisCollider);
Collider_SetTris(globalCtx, &this->trisCollider, &this->dyna.actor, &sTrisInit, this->trisColliderItems);
if (this->dyna.actor.params == WEB_FLOOR) {
CollisionHeader_GetVirtual(&D_06006460, &colHeader);
CollisionHeader_GetVirtual(&gDTWebFloorCol, &colHeader);
this->actionFunc = BgYdanSp_FloorWebIdle;
for (i = 0; i < 3; i++) {
@ -115,7 +117,7 @@ void BgYdanSp_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetTrisVertices(&this->trisCollider, 1, &tri[0], &tri[2], &tri[1]);
this->unk16C = 0.0f;
} else {
CollisionHeader_GetVirtual(&D_06006050, &colHeader);
CollisionHeader_GetVirtual(&gDTWebWallCol, &colHeader);
this->actionFunc = BgYdanSp_WallWebIdle;
Actor_SetFocus(&this->dyna.actor, 30.0f);
sinsY = Math_SinS(this->dyna.actor.shape.rot.y);
@ -155,7 +157,7 @@ void* BgYdanSp_UpdateFloorWebCollision(BgYdanSp* this) {
s16 newY;
CollisionHeader* colHeader;
colHeader = SEGMENTED_TO_VIRTUAL(&D_06006460);
colHeader = SEGMENTED_TO_VIRTUAL(&gDTWebFloorCol);
colHeader->vtxList = SEGMENTED_TO_VIRTUAL(colHeader->vtxList);
newY = (this->dyna.actor.home.pos.y - this->dyna.actor.world.pos.y) * 10;
colHeader->vtxList[14].y = newY;
@ -427,7 +429,7 @@ void BgYdanSp_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->params == WEB_WALL) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ydan_sp.c", 787),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_06005F40);
gSPDisplayList(POLY_XLU_DISP++, gDTWebWallDL);
} else if (this->actionFunc == BgYdanSp_FloorWebBroken) {
Matrix_Get(&mtxF);
if (this->timer == 40) {
@ -435,7 +437,7 @@ void BgYdanSp_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Scale(1.0f, ((thisx->home.pos.y - thisx->world.pos.y) + 10.0f) * 0.1f, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ydan_sp.c", 808),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_060061B0);
gSPDisplayList(POLY_XLU_DISP++, gDTWebFloorDL);
}
for (i = 0; i < 8; i++) {
Matrix_Put(&mtxF);
@ -444,14 +446,14 @@ void BgYdanSp_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Scale(3.5f, 5.0f, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ydan_sp.c", 830),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_06003850);
gSPDisplayList(POLY_XLU_DISP++, gDTUnknownWebDL);
}
} else {
Matrix_Translate(0.0f, (thisx->home.pos.y - thisx->world.pos.y) * 10.0f, 0.0f, MTXMODE_APPLY);
Matrix_Scale(1.0f, ((thisx->home.pos.y - thisx->world.pos.y) + 10.0f) * 0.1f, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ydan_sp.c", 849),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_060061B0);
gSPDisplayList(POLY_XLU_DISP++, gDTWebFloorDL);
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_ydan_sp.c", 856);

View file

@ -7,6 +7,7 @@
#include "z_obj_syokudai.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_syokudai/object_syokudai.h"
#define FLAGS 0x00000410
@ -258,7 +259,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
void ObjSyokudai_Draw(Actor* thisx, GlobalContext* globalCtx) {
static Gfx* displayLists[] = { 0x060003A0, 0x06000B90, 0x06000870 };
static Gfx* displayLists[] = { gGoldenTorchDL, gTimedTorchDL, gWoodenTorchDL };
s32 pad;
ObjSyokudai* this = THIS;
s32 timerMax;