mirror of https://github.com/zeldaret/mm.git
ovl_Oceff_Wipe OK (#1008)
* ovl_Oceff_Wipe Decompiled * format * format * pr review * renaming * renamings * renamings * magic * pr review
This commit is contained in:
parent
1af942ae12
commit
6ff53e448b
|
|
@ -0,0 +1,10 @@
|
|||
<Root>
|
||||
<File Name="ovl_Oceff_Wipe" BaseAddress="0x809764B0" RangeStart="0x4F0" RangeEnd="0xCB0">
|
||||
<Texture Name="sSongOfTimeEffectTex" OutName="song_of_time_effect" Format="i8" Width="32" Height="32" Offset="0x4F0"/>
|
||||
<Array Name="sSongOfTimeFrustumVtx" Count="32" Offset="0x8F0">
|
||||
<Vtx/>
|
||||
</Array>
|
||||
<DList Name="sSongOfTimeFrustumMaterialDL" Offset="0xB70"/>
|
||||
<DList Name="sSongOfTimeFrustumModelDL" Offset="0xBF8"/>
|
||||
</File>
|
||||
</Root>
|
||||
4
spec
4
spec
|
|
@ -1730,9 +1730,7 @@ beginseg
|
|||
name "ovl_Oceff_Wipe"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.o"
|
||||
include "build/data/ovl_Oceff_Wipe/ovl_Oceff_Wipe.data.o"
|
||||
include "build/data/ovl_Oceff_Wipe/ovl_Oceff_Wipe.bss.o"
|
||||
include "build/data/ovl_Oceff_Wipe/ovl_Oceff_Wipe.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Oceff_Wipe/ovl_Oceff_Wipe_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ void OceffWipe_Destroy(Actor* thisx, PlayState* play);
|
|||
void OceffWipe_Update(Actor* thisx, PlayState* play);
|
||||
void OceffWipe_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
#if 0
|
||||
const ActorInit Oceff_Wipe_InitVars = {
|
||||
ACTOR_OCEFF_WIPE,
|
||||
ACTORCAT_ITEMACTION,
|
||||
|
|
@ -28,12 +27,100 @@ const ActorInit Oceff_Wipe_InitVars = {
|
|||
(ActorFunc)OceffWipe_Draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
UNK_TYPE4 D_80977200;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe/OceffWipe_Init.s")
|
||||
void OceffWipe_Init(Actor* thisx, PlayState* play) {
|
||||
OceffWipe* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe/OceffWipe_Destroy.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_Wipe/OceffWipe_Update.s")
|
||||
void OceffWipe_Destroy(Actor* thisx, PlayState* play) {
|
||||
OceffWipe* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe/OceffWipe_Draw.s")
|
||||
Magic_Reset(play);
|
||||
play->msgCtx.unk120B0 = 0;
|
||||
}
|
||||
|
||||
void OceffWipe_Update(Actor* thisx, PlayState* play) {
|
||||
OceffWipe* this = THIS;
|
||||
|
||||
this->actor.world.pos = GET_ACTIVE_CAM(play)->eye;
|
||||
if (this->counter < 100) {
|
||||
this->counter++;
|
||||
} else {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
#include "assets/overlays/ovl_Oceff_Wipe/ovl_Oceff_Wipe.c"
|
||||
|
||||
static u8 sAlphaIndices[] = {
|
||||
0x01, 0x10, 0x22, 0x01, 0x20, 0x12, 0x01, 0x20, 0x12, 0x01,
|
||||
0x10, 0x22, 0x01, 0x20, 0x12, 0x01, 0x12, 0x21, 0x01, 0x02,
|
||||
};
|
||||
|
||||
void OceffWipe_Draw(Actor* thisx, PlayState* play) {
|
||||
u32 scroll = play->state.frames & 0xFF;
|
||||
OceffWipe* this = THIS;
|
||||
f32 z;
|
||||
s32 pad;
|
||||
u8 alphaTable[3];
|
||||
s32 i;
|
||||
Vec3f eye = GET_ACTIVE_CAM(play)->eye;
|
||||
Vtx* vtxPtr;
|
||||
Vec3f quakeOffset;
|
||||
|
||||
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(play));
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if (this->counter < 32) {
|
||||
z = Math_SinS(this->counter << 9) * 1360.0f;
|
||||
} else {
|
||||
z = 1360.0f;
|
||||
}
|
||||
|
||||
if (this->counter >= 80) {
|
||||
alphaTable[0] = 0;
|
||||
alphaTable[1] = (100 - this->counter) * 8;
|
||||
alphaTable[2] = (100 - this->counter) * 12;
|
||||
} else {
|
||||
alphaTable[0] = 0;
|
||||
alphaTable[1] = 160;
|
||||
alphaTable[2] = 255;
|
||||
}
|
||||
|
||||
for (i = 0; i < 20; i++) {
|
||||
vtxPtr = sSongOfTimeFrustumVtx;
|
||||
vtxPtr[i * 2 + 0].v.cn[3] = alphaTable[(sAlphaIndices[i] & 0xF0) >> 4];
|
||||
vtxPtr[i * 2 + 1].v.cn[3] = alphaTable[sAlphaIndices[i] & 0xF];
|
||||
}
|
||||
|
||||
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_WIPE_ZL) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 255, 255, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 150, 255, 128);
|
||||
} else {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 100, 0, 255, 128);
|
||||
}
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, sSongOfTimeFrustumMaterialDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0 - scroll, scroll * -2, 32,
|
||||
32, 1, 0 - scroll, scroll * -2, 32, 32));
|
||||
gSPDisplayList(POLY_XLU_DISP++, sSongOfTimeFrustumModelDL);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,16 @@
|
|||
|
||||
#include "global.h"
|
||||
|
||||
typedef enum {
|
||||
/* 0x0 */ OCEFF_WIPE_ZL,
|
||||
/* 0x1 */ OCEFF_WIPE_SOT
|
||||
} OceffWipeType;
|
||||
|
||||
struct OceffWipe;
|
||||
|
||||
typedef struct OceffWipe {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x4];
|
||||
/* 0x144 */ s16 counter;
|
||||
} OceffWipe; // size = 0x148
|
||||
|
||||
extern const ActorInit Oceff_Wipe_InitVars;
|
||||
|
|
|
|||
Loading…
Reference in New Issue