bg_haka_curtain OK (#25)

* bg_haka_curtain OK

* Renamed InitVars back to its symbol name, plus converted the actor to a dynaActor like it should be

Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com>
This commit is contained in:
fullgrowngaming
2020-09-23 21:04:29 -04:00
committed by GitHub
co-authored by Kenix3
parent d612cc7196
commit a051672fd6
8 changed files with 114 additions and 24 deletions
@@ -9,7 +9,16 @@ void BgHakaCurtain_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgHakaCurtain_Update(Actor* thisx, GlobalContext* globalCtx);
void BgHakaCurtain_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
void func_80B6DC98(BgHakaCurtain* this);
void func_80B6DCAC(BgHakaCurtain* this, GlobalContext* globalCtx);
void func_80B6DCEC(BgHakaCurtain* this);
void func_80B6DD00(BgHakaCurtain* this, GlobalContext* globalCtx);
void func_80B6DD5C(BgHakaCurtain* this);
void func_80B6DD70(BgHakaCurtain* this, GlobalContext* globalCtx);
void func_80B6DD9C(BgHakaCurtain* this, GlobalContext* globalCtx);
void func_80B6DEA8(BgHakaCurtain* this, GlobalContext* globalCtx);
void func_80B6DE80(BgHakaCurtain* this);
const ActorInit Bg_Haka_Curtain_InitVars = {
ACTOR_BG_HAKA_CURTAIN,
ACTORTYPE_BG,
@@ -21,32 +30,106 @@ const ActorInit Bg_Haka_Curtain_InitVars = {
(ActorFunc)BgHakaCurtain_Update,
(ActorFunc)BgHakaCurtain_Draw
};
*/
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/BgHakaCurtain_Init.asm")
static InitChainEntry D_80B6DFA0[] = {
ICHAIN_F32(unkFC, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(unk100, 700, ICHAIN_CONTINUE),
ICHAIN_F32(unk104, 600, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/BgHakaCurtain_Destroy.asm")
extern BgMeshHeader D_06001588;
extern UNK_TYPE D_06001410;
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DC98.asm")
void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
BgHakaCurtain* this = THIS;
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DCAC.asm")
Actor_ProcessInitChain(&this->dyna.actor, D_80B6DFA0);
BcCheck3_BgActorInit(&this->dyna, 1);
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06001588);
if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) {
func_80B6DE80(this);
return;
}
func_80B6DC98(this);
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DCEC.asm")
void BgHakaCurtain_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgHakaCurtain* this = THIS;
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DD00.asm")
BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DD5C.asm")
void func_80B6DC98(BgHakaCurtain* this) {
this->actionFunc = func_80B6DCAC;
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DD70.asm")
void func_80B6DCAC(BgHakaCurtain* this, GlobalContext* globalCtx) {
if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) {
func_80B6DCEC(this);
}
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DD80.asm")
void func_80B6DCEC(BgHakaCurtain* this) {
this->actionFunc = func_80B6DD00;
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DD9C.asm")
void func_80B6DD00(BgHakaCurtain* this, GlobalContext* globalCtx) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
func_80B6DD5C(this);
return;
}
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DE80.asm")
void func_80B6DD5C(BgHakaCurtain* this) {
this->actionFunc = func_80B6DD70;
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/func_80B6DEA8.asm")
void func_80B6DD70(BgHakaCurtain* this, GlobalContext* globalCtx) {
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/BgHakaCurtain_Update.asm")
void func_80B6DD80(BgHakaCurtain* this) {
this->actionFunc = func_80B6DD9C;
this->dyna.actor.velocity.y = 0.0f;
}
GLOBAL_ASM("asm/non_matchings/ovl_Bg_Haka_Curtain_0x80B6DBE0/BgHakaCurtain_Draw.asm")
void func_80B6DD9C(BgHakaCurtain* this, GlobalContext* globalCtx) {
if (this->dyna.actor.currPosRot.pos.y < this->dyna.actor.initPosRot.pos.y + 150.0f - 30.0f) {
Lib_StepTowardsCheck_f(&this->dyna.actor.velocity.y, 1.6f, 0.12f);
} else {
Lib_StepTowardsCheck_f(&this->dyna.actor.velocity.y, 0.8f, 0.05f);
}
this->dyna.actor.currPosRot.pos.y += this->dyna.actor.velocity.y;
if (this->dyna.actor.initPosRot.pos.y + 150.0f < this->dyna.actor.currPosRot.pos.y) {
func_80B6DE80(this);
return;
}
func_800B9010(&this->dyna.actor, 0x218D);
}
void func_80B6DE80(BgHakaCurtain* this) {
this->actionFunc = func_80B6DEA8;
this->dyna.actor.currPosRot.pos.y = this->dyna.actor.initPosRot.pos.y + 150.0f;
}
void func_80B6DEA8(BgHakaCurtain* this, GlobalContext* globalCtx) {
}
void BgHakaCurtain_Update(Actor* thisx, GlobalContext* globalCtx) {
BgHakaCurtain* this = THIS;
CsCmdActorAction* actorAction;
if (func_800EE29C(globalCtx, 0x1D5)) {
actorAction = globalCtx->csCtx.actorActions[func_800EE200(globalCtx, 0x1D5)];
if (actorAction->startFrame == globalCtx->csCtx.frames && actorAction->unk0 == 2) {
func_80B6DD80(this);
}
}
this->actionFunc(this, globalCtx);
}
void BgHakaCurtain_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_800BDFC0(globalCtx, &D_06001410);
}
@@ -5,9 +5,11 @@
struct BgHakaCurtain;
typedef void (*BgHakaCurtainActionFunc)(struct BgHakaCurtain*, GlobalContext*);
typedef struct BgHakaCurtain {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x1C];
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ BgHakaCurtainActionFunc actionFunc;
} BgHakaCurtain; // size = 0x160
extern const ActorInit Bg_Haka_Curtain_InitVars;