ovl_Oceff_Wipe5 OK (#1011)

* progress

* progress

* ovl_Oceff_Wipe5 OK

* Co-authored-by: Derek-Hensley hensley.derek58@gmail.com

* Co-authored-by: Synray synray@users.noreply.github.com

* Co-authored-by: darkeye darkeye@users.noreply.github.com

* pr review

* pr review

* Magic_Reset

* fixes
This commit is contained in:
SonicDcer 2022-09-30 12:37:01 -03:00 committed by GitHub
parent 6ff53e448b
commit 1be5a7d2c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 110 additions and 10 deletions

View File

@ -0,0 +1,9 @@
<Root>
<File Name="ovl_Oceff_Wipe5" BaseAddress="0x80BC7AD0" RangeStart="0x440" RangeEnd="0x1630">
<TextureAnimation Name="gOceff5TexAnim" Offset="0x448" />
<Array Name="gOceff5Vtx" Count="22" Offset="0x1450">
<Vtx/>
</Array>
<DList Name="gOceff5DL" Offset="0x15B0"/>
</File>
</Root>

4
spec
View File

@ -4363,9 +4363,7 @@ beginseg
name "ovl_Oceff_Wipe5" name "ovl_Oceff_Wipe5"
compress compress
include "build/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.o" include "build/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.o"
include "build/data/ovl_Oceff_Wipe5/ovl_Oceff_Wipe5.data.o" include "build/src/overlays/actors/ovl_Oceff_Wipe5/ovl_Oceff_Wipe5_reloc.o"
include "build/data/ovl_Oceff_Wipe5/ovl_Oceff_Wipe5.bss.o"
include "build/data/ovl_Oceff_Wipe5/ovl_Oceff_Wipe5.reloc.o"
endseg endseg
beginseg beginseg

View File

@ -15,7 +15,6 @@ void OceffWipe5_Destroy(Actor* thisx, PlayState* play);
void OceffWipe5_Update(Actor* thisx, PlayState* play); void OceffWipe5_Update(Actor* thisx, PlayState* play);
void OceffWipe5_Draw(Actor* thisx, PlayState* play); void OceffWipe5_Draw(Actor* thisx, PlayState* play);
#if 0
const ActorInit Oceff_Wipe5_InitVars = { const ActorInit Oceff_Wipe5_InitVars = {
ACTOR_OCEFF_WIPE5, ACTOR_OCEFF_WIPE5,
ACTORCAT_ITEMACTION, ACTORCAT_ITEMACTION,
@ -28,12 +27,104 @@ const ActorInit Oceff_Wipe5_InitVars = {
(ActorFunc)OceffWipe5_Draw, (ActorFunc)OceffWipe5_Draw,
}; };
#endif UNK_TYPE4 D_80BC9260;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe5/OceffWipe5_Init.s") void OceffWipe5_Init(Actor* thisx, PlayState* play) {
OceffWipe5* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe5/OceffWipe5_Destroy.s") Actor_SetScale(&this->actor, 1.0f);
this->counter = 0;
this->actor.world.pos = play->cameraPtrs[play->activeCamId]->eye;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe5/OceffWipe5_Update.s") void OceffWipe5_Destroy(Actor* thisx, PlayState* play) {
OceffWipe5* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe5/OceffWipe5_Draw.s") Magic_Reset(play);
play->msgCtx.unk120B0 = 0;
}
void OceffWipe5_Update(Actor* thisx, PlayState* play) {
OceffWipe5* 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_Wipe5/ovl_Oceff_Wipe5.c"
static u8 sPrimColors[] = {
255, 255, 200, 255, 255, 200, 200, 255, 255, 255, 255, 200, 255, 200, 255,
};
static u8 sEnvColors[] = {
50, 200, 0, 255, 50, 0, 0, 100, 255, 255, 150, 0, 255, 0, 200,
};
void OceffWipe5_Draw(Actor* thisx, PlayState* play) {
OceffWipe5* this = THIS;
f32 z;
s32 pad;
s32 i;
s32 pad2;
Vec3f activeCamEye = GET_ACTIVE_CAM(play)->eye;
Camera* cam = GET_ACTIVE_CAM(play);
Vec3f quakeOffset;
u8 alpha;
s32 colorIndex = OCEFF_WIPE5_GET_SONG_TYPE(thisx) * 3;
f32 phi_fv1 = 1220.0f;
if ((((OCEFF_WIPE5_GET_SONG_TYPE(thisx) == 2) && (play->sceneId == SCENE_LABO)) &&
((play->csCtx.currentCsIndex == 0) || (play->csCtx.currentCsIndex == 1))) &&
(play->csCtx.state != 0)) {
phi_fv1 = 1150.0f;
}
if (colorIndex >= 13) {
colorIndex = 0;
}
Camera_GetQuakeOffset(&quakeOffset, cam);
if (this->counter < 32) {
z = Math_SinS(this->counter << 9) * phi_fv1;
} else {
z = phi_fv1;
}
if (this->counter >= 80) {
alpha = 12 * (100 - this->counter);
} else {
alpha = 255;
}
for (i = 1; i < ARRAY_COUNT(gOceff5Vtx); i += 2) {
gOceff5Vtx[i].v.cn[3] = alpha;
}
OPEN_DISPS(play->state.gfxCtx);
func_8012C2DC(play->state.gfxCtx);
Matrix_Translate(activeCamEye.x + quakeOffset.x, activeCamEye.y + quakeOffset.y, activeCamEye.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, 0x80, sPrimColors[colorIndex], sPrimColors[colorIndex + 1],
sPrimColors[colorIndex + 2], 255);
gDPSetEnvColor(POLY_XLU_DISP++, sEnvColors[colorIndex], sEnvColors[colorIndex + 1], sEnvColors[colorIndex + 2],
255);
AnimatedMat_Draw(play, gOceff5TexAnim);
gSPDisplayList(POLY_XLU_DISP++, &gOceff5DL);
CLOSE_DISPS(play->state.gfxCtx);
}

View File

@ -3,11 +3,13 @@
#include "global.h" #include "global.h"
#define OCEFF_WIPE5_GET_SONG_TYPE(thisx) ((thisx)->params & 0xF)
struct OceffWipe5; struct OceffWipe5;
typedef struct OceffWipe5 { typedef struct OceffWipe5 {
/* 0x000 */ Actor actor; /* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x4]; /* 0x144 */ s16 counter;
} OceffWipe5; // size = 0x148 } OceffWipe5; // size = 0x148
extern const ActorInit Oceff_Wipe5_InitVars; extern const ActorInit Oceff_Wipe5_InitVars;