diff --git a/assets/xml/objects/object_ma2.xml b/assets/xml/objects/object_ma2.xml index a61eff4e08..5e642f3409 100644 --- a/assets/xml/objects/object_ma2.xml +++ b/assets/xml/objects/object_ma2.xml @@ -1,85 +1,101 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c index 0cfc9a543d..2f498f20c2 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -268,16 +268,15 @@ static TexturePtr sRomaniMouthTextures[] = { static s8 D_80B4E968 = 0; -static TexturePtr D_80B4E96C[] = { - object_ma2_Tex_011AD8, object_ma2_Tex_0122D8, object_ma2_Tex_012AD8, - object_ma2_Tex_0132D8, object_ma2_Tex_013AD8, object_ma2_Tex_0142D8, +static TexturePtr sCremiaEyeTextures[] = { + gCremiaEyeOpenTex, gCremiaEyeHalfTex, gCremiaEyeClosedTex, gCremiaEyeHappyTex, gCremiaEyeAngryTex, gCremiaEyeSadTex, }; -static TexturePtr D_80B4E984[] = { - object_ma2_Tex_014AD8, - object_ma2_Tex_014ED8, - object_ma2_Tex_0152D8, - object_ma2_Tex_0156D8, +static TexturePtr sCremiaMouthTextures[] = { + gCremiaMouthNormalTex, + gCremiaMouthSlightSmileTex, + gCremiaMouthFrownTex, + gCremiaMouthHangingOpenTex, }; static s8 D_80B4E994 = 0; @@ -1214,11 +1213,11 @@ void func_80B44FEC(void) { if (!D_80B4E994) { D_80B4E994 = true; - for (i = 0, iter = D_80B4E96C; i < ARRAY_COUNT(D_80B4E96C); i++, iter++) { + for (i = 0, iter = sCremiaEyeTextures; i < ARRAY_COUNT(sCremiaEyeTextures); i++, iter++) { *iter = Lib_SegmentedToVirtual(*iter); } - for (i = 0, iter = D_80B4E984; i < ARRAY_COUNT(D_80B4E984); i++, iter++) { + for (i = 0, iter = sCremiaMouthTextures; i < ARRAY_COUNT(sCremiaMouthTextures); i++, iter++) { *iter = Lib_SegmentedToVirtual(*iter); } } @@ -3721,7 +3720,7 @@ void func_80B4BA84(Actor* thisx, PlayState* play) { void func_80B4BBE0(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; - Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_016720, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &gCremiaWalkAnim, -6.0f); substruct->unk26.x = 0; substruct->unk26.y = 0; substruct->unk26.z = 0; @@ -3802,7 +3801,7 @@ void func_80B4BC4C(EnInvadepoh* this, PlayState* play) { void func_80B4BFFC(EnInvadepoh* this) { this->behaviorInfo.unk30 = 0.08f; this->behaviorInfo.unk2C = 2000; - Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_00A174, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &gCremiaIdleAnim, -6.0f); this->behaviorInfo.unk4C = 0; this->actionFunc = func_80B4C058; } @@ -3834,7 +3833,7 @@ void func_80B4C058(EnInvadepoh* this, PlayState* play) { void func_80B4C1BC(EnInvadepoh* this) { this->behaviorInfo.unk30 = 0.08f; this->behaviorInfo.unk2C = 2000; - Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_00A174, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &gCremiaIdleAnim, -6.0f); this->behaviorInfo.unk4C = 0; this->actionFunc = func_80B4C218; } @@ -3874,8 +3873,8 @@ void func_80B4C3A0(Actor* thisx, PlayState* play) { this->actor.objBankIndex = this->bankIndex; Actor_SetObjectDependency(play, &this->actor); func_80B44FEC(); - SkelAnime_InitFlex(play, &this->skelAnime, &object_ma2_Skel_015C28, &object_ma2_Anim_016720, this->jointTable, - this->morphTable, 22); + SkelAnime_InitFlex(play, &this->skelAnime, &gCremiaSkel, &gCremiaWalkAnim, this->jointTable, this->morphTable, + CREMIA_LIMB_MAX); func_80B45C04(&this->behaviorInfo, D_80B4EBDC, 1, D_80B4EC08, 0, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f); this->actor.textId = 0x33CD; if (currentTime < 0xD5A0) { @@ -4598,8 +4597,8 @@ void func_80B4E7BC(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); func_8012C28C(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x09, D_80B4E984[this->behaviorInfo.unk10.unkF]); - gSPSegment(POLY_OPA_DISP++, 0x08, D_80B4E96C[this->behaviorInfo.unk0.unkF]); + gSPSegment(POLY_OPA_DISP++, 0x09, sCremiaMouthTextures[this->behaviorInfo.unk10.unkF]); + gSPSegment(POLY_OPA_DISP++, 0x08, sCremiaEyeTextures[this->behaviorInfo.unk0.unkF]); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80B4E6E4, func_80B4E784, &this->actor); CLOSE_DISPS(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index 306c9f7a31..48817003ab 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -5,7 +5,7 @@ */ #include "z_en_ma_yto.h" -#include "objects/object_ma2/object_ma2.h" +#include "overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_100000 | ACTOR_FLAG_2000000) @@ -106,30 +106,41 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { }; static AnimationSpeedInfo sAnimationInfo[] = { - { &object_ma2_Anim_00A174, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_00A174, 1.0f, ANIMMODE_LOOP, -6.0f }, // - { &object_ma2_Anim_00AF7C, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_ma2_Anim_00AF7C, 1.0f, ANIMMODE_ONCE, -6.0f }, // - { &object_ma2_Anim_000CC0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_000CC0, 1.0f, ANIMMODE_LOOP, -6.0f }, // - { &object_ma2_Anim_016720, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_016720, 1.0f, ANIMMODE_LOOP, -8.0f }, // - { &object_ma2_Anim_005314, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_005314, 1.0f, ANIMMODE_LOOP, -8.0f }, // - { &object_ma2_Anim_0093E8, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0093E8, 1.0f, ANIMMODE_LOOP, -10.0f }, // - { &object_ma2_Anim_007E28, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_007E28, 1.0f, ANIMMODE_LOOP, -8.0f }, // - { &object_ma2_Anim_0070EC, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0070EC, 1.0f, ANIMMODE_LOOP, -8.0f }, // - { &object_ma2_Anim_003D54, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_003D54, 1.0f, ANIMMODE_LOOP, -8.0f }, // - { &object_ma2_Anim_001FD0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_001FD0, 1.0f, ANIMMODE_LOOP, -8.0f }, // - { &object_ma2_Anim_0030B4, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0030B4, 1.0f, ANIMMODE_LOOP, -8.0f }, // - { &object_ma2_Anim_004370, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_004370, 1.0f, ANIMMODE_LOOP, -8.0f }, // + { &gCremiaIdleAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaIdleAnim, 1.0f, ANIMMODE_LOOP, -6.0f }, + { &gCremiaSpreadArmsStartAnim, 1.0f, ANIMMODE_ONCE, 0.0f }, + { &gCremiaSpreadArmsStartAnim, 1.0f, ANIMMODE_ONCE, -6.0f }, + { &gCremiaSpreadArmsLoopAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaSpreadArmsLoopAnim, 1.0f, ANIMMODE_LOOP, -6.0f }, + { &gCremiaWalkAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaWalkAnim, 1.0f, ANIMMODE_LOOP, -8.0f }, + { &gCremiaThinkAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaThinkAnim, 1.0f, ANIMMODE_LOOP, -8.0f }, + { &gCremiaPetCowAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaPetCowAnim, 1.0f, ANIMMODE_LOOP, -10.0f }, + { &gCremiaSittingPetCowAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaSittingPetCowAnim, 1.0f, ANIMMODE_LOOP, -8.0f }, + { &gCremiaSittingAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaSittingAnim, 1.0f, ANIMMODE_LOOP, -8.0f }, + { &gCremiaSittingLookDownAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaSittingLookDownAnim, 1.0f, ANIMMODE_LOOP, -8.0f }, + { &gCremiaHugStartAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaHugStartAnim, 1.0f, ANIMMODE_LOOP, -8.0f }, + { &gCremiaHugLoopAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaHugLoopAnim, 1.0f, ANIMMODE_LOOP, -8.0f }, + { &gCremiaClapAnim, 1.0f, ANIMMODE_LOOP, 0.0f }, + { &gCremiaClapAnim, 1.0f, ANIMMODE_LOOP, -8.0f }, }; static TexturePtr sMouthTextures[] = { - object_ma2_Tex_014AD8, - object_ma2_Tex_014ED8, - object_ma2_Tex_0152D8, - object_ma2_Tex_0156D8, + gCremiaMouthNormalTex, + gCremiaMouthSlightSmileTex, + gCremiaMouthFrownTex, + gCremiaMouthHangingOpenTex, }; static TexturePtr sEyesTextures[] = { - object_ma2_Tex_011AD8, object_ma2_Tex_0122D8, object_ma2_Tex_012AD8, - object_ma2_Tex_0132D8, object_ma2_Tex_013AD8, object_ma2_Tex_0142D8, + gCremiaEyeOpenTex, gCremiaEyeHalfTex, gCremiaEyeClosedTex, gCremiaEyeHappyTex, gCremiaEyeAngryTex, gCremiaEyeSadTex, }; void EnMaYto_Init(Actor* thisx, PlayState* play) { @@ -157,8 +168,7 @@ void EnMaYto_Init(Actor* thisx, PlayState* play) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_ma2_Skel_015C28, NULL, this->jointTable, this->morphTable, - MA2_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gCremiaSkel, NULL, this->jointTable, this->morphTable, CREMIA_LIMB_MAX); EnMaYto_InitAnimation(this, play); Collider_InitCylinder(play, &this->collider); @@ -432,7 +442,7 @@ void EnMaYto_DefaultDialogueHandler(EnMaYto* this, PlayState* play) { } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x3000, 0x100); - if (this->textId == 0x3395 && this->skelAnime.animation == &object_ma2_Anim_00AF7C && + if (this->textId == 0x3395 && this->skelAnime.animation == &gCremiaSpreadArmsStartAnim && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { EnMaYto_ChangeAnim(this, 4); } @@ -1049,7 +1059,7 @@ void EnMaYto_WarmFuzzyFeelingCs(EnMaYto* this, PlayState* play) { } Cutscene_ActorTranslateAndYaw(&this->actor, play, csActionIndex); - if (D_80B915F0 == 2 && this->skelAnime.animation == &object_ma2_Anim_001FD0 && + if (D_80B915F0 == 2 && this->skelAnime.animation == &gCremiaHugStartAnim && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { EnMaYto_ChangeAnim(this, 20); } @@ -1425,20 +1435,19 @@ s32 EnMaYto_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* EnMaYto* this = THIS; Vec3s sp4; - if (limbIndex == MA2_LIMB_HEAD) { + if (limbIndex == CREMIA_LIMB_HEAD) { sp4 = this->unk_1D8.unk_08; rot->x += sp4.y; rot->z += sp4.x; - } else if (limbIndex == MA2_LIMB_TORSO) { - if (this->skelAnime.animation != &object_ma2_Anim_007E28 && - this->skelAnime.animation != &object_ma2_Anim_003D54) { + } else if (limbIndex == CREMIA_LIMB_TORSO) { + if (this->skelAnime.animation != &gCremiaSittingPetCowAnim && + this->skelAnime.animation != &gCremiaSittingLookDownAnim) { sp4 = this->unk_1D8.unk_0E; rot->x += sp4.y; - if (this->skelAnime.animation == &object_ma2_Anim_00A174 || - this->skelAnime.animation == &object_ma2_Anim_0070EC || - this->skelAnime.animation == &object_ma2_Anim_003D54) { + if (this->skelAnime.animation == &gCremiaIdleAnim || this->skelAnime.animation == &gCremiaSittingAnim || + this->skelAnime.animation == &gCremiaSittingLookDownAnim) { rot->z += sp4.x; } } @@ -1449,7 +1458,7 @@ s32 EnMaYto_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* void EnMaYto_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { EnMaYto* this = THIS; - if (limbIndex == MA2_LIMB_HEAD) { + if (limbIndex == CREMIA_LIMB_HEAD) { Matrix_MultZero(&this->actor.focus.pos); } } @@ -1461,7 +1470,7 @@ void EnMaYto_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); if (this->type == MA_YTO_TYPE_BARN && (gSaveContext.save.weekEventReg[22] & 1)) { // Aliens defeated gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, gCremiaWoodenBox); + gSPDisplayList(POLY_OPA_DISP++, gCremiaWoodenBoxDL); } func_8012C28C(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h index 25eb2bed54..7f2c50fb3e 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.h @@ -2,38 +2,12 @@ #define Z_EN_MA_YTO_H #include "global.h" -#include "overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h" +#include "objects/object_ma2/object_ma2.h" struct EnMaYto; typedef void (*EnMaYtoActionFunc)(struct EnMaYto*, PlayState*); -typedef enum { - /* 00 */ MA2_LIMB_NONE, - /* 01 */ MA2_LIMB_ROOT, - /* 02 */ MA2_LIMB_TORSO, - /* 03 */ MA2_LIMB_ARM_LEFT, - /* 04 */ MA2_LIMB_FOREARM_LEFT, - /* 05 */ MA2_LIMB_HAND_LEFT, - /* 06 */ MA2_LIMB_ARM_RIGHT, - /* 07 */ MA2_LIMB_FOREARM_RIGHT, - /* 08 */ MA2_LIMB_HAND_RIGHT, - /* 09 */ MA2_LIMB_HEAD, - /* 10 */ MA2_LIMB_HAIR, - /* 11 */ MA2_LIMB_PELVIS, - /* 12 */ MA2_LIMB_TIGHT_LEFT, - /* 13 */ MA2_LIMB_LEG_LEFT, - /* 14 */ MA2_LIMB_FOOT_LEFT, - /* 15 */ MA2_LIMB_TIGHT_RIGHT, - /* 16 */ MA2_LIMB_LEG_RIGHT, - /* 17 */ MA2_LIMB_FOOT_RIGHT, - /* 18 */ MA2_LIMB_DRESS_0, - /* 19 */ MA2_LIMB_DRESS_1, - /* 20 */ MA2_LIMB_DRESS_2, - /* 21 */ MA2_LIMB_DRESS_3, - /* 22 */ MA2_LIMB_MAX -} ObjectMa2Limbs; - typedef struct EnMaYto { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; @@ -42,8 +16,8 @@ typedef struct EnMaYto { /* 0x1D8 */ struct_800BD888_arg1 unk_1D8; /* 0x200 */ s32 unk200; // unused /* 0x204 */ s32 type; - /* 0x208 */ Vec3s jointTable[MA2_LIMB_MAX]; - /* 0x28C */ Vec3s morphTable[MA2_LIMB_MAX]; + /* 0x208 */ Vec3s jointTable[CREMIA_LIMB_MAX]; + /* 0x28C */ Vec3s morphTable[CREMIA_LIMB_MAX]; /* 0x310 */ s16 unk310; // state? /* 0x312 */ UNK_TYPE1 unk_312[0x2]; /* 0x314 */ s16 currentAnim; // Used only in DefaultWait diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index f66742c94b..06985120a1 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -14351,8 +14351,8 @@ 0x80B4E944:("sRomaniEyeTextures","UNK_TYPE4","",0x4), 0x80B4E958:("sRomaniMouthTextures","UNK_TYPE4","",0x4), 0x80B4E968:("D_80B4E968","UNK_TYPE1","",0x1), - 0x80B4E96C:("D_80B4E96C","UNK_TYPE4","",0x4), - 0x80B4E984:("D_80B4E984","UNK_TYPE4","",0x4), + 0x80B4E96C:("sCremiaEyeTextures","UNK_TYPE4","",0x4), + 0x80B4E984:("sCremiaMouthTextures","UNK_TYPE4","",0x4), 0x80B4E994:("D_80B4E994","UNK_TYPE1","",0x1), 0x80B4E998:("D_80B4E998","UNK_TYPE1","",0x1), 0x80B4E99C:("D_80B4E99C","UNK_TYPE1","",0x1),