mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-27 06:44:55 -04:00
en_nnh OK (#42)
* Matching (last thing to figure out is ColliderInit) * nnh work * Working on collider * formatting * Fixing en_nnh * Fixed build error. The issue was a collider init, not sure what made me think it was OK before * Removed overlay helper stuff * Removed weird qemu file * Fixed collider once and for all. Co-authored-by: fullgrowngaming <fullgrowngaming@gmail.com>
This commit is contained in:
@@ -9,7 +9,11 @@ void EnNnh_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnNnh_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnNnh_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
/*
|
||||
void func_80C08828(EnNnh* this);
|
||||
void func_80C0883C(EnNnh* this, GlobalContext* globalCtx);
|
||||
void func_80C088A4(EnNnh* this);
|
||||
void func_80C088B8(EnNnh* this, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit En_Nnh_InitVars = {
|
||||
ACTOR_EN_NNH,
|
||||
ACTORTYPE_PROP,
|
||||
@@ -21,20 +25,72 @@ const ActorInit En_Nnh_InitVars = {
|
||||
(ActorFunc)EnNnh_Update,
|
||||
(ActorFunc)EnNnh_Draw
|
||||
};
|
||||
*/
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/ovl_En_Nnh_0x80C08760/EnNnh_Init.asm")
|
||||
ColCylinderInit D_80C08A00 =
|
||||
{
|
||||
{ 0x0D, 0x00, 0x09, 0x39, 0x10, 0x01 },
|
||||
{ 0x01, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
{ 20, 50, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/ovl_En_Nnh_0x80C08760/EnNnh_Destroy.asm")
|
||||
extern Gfx D_06001510[];
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/ovl_En_Nnh_0x80C08760/func_80C08828.asm")
|
||||
void EnNnh_Init(Actor *thisx, GlobalContext *globalCtx) {
|
||||
EnNnh* this = THIS;
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/ovl_En_Nnh_0x80C08760/func_80C0883C.asm")
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
Collision_InitCylinderDefault(globalCtx, &this->collider);
|
||||
Collision_InitCylinderWithData(globalCtx, &this->collider, &this->actor, &D_80C08A00);
|
||||
this->actor.unk1F = 1;
|
||||
this->actor.topPosRot.pos = this->actor.currPosRot.pos;
|
||||
this->actor.topPosRot.pos.y += 30.0f;
|
||||
func_80C08828(this);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/ovl_En_Nnh_0x80C08760/func_80C088A4.asm")
|
||||
void EnNnh_Destroy(Actor *thisx, GlobalContext *globalCtx) {
|
||||
EnNnh* this = THIS;
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/ovl_En_Nnh_0x80C08760/func_80C088B8.asm")
|
||||
Collision_FiniCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/ovl_En_Nnh_0x80C08760/EnNnh_Update.asm")
|
||||
void func_80C08828(EnNnh* this) {
|
||||
this->actionFunc = func_80C0883C;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("asm/non_matchings/ovl_En_Nnh_0x80C08760/EnNnh_Draw.asm")
|
||||
void func_80C0883C(EnNnh* this, GlobalContext* globalCtx) {
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
func_801518B0(globalCtx, 0x228U, &this->actor);
|
||||
func_80C088A4(this);
|
||||
return;
|
||||
}
|
||||
func_800B8614(&this->actor, globalCtx, 100.0f);
|
||||
}
|
||||
|
||||
void func_80C088A4(EnNnh* this) {
|
||||
this->actionFunc = func_80C088B8;
|
||||
}
|
||||
|
||||
void func_80C088B8(EnNnh* this, GlobalContext* globalCtx) {
|
||||
if (func_800B867C(&this->actor, globalCtx)) {
|
||||
func_80C08828(this);
|
||||
}
|
||||
}
|
||||
|
||||
void EnNnh_Update(Actor *thisx, GlobalContext *globalCtx) {
|
||||
EnNnh* this = THIS;
|
||||
s32 pad;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
Collision_CylinderMoveToActor(&this->actor, &this->collider);
|
||||
Collision_AddOT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
|
||||
}
|
||||
|
||||
void EnNnh_Draw(Actor *thisx, GlobalContext *globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
s32 pad;
|
||||
|
||||
func_8012C28C(gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, SysMatrix_AppendStateToPolyOpaDisp(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, D_06001510);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
|
||||
struct EnNnh;
|
||||
|
||||
typedef void (*EnNnhActionFunc)(struct EnNnh*, GlobalContext*);
|
||||
|
||||
typedef struct EnNnh {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x50];
|
||||
/* 0x144 */ ColCylinder collider;
|
||||
/* 0x190 */ EnNnhActionFunc actionFunc;
|
||||
} EnNnh; // size = 0x194
|
||||
|
||||
extern const ActorInit En_Nnh_InitVars;
|
||||
|
||||
Reference in New Issue
Block a user