* all matching

* implement feedback

* feedback

* feedback

* cleanup param macros
This commit is contained in:
retro 2021-12-06 22:28:48 +00:00 committed by GitHub
parent 5b7df3f1ca
commit 64ecb146ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 7 deletions

3
spec
View File

@ -1329,8 +1329,7 @@ beginseg
name "ovl_En_Fr"
compress
include "build/src/overlays/actors/ovl_En_Fr/z_en_fr.o"
include "build/data/ovl_En_Fr/ovl_En_Fr.data.o"
include "build/data/ovl_En_Fr/ovl_En_Fr.reloc.o"
include "build/src/overlays/actors/ovl_En_Fr/ovl_En_Fr_reloc.o"
endseg
beginseg

View File

@ -14,7 +14,6 @@ void EnFr_Init(Actor* thisx, GlobalContext* globalCtx);
void EnFr_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnFr_Update(Actor* thisx, GlobalContext* globalCtx);
#if 0
const ActorInit En_Fr_InitVars = {
ACTOR_EN_FR,
ACTORCAT_ITEMACTION,
@ -27,10 +26,27 @@ const ActorInit En_Fr_InitVars = {
(ActorFunc)NULL,
};
#endif
void EnFr_Init(Actor* thisx, GlobalContext* globalCtx) {
EnFr* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Fr/EnFr_Init.s")
if (Flags_GetSwitch(globalCtx, ENFR_GET_SWITCHFLAG(&this->actor))) {
Actor_MarkForDeath(&this->actor);
} else {
this->actor.targetMode = ENFR_GET_TARGETMODE(&this->actor);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Fr/EnFr_Destroy.s")
void EnFr_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Fr/EnFr_Update.s")
void EnFr_Update(Actor* thisx, GlobalContext* globalCtx) {
EnFr* this = THIS;
if (Flags_GetSwitch(globalCtx, ENFR_GET_SWITCHFLAG(&this->actor))) {
Actor_MarkForDeath(&this->actor);
} else if (this->actor.xyzDistToPlayerSq < SQ(IREG(29))) {
this->actor.flags &= ~0x40000000;
} else {
this->actor.flags |= 0x40000000;
}
}

View File

@ -5,6 +5,9 @@
struct EnFr;
#define ENFR_GET_SWITCHFLAG(thisx) ((thisx)->params & 0x7F)
#define ENFR_GET_TARGETMODE(thisx) (((thisx)->params >> 7) & 0xF)
typedef struct EnFr {
/* 0x000 */ Actor actor;
} EnFr; // size = 0x144