mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
ovl_en_hata decompiled (#844)
* z_en_hara progress * ovl_En_Hata Decompiled * PR review fixes * pr review fixes * PR review fixes * format * PR review fixes Co-authored-by: SonicDcer <noreply@github.com>
This commit is contained in:
co-authored by
SonicDcer
parent
aea2e67f79
commit
9e6bc5db8b
@@ -877,8 +877,7 @@ beginseg
|
||||
name "ovl_En_Hata"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Hata/z_en_hata.o"
|
||||
include "build/data/ovl_En_Hata/ovl_En_Hata.data.o"
|
||||
include "build/data/ovl_En_Hata/ovl_En_Hata.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Hata/ovl_En_Hata_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_en_hata.h"
|
||||
#include "objects/object_hata/object_hata.h"
|
||||
|
||||
#define FLAGS 0x00000000
|
||||
|
||||
@@ -12,10 +13,9 @@
|
||||
|
||||
void EnHata_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnHata_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnHata_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnHata_Update(Actor* thisx, GlobalContext* globalCtx2);
|
||||
void EnHata_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
const ActorInit En_Hata_InitVars = {
|
||||
ACTOR_EN_HATA,
|
||||
ACTORCAT_PROP,
|
||||
@@ -28,16 +28,74 @@ const ActorInit En_Hata_InitVars = {
|
||||
(ActorFunc)EnHata_Draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
void EnHata_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHata* this = THIS;
|
||||
s32 rand;
|
||||
f32 endFrame;
|
||||
|
||||
extern UNK_TYPE D_06002FD0;
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &object_hata_Skel_002FD0, NULL, this->jointTable, this->morphTable,
|
||||
OBJECT_HATA_LIMB_MAX);
|
||||
endFrame = Animation_GetLastFrame(&object_hata_Anim_000444);
|
||||
Animation_Change(&this->skelAnime, &object_hata_Anim_000444, 1.0f, 0.0f, endFrame, ANIMMODE_LOOP, 0.0f);
|
||||
rand = Rand_ZeroFloat(endFrame);
|
||||
this->skelAnime.curFrame = rand;
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hata_Colheader_0000C0);
|
||||
Actor_SetScale(&this->dyna.actor, 0.013f);
|
||||
this->dyna.actor.uncullZoneScale = 500.0f;
|
||||
this->dyna.actor.uncullZoneDownward = 500.0f;
|
||||
this->dyna.actor.uncullZoneForward = 2200.0f;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hata/EnHata_Init.s")
|
||||
void EnHata_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHata* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hata/EnHata_Destroy.s")
|
||||
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hata/EnHata_Update.s")
|
||||
void EnHata_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
GlobalContext* globalCtx = globalCtx2;
|
||||
EnHata* this = THIS;
|
||||
Vec3f sp34;
|
||||
f32 phi_fv0;
|
||||
s32 pad;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hata/func_8089EC68.s")
|
||||
phi_fv0 = CLAMP(globalCtx->envCtx.windSpeed / 120.0f, 0.0f, 1.0f);
|
||||
this->skelAnime.playSpeed = 2.75f * phi_fv0;
|
||||
this->skelAnime.playSpeed += 1.0f + Rand_ZeroFloat(1.25f);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hata/EnHata_Draw.s")
|
||||
sp34.x = globalCtx->envCtx.windDir.x;
|
||||
sp34.y = globalCtx->envCtx.windDir.y + ((1.0f - phi_fv0) * 240.0f);
|
||||
sp34.y = CLAMP(sp34.y, -118.0f, 118.0f);
|
||||
sp34.z = globalCtx->envCtx.windDir.z;
|
||||
|
||||
phi_fv0 = CLAMP(phi_fv0, 0.1f, 0.4f);
|
||||
Math_ApproachF(&this->unk_2A4.x, sp34.x, phi_fv0, 1000.0f);
|
||||
Math_ApproachF(&this->unk_2A4.y, sp34.y, phi_fv0, 1000.0f);
|
||||
Math_ApproachF(&this->unk_2A4.z, sp34.z, phi_fv0, 1000.0f);
|
||||
|
||||
sp34 = this->unk_2A4;
|
||||
this->unk_29C = Math_Vec3f_Pitch(&gZeroVec3f, &sp34);
|
||||
this->unk_29C = -this->unk_29C;
|
||||
this->unk_2A0 = Math_Vec3f_Yaw(&gZeroVec3f, &sp34);
|
||||
this->unk_2A0 += -0x4000;
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
s32 EnHata_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx) {
|
||||
EnHata* this = THIS;
|
||||
|
||||
if ((limbIndex == OBJECT_HATA_LIMB_04) || (limbIndex == OBJECT_HATA_LIMB_0D)) {
|
||||
rot->y += this->unk_29C;
|
||||
rot->z += this->unk_2A0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void EnHata_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnHata* this = THIS;
|
||||
|
||||
func_8012C5B0(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHata_OverrideLimbDraw, NULL,
|
||||
&this->dyna.actor);
|
||||
}
|
||||
|
||||
@@ -2,13 +2,20 @@
|
||||
#define Z_EN_HATA_H
|
||||
|
||||
#include "global.h"
|
||||
#include "objects/object_hata/object_hata.h"
|
||||
|
||||
struct EnHata;
|
||||
|
||||
typedef struct EnHata {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x16C];
|
||||
} EnHata; // size = 0x2B0
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ SkelAnime skelAnime;
|
||||
/* 0x1A0 */ Vec3s jointTable[OBJECT_HATA_LIMB_MAX];
|
||||
/* 0x21E */ Vec3s morphTable[OBJECT_HATA_LIMB_MAX];
|
||||
/* 0x29C */ s16 unk_29C;
|
||||
/* 0x29E */ UNK_TYPE1 pad_29E[2];
|
||||
/* 0x2A0 */ s16 unk_2A0;
|
||||
/* 0x2A4 */ Vec3f unk_2A4;
|
||||
} EnHata; /* size = 0x2B0 */
|
||||
|
||||
extern const ActorInit En_Hata_InitVars;
|
||||
|
||||
|
||||
@@ -5605,7 +5605,7 @@
|
||||
0x8089E8E0:("EnHata_Init",),
|
||||
0x8089E9DC:("EnHata_Destroy",),
|
||||
0x8089EA10:("EnHata_Update",),
|
||||
0x8089EC68:("func_8089EC68",),
|
||||
0x8089EC68:("EnHata_OverrideLimbDraw",),
|
||||
0x8089ECBC:("EnHata_Draw",),
|
||||
0x8089ED90:("EnZl1_Init",),
|
||||
0x8089EDA0:("EnZl1_Destroy",),
|
||||
|
||||
@@ -1186,12 +1186,6 @@ D_0600A808 = 0x0600A808;
|
||||
D_06000F9C = 0x06000F9C;
|
||||
D_06003F00 = 0x06003F00;
|
||||
|
||||
// ovl_En_Hata
|
||||
|
||||
D_060000C0 = 0x060000C0;
|
||||
D_06000444 = 0x06000444;
|
||||
D_06002FD0 = 0x06002FD0;
|
||||
|
||||
// ovl_En_Hgo
|
||||
|
||||
D_0600B644 = 0x0600B644;
|
||||
|
||||
Reference in New Issue
Block a user