EnAnd OK and documented (#1224)

* EnAnd before data

* EnAnd data

* EnAnd preliminary renaming

* EnAnd document object

* EnAnd finalize pre-PR documenting

* EnAnd style improvements

* EnAnd refactor eye textures

* EnAnd make some parts more explicit

* EnAnd cutscene refactor according to suggestions

* EnAnd style improvements
This commit is contained in:
Zakru 2023-05-15 13:51:47 +03:00 committed by GitHub
parent 389a2bf33c
commit 35c45eab70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 257 additions and 100 deletions

View File

@ -1,79 +1,80 @@
<Root>
<!-- Assets for Anju in a wedding dress -->
<File Name="object_and" Segment="6">
<Animation Name="object_and_Anim_0000C8" Offset="0xC8" /> <!-- Original name is "and_test" -->
<DList Name="object_and_DL_004670" Offset="0x4670" />
<DList Name="object_and_DL_004708" Offset="0x4708" />
<DList Name="object_and_DL_0047F0" Offset="0x47F0" />
<DList Name="object_and_DL_004998" Offset="0x4998" />
<DList Name="object_and_DL_004BE0" Offset="0x4BE0" />
<DList Name="object_and_DL_004D90" Offset="0x4D90" />
<DList Name="object_and_DL_004E50" Offset="0x4E50" />
<DList Name="object_and_DL_004F20" Offset="0x4F20" />
<DList Name="object_and_DL_005038" Offset="0x5038" />
<DList Name="object_and_DL_0056C0" Offset="0x56C0" />
<DList Name="object_and_DL_005888" Offset="0x5888" />
<DList Name="object_and_DL_005938" Offset="0x5938" />
<DList Name="object_and_DL_0059C8" Offset="0x59C8" />
<DList Name="object_and_DL_005A80" Offset="0x5A80" />
<DList Name="object_and_DL_005BA8" Offset="0x5BA8" />
<DList Name="object_and_DL_005C60" Offset="0x5C60" />
<DList Name="object_and_DL_005D80" Offset="0x5D80" />
<DList Name="object_and_DL_005F10" Offset="0x5F10" />
<DList Name="object_and_DL_005FF8" Offset="0x5FF8" />
<DList Name="object_and_DL_006240" Offset="0x6240" />
<DList Name="object_and_DL_0063D8" Offset="0x63D8" />
<DList Name="object_and_DL_0064C0" Offset="0x64C0" />
<DList Name="object_and_DL_006708" Offset="0x6708" />
<DList Name="object_and_DL_0067E0" Offset="0x67E0" />
<Texture Name="object_and_Tex_006C30" OutName="tex_006C30" Format="rgba16" Width="8" Height="8" Offset="0x6C30" />
<Texture Name="object_and_Tex_006CB0" OutName="tex_006CB0" Format="rgba16" Width="8" Height="16" Offset="0x6CB0" />
<Texture Name="object_and_Tex_006DB0" OutName="tex_006DB0" Format="rgba16" Width="16" Height="16" Offset="0x6DB0" />
<Texture Name="object_and_Tex_006FB0" OutName="tex_006FB0" Format="rgba16" Width="16" Height="16" Offset="0x6FB0" />
<Texture Name="object_and_Tex_0071B0" OutName="tex_0071B0" Format="i8" Width="8" Height="8" Offset="0x71B0" />
<Texture Name="object_and_Tex_0071F0" OutName="tex_0071F0" Format="i8" Width="32" Height="32" Offset="0x71F0" />
<Texture Name="object_and_Tex_0075F0" OutName="tex_0075F0" Format="rgba16" Width="16" Height="16" Offset="0x75F0" />
<Texture Name="object_and_Tex_0077F0" OutName="tex_0077F0" Format="rgba16" Width="32" Height="16" Offset="0x77F0" />
<Texture Name="object_and_Tex_007BF0" OutName="tex_007BF0" Format="rgba16" Width="16" Height="16" Offset="0x7BF0" />
<Texture Name="object_and_Tex_007DF0" OutName="tex_007DF0" Format="rgba16" Width="32" Height="32" Offset="0x7DF0" />
<Texture Name="object_and_Tex_0085F0" OutName="tex_0085F0" Format="rgba16" Width="32" Height="32" Offset="0x85F0" />
<Texture Name="object_and_Tex_008DF0" OutName="tex_008DF0" Format="rgba16" Width="32" Height="32" Offset="0x8DF0" />
<Texture Name="object_and_Tex_0095F0" OutName="tex_0095F0" Format="rgba16" Width="32" Height="32" Offset="0x95F0" />
<Texture Name="object_and_Tex_009DF0" OutName="tex_009DF0" Format="rgba16" Width="32" Height="16" Offset="0x9DF0" />
<Texture Name="object_and_Tex_00A1F0" OutName="tex_00A1F0" Format="rgba16" Width="32" Height="16" Offset="0xA1F0" />
<Texture Name="object_and_Tex_00A5F0" OutName="tex_00A5F0" Format="i8" Width="32" Height="64" Offset="0xA5F0" />
<Texture Name="object_and_Tex_00ADF0" OutName="tex_00ADF0" Format="i8" Width="32" Height="32" Offset="0xADF0" />
<Limb Name="object_and_Standardlimb_00B1F0" Type="Standard" EnumName="OBJECT_AND_LIMB_01" Offset="0xB1F0" />
<Limb Name="object_and_Standardlimb_00B1FC" Type="Standard" EnumName="OBJECT_AND_LIMB_02" Offset="0xB1FC" />
<Limb Name="object_and_Standardlimb_00B208" Type="Standard" EnumName="OBJECT_AND_LIMB_03" Offset="0xB208" />
<Limb Name="object_and_Standardlimb_00B214" Type="Standard" EnumName="OBJECT_AND_LIMB_04" Offset="0xB214" />
<Limb Name="object_and_Standardlimb_00B220" Type="Standard" EnumName="OBJECT_AND_LIMB_05" Offset="0xB220" />
<Limb Name="object_and_Standardlimb_00B22C" Type="Standard" EnumName="OBJECT_AND_LIMB_06" Offset="0xB22C" />
<Limb Name="object_and_Standardlimb_00B238" Type="Standard" EnumName="OBJECT_AND_LIMB_07" Offset="0xB238" />
<Limb Name="object_and_Standardlimb_00B244" Type="Standard" EnumName="OBJECT_AND_LIMB_08" Offset="0xB244" />
<Limb Name="object_and_Standardlimb_00B250" Type="Standard" EnumName="OBJECT_AND_LIMB_09" Offset="0xB250" />
<Limb Name="object_and_Standardlimb_00B25C" Type="Standard" EnumName="OBJECT_AND_LIMB_0A" Offset="0xB25C" />
<Limb Name="object_and_Standardlimb_00B268" Type="Standard" EnumName="OBJECT_AND_LIMB_0B" Offset="0xB268" />
<Limb Name="object_and_Standardlimb_00B274" Type="Standard" EnumName="OBJECT_AND_LIMB_0C" Offset="0xB274" />
<Limb Name="object_and_Standardlimb_00B280" Type="Standard" EnumName="OBJECT_AND_LIMB_0D" Offset="0xB280" />
<Limb Name="object_and_Standardlimb_00B28C" Type="Standard" EnumName="OBJECT_AND_LIMB_0E" Offset="0xB28C" />
<Limb Name="object_and_Standardlimb_00B298" Type="Standard" EnumName="OBJECT_AND_LIMB_0F" Offset="0xB298" />
<Limb Name="object_and_Standardlimb_00B2A4" Type="Standard" EnumName="OBJECT_AND_LIMB_10" Offset="0xB2A4" />
<Limb Name="object_and_Standardlimb_00B2B0" Type="Standard" EnumName="OBJECT_AND_LIMB_11" Offset="0xB2B0" />
<Limb Name="object_and_Standardlimb_00B2BC" Type="Standard" EnumName="OBJECT_AND_LIMB_12" Offset="0xB2BC" />
<Limb Name="object_and_Standardlimb_00B2C8" Type="Standard" EnumName="OBJECT_AND_LIMB_13" Offset="0xB2C8" />
<Limb Name="object_and_Standardlimb_00B2D4" Type="Standard" EnumName="OBJECT_AND_LIMB_14" Offset="0xB2D4" />
<Limb Name="object_and_Standardlimb_00B2E0" Type="Standard" EnumName="OBJECT_AND_LIMB_15" Offset="0xB2E0" />
<Limb Name="object_and_Standardlimb_00B2EC" Type="Standard" EnumName="OBJECT_AND_LIMB_16" Offset="0xB2EC" />
<Limb Name="object_and_Standardlimb_00B2F8" Type="Standard" EnumName="OBJECT_AND_LIMB_17" Offset="0xB2F8" />
<Limb Name="object_and_Standardlimb_00B304" Type="Standard" EnumName="OBJECT_AND_LIMB_18" Offset="0xB304" />
<Limb Name="object_and_Standardlimb_00B310" Type="Standard" EnumName="OBJECT_AND_LIMB_19" Offset="0xB310" />
<Skeleton Name="object_and_Skel_00B380" Type="Flex" LimbType="Standard" LimbNone="OBJECT_AND_LIMB_NONE" LimbMax="OBJECT_AND_LIMB_MAX" EnumName="ObjectAndLimb" Offset="0xB380" />
<Animation Name="object_and_Anim_00DA58" Offset="0xDA58" /> <!-- Original name is "wa_aruku" ("walk") -->
<Animation Name="object_and_Anim_00EE00" Offset="0xEE00" /> <!-- Original name is "wa_hidari" ("left; left hand side") -->
<Animation Name="object_and_Anim_00F6C4" Offset="0xF6C4" /> <!-- Original name is "wa_hidari_loop" -->
<Animation Name="object_and_Anim_00FE64" Offset="0xFE64" /> <!-- Original name is "wa_kaoage" ("raising face") -->
<Animation Name="object_and_Anim_01067C" Offset="0x1067C" /> <!-- Original name is "wa_kaoage_loop" -->
<Animation Name="object_and_Anim_011AFC" Offset="0x11AFC" /> <!-- Original name is "wa_kaoaruki" (probably a combination of "kaoage" and "aruki") -->
<Animation Name="object_and_Anim_0122D0" Offset="0x122D0" /> <!-- Original name is "wa_utumuki_loop" ("looking down") -->
<Animation Name="gAndStaticAnim" Offset="0xC8" /> <!-- Original name is "and_test" -->
<DList Name="gAndTrainDL" Offset="0x4670" />
<DList Name="gAndCalvesDL" Offset="0x4708" />
<DList Name="gAndShinsDL" Offset="0x47F0" />
<DList Name="gAndThighsDL" Offset="0x4998" />
<DList Name="gAndPelvisDL" Offset="0x4BE0" />
<DList Name="gAndLowerVeilDL" Offset="0x4D90" />
<DList Name="gAndUpperVeilDL" Offset="0x4E50" />
<DList Name="gAndVeilBaseDL" Offset="0x4F20" />
<DList Name="gAndHeadDL" Offset="0x5038" />
<DList Name="gAndBouquetDL" Offset="0x56C0" />
<DList Name="gAndCenterLeavesTipDL" Offset="0x5888" />
<DList Name="gAndCenterLeavesDL" Offset="0x5938" />
<DList Name="gAndRightLeavesTipDL" Offset="0x59C8" />
<DList Name="gAndRightLeavesDL" Offset="0x5A80" />
<DList Name="gAndLeftLeavesTipDL" Offset="0x5BA8" />
<DList Name="gAndLeftLeavesDL" Offset="0x5C60" />
<DList Name="gAndRightHandDL" Offset="0x5D80" />
<DList Name="gAndRightForearmDL" Offset="0x5F10" />
<DList Name="gAndRightUpperArmDL" Offset="0x5FF8" />
<DList Name="gAndLeftHandDL" Offset="0x6240" />
<DList Name="gAndLeftForearmDL" Offset="0x63D8" />
<DList Name="gAndLeftUpperArmDL" Offset="0x64C0" />
<DList Name="gAndSymbolDL" Offset="0x6708" />
<DList Name="gAndTorsoDL" Offset="0x67E0" />
<Texture Name="gAndSkinShadowTex" OutName="and_skin_shadow" Format="rgba16" Width="8" Height="8" Offset="0x6C30" />
<Texture Name="gAndHairTex" OutName="and_hair" Format="rgba16" Width="8" Height="16" Offset="0x6CB0" />
<Texture Name="gAndEarTex" OutName="and_ear" Format="rgba16" Width="16" Height="16" Offset="0x6DB0" />
<Texture Name="gAndFingersTex" OutName="and_fingers" Format="rgba16" Width="16" Height="16" Offset="0x6FB0" />
<Texture Name="gAndDressGradientTex" OutName="and_dress_gradient" Format="i8" Width="8" Height="8" Offset="0x71B0" />
<Texture Name="gAndDressSymbolTex" OutName="and_dress_symbol" Format="i8" Width="32" Height="32" Offset="0x71F0" />
<Texture Name="gAndPearlTex" OutName="and_pearl" Format="rgba16" Width="16" Height="16" Offset="0x75F0" />
<Texture Name="gAndLeavesTex" OutName="and_leaves" Format="rgba16" Width="32" Height="16" Offset="0x77F0" />
<Texture Name="gAndFlowerTex" OutName="and_flower" Format="rgba16" Width="16" Height="16" Offset="0x7BF0" />
<Texture Name="gAndEyeOpenTex" OutName="and_eye_open" Format="rgba16" Width="32" Height="32" Offset="0x7DF0" />
<Texture Name="gAndEyeClosingTex" OutName="and_eye_closing" Format="rgba16" Width="32" Height="32" Offset="0x85F0" />
<Texture Name="gAndEyeClosedTex" OutName="and_eye_closed" Format="rgba16" Width="32" Height="32" Offset="0x8DF0" />
<Texture Name="gAndEyeOpeningTex" OutName="and_eye_opening" Format="rgba16" Width="32" Height="32" Offset="0x95F0" />
<Texture Name="gAndMouthNeutralTex" OutName="and_mouth_neutral" Format="rgba16" Width="32" Height="16" Offset="0x9DF0" />
<Texture Name="gAndMouthSmileTex" OutName="and_mouth_smile" Format="rgba16" Width="32" Height="16" Offset="0xA1F0" />
<Texture Name="gAndDressSpotsTex" OutName="and_dress_spots" Format="i8" Width="32" Height="64" Offset="0xA5F0" />
<Texture Name="gAndDressCircleTex" OutName="and_dress_circle" Format="i8" Width="32" Height="32" Offset="0xADF0" />
<Limb Name="gAndRootLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_ROOT" Offset="0xB1F0" />
<Limb Name="gAndTorsoLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_TORSO" Offset="0xB1FC" />
<Limb Name="gAndSymbolLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_SYMBOL" Offset="0xB208" />
<Limb Name="gAndLeftUpperArmLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_LEFT_UPPER_ARM" Offset="0xB214" />
<Limb Name="gAndLeftForearmLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_LEFT_FOREARM" Offset="0xB220" />
<Limb Name="gAndLeftHandLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_LEFT_HAND" Offset="0xB22C" />
<Limb Name="gAndRightUpperArmLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_RIGHT_UPPER_ARM" Offset="0xB238" />
<Limb Name="gAndRightForearmLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_RIGHT_FOREARM" Offset="0xB244" />
<Limb Name="gAndRightHandLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_RIGHT_HAND" Offset="0xB250" />
<Limb Name="gAndBouquetLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_BOUQUET" Offset="0xB25C" />
<Limb Name="gAndLeftLeavesLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_LEFT_LEAVES" Offset="0xB268" />
<Limb Name="gAndLeftLeavesTipLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_LEFT_LEAVES_TIP" Offset="0xB274" />
<Limb Name="gAndRightLeavesLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_RIGHT_LEAVES" Offset="0xB280" />
<Limb Name="gAndRightLeavesTipLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_RIGHT_LEAVES_TIP" Offset="0xB28C" />
<Limb Name="gAndCenterLeavesLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_CENTER_LEAVES" Offset="0xB298" />
<Limb Name="gAndCenterLeavesTipLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_CENTER_LEAVES_TIP" Offset="0xB2A4" />
<Limb Name="gAndVeilBaseLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_VEIL_BASE" Offset="0xB2B0" />
<Limb Name="gAndHeadLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_HEAD" Offset="0xB2BC" />
<Limb Name="gAndUpperVeilLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_UPPER_VEIL" Offset="0xB2C8" />
<Limb Name="gAndLowerVeilLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_LOWER_VEIL" Offset="0xB2D4" />
<Limb Name="gAndPelvisLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_PELVIS" Offset="0xB2E0" />
<Limb Name="gAndThighsLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_THIGHS" Offset="0xB2EC" />
<Limb Name="gAndShinsLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_SHINS" Offset="0xB2F8" />
<Limb Name="gAndCalvesLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_CALVES" Offset="0xB304" />
<Limb Name="gAndTrainLimb" Type="Standard" EnumName="OBJECT_AND_LIMB_TRAIN" Offset="0xB310" />
<Skeleton Name="gAndSkel" Type="Flex" LimbType="Standard" LimbNone="OBJECT_AND_LIMB_NONE" LimbMax="OBJECT_AND_LIMB_MAX" EnumName="ObjectAndLimb" Offset="0xB380" />
<Animation Name="gAndWalkAnim" Offset="0xDA58" /> <!-- Original name is "wa_aruku" ("walk") -->
<Animation Name="gAndRaiseHandAnim" Offset="0xEE00" /> <!-- Original name is "wa_hidari" ("left; left hand side") -->
<Animation Name="gAndRaisedHandLoopAnim" Offset="0xF6C4" /> <!-- Original name is "wa_hidari_loop" -->
<Animation Name="gAndRaiseHeadAnim" Offset="0xFE64" /> <!-- Original name is "wa_kaoage" ("raising face") -->
<Animation Name="gAndRaisedHeadLoopAnim" Offset="0x1067C" /> <!-- Original name is "wa_kaoage_loop" -->
<Animation Name="gAndRaisedHandWalkAnim" Offset="0x11AFC" /> <!-- Original name is "wa_kaoaruki" (probably a combination of "kaoage" and "aruki") -->
<Animation Name="gAndIdleAnim" Offset="0x122D0" /> <!-- Original name is "wa_utumuki_loop" ("looking down") -->
</File>
</Root>

3
spec
View File

@ -4884,8 +4884,7 @@ beginseg
name "ovl_En_And"
compress
include "build/src/overlays/actors/ovl_En_And/z_en_and.o"
include "build/data/ovl_En_And/ovl_En_And.data.o"
include "build/data/ovl_En_And/ovl_En_And.reloc.o"
include "build/src/overlays/actors/ovl_En_And/ovl_En_And_reloc.o"
endseg
beginseg

View File

@ -10,14 +10,13 @@
#define THIS ((EnAnd*)thisx)
#define EYE_TEXTURES_COUNT 4
void EnAnd_Init(Actor* thisx, PlayState* play);
void EnAnd_Destroy(Actor* thisx, PlayState* play);
void EnAnd_Update(Actor* thisx, PlayState* play);
void EnAnd_Draw(Actor* thisx, PlayState* play);
void func_80C18C50(EnAnd* this, PlayState* play);
#if 0
ActorInit En_And_InitVars = {
ACTOR_EN_AND,
ACTORCAT_NPC,
@ -30,22 +29,163 @@ ActorInit En_And_InitVars = {
(ActorFunc)EnAnd_Draw,
};
#endif
static AnimationInfoS sAnimationInfo[] = {
{ &gAndStaticAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndRaiseHeadAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &gAndRaisedHeadLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndRaiseHandAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &gAndRaisedHandLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &gAndRaisedHandWalkAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
};
extern UNK_TYPE D_0600B380;
s32 EnAnd_ChangeAnim(EnAnd* this, s32 animIndex) {
s32 ret = false;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_And/func_80C18B90.s")
if (this->animIndex != animIndex) {
this->animIndex = animIndex;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
}
return ret;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_And/func_80C18BD8.s")
void EnAnd_Blink(EnAnd* this) {
if (DECR(this->blinkTimer) == 0) {
this->eyeTexIndex++;
if (this->eyeTexIndex >= EYE_TEXTURES_COUNT) {
this->blinkTimer = Rand_S16Offset(30, 30);
this->eyeTexIndex = 0;
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_And/func_80C18C50.s")
void EnAnd_HandleCutscene(EnAnd* this, PlayState* play) {
s32 csAnimations[] = { 0, 1, 2, 3, 5, 7 };
u16 cueType;
s32 cueChannel;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_And/EnAnd_Init.s")
if (play->csCtx.state != CS_STATE_IDLE) {
if (!this->isCutscenePlaying) {
// Cutscene is starting
this->cueId = 255;
this->isCutscenePlaying = true;
this->prevAnimIndex = this->animIndex;
}
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_565)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_565);
cueType = play->csCtx.actorCues[cueChannel]->id;
if (this->cueId != (u8)cueType) {
this->cueId = cueType;
EnAnd_ChangeAnim(this, csAnimations[cueType]);
}
switch (this->cueId) {
case 3:
case 4:
if ((this->animIndex == 3) || (this->animIndex == 5)) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
EnAnd_ChangeAnim(this, this->animIndex + 1);
}
}
break;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_And/EnAnd_Destroy.s")
default:
break;
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
}
} else if (this->isCutscenePlaying) {
this->isCutscenePlaying = false;
EnAnd_ChangeAnim(this, this->prevAnimIndex);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_And/EnAnd_Update.s")
void EnAnd_Init(Actor* thisx, PlayState* play) {
EnAnd* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_And/func_80C18ED0.s")
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gAndSkel, NULL, this->jointTable, this->morphTable,
OBJECT_AND_LIMB_MAX);
this->animIndex = -1;
EnAnd_ChangeAnim(this, 0);
Actor_SetScale(&this->actor, 0.01f);
this->actor.flags &= ~ACTOR_FLAG_1;
this->flags |= 8;
this->actionFunc = EnAnd_HandleCutscene;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_And/EnAnd_Draw.s")
void EnAnd_Destroy(Actor* thisx, PlayState* play) {
}
void EnAnd_Update(Actor* thisx, PlayState* play) {
EnAnd* this = THIS;
this->actionFunc(this, play);
SkelAnime_Update(&this->skelAnime);
EnAnd_Blink(this);
}
void EnAnd_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
EnAnd* this = THIS;
s32 stepRot;
s32 overrideRot;
stepRot = this->flags & 8 ? false : true;
overrideRot = this->flags & 2 ? true : false;
if (!stepRot) {
overrideRot = false;
}
switch (limbIndex) {
case OBJECT_AND_LIMB_HEAD:
SubS_UpdateLimb(this->headRotZ + this->torsoRotZ + 0x4000,
this->headRotY + this->torsoRotY + this->actor.shape.rot.y + 0x4000, &this->headComputedPos,
&this->headComputedRot, stepRot, overrideRot);
Matrix_Pop();
Matrix_Translate(this->headComputedPos.x, this->headComputedPos.y, this->headComputedPos.z, MTXMODE_NEW);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
Matrix_RotateYS(this->headComputedRot.y, MTXMODE_APPLY);
Matrix_RotateXS(this->headComputedRot.x, MTXMODE_APPLY);
Matrix_RotateZS(this->headComputedRot.z, MTXMODE_APPLY);
Matrix_Push();
break;
case OBJECT_AND_LIMB_TORSO:
SubS_UpdateLimb(this->torsoRotZ + 0x4000, this->torsoRotY + this->actor.shape.rot.y + 0x4000,
&this->torsoComputedPos, &this->torsoComputedRot, stepRot, overrideRot);
Matrix_Pop();
Matrix_Translate(this->torsoComputedPos.x, this->torsoComputedPos.y, this->torsoComputedPos.z, MTXMODE_NEW);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
Matrix_RotateYS(this->torsoComputedRot.y, MTXMODE_APPLY);
Matrix_RotateXS(this->torsoComputedRot.x, MTXMODE_APPLY);
Matrix_RotateZS(this->torsoComputedRot.z, MTXMODE_APPLY);
Matrix_Push();
break;
default:
break;
}
}
void EnAnd_Draw(Actor* thisx, PlayState* play) {
static TexturePtr sMouthTextures[] = { gAndMouthNeutralTex, gAndMouthSmileTex };
static TexturePtr sEyeTextures[EYE_TEXTURES_COUNT] = {
gAndEyeOpenTex,
gAndEyeClosingTex,
gAndEyeClosedTex,
gAndEyeOpeningTex,
};
EnAnd* this = THIS;
OPEN_DISPS(play->state.gfxCtx);
func_8012C28C(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex]));
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sMouthTextures[0]));
SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, NULL, NULL, EnAnd_TransformLimbDraw, &this->actor);
CLOSE_DISPS(play->state.gfxCtx);
}

View File

@ -2,6 +2,7 @@
#define Z_EN_AND_H
#include "global.h"
#include "objects/object_and/object_and.h"
struct EnAnd;
@ -9,9 +10,29 @@ typedef void (*EnAndActionFunc)(struct EnAnd*, PlayState*);
typedef struct EnAnd {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x44];
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ EnAndActionFunc actionFunc;
/* 0x18C */ char unk_18C[0x188];
/* 0x18C */ u8 cueId;
/* 0x18D */ UNK_TYPE1 pad18D[0x7];
/* 0x194 */ Vec3f headComputedPos;
/* 0x1A0 */ Vec3f torsoComputedPos;
/* 0x1AC */ Vec3s headComputedRot;
/* 0x1B2 */ Vec3s torsoComputedRot;
/* 0x1B8 */ Vec3s jointTable[OBJECT_AND_LIMB_MAX];
/* 0x254 */ Vec3s morphTable[OBJECT_AND_LIMB_MAX];
/* 0x2F0 */ u16 flags;
/* 0x2F2 */ UNK_TYPE1 pad2F2[0x4];
/* 0x2F6 */ s16 headRotZ;
/* 0x2F8 */ s16 headRotY;
/* 0x2FA */ s16 torsoRotZ;
/* 0x2FC */ s16 torsoRotY;
/* 0x2FE */ UNK_TYPE1 pad2FE[0x2];
/* 0x300 */ s16 blinkTimer;
/* 0x302 */ s16 eyeTexIndex;
/* 0x304 */ s32 animIndex;
/* 0x308 */ s32 prevAnimIndex;
/* 0x30C */ s32 isCutscenePlaying;
/* 0x310 */ UNK_TYPE1 pad310[4];
} EnAnd; // size = 0x314
#endif // Z_EN_AND_H

View File

@ -16868,13 +16868,13 @@
0x80C18928:("BgLastBwall_DoNothing",),
0x80C18938:("BgLastBwall_Update",),
0x80C1895C:("BgLastBwall_Draw",),
0x80C18B90:("func_80C18B90",),
0x80C18BD8:("func_80C18BD8",),
0x80C18C50:("func_80C18C50",),
0x80C18B90:("EnAnd_ChangeAnimation",),
0x80C18BD8:("EnAnd_Blink",),
0x80C18C50:("EnAnd_HandleCsAction",),
0x80C18DC8:("EnAnd_Init",),
0x80C18E84:("EnAnd_Destroy",),
0x80C18E94:("EnAnd_Update",),
0x80C18ED0:("func_80C18ED0",),
0x80C18ED0:("EnAnd_TransformLimbDraw",),
0x80C19084:("EnAnd_Draw",),
0x80C192A0:("func_80C192A0",),
0x80C192B0:("func_80C192B0",),

View File

@ -770,10 +770,6 @@ D_060111E8 = 0x060111E8;
D_06012478 = 0x06012478;
D_06012618 = 0x06012618;
// ovl_En_And
D_0600B380 = 0x0600B380;
// ovl_En_Bal
D_060005FC = 0x060005FC;