mirror of
https://github.com/zeldaret/mm.git
synced 2024-11-23 12:59:44 +00:00
EnDemoheishi OK and documented (#584)
* EnDemoheishi decomp first pass * object decomp * whitespace between declarations and statements added * various PR fixes * format for CI * various PR fixes 2 + format * missed one texture output name * fix texture docs in unrelated files * fix demoheishi shared texture naming * made object sdn properties generic for soldiers * missed outName modifications * fixed references to updated function names * reverting some texture changes to unrelated objects & use object specific names for lips and fingers textures * added textId comment * various PR comments addressed * added enum for animations * reverting halt animation naming * moved animation enum to actor class * fixed enum names * fix typo * more PR fixes * format * fix for broken build after other PR merge * format * merge fixes * isTalking * Enum - Calf to shin Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Object - Calf to shin Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * DList - Calf to Shin Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
parent
2104c16362
commit
40d1bc00fe
@ -1,66 +1,66 @@
|
||||
<Root>
|
||||
<File Name="object_sdn" Segment="6">
|
||||
<DList Name="object_sdn_DL_000630" Offset="0x630" />
|
||||
<DList Name="object_sdn_DL_000768" Offset="0x768" />
|
||||
<DList Name="object_sdn_DL_000800" Offset="0x800" />
|
||||
<Texture Name="object_sdn_Tex_000808" OutName="tex_000808" Format="i4" Width="16" Height="16" Offset="0x808" />
|
||||
<Animation Name="object_sdn_Anim_000A54" Offset="0xA54" />
|
||||
<Animation Name="object_sdn_Anim_0020D8" Offset="0x20D8" />
|
||||
<Animation Name="object_sdn_Anim_002A84" Offset="0x2A84" />
|
||||
<Animation Name="object_sdn_Anim_003380" Offset="0x3380" />
|
||||
<Animation Name="object_sdn_Anim_003BFC" Offset="0x3BFC" />
|
||||
<Animation Name="object_sdn_Anim_004770" Offset="0x4770" />
|
||||
<Animation Name="object_sdn_Anim_004AC0" Offset="0x4AC0" />
|
||||
<Animation Name="object_sdn_Anim_005320" Offset="0x5320" />
|
||||
<Animation Name="object_sdn_Anim_0057BC" Offset="0x57BC" />
|
||||
<Animation Name="object_sdn_Anim_005D28" Offset="0x5D28" />
|
||||
<Animation Name="object_sdn_Anim_0064C0" Offset="0x64C0" />
|
||||
<Animation Name="object_sdn_Anim_006C18" Offset="0x6C18" />
|
||||
<DList Name="object_sdn_DL_009EB0" Offset="0x9EB0" />
|
||||
<DList Name="object_sdn_DL_00A1A8" Offset="0xA1A8" />
|
||||
<DList Name="object_sdn_DL_00A678" Offset="0xA678" />
|
||||
<DList Name="object_sdn_DL_00A768" Offset="0xA768" />
|
||||
<DList Name="object_sdn_DL_00A9A8" Offset="0xA9A8" />
|
||||
<DList Name="object_sdn_DL_00ADE0" Offset="0xADE0" />
|
||||
<DList Name="object_sdn_DL_00AED0" Offset="0xAED0" />
|
||||
<DList Name="object_sdn_DL_00B120" Offset="0xB120" />
|
||||
<DList Name="object_sdn_DL_00B438" Offset="0xB438" />
|
||||
<DList Name="object_sdn_DL_00B5B0" Offset="0xB5B0" />
|
||||
<DList Name="object_sdn_DL_00B698" Offset="0xB698" />
|
||||
<DList Name="object_sdn_DL_00B988" Offset="0xB988" />
|
||||
<DList Name="object_sdn_DL_00BAD0" Offset="0xBAD0" />
|
||||
<DList Name="object_sdn_DL_00BBB8" Offset="0xBBB8" />
|
||||
<DList Name="object_sdn_DL_00BEB8" Offset="0xBEB8" />
|
||||
<Texture Name="object_sdn_TLUT_00C000" OutName="tlut_00C000" Format="rgba16" Width="16" Height="16" Offset="0xC000" />
|
||||
<Texture Name="object_sdn_TLUT_00C200" OutName="tlut_00C200" Format="rgba16" Width="16" Height="16" Offset="0xC200" />
|
||||
<Texture Name="object_sdn_Tex_00C400" OutName="tex_00C400" Format="ci8" Width="32" Height="32" Offset="0xC400" />
|
||||
<Texture Name="object_sdn_Tex_00C800" OutName="tex_00C800" Format="i8" Width="16" Height="16" Offset="0xC800" />
|
||||
<Texture Name="object_sdn_Tex_00C900" OutName="tex_00C900" Format="i8" Width="32" Height="32" Offset="0xC900" />
|
||||
<Texture Name="object_sdn_Tex_00CD00" OutName="tex_00CD00" Format="ci8" Width="8" Height="8" Offset="0xCD00" />
|
||||
<Texture Name="object_sdn_Tex_00CD40" OutName="tex_00CD40" Format="ci8" Width="16" Height="16" Offset="0xCD40" />
|
||||
<Texture Name="object_sdn_Tex_00CE40" OutName="tex_00CE40" Format="ci8" Width="8" Height="8" Offset="0xCE40" />
|
||||
<Texture Name="object_sdn_Tex_00CE80" OutName="tex_00CE80" Format="ci8" Width="8" Height="8" Offset="0xCE80" />
|
||||
<Texture Name="object_sdn_Tex_00CEC0" OutName="tex_00CEC0" Format="ci8" Width="16" Height="16" Offset="0xCEC0" />
|
||||
<Texture Name="object_sdn_Tex_00CFC0" OutName="tex_00CFC0" Format="ci8" Width="32" Height="32" Offset="0xCFC0" />
|
||||
<Texture Name="object_sdn_Tex_00D3C0" OutName="tex_00D3C0" Format="i8" Width="16" Height="8" Offset="0xD3C0" />
|
||||
<Texture Name="object_sdn_Tex_00D440" OutName="tex_00D440" Format="ci8" Width="16" Height="16" Offset="0xD440" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D540" Type="Standard" Offset="0xD540" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D54C" Type="Standard" Offset="0xD54C" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D558" Type="Standard" Offset="0xD558" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D564" Type="Standard" Offset="0xD564" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D570" Type="Standard" Offset="0xD570" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D57C" Type="Standard" Offset="0xD57C" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D588" Type="Standard" Offset="0xD588" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D594" Type="Standard" Offset="0xD594" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D5A0" Type="Standard" Offset="0xD5A0" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D5AC" Type="Standard" Offset="0xD5AC" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D5B8" Type="Standard" Offset="0xD5B8" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D5C4" Type="Standard" Offset="0xD5C4" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D5D0" Type="Standard" Offset="0xD5D0" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D5DC" Type="Standard" Offset="0xD5DC" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D5E8" Type="Standard" Offset="0xD5E8" />
|
||||
<Limb Name="object_sdn_Standardlimb_00D5F4" Type="Standard" Offset="0xD5F4" />
|
||||
<Skeleton Name="object_sdn_Skel_00D640" Type="Flex" LimbType="Standard" Offset="0xD640" />
|
||||
<Animation Name="object_sdn_Anim_00DC7C" Offset="0xDC7C" />
|
||||
<DList Name="gSoldierBottleDL" Offset="0x630" />
|
||||
<DList Name="gSoldierBottleContentsDL" Offset="0x768" />
|
||||
<DList Name="gSoldierBottleEmptyContentsDL" Offset="0x800" />
|
||||
<Texture Name="gSoldierBottleTex" OutName="soldier_bottle_tex" Format="i4" Width="16" Height="16" Offset="0x808" />
|
||||
<Animation Name="gSoldierStandWithHandOnChest" Offset="0xA54" />
|
||||
<Animation Name="gSoldierDrink" Offset="0x20D8" />
|
||||
<Animation Name="gSoldierCheerWithSpear" Offset="0x2A84" />
|
||||
<Animation Name="gSoldierSitAndReach" Offset="0x3380" />
|
||||
<Animation Name="gSoldierWave" Offset="0x3BFC" />
|
||||
<Animation Name="gSoldierStandUp" Offset="0x4770" />
|
||||
<Animation Name="gSoldierLookDown" Offset="0x4AC0" />
|
||||
<Animation Name="gSoldierComeUpHere" Offset="0x5320" />
|
||||
<Animation Name="object_sdn_Anim_0057BC" Offset="0x57BC" /><!-- gSoldierHaltStart? -->
|
||||
<Animation Name="object_sdn_Anim_005D28" Offset="0x5D28" /><!-- gSoldierHaltIdle? -->
|
||||
<Animation Name="object_sdn_Anim_0064C0" Offset="0x64C0" /><!-- gSoldierHaltLoop? -->
|
||||
<Animation Name="gSoldierStandHandOnHip" Offset="0x6C18" />
|
||||
<DList Name="gSoldierTorsoDL" Offset="0x9EB0" />
|
||||
<DList Name="gSoldierHeadDL" Offset="0xA1A8" />
|
||||
<DList Name="gSoldierRightShoulderDL" Offset="0xA678" />
|
||||
<DList Name="gSoldierRightForearmDL" Offset="0xA768" />
|
||||
<DList Name="gSoldierRightHandWithSpearDL" Offset="0xA9A8" />
|
||||
<DList Name="gSoldierLeftShoulderDL" Offset="0xADE0" />
|
||||
<DList Name="gSoldierLeftForearmDL" Offset="0xAED0" />
|
||||
<DList Name="gSoldierLeftHandDL" Offset="0xB120" />
|
||||
<DList Name="gSoldierPelvisDL" Offset="0xB438" />
|
||||
<DList Name="gSoldierRightThighDL" Offset="0xB5B0" />
|
||||
<DList Name="gSoldierRightShinDL" Offset="0xB698" />
|
||||
<DList Name="gSoldierRightFootDL" Offset="0xB988" />
|
||||
<DList Name="gSoldierLeftThighDL" Offset="0xBAD0" />
|
||||
<DList Name="gSoldierLeftShinDL" Offset="0xBBB8" />
|
||||
<DList Name="gSoldierLeftFootDL" Offset="0xBEB8" />
|
||||
<Texture Name="gSoldierSkinTLUT" OutName="soldier_skin_tlut" Format="rgba16" Width="16" Height="16" Offset="0xC000" />
|
||||
<Texture Name="gSoldierGeneralTLUT" OutName="soldier_general_tlut" Format="rgba16" Width="16" Height="16" Offset="0xC200" />
|
||||
<Texture Name="gSoldierArmorStrapTex" OutName="soldier_armor_strap_tex" Format="ci8" Width="32" Height="32" Offset="0xC400" />
|
||||
<Texture Name="gSoldierArmorPlate1Tex" OutName="soldier_armor_plate1_tex" Format="i8" Width="16" Height="16" Offset="0xC800" />
|
||||
<Texture Name="gSoldierArmorEmblemTex" OutName="soldier_armor_emblem_tex" Format="i8" Width="32" Height="32" Offset="0xC900" />
|
||||
<Texture Name="gSoldierSkinShadowGradient2Tex" OutName="soldier_skin_shadow_gradient2_tex" Format="ci8" Width="8" Height="8" Offset="0xCD00" />
|
||||
<Texture Name="gSoldierShortsToLegTex" OutName="soldier_shorts_to_leg_tex" Format="ci8" Width="16" Height="16" Offset="0xCD40" />
|
||||
<Texture Name="gSoldierArmorTex" OutName="soldier_armor_tex" Format="ci8" Width="8" Height="8" Offset="0xCE40" />
|
||||
<Texture Name="gSoldierSkinShadowGradient1Tex" OutName="soldier_skin_shadow_gradient1_tex" Format="ci8" Width="8" Height="8" Offset="0xCE80" />
|
||||
<Texture Name="gSoldierLipsTex" OutName="soldier_lips_tex" Format="ci8" Width="16" Height="16" Offset="0xCEC0" />
|
||||
<Texture Name="gSoldierArmorCoatOfArmsTex" OutName="soldier_armor_coat_of_arms_tex" Format="ci8" Width="32" Height="32" Offset="0xCFC0" />
|
||||
<Texture Name="gSoldierArmorPlate2Tex" OutName="soldier_armor_plate2_tex" Format="i8" Width="16" Height="8" Offset="0xD3C0" />
|
||||
<Texture Name="gSoldierFingersTex" OutName="soldier_fingers_tex" Format="ci8" Width="16" Height="16" Offset="0xD440" />
|
||||
<Limb Name="gSoldierRootLimb" Type="Standard" Offset="0xD540" />
|
||||
<Limb Name="gSoldierPelvisLimb" Type="Standard" Offset="0xD54C" />
|
||||
<Limb Name="gSoldierLeftThighLimb" Type="Standard" Offset="0xD558" />
|
||||
<Limb Name="gSoldierLeftShinLimb" Type="Standard" Offset="0xD564" />
|
||||
<Limb Name="gSoldierLeftFootLimb" Type="Standard" Offset="0xD570" />
|
||||
<Limb Name="gSoldierRightThighLimb" Type="Standard" Offset="0xD57C" />
|
||||
<Limb Name="gSoldierRightShinLimb" Type="Standard" Offset="0xD588" />
|
||||
<Limb Name="gSoldierRightFootLimb" Type="Standard" Offset="0xD594" />
|
||||
<Limb Name="gSoldierTorsoLimb" Type="Standard" Offset="0xD5A0" />
|
||||
<Limb Name="gSoldierLeftShoulderLimb" Type="Standard" Offset="0xD5AC" />
|
||||
<Limb Name="gSoldierLeftForearmLimb" Type="Standard" Offset="0xD5B8" />
|
||||
<Limb Name="gSoldierLeftHandLimb" Type="Standard" Offset="0xD5C4" />
|
||||
<Limb Name="gSoldierRightShoulderLimb" Type="Standard" Offset="0xD5D0" />
|
||||
<Limb Name="gSoldierRightForearmLimb" Type="Standard" Offset="0xD5DC" />
|
||||
<Limb Name="gSoldierRightHandWithSpearLimb" Type="Standard" Offset="0xD5E8" />
|
||||
<Limb Name="gSoldierHeadLimb" Type="Standard" Offset="0xD5F4" />
|
||||
<Skeleton Name="gSoldierSkeleton" Type="Flex" LimbType="Standard" Offset="0xD640" />
|
||||
<Animation Name="gSoldierStandAndLookDown" Offset="0xDC7C" />
|
||||
</File>
|
||||
</Root>
|
||||
|
3
spec
3
spec
@ -4956,8 +4956,7 @@ beginseg
|
||||
name "ovl_En_Demo_heishi"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.o"
|
||||
include "build/data/ovl_En_Demo_heishi/ovl_En_Demo_heishi.data.o"
|
||||
include "build/data/ovl_En_Demo_heishi/ovl_En_Demo_heishi.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_En_Demo_heishi/ovl_En_Demo_heishi_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_en_demo_heishi.h"
|
||||
#include "objects/object_sdn/object_sdn.h"
|
||||
|
||||
#define FLAGS 0x00000009
|
||||
|
||||
@ -15,10 +16,22 @@ void EnDemoheishi_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnDemoheishi_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnDemoheishi_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
void func_80BE975C(EnDemoheishi* this, GlobalContext* globalCtx);
|
||||
void func_80BE980C(EnDemoheishi* this, GlobalContext* globalCtx);
|
||||
void EnDemoheishi_ChangeAnimation(EnDemoheishi* this, s32 animIndex);
|
||||
void EnDemoheishi_SetupIdle(EnDemoheishi* this);
|
||||
void EnDemoheishi_Idle(EnDemoheishi* this, GlobalContext* globalCtx);
|
||||
void EnDemoheishi_SetupTalk(EnDemoheishi* this);
|
||||
void EnDemoheishi_Talk(EnDemoheishi* this, GlobalContext* globalCtx);
|
||||
s32 EnDemoheishi_OverrideLimbDraw(GlobalContext* globalctx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx);
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ DEMOHEISHI_ANIMATION_STAND_HAND_ON_HIP,
|
||||
/* 1 */ DEMOHEISHI_ANIMATION_CHEER_WITH_SPEAR,
|
||||
/* 2 */ DEMOHEISHI_ANIMATION_WAVE,
|
||||
/* 3 */ DEMOHEISHI_ANIMATION_SIT_AND_REACH,
|
||||
/* 4 */ DEMOHEISHI_ANIMATION_STAND_UP
|
||||
} EnDemoheishiAnimationIndex;
|
||||
|
||||
#if 0
|
||||
const ActorInit En_Demo_heishi_InitVars = {
|
||||
ACTOR_EN_DEMO_HEISHI,
|
||||
ACTORCAT_NPC,
|
||||
@ -31,37 +44,152 @@ const ActorInit En_Demo_heishi_InitVars = {
|
||||
(ActorFunc)EnDemoheishi_Draw,
|
||||
};
|
||||
|
||||
// static ColliderCylinderInit sCylinderInit = {
|
||||
static ColliderCylinderInit D_80BE9A50 = {
|
||||
{ COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
|
||||
{ ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
{
|
||||
COLTYPE_NONE,
|
||||
AT_NONE,
|
||||
AC_NONE,
|
||||
OC1_ON | OC1_TYPE_ALL,
|
||||
OC2_TYPE_2,
|
||||
COLSHAPE_CYLINDER,
|
||||
},
|
||||
{
|
||||
ELEMTYPE_UNK0,
|
||||
{ 0x00000000, 0x00, 0x00 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
||||
BUMP_NONE,
|
||||
OCELEM_ON,
|
||||
},
|
||||
{ 40, 40, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
#endif
|
||||
static u16 sTextIds[] = { 0x1473 }; // Shiro initial intro text
|
||||
|
||||
extern ColliderCylinderInit D_80BE9A50;
|
||||
void EnDemoheishi_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDemoheishi* this = THIS;
|
||||
|
||||
extern UNK_TYPE D_06003BFC;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gSoldierSkeleton, &gSoldierWave, this->jointTable,
|
||||
this->morphTable, 17);
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
this->actor.targetMode = 6;
|
||||
this->actor.gravity = -3.0f;
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit);
|
||||
EnDemoheishi_SetupIdle(this);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/EnDemoheishi_Init.s")
|
||||
void EnDemoheishi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDemoheishi* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/EnDemoheishi_Destroy.s")
|
||||
Collider_DestroyCylinder(globalCtx, &this->colliderCylinder);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE95EC.s")
|
||||
void EnDemoheishi_ChangeAnimation(EnDemoheishi* this, s32 animIndex) {
|
||||
static AnimationHeader* sAnimations[] = {
|
||||
&gSoldierStandHandOnHip, &gSoldierCheerWithSpear, &gSoldierWave, &gSoldierSitAndReach, &gSoldierStandUp,
|
||||
};
|
||||
static u8 sAnimModes[] = {
|
||||
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP,
|
||||
ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE9678.s")
|
||||
this->animIndex = animIndex;
|
||||
this->frameCount = Animation_GetLastFrame(sAnimations[animIndex]);
|
||||
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->frameCount,
|
||||
sAnimModes[this->animIndex], -10.0f);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE970C.s")
|
||||
void EnDemoheishi_SetHeadRotation(EnDemoheishi* this) {
|
||||
s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
|
||||
s32 absYawDiff = ABS_ALT(yawDiff);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE975C.s")
|
||||
this->headRotXTarget = 0;
|
||||
if ((this->actor.xzDistToPlayer < 200.0f) && (absYawDiff < 0x4E20)) {
|
||||
this->headRotXTarget = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
|
||||
if (this->headRotXTarget > 0x2710) {
|
||||
this->headRotXTarget = 0x2710;
|
||||
} else if (this->headRotXTarget < -0x2710) {
|
||||
this->headRotXTarget = -0x2710;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE97F0.s")
|
||||
void EnDemoheishi_SetupIdle(EnDemoheishi* this) {
|
||||
EnDemoheishi_ChangeAnimation(this, DEMOHEISHI_ANIMATION_STAND_HAND_ON_HIP);
|
||||
this->textIdIndex = 0;
|
||||
this->actor.textId = sTextIds[this->textIdIndex];
|
||||
this->isTalking = false;
|
||||
this->actionFunc = EnDemoheishi_Idle;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE980C.s")
|
||||
void EnDemoheishi_Idle(EnDemoheishi* this, GlobalContext* globalCtx) {
|
||||
s32 absYawDiff;
|
||||
s16 yawDiff;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/EnDemoheishi_Update.s")
|
||||
this->actor.flags &= ~ACTOR_FLAG_8000000;
|
||||
yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
|
||||
absYawDiff = ABS_ALT(yawDiff);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE9974.s")
|
||||
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
|
||||
EnDemoheishi_SetupTalk(this);
|
||||
} else if (absYawDiff <= 0x4BB8) {
|
||||
func_800B8614(&this->actor, globalCtx, 70.0f);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/EnDemoheishi_Draw.s")
|
||||
void EnDemoheishi_SetupTalk(EnDemoheishi* this) {
|
||||
this->isTalking = true;
|
||||
this->actionFunc = EnDemoheishi_Talk;
|
||||
}
|
||||
|
||||
void EnDemoheishi_Talk(EnDemoheishi* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
|
||||
func_801477B4(globalCtx);
|
||||
EnDemoheishi_SetupIdle(this);
|
||||
}
|
||||
}
|
||||
|
||||
void EnDemoheishi_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
EnDemoheishi* this = THIS;
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
this->actionFunc(this, globalCtx);
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
EnDemoheishi_SetHeadRotation(this);
|
||||
|
||||
Actor_SetFocus(&this->actor, 60.0f);
|
||||
Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 0xBB8, 0);
|
||||
Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 0x3E8, 0);
|
||||
Collider_UpdateCylinder(&this->actor, &this->colliderCylinder);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base);
|
||||
}
|
||||
|
||||
s32 EnDemoheishi_OverrideLimbDraw(GlobalContext* globalctx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx) {
|
||||
EnDemoheishi* this = THIS;
|
||||
|
||||
if (limbIndex == DEMOHEISHI_LIMB_HEAD) {
|
||||
rot->x += this->headRotX;
|
||||
rot->y += this->headRotY;
|
||||
rot->z += this->headRotZ;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void EnDemoheishi_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDemoheishi* this = THIS;
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnDemoheishi_OverrideLimbDraw, NULL, &this->actor);
|
||||
}
|
||||
|
@ -7,12 +7,46 @@ struct EnDemoheishi;
|
||||
|
||||
typedef void (*EnDemoheishiActionFunc)(struct EnDemoheishi*, GlobalContext*);
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ DEMOHEISHI_LIMB_NONE,
|
||||
/* 1 */ DEMOHEISHI_LIMB_ROOT,
|
||||
/* 2 */ DEMOHEISHI_LIMB_PELVIS,
|
||||
/* 3 */ DEMOHEISHI_LIMB_LEFT_THIGH,
|
||||
/* 4 */ DEMOHEISHI_LIMB_LEFT_SHIN,
|
||||
/* 5 */ DEMOHEISHI_LIMB_LEFT_FOOT,
|
||||
/* 6 */ DEMOHEISHI_LIMB_RIGHT_THIGH,
|
||||
/* 7 */ DEMOHEISHI_LIMB_RIGHT_SHIN,
|
||||
/* 8 */ DEMOHEISHI_LIMB_RIGHT_FOOT,
|
||||
/* 9 */ DEMOHEISHI_LIMB_TORSO,
|
||||
/* 10 */ DEMOHEISHI_LIMB_LEFT_SHOULDER,
|
||||
/* 11 */ DEMOHEISHI_LIMB_LEFT_FOREARM,
|
||||
/* 12 */ DEMOHEISHI_LIMB_LEFT_HAND,
|
||||
/* 13 */ DEMOHEISHI_LIMB_RIGHT_SHOULDER,
|
||||
/* 14 */ DEMOHEISHI_LIMB_RIGHT_FOREARM,
|
||||
/* 15 */ DEMOHEISHI_LIMB_RIGHT_HAND_WITH_SPEAR,
|
||||
/* 16 */ DEMOHEISHI_LIMB_HEAD,
|
||||
/* 17 */ DEMOHEISHI_LIMB_MAX
|
||||
} EnDemoheishiLimbs;
|
||||
|
||||
typedef struct EnDemoheishi {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x0144 */ char unk_144[0x110];
|
||||
/* 0x0254 */ EnDemoheishiActionFunc actionFunc;
|
||||
/* 0x0258 */ char unk_258[0x68];
|
||||
} EnDemoheishi; // size = 0x2C0
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s jointTable[DEMOHEISHI_LIMB_MAX];
|
||||
/* 0x1EE */ Vec3s morphTable[DEMOHEISHI_LIMB_MAX];
|
||||
/* 0x254 */ EnDemoheishiActionFunc actionFunc;
|
||||
/* 0x258 */ s16 headRotY;
|
||||
/* 0x25A */ s16 headRotX;
|
||||
/* 0x25C */ s16 headRotZ;
|
||||
/* 0x25E */ s16 headRotYTarget;
|
||||
/* 0x260 */ s16 headRotXTarget;
|
||||
/* 0x262 */ s16 headRotZTarget;
|
||||
/* 0x264 */ s32 animIndex;
|
||||
/* 0x268 */ s16 timer;
|
||||
/* 0x26C */ f32 frameCount;
|
||||
/* 0x270 */ s16 isTalking;
|
||||
/* 0x272 */ s16 textIdIndex;
|
||||
/* 0x274 */ ColliderCylinder colliderCylinder;
|
||||
} EnDemoheishi; //size = 0x2C0
|
||||
|
||||
extern const ActorInit En_Demo_heishi_InitVars;
|
||||
|
||||
|
@ -38,7 +38,7 @@ void EnEndingHero4_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.targetMode = 6;
|
||||
this->actor.gravity = -3.0f;
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_sdn_Skel_00D640, &object_sdn_Anim_002A84, this->jointTable,
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gSoldierSkeleton, &gSoldierCheerWithSpear, this->jointTable,
|
||||
this->morphTable, 17);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
|
||||
func_80C23748(this);
|
||||
|
@ -38,13 +38,13 @@ const ActorInit En_Ending_Hero6_InitVars = {
|
||||
|
||||
static FlexSkeletonHeader* sSkeletons[] = {
|
||||
&object_dt_Skel_00B0CC, &object_bai_Skel_007908, &object_toryo_Skel_007150,
|
||||
&object_sdn_Skel_00D640, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850,
|
||||
&gSoldierSkeleton, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850,
|
||||
&object_daiku_Skel_00A850, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850,
|
||||
};
|
||||
|
||||
static AnimationHeader* sAnimations[] = {
|
||||
&object_dt_Anim_000BE0, &object_bai_Anim_0011C0, &object_toryo_Anim_000E50,
|
||||
&object_sdn_Anim_002A84, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0,
|
||||
&gSoldierCheerWithSpear, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0,
|
||||
&object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0,
|
||||
};
|
||||
|
||||
|
@ -16170,14 +16170,14 @@
|
||||
0x80BE93D8:("EnHeishi_Draw",),
|
||||
0x80BE9510:("EnDemoheishi_Init",),
|
||||
0x80BE95C0:("EnDemoheishi_Destroy",),
|
||||
0x80BE95EC:("func_80BE95EC",),
|
||||
0x80BE9678:("func_80BE9678",),
|
||||
0x80BE970C:("func_80BE970C",),
|
||||
0x80BE975C:("func_80BE975C",),
|
||||
0x80BE97F0:("func_80BE97F0",),
|
||||
0x80BE980C:("func_80BE980C",),
|
||||
0x80BE95EC:("EnDemoheishi_ChangeAnimation",),
|
||||
0x80BE9678:("EnDemoheishi_SetHeadRotation",),
|
||||
0x80BE970C:("EnDemoheishi_SetupIdle",),
|
||||
0x80BE975C:("EnDemoheishi_Idle",),
|
||||
0x80BE97F0:("EnDemoheishi_SetupTalk",),
|
||||
0x80BE980C:("EnDemoheishi_Talk",),
|
||||
0x80BE9864:("EnDemoheishi_Update",),
|
||||
0x80BE9974:("func_80BE9974",),
|
||||
0x80BE9974:("EnDemoheishi_OverrideLimbDraw",),
|
||||
0x80BE99CC:("EnDemoheishi_Draw",),
|
||||
0x80BE9B20:("EnDt_Init",),
|
||||
0x80BE9C48:("EnDt_Destroy",),
|
||||
|
@ -16195,10 +16195,10 @@
|
||||
0x80BE947C:("D_80BE947C","UNK_TYPE1","",0x1),
|
||||
0x80BE9490:("D_80BE9490","UNK_TYPE1","",0x1),
|
||||
0x80BE9A30:("En_Demo_heishi_InitVars","UNK_TYPE1","",0x1),
|
||||
0x80BE9A50:("D_80BE9A50","UNK_TYPE1","",0x1),
|
||||
0x80BE9A7C:("D_80BE9A7C","UNK_TYPE1","",0x1),
|
||||
0x80BE9A80:("D_80BE9A80","UNK_TYPE1","",0x1),
|
||||
0x80BE9A94:("D_80BE9A94","UNK_TYPE1","",0x1),
|
||||
0x80BE9A50:("sCylinderInit","UNK_TYPE1","",0x1),
|
||||
0x80BE9A7C:("sTextIds","UNK_TYPE1","",0x1),
|
||||
0x80BE9A80:("sAnimations","UNK_TYPE1","",0x1),
|
||||
0x80BE9A94:("sAnimModes","UNK_TYPE1","",0x1),
|
||||
0x80BEB1B0:("En_Dt_InitVars","UNK_TYPE1","",0x1),
|
||||
0x80BEB1D0:("D_80BEB1D0","UNK_TYPE1","",0x1),
|
||||
0x80BEB208:("D_80BEB208","UNK_TYPE1","",0x1),
|
||||
|
Loading…
Reference in New Issue
Block a user