mirror of https://github.com/zeldaret/mm.git
ovl_Oceff_Wipe4 OK (#1007)
* ovl_Oceff_Wipe4 decompiled * pr review * renamings * renamings * Material -> Model * pr review * Magic_Reset
This commit is contained in:
parent
72d24b9995
commit
363a7cda46
|
|
@ -0,0 +1,12 @@
|
|||
<Root>
|
||||
<ExternalFile XmlPath="objects/gameplay_keep.xml" OutPath="assets/objects/gameplay_keep/"/>
|
||||
<File Name="ovl_Oceff_Wipe4" BaseAddress="0x8099D780" RangeStart="0x430" RangeEnd="0xF18">
|
||||
<Texture Name="sScarecrowSongEffectTex" OutName="scarecrow_song_effect" Format="i8" Width="32" Height="64" Offset="0x430"/>
|
||||
<Array Name="sScarecrowSongFrustumVtx" Count="22" Offset="0xC30">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="sScarecrowSongMaterialDL" Offset="0xD90"/>
|
||||
<DList Name="sScarecrowSongUnusedMaterialDL" Offset="0xDF8"/>
|
||||
<DList Name="sScarecrowSongModelDL" Offset="0xE60"/>
|
||||
</File>
|
||||
</Root>
|
||||
4
spec
4
spec
|
|
@ -2080,9 +2080,7 @@ beginseg
|
|||
name "ovl_Oceff_Wipe4"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.o"
|
||||
include "build/data/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4.data.o"
|
||||
include "build/data/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4.bss.o"
|
||||
include "build/data/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ void OceffWipe4_Destroy(Actor* thisx, PlayState* play);
|
|||
void OceffWipe4_Update(Actor* thisx, PlayState* play);
|
||||
void OceffWipe4_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
#if 0
|
||||
const ActorInit Oceff_Wipe4_InitVars = {
|
||||
ACTOR_OCEFF_WIPE4,
|
||||
ACTORCAT_ITEMACTION,
|
||||
|
|
@ -28,12 +27,87 @@ const ActorInit Oceff_Wipe4_InitVars = {
|
|||
(ActorFunc)OceffWipe4_Draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
#include "assets/overlays/ovl_Oceff_Wipe4/ovl_Oceff_Wipe4.c"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe4/OceffWipe4_Init.s")
|
||||
s32 D_8099E780;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe4/OceffWipe4_Destroy.s")
|
||||
void OceffWipe4_Init(Actor* thisx, PlayState* play) {
|
||||
OceffWipe4* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe4/OceffWipe4_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_Wipe4/OceffWipe4_Draw.s")
|
||||
void OceffWipe4_Destroy(Actor* thisx, PlayState* play) {
|
||||
OceffWipe4* this = THIS;
|
||||
|
||||
Magic_Reset(play);
|
||||
play->msgCtx.unk120B0 = 0;
|
||||
}
|
||||
|
||||
void OceffWipe4_Update(Actor* thisx, PlayState* play) {
|
||||
OceffWipe4* this = THIS;
|
||||
|
||||
this->actor.world.pos = GET_ACTIVE_CAM(play)->eye;
|
||||
if (this->counter < 50) {
|
||||
this->counter++;
|
||||
} else {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
void OceffWipe4_Draw(Actor* thisx, PlayState* play) {
|
||||
u32 scroll = play->state.frames & 0xFFF;
|
||||
OceffWipe4* 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));
|
||||
|
||||
if (this->counter < 16) {
|
||||
z = Math_SinS(this->counter * 0x400) * 1220.0f;
|
||||
} else {
|
||||
z = 1220.0f;
|
||||
}
|
||||
|
||||
vtxPtr = sScarecrowSongFrustumVtx;
|
||||
if (this->counter >= 30) {
|
||||
alpha = 12 * (50 - 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);
|
||||
|
||||
if (this->actor.params == OCEFF_WIPE4_UNUSED) {
|
||||
gSPDisplayList(POLY_XLU_DISP++, sScarecrowSongUnusedMaterialDL);
|
||||
} else {
|
||||
gSPDisplayList(POLY_XLU_DISP++, sScarecrowSongMaterialDL);
|
||||
}
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, sScarecrowSongModelDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, scroll * 2, scroll * -2, 32,
|
||||
64, 1, scroll * -1, scroll, 32, 32));
|
||||
gSPDisplayList(POLY_XLU_DISP++, &sScarecrowSongModelDL[11]);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,16 @@
|
|||
|
||||
#include "global.h"
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ OCEFF_WIPE4_SCARECROWS,
|
||||
/* 1 */ OCEFF_WIPE4_UNUSED
|
||||
} OceffWipe4Type;
|
||||
|
||||
struct OceffWipe4;
|
||||
|
||||
typedef struct OceffWipe4 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x4];
|
||||
/* 0x144 */ s16 counter;
|
||||
} OceffWipe4; // size = 0x148
|
||||
|
||||
extern const ActorInit Oceff_Wipe4_InitVars;
|
||||
|
|
|
|||
Loading…
Reference in New Issue