En_M_Fire1 OK (#106)

* En_M_Fire1 OK

* Removed Null cast

* Added newline

* Address PR Review Comments

* Update src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c

Co-authored-by: Parker Burnett <burnettparker@gmail.com>

* Renamed unk190 to timer

Co-authored-by: Parker Burnett <burnettparker@gmail.com>
This commit is contained in:
Derek Hensley 2021-05-01 09:33:57 -07:00 committed by GitHub
parent 1ca8a9c24d
commit c7a1fb739f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 9 deletions

View File

@ -1289,9 +1289,9 @@ SECTIONS
ovl_En_M_Fire1 : AT(RomLocation)
{
build/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.o(.text)
build/asm/overlays/ovl_En_M_Fire1_data.o(.data)
build/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.o(.data)
build/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.o(.rodata)
build/asm/overlays/ovl_En_M_Fire1_rodata.o(.rodata)
build/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1_overlay.o(.ovl)
}
SegmentEnd = .;
SegmentSize = SegmentEnd - SegmentStart;

View File

@ -8,7 +8,6 @@ void EnMFire1_Init(Actor* thisx, GlobalContext* globalCtx);
void EnMFire1_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnMFire1_Update(Actor* thisx, GlobalContext* globalCtx);
/*
const ActorInit En_M_Fire1_InitVars = {
ACTOR_EN_M_FIRE1,
ACTORCAT_MISC,
@ -18,12 +17,55 @@ const ActorInit En_M_Fire1_InitVars = {
(ActorFunc)EnMFire1_Init,
(ActorFunc)EnMFire1_Destroy,
(ActorFunc)EnMFire1_Update,
(ActorFunc)NULL
NULL
};
*/
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_M_Fire1_0x808B5230/EnMFire1_Init.asm")
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_NONE,
AT_ON | AT_TYPE_PLAYER,
AC_NONE,
OC1_NONE,
OC2_TYPE_PLAYER,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK2,
{ 0x00000001, 0x00, 0x01 },
{ 0xF7CFFFFF, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NONE,
BUMP_NONE,
OCELEM_NONE,
},
{ 100, 100, 0, { 0, 0, 0 } },
};
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_M_Fire1_0x808B5230/EnMFire1_Destroy.asm")
void EnMFire1_Init(Actor* thisx, GlobalContext *globalCtx) {
EnMFire1* this = THIS;
s32 pad;
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_M_Fire1_0x808B5230/EnMFire1_Update.asm")
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
if (this->actor.params != 0) {
this->collider.info.toucher.dmgFlags = 0x40000;
}
}
void EnMFire1_Destroy(Actor* thisx, GlobalContext *globalCtx) {
EnMFire1* this = THIS;
Collider_DestroyCylinder(globalCtx, &this->collider);
}
void EnMFire1_Update(Actor* thisx, GlobalContext *globalCtx) {
EnMFire1* this = THIS;
s32 pad;
if (Math_StepToF(&this->timer, 1.0f, 0.2f)) {
Actor_MarkForDeath(&this->actor);
} else {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
}
}

View File

@ -7,7 +7,8 @@ struct EnMFire1;
typedef struct EnMFire1 {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x50];
/* 0x144 */ ColliderCylinder collider;
/* 0x190 */ f32 timer;
} EnMFire1; // size = 0x194
extern const ActorInit En_M_Fire1_InitVars;