mirror of https://github.com/zeldaret/mm.git
ovl_En_Nimotsu OK and documented (#1028)
* Done-ish, looking for feedback. * Finished decompile and rename of ovl_En_Nimotsu (Bomb shop bag) * Revert unk->pad rename, leaving as unknown. * Swap the reloc include to the src version * Style/type updates from review comments * Changes from review: - Remove extra whitespace - Remove unnecessary include - Hex->Dec for alpha value. * Changes from review, Texture name and comment formatting * More changes from review, whitespace and dustTimer->timer rename.
This commit is contained in:
parent
cc52da9952
commit
084bafcfcc
|
@ -87,8 +87,8 @@
|
||||||
<Animation Name="object_boj_Anim_011F84" Offset="0x11F84" />
|
<Animation Name="object_boj_Anim_011F84" Offset="0x11F84" />
|
||||||
<Animation Name="object_boj_Anim_0128F4" Offset="0x128F4" />
|
<Animation Name="object_boj_Anim_0128F4" Offset="0x128F4" />
|
||||||
<Animation Name="object_boj_Anim_012E84" Offset="0x12E84" />
|
<Animation Name="object_boj_Anim_012E84" Offset="0x12E84" />
|
||||||
<DList Name="object_boj_DL_013380" Offset="0x13380" />
|
<DList Name="gBombShopBagDL" Offset="0x13380" />
|
||||||
<Texture Name="object_boj_TLUT_0134C0" OutName="tlut_0134C0" Format="rgba16" Width="16" Height="16" Offset="0x134C0" />
|
<Texture Name="gBombShopBagTLUT" OutName="bomb_shop_bag_tlut" Format="rgba16" Width="16" Height="16" Offset="0x134C0" />
|
||||||
<Texture Name="object_boj_Tex_0136C0" OutName="tex_0136C0" Format="ci8" Width="16" Height="16" Offset="0x136C0" />
|
<Texture Name="gBombShopBagTex" OutName="bomb_shop_bag" Format="ci8" Width="16" Height="16" Offset="0x136C0" />
|
||||||
</File>
|
</File>
|
||||||
</Root>
|
</Root>
|
||||||
|
|
3
spec
3
spec
|
@ -4567,8 +4567,7 @@ beginseg
|
||||||
name "ovl_En_Nimotsu"
|
name "ovl_En_Nimotsu"
|
||||||
compress
|
compress
|
||||||
include "build/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.o"
|
include "build/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.o"
|
||||||
include "build/data/ovl_En_Nimotsu/ovl_En_Nimotsu.data.o"
|
include "build/src/overlays/actors/ovl_En_Nimotsu/ovl_En_Nimotsu_reloc.o"
|
||||||
include "build/data/ovl_En_Nimotsu/ovl_En_Nimotsu.reloc.o"
|
|
||||||
endseg
|
endseg
|
||||||
|
|
||||||
beginseg
|
beginseg
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "z_en_nimotsu.h"
|
#include "z_en_nimotsu.h"
|
||||||
|
#include "assets/objects/object_boj/object_boj.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_10)
|
#define FLAGS (ACTOR_FLAG_10)
|
||||||
|
|
||||||
|
@ -15,7 +16,8 @@ void EnNimotsu_Destroy(Actor* thisx, PlayState* play);
|
||||||
void EnNimotsu_Update(Actor* thisx, PlayState* play);
|
void EnNimotsu_Update(Actor* thisx, PlayState* play);
|
||||||
void EnNimotsu_Draw(Actor* thisx, PlayState* play);
|
void EnNimotsu_Draw(Actor* thisx, PlayState* play);
|
||||||
|
|
||||||
#if 0
|
void EnNimotsu_UpdateCollision(EnNimotsu* this, PlayState* play);
|
||||||
|
|
||||||
const ActorInit En_Nimotsu_InitVars = {
|
const ActorInit En_Nimotsu_InitVars = {
|
||||||
ACTOR_EN_NIMOTSU,
|
ACTOR_EN_NIMOTSU,
|
||||||
ACTORCAT_PROP,
|
ACTORCAT_PROP,
|
||||||
|
@ -28,25 +30,93 @@ const ActorInit En_Nimotsu_InitVars = {
|
||||||
(ActorFunc)EnNimotsu_Draw,
|
(ActorFunc)EnNimotsu_Draw,
|
||||||
};
|
};
|
||||||
|
|
||||||
// static ColliderCylinderInit sCylinderInit = {
|
static ColliderCylinderInit sCylinderInit = {
|
||||||
static ColliderCylinderInit D_80BE1FB0 = {
|
{
|
||||||
{ COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
|
COLTYPE_NONE,
|
||||||
{ ELEMTYPE_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
|
AT_NONE,
|
||||||
|
AC_NONE,
|
||||||
|
OC1_ON | OC1_TYPE_ALL,
|
||||||
|
OC2_TYPE_2,
|
||||||
|
COLSHAPE_CYLINDER,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ELEMTYPE_UNK4,
|
||||||
|
{ 0x00000000, 0x00, 0x00 },
|
||||||
|
{ 0x00000000, 0x00, 0x00 },
|
||||||
|
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
||||||
|
BUMP_NONE,
|
||||||
|
OCELEM_ON,
|
||||||
|
},
|
||||||
{ 10, 30, 0, { 0, 0, 0 } },
|
{ 10, 30, 0, { 0, 0, 0 } },
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
void EnNimotsu_UpdateCollision(EnNimotsu* this, PlayState* play) {
|
||||||
|
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||||
|
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||||
|
Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 0.0f, 4);
|
||||||
|
}
|
||||||
|
|
||||||
extern ColliderCylinderInit D_80BE1FB0;
|
void EnNimotsu_Init(Actor* thisx, PlayState* play) {
|
||||||
|
EnNimotsu* this = THIS;
|
||||||
|
|
||||||
extern UNK_TYPE D_06013380;
|
Collider_InitCylinder(play, &this->collider);
|
||||||
|
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/func_80BE1C80.s")
|
this->timer = 10;
|
||||||
|
this->actor.gravity = -0.5f;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/EnNimotsu_Init.s")
|
Actor_SetScale(&this->actor, 0.01f);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/EnNimotsu_Destroy.s")
|
void EnNimotsu_Destroy(Actor* thisx, PlayState* play) {
|
||||||
|
EnNimotsu* this = THIS;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/EnNimotsu_Update.s")
|
Collider_DestroyCylinder(play, &this->collider);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Nimotsu/EnNimotsu_Draw.s")
|
void EnNimotsu_Update(Actor* thisx, PlayState* play) {
|
||||||
|
s32 pad;
|
||||||
|
EnNimotsu* this = THIS;
|
||||||
|
Vec3f dustPosition;
|
||||||
|
|
||||||
|
Actor_MoveWithGravity(&this->actor);
|
||||||
|
|
||||||
|
if (!(this->dustDone & 1) && (this->actor.bgCheckFlags & 1)) {
|
||||||
|
if (DECR(this->timer) == 0) {
|
||||||
|
this->dustDone |= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((play->state.frames % 3) == 0) {
|
||||||
|
dustPosition.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(15.0f);
|
||||||
|
dustPosition.y = this->actor.world.pos.y;
|
||||||
|
dustPosition.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(15.0f);
|
||||||
|
Actor_SpawnFloorDustRing(play, &this->actor, &dustPosition, 20.0f, 0, 2.0f, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EnNimotsu_UpdateCollision(this, play);
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnNimotsu_Draw(Actor* thisx, PlayState* play) {
|
||||||
|
s32 pad;
|
||||||
|
EnNimotsu* this = THIS;
|
||||||
|
Vec3f position;
|
||||||
|
Vec3f scale;
|
||||||
|
|
||||||
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
func_8012C28C(play->state.gfxCtx);
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
gSPDisplayList(POLY_OPA_DISP++, &gBombShopBagDL);
|
||||||
|
func_8012C2DC(play->state.gfxCtx);
|
||||||
|
|
||||||
|
position.x = this->actor.world.pos.x + 7.0f;
|
||||||
|
position.y = this->actor.world.pos.y;
|
||||||
|
position.z = this->actor.world.pos.z + 2.0f;
|
||||||
|
|
||||||
|
scale.x = 0.2f;
|
||||||
|
scale.y = 0.2f;
|
||||||
|
scale.z = 0.2f;
|
||||||
|
|
||||||
|
func_800BC620(&position, &scale, 255, play);
|
||||||
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@ struct EnNimotsu;
|
||||||
|
|
||||||
typedef struct EnNimotsu {
|
typedef struct EnNimotsu {
|
||||||
/* 0x000 */ Actor actor;
|
/* 0x000 */ Actor actor;
|
||||||
/* 0x144 */ char unk_144[0x98];
|
/* 0x144 */ UNK_TYPE1 unk_144[0x48];
|
||||||
|
/* 0x18C */ ColliderCylinder collider;
|
||||||
|
/* 0x1D8 */ u16 dustDone;
|
||||||
|
/* 0x1DA */ s16 timer;
|
||||||
} EnNimotsu; // size = 0x1DC
|
} EnNimotsu; // size = 0x1DC
|
||||||
|
|
||||||
extern const ActorInit En_Nimotsu_InitVars;
|
extern const ActorInit En_Nimotsu_InitVars;
|
||||||
|
|
|
@ -1542,7 +1542,7 @@ void EnSuttari_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
|
||||||
} else {
|
} else {
|
||||||
func_8012C28C(play->state.gfxCtx);
|
func_8012C28C(play->state.gfxCtx);
|
||||||
OPEN_DISPS(play->state.gfxCtx);
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_013380);
|
gSPDisplayList(POLY_OPA_DISP++, gBombShopBagDL);
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16061,7 +16061,7 @@
|
||||||
0x80BE16B4:("EnTab_PostLimbDraw",),
|
0x80BE16B4:("EnTab_PostLimbDraw",),
|
||||||
0x80BE1704:("EnTab_TransformLimbDraw",),
|
0x80BE1704:("EnTab_TransformLimbDraw",),
|
||||||
0x80BE1810:("EnTab_Draw",),
|
0x80BE1810:("EnTab_Draw",),
|
||||||
0x80BE1C80:("func_80BE1C80",),
|
0x80BE1C80:("EnNimotsu_UpdateCollision",),
|
||||||
0x80BE1CEC:("EnNimotsu_Init",),
|
0x80BE1CEC:("EnNimotsu_Init",),
|
||||||
0x80BE1D5C:("EnNimotsu_Destroy",),
|
0x80BE1D5C:("EnNimotsu_Destroy",),
|
||||||
0x80BE1D88:("EnNimotsu_Update",),
|
0x80BE1D88:("EnNimotsu_Update",),
|
||||||
|
|
|
@ -1223,10 +1223,6 @@ D_06008C40 = 0x06008C40;
|
||||||
D_060001E4 = 0x060001E4;
|
D_060001E4 = 0x060001E4;
|
||||||
D_06001EE8 = 0x06001EE8;
|
D_06001EE8 = 0x06001EE8;
|
||||||
|
|
||||||
// ovl_En_Nimotsu
|
|
||||||
|
|
||||||
D_06013380 = 0x06013380;
|
|
||||||
|
|
||||||
// ovl_En_Nwc
|
// ovl_En_Nwc
|
||||||
|
|
||||||
D_060000E8 = 0x060000E8;
|
D_060000E8 = 0x060000E8;
|
||||||
|
|
Loading…
Reference in New Issue