summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlejandro Asenjo <96613413+sonicdcer@users.noreply.github.com>2022-09-14 12:57:47 -0300
committerGitHub <noreply@github.com>2022-09-14 12:57:47 -0300
commite47dc7da25ee45b4e2805d78766e27ac8c0f6970 (patch)
tree464922f5e0587b166576d9e57e61a0057c08c6c6 /src
parentbf2606586732d1dc39e48fe1b09b98fd668760be (diff)
ovl_Oceff_Wipe3 OK (#1001)
* all functions matching * ovl_Oceff_Wipe3 decompiled * bss * pr review * pr review * renamings * pr review
Diffstat (limited to 'src')
-rw-r--r--src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c81
-rw-r--r--src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h2
2 files changed, 76 insertions, 7 deletions
diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c
index fb1f2a45d..1b1347e8f 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c
@@ -16,7 +16,6 @@ void OceffWipe3_Destroy(Actor* thisx, PlayState* play);
void OceffWipe3_Update(Actor* thisx, PlayState* play);
void OceffWipe3_Draw(Actor* thisx, PlayState* play);
-#if 0
const ActorInit Oceff_Wipe3_InitVars = {
ACTOR_OCEFF_WIPE3,
ACTORCAT_ITEMACTION,
@@ -29,12 +28,82 @@ const ActorInit Oceff_Wipe3_InitVars = {
(ActorFunc)OceffWipe3_Draw,
};
-#endif
+#include "assets/overlays/ovl_Oceff_Wipe3/ovl_Oceff_Wipe3.c"
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe3/OceffWipe3_Init.s")
+s32 D_80989130;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe3/OceffWipe3_Destroy.s")
+void OceffWipe3_Init(Actor* thisx, PlayState* play) {
+ OceffWipe3* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe3/OceffWipe3_Update.s")
+ Actor_SetScale(&this->actor, 0.1f);
+ this->counter = 0;
+ this->actor.world.pos = GET_ACTIVE_CAM(play)->eye;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe3/OceffWipe3_Draw.s")
+void OceffWipe3_Destroy(Actor* thisx, PlayState* play) {
+ OceffWipe3* this = THIS;
+
+ func_80115D5C(&play->state);
+ play->msgCtx.unk120B0 = 0;
+}
+
+void OceffWipe3_Update(Actor* thisx, PlayState* play) {
+ OceffWipe3* this = THIS;
+
+ this->actor.world.pos = GET_ACTIVE_CAM(play)->eye;
+ if (this->counter < 100) {
+ this->counter++;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void OceffWipe3_Draw(Actor* thisx, PlayState* play) {
+ u32 scroll = play->state.frames & 0xFFF;
+ OceffWipe3* this = THIS;
+ f32 z;
+ u8 alpha;
+ s32 pad[2];
+ Vec3f eye = GET_ACTIVE_CAM(play)->eye;
+ Vtx* vtxPtr;
+ Vec3f quakeOffset;
+
+ Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(play));
+
+ vtxPtr = sSariaSongFrustumVtx;
+
+ if (this->counter < 32) {
+ z = Math_SinS(this->counter * 512) * 1220.0f;
+ } else {
+ z = 1220.0f;
+ }
+
+ if (this->counter >= 80) {
+ alpha = 12 * (100 - this->counter);
+ } else {
+ alpha = 255;
+ }
+
+ vtxPtr[1].v.cn[3] = vtxPtr[3].v.cn[3] = vtxPtr[5].v.cn[3] = vtxPtr[7].v.cn[3] = vtxPtr[9].v.cn[3] =
+ vtxPtr[11].v.cn[3] = vtxPtr[13].v.cn[3] = vtxPtr[15].v.cn[3] = vtxPtr[17].v.cn[3] = vtxPtr[19].v.cn[3] =
+ vtxPtr[21].v.cn[3] = alpha;
+
+ OPEN_DISPS(play->state.gfxCtx);
+
+ func_8012C2DC(play->state.gfxCtx);
+ Matrix_Translate(eye.x + quakeOffset.x, eye.y + quakeOffset.y, eye.z + quakeOffset.z, MTXMODE_NEW);
+ Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
+ Matrix_ReplaceRotation(&play->billboardMtxF);
+ Matrix_RotateXS(0x708, MTXMODE_APPLY);
+ Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 170, 255);
+ gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 128);
+ gSPDisplayList(POLY_XLU_DISP++, &sSariaSongFrustrumMaterialDL);
+ gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, 0, scroll * 12, scroll * -12, 64, 64, 1,
+ scroll * 8, scroll * -8, 64, 64));
+ gSPDisplayList(POLY_XLU_DISP++, &sSariaSongFrustumModelDL);
+
+ CLOSE_DISPS(play->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h
index b9f41bb09..f29ca9278 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h
+++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h
@@ -7,7 +7,7 @@ struct OceffWipe3;
typedef struct OceffWipe3 {
/* 0x000 */ Actor actor;
- /* 0x144 */ char unk_144[0x4];
+ /* 0x144 */ s16 counter;
} OceffWipe3; // size = 0x148
extern const ActorInit Oceff_Wipe3_InitVars;