Oceff wipe6 (#686)

* Uncorrupted; Not OK

* Merged upstream -- actually OK

* Update assets/xml/overlays/ovl_Oceff_Wipe6.xml

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* - Removed Extra 0 characters; clang-format-11

* Removed new warnings.

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Nick
2022-03-25 02:45:37 +00:00
committed by GitHub
parent 80cbdb956d
commit ce7aa87454
9 changed files with 85 additions and 14 deletions
+1 -1
View File
@@ -356,7 +356,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E01AC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E01B8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetQuakeOffset.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E01DC.s")
@@ -15,7 +15,6 @@ void OceffWipe6_Destroy(Actor* thisx, GlobalContext* globalCtx);
void OceffWipe6_Update(Actor* thisx, GlobalContext* globalCtx);
void OceffWipe6_Draw(Actor* thisx, GlobalContext* globalCtx);
#if 0
const ActorInit Oceff_Wipe6_InitVars = {
ACTOR_OCEFF_WIPE6,
ACTORCAT_ITEMACTION,
@@ -28,12 +27,75 @@ const ActorInit Oceff_Wipe6_InitVars = {
(ActorFunc)OceffWipe6_Draw,
};
#endif
#include "overlays/ovl_Oceff_Wipe6/ovl_Oceff_Wipe6.c"
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe6/OceffWipe6_Init.s")
void OceffWipe6_Init(Actor* thisx, GlobalContext* globalCtx) {
OceffWipe6* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe6/OceffWipe6_Destroy.s")
Actor_SetScale(&this->actor, 1.0f);
this->counter = 0;
this->actor.world.pos = GET_ACTIVE_CAM(globalCtx)->eye;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe6/OceffWipe6_Update.s")
void OceffWipe6_Destroy(Actor* thisx, GlobalContext* globalCtx) {
func_80115D5C(&globalCtx->state);
globalCtx->msgCtx.unk120B0 = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Oceff_Wipe6/OceffWipe6_Draw.s")
void OceffWipe6_Update(Actor* thisx, GlobalContext* globalCtx) {
OceffWipe6* this = THIS;
this->actor.world.pos = GET_ACTIVE_CAM(globalCtx)->eye;
if (this->counter < 100) {
this->counter++;
} else {
Actor_MarkForDeath(&this->actor);
}
}
void OceffWipe6_Draw(Actor* thisx, GlobalContext* globalCtx) {
OceffWipe6* this = THIS;
f32 z;
u8 alpha;
s32 i;
s32 counter;
Vec3f activeCamEye;
s32 pad;
Vec3f quakeOffset;
s32 pad2;
activeCamEye = GET_ACTIVE_CAM(globalCtx)->eye;
Camera_GetQuakeOffset(&quakeOffset, GET_ACTIVE_CAM(globalCtx));
if (this->counter < 32) {
counter = this->counter;
z = Math_SinS(counter * 0x200) * 1220.0f;
} else {
z = 1220.0f;
}
if (this->counter >= 80) {
alpha = 12 * (100 - this->counter);
} else {
alpha = 255;
}
for (i = 1; i < ARRAY_COUNT(gOceff6Vtx); i += 2) {
gOceff6Vtx[i].v.cn[3] = alpha;
}
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
Matrix_InsertTranslation(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_NormalizeXYZ(&globalCtx->billboardMtxF);
Matrix_InsertXRotation_s(0x708, MTXMODE_APPLY);
Matrix_InsertTranslation(0.0f, 0.0f, -z, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
AnimatedMat_Draw(globalCtx, ovl_Oceff_Wipe6_Matanimheader_000338);
gSPDisplayList(POLY_XLU_DISP++, gOceff6DL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -7,7 +7,7 @@ struct OceffWipe6;
typedef struct OceffWipe6 {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x4];
/* 0x144 */ s16 counter;
} OceffWipe6; // size = 0x148
extern const ActorInit Oceff_Wipe6_InitVars;