mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-18 07:05:21 -04:00
Anju objects (#1444)
* bring over the objects from the other branch * kafeis mask * use symbols * dman naming after assets * stateFlags * remaining stuff * anim array bug * Name everything in DmGm after DmAn * WEEKEVENTREG_COUPLES_MASK_CUTSCENE_FINISHED * undef * format * idk * ing * format * name animations from an4, thanks emil! * emptydl * disbelief * review * format * Update assets/xml/objects/object_mask_kerfay.xml Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
@@ -2515,7 +2515,7 @@ u8 D_801C0B1C[] = {
|
||||
|
||||
Gfx* D_801C0B20[] = {
|
||||
object_mask_truth_DL_0001A0, // PLAYER_MASK_TRUTH
|
||||
object_mask_kerfay_DL_000D40, // PLAYER_MASK_KAFEIS_MASK
|
||||
gKafeisMaskDL, // PLAYER_MASK_KAFEIS_MASK
|
||||
object_mask_yofukasi_DL_000490, // PLAYER_MASK_ALL_NIGHT
|
||||
object_mask_rabit_DL_000610, // PLAYER_MASK_BUNNY
|
||||
object_mask_ki_tan_DL_0004A0, // PLAYER_MASK_KEATON
|
||||
|
||||
@@ -16,10 +16,10 @@ void DmAn_Init(Actor* thisx, PlayState* play);
|
||||
void DmAn_Destroy(Actor* thisx, PlayState* play);
|
||||
void DmAn_Update(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80C1C958(DmAn* this, PlayState* play);
|
||||
void DmAn_HandleCutscene(DmAn* this, PlayState* play);
|
||||
void DmAn_WaitForObject(DmAn* this, PlayState* play);
|
||||
void DmAn_HandleCouplesMaskCs(DmAn* this, PlayState* play);
|
||||
void DmAn_DoNothing(DmAn* this, PlayState* play);
|
||||
void func_80C1D0B0(Actor* thisx, PlayState* play);
|
||||
void DmAn_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
ActorInit Dm_An_InitVars = {
|
||||
ACTOR_DM_AN,
|
||||
@@ -33,40 +33,51 @@ ActorInit Dm_An_InitVars = {
|
||||
(ActorFunc)NULL,
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
/* -1 */ DMAN_ANIM_NONE = -1,
|
||||
/* 0x0 */ DMAN_ANIM_0,
|
||||
/* 0x1 */ DMAN_ANIM_1,
|
||||
/* 0x2 */ DMAN_ANIM_2,
|
||||
/* 0x3 */ DMAN_ANIM_3,
|
||||
/* 0x4 */ DMAN_ANIM_4,
|
||||
/* 0x5 */ DMAN_ANIM_5,
|
||||
/* 0x6 */ DMAN_ANIM_6,
|
||||
/* 0x7 */ DMAN_ANIM_7,
|
||||
/* 0x8 */ DMAN_ANIM_8,
|
||||
/* 0x9 */ DMAN_ANIM_9,
|
||||
/* 0xA */ DMAN_ANIM_10,
|
||||
/* 0xB */ DMAN_ANIM_11,
|
||||
/* 0xC */ DMAN_ANIM_12,
|
||||
/* 0xD */ DMAN_ANIM_13,
|
||||
/* 0xE */ DMAN_ANIM_MAX
|
||||
/**
|
||||
* Anju stores her animations across different objects and the ones used by this actor are put together right next to
|
||||
* each other in the sAnimationInfo array. Due to this, animation functions check which object to load by comparing
|
||||
* index ranges. To make this a bit easier to read, this enum includes `DMAN_ANIMOBJ_*` values that mark when a range of
|
||||
* animations of a certain object start
|
||||
*/
|
||||
typedef enum DmAnAnimation {
|
||||
/* -1 */ DMAN_ANIM_NONE = -1,
|
||||
/* 0 */ DMAN_ANIM_SITTING_IN_DISBELIEF,
|
||||
/* 1 */ DMAN_ANIM_SIT,
|
||||
|
||||
/* 2 */ DMAN_ANIMOBJ_AN4,
|
||||
/* 2 */ DMAN_ANIM_MASK_STAND_LOOP = DMAN_ANIMOBJ_AN4,
|
||||
/* 3 */ DMAN_ANIM_HOLD_HANDS, //! @bug See note at `sAnimationInfo`
|
||||
/* 4 */ DMAN_ANIM_MASK_KNEEL,
|
||||
/* 5 */ DMAN_ANIM_MASK_KNEEL_LOOP,
|
||||
/* 6 */ DMAN_ANIM_HUG,
|
||||
/* 7 */ DMAN_ANIM_HUG_LOOP,
|
||||
/* 8 */ DMAN_ANIM_HUG_RELEASE,
|
||||
/* 9 */ DMAN_ANIM_HUG_RELEASE_LOOP,
|
||||
/* 10 */ DMAN_ANIM_COMBINE_MASKS_1,
|
||||
/* 11 */ DMAN_ANIM_COMBINE_MASKS_2,
|
||||
/* 12 */ DMAN_ANIM_LOOK_UP,
|
||||
/* 13 */ DMAN_ANIM_LOOK_UP_LOOP,
|
||||
/* 14 */ DMAN_ANIM_MAX
|
||||
} DmAnAnimation;
|
||||
|
||||
static AnimationInfoS sAnimationInfo[DMAN_ANIM_MAX] = {
|
||||
{ &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_0
|
||||
{ &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_1
|
||||
{ &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_2
|
||||
{ &object_an1_Anim_013E1C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_3
|
||||
{ &object_an4_Anim_007E3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_4
|
||||
{ &object_an4_Anim_0088C0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_5
|
||||
{ &object_an4_Anim_0013C8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_6
|
||||
{ &object_an4_Anim_002550, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_7
|
||||
{ &object_an4_Anim_00353C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_8
|
||||
{ &object_an4_Anim_004498, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_9
|
||||
{ &object_an4_Anim_0060B4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_10
|
||||
{ &object_an4_Anim_00041C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_11
|
||||
{ &object_an4_Anim_004A78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_12
|
||||
{ &object_an4_Anim_00506C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_13
|
||||
{ &gAnju1SittingInDisbeliefAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_SITTING_IN_DISBELIEF
|
||||
{ &gAnju1SitAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_SIT
|
||||
|
||||
// DMAN_ANIMOBJ_AN4
|
||||
{ &gAnju4MaskStandLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_MASK_STAND_LOOP
|
||||
//! @bug Uses symbol from OBJECT_AN1 instead of OBJECT_AN4
|
||||
{ &gAnju1HoldHandsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_HOLD_HANDS
|
||||
{ &gAnju4MaskKneelAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_MASK_KNEEL
|
||||
{ &gAnju4MaskKneelLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_MASK_KNEEL_LOOP
|
||||
{ &gAnju4HugAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_HUG
|
||||
{ &gAnju4HugLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_HUG_LOOP
|
||||
{ &gAnju4HugReleaseAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_HUG_RELEASE
|
||||
{ &gAnju4HugReleaseLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_HUG_RELEASE_LOOP
|
||||
{ &gAnju4CombineMasks1Anim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_COMBINE_MASKS_1
|
||||
{ &gAnju4CombineMasks2Anim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_COMBINE_MASKS_2
|
||||
{ &gAnju4LookUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_LOOK_UP
|
||||
{ &gAnju4LookUpLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_LOOK_UP_LOOP
|
||||
};
|
||||
|
||||
s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) {
|
||||
@@ -74,13 +85,13 @@ s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) {
|
||||
s8 objectSlot2;
|
||||
s32 isAnimFinished = false;
|
||||
|
||||
if (this->animIndex <= DMAN_ANIM_1) {
|
||||
if (this->animIndex < DMAN_ANIMOBJ_AN4) {
|
||||
objectSlot2 = this->actor.objectSlot;
|
||||
} else {
|
||||
objectSlot2 = this->an4ObjectSlot;
|
||||
}
|
||||
|
||||
if (objectSlot2 >= 0) {
|
||||
if (objectSlot2 > OBJECT_SLOT_NONE) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot2].segment);
|
||||
isAnimFinished = SkelAnime_Update(&this->skelAnime);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
@@ -89,18 +100,18 @@ s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) {
|
||||
return isAnimFinished;
|
||||
}
|
||||
|
||||
s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, s32 animIndex) {
|
||||
s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, DmAnAnimation animIndex) {
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 objectSlot2;
|
||||
s32 didAnimChange = false;
|
||||
|
||||
if (animIndex <= DMAN_ANIM_1) {
|
||||
if (animIndex < DMAN_ANIMOBJ_AN4) {
|
||||
objectSlot2 = this->actor.objectSlot;
|
||||
} else {
|
||||
objectSlot2 = this->an4ObjectSlot;
|
||||
}
|
||||
|
||||
if ((objectSlot2 >= 0) && (this->animIndex != animIndex)) {
|
||||
if ((objectSlot2 > OBJECT_SLOT_NONE) && (this->animIndex != animIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot2].segment);
|
||||
this->animIndex = animIndex;
|
||||
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
|
||||
@@ -110,66 +121,85 @@ s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, s32 animIndex) {
|
||||
return didAnimChange;
|
||||
}
|
||||
|
||||
void func_80C1C5B4(DmAn* this) {
|
||||
if (DECR(this->unk_2BA) == 0) {
|
||||
this->unk_2B8++;
|
||||
if (this->unk_2B8 >= 4) {
|
||||
this->unk_2BA = Rand_S16Offset(30, 30);
|
||||
this->unk_2B8 = 0;
|
||||
typedef enum DmAnEyes {
|
||||
/* 0 */ DMAN_EYES_OPEN,
|
||||
/* 1 */ DMAN_EYES_HALF1,
|
||||
/* 2 */ DMAN_EYES_CLOSED,
|
||||
/* 3 */ DMAN_EYES_HALF2,
|
||||
/* 4 */ DMAN_EYES_COMFORT,
|
||||
/* 5 */ DMAN_EYES_SAD,
|
||||
/* 6 */ DMAN_EYES_RELIEVED_CLOSED,
|
||||
/* 7 */ DMAN_EYES_MAX
|
||||
} DmAnEyes;
|
||||
|
||||
typedef enum DmAnMouth {
|
||||
/* 0 */ DMAN_MOUTH_CLOSED,
|
||||
/* 1 */ DMAN_MOUTH_HAPPY,
|
||||
/* 2 */ DMAN_MOUTH_OPEN,
|
||||
/* 3 */ DMAN_MOUTH_MAX
|
||||
} DmAnMouth;
|
||||
|
||||
void DmAn_Blink(DmAn* this) {
|
||||
if (DECR(this->eyeTimer) == 0) {
|
||||
this->eyeTexIndex++;
|
||||
if (this->eyeTexIndex > DMAN_EYES_HALF2) {
|
||||
this->eyeTimer = Rand_S16Offset(30, 30);
|
||||
this->eyeTexIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80C1C62C(DmAn* this, PlayState* play) {
|
||||
s32 DmAn_UpdateHeadRot(DmAn* this, PlayState* play) {
|
||||
s32 pad;
|
||||
Vec3f sp40;
|
||||
Vec3f sp34;
|
||||
s16 sp32;
|
||||
Vec3f lookAtActorPos;
|
||||
Vec3f pos;
|
||||
s16 yaw;
|
||||
|
||||
Math_Vec3f_Copy(&sp40, &this->unk_2B4->world.pos);
|
||||
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
|
||||
sp32 = Math_Vec3f_Yaw(&sp34, &sp40);
|
||||
Math_Vec3f_Copy(&lookAtActorPos, &this->lookAtActor->world.pos);
|
||||
Math_Vec3f_Copy(&pos, &this->actor.world.pos);
|
||||
yaw = Math_Vec3f_Yaw(&pos, &lookAtActorPos);
|
||||
|
||||
Math_ApproachS(&this->unk_2C0, (sp32 - this->unk_2C4) - this->actor.shape.rot.y, 4, 0x2AA8);
|
||||
this->unk_2C0 = CLAMP(this->unk_2C0, -0x1FFE, 0x1FFE);
|
||||
Math_ApproachS(&this->headRotY, (yaw - this->torsoRotY) - this->actor.shape.rot.y, 4, 0x2AA8);
|
||||
this->headRotY = CLAMP(this->headRotY, -0x1FFE, 0x1FFE);
|
||||
|
||||
Math_ApproachS(&this->unk_2C4, (sp32 - this->unk_2C0) - this->actor.shape.rot.y, 4, 0x2AA8);
|
||||
this->unk_2C4 = CLAMP(this->unk_2C4, -0x1C70, 0x1C70);
|
||||
Math_ApproachS(&this->torsoRotY, (yaw - this->headRotY) - this->actor.shape.rot.y, 4, 0x2AA8);
|
||||
this->torsoRotY = CLAMP(this->torsoRotY, -0x1C70, 0x1C70);
|
||||
|
||||
if (this->unk_2B4->id == ACTOR_PLAYER) {
|
||||
sp40.y = ((Player*)this->unk_2B4)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
|
||||
if (this->lookAtActor->id == ACTOR_PLAYER) {
|
||||
lookAtActorPos.y = ((Player*)this->lookAtActor)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
|
||||
} else {
|
||||
Math_Vec3f_Copy(&sp40, &this->unk_2B4->focus.pos);
|
||||
Math_Vec3f_Copy(&lookAtActorPos, &this->lookAtActor->focus.pos);
|
||||
}
|
||||
|
||||
Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
|
||||
Math_ApproachS(&this->unk_2BE, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_2C2, 4, 0x2AA8);
|
||||
this->unk_2BE = CLAMP(this->unk_2BE, -0x1C70, 0x1C70);
|
||||
Math_Vec3f_Copy(&pos, &this->actor.focus.pos);
|
||||
Math_ApproachS(&this->headRotZ, Math_Vec3f_Pitch(&pos, &lookAtActorPos) - this->torsoRotZ, 4, 0x2AA8);
|
||||
this->headRotZ = CLAMP(this->headRotZ, -0x1C70, 0x1C70);
|
||||
|
||||
Math_ApproachS(&this->torsoRotZ, Math_Vec3f_Pitch(&pos, &lookAtActorPos) - this->headRotZ, 4, 0x2AA8);
|
||||
this->torsoRotZ = CLAMP(this->torsoRotZ, -0x1C70, 0x1C70);
|
||||
|
||||
Math_ApproachS(&this->unk_2C2, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_2BE, 4, 0x2AA8);
|
||||
this->unk_2C2 = CLAMP(this->unk_2C2, -0x1C70, 0x1C70);
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 func_80C1C83C(DmAn* this, PlayState* play) {
|
||||
if (this->unk_2B4 != NULL) {
|
||||
func_80C1C62C(this, play);
|
||||
this->unk_2AE &= ~1;
|
||||
this->unk_2AE |= 2;
|
||||
} else if (this->unk_2AE & 2) {
|
||||
this->unk_2AE &= ~2;
|
||||
this->unk_2BE = 0;
|
||||
this->unk_2C0 = 0;
|
||||
this->unk_2C2 = 0;
|
||||
this->unk_2C4 = 0;
|
||||
this->unk_2BC = 20;
|
||||
} else if (DECR(this->unk_2BC) == 0) {
|
||||
this->unk_2AE |= 1;
|
||||
s32 DmAn_UpdateAttention(DmAn* this, PlayState* play) {
|
||||
if (this->lookAtActor != NULL) {
|
||||
DmAn_UpdateHeadRot(this, play);
|
||||
this->stateFlags &= ~DMAN_STATE_LOST_ATTENTION;
|
||||
this->stateFlags |= DMAN_STATE_FACE_TARGET;
|
||||
} else if (this->stateFlags & DMAN_STATE_FACE_TARGET) {
|
||||
this->stateFlags &= ~DMAN_STATE_FACE_TARGET;
|
||||
this->headRotZ = 0;
|
||||
this->headRotY = 0;
|
||||
this->torsoRotZ = 0;
|
||||
this->torsoRotY = 0;
|
||||
this->loseAttentionTimer = 20;
|
||||
} else if (DECR(this->loseAttentionTimer) == 0) {
|
||||
this->stateFlags |= DMAN_STATE_LOST_ATTENTION;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Actor* func_80C1C8E8(PlayState* play) {
|
||||
Actor* DmAn_FindAnjusMotherActor(PlayState* play) {
|
||||
Actor* tempActor;
|
||||
Actor* foundActor = NULL;
|
||||
|
||||
@@ -190,34 +220,42 @@ Actor* func_80C1C8E8(PlayState* play) {
|
||||
return foundActor;
|
||||
}
|
||||
|
||||
void func_80C1C958(DmAn* this, PlayState* play) {
|
||||
void DmAn_WaitForObject(DmAn* this, PlayState* play) {
|
||||
if ((this->an4ObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->an4ObjectSlot, play) &&
|
||||
(this->msmoObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->msmoObjectSlot, play)) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &object_an1_Skel_012618, NULL, this->jointTable, this->morphTable,
|
||||
OBJECT_AN1_LIMB_MAX);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gAnju1Skel, NULL, this->jointTable, this->morphTable,
|
||||
ANJU1_LIMB_MAX);
|
||||
|
||||
this->animIndex = DMAN_ANIM_NONE;
|
||||
DmAn_ChangeAnim(this, play, DMAN_ANIM_0);
|
||||
DmAn_ChangeAnim(this, play, DMAN_ANIM_SITTING_IN_DISBELIEF);
|
||||
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->unk_2AE |= 1;
|
||||
this->actor.draw = func_80C1D0B0;
|
||||
this->stateFlags |= DMAN_STATE_LOST_ATTENTION;
|
||||
this->actor.draw = DmAn_Draw;
|
||||
|
||||
if ((play->sceneId == SCENE_YADOYA) && (play->curSpawn == 4)) {
|
||||
this->unk_2B4 = func_80C1C8E8(play);
|
||||
DmAn_ChangeAnim(this, play, DMAN_ANIM_1);
|
||||
this->lookAtActor = DmAn_FindAnjusMotherActor(play);
|
||||
DmAn_ChangeAnim(this, play, DMAN_ANIM_SIT);
|
||||
this->actionFunc = DmAn_DoNothing;
|
||||
} else {
|
||||
this->actionFunc = DmAn_HandleCutscene;
|
||||
this->actionFunc = DmAn_HandleCouplesMaskCs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DmAn_HandleCutscene(DmAn* this, PlayState* play) {
|
||||
void DmAn_HandleCouplesMaskCs(DmAn* this, PlayState* play) {
|
||||
s32 csAnimIndex[] = {
|
||||
DMAN_ANIM_0, DMAN_ANIM_0, DMAN_ANIM_12, DMAN_ANIM_2, DMAN_ANIM_4,
|
||||
DMAN_ANIM_6, DMAN_ANIM_8, DMAN_ANIM_10, DMAN_ANIM_11, DMAN_ANIM_3,
|
||||
/* 0 */ 0, // no cue
|
||||
/* 1 */ DMAN_ANIM_SITTING_IN_DISBELIEF,
|
||||
/* 2 */ DMAN_ANIM_LOOK_UP,
|
||||
/* 3 */ DMAN_ANIM_MASK_STAND_LOOP,
|
||||
/* 4 */ DMAN_ANIM_MASK_KNEEL,
|
||||
/* 5 */ DMAN_ANIM_HUG,
|
||||
/* 6 */ DMAN_ANIM_HUG_RELEASE,
|
||||
/* 7 */ DMAN_ANIM_COMBINE_MASKS_1,
|
||||
/* 8 */ DMAN_ANIM_COMBINE_MASKS_2,
|
||||
/* 9 */ DMAN_ANIM_HOLD_HANDS,
|
||||
};
|
||||
u16 cueId;
|
||||
s32 cueChannel;
|
||||
@@ -247,8 +285,8 @@ void DmAn_HandleCutscene(DmAn* this, PlayState* play) {
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
if ((this->animIndex == DMAN_ANIM_12) || (this->animIndex == DMAN_ANIM_4) ||
|
||||
(this->animIndex == DMAN_ANIM_6) || (this->animIndex == DMAN_ANIM_8)) {
|
||||
if ((this->animIndex == DMAN_ANIM_LOOK_UP) || (this->animIndex == DMAN_ANIM_MASK_KNEEL) ||
|
||||
(this->animIndex == DMAN_ANIM_HUG) || (this->animIndex == DMAN_ANIM_HUG_RELEASE)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
DmAn_ChangeAnim(this, play, this->animIndex + 1);
|
||||
}
|
||||
@@ -275,7 +313,7 @@ void DmAn_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->an4ObjectSlot = SubS_GetObjectSlot(OBJECT_AN4, play);
|
||||
this->msmoObjectSlot = SubS_GetObjectSlot(OBJECT_MSMO, play);
|
||||
this->actionFunc = func_80C1C958;
|
||||
this->actionFunc = DmAn_WaitForObject;
|
||||
}
|
||||
|
||||
void DmAn_Destroy(Actor* thisx, PlayState* play) {
|
||||
@@ -286,26 +324,25 @@ void DmAn_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->actionFunc(this, play);
|
||||
|
||||
func_80C1C83C(this, play);
|
||||
DmAn_UpdateAttention(this, play);
|
||||
|
||||
if (this->actor.draw != NULL) {
|
||||
DmAn_UpdateSkelAnime(this, play);
|
||||
func_80C1C5B4(this);
|
||||
DmAn_Blink(this);
|
||||
}
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_4);
|
||||
}
|
||||
|
||||
Vec3f D_80C1D2C8 = { 450.0f, 700.0f, -760.0f };
|
||||
Vec3s D_80C1D2D4 = { 0x238C, 0, -0x3FFC };
|
||||
Vec3f D_80C1D2DC = { 1000.0f, 0.0f, 0.0f };
|
||||
|
||||
void func_80C1CD80(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
void DmAn_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
s32 pad[2];
|
||||
DmAn* this = THIS;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 msmoObjectSlot = this->msmoObjectSlot;
|
||||
|
||||
if ((limbIndex == OBJECT_AN1_LIMB_05) && this->didAnimChangeInCs) {
|
||||
if ((limbIndex == ANJU1_LIMB_LEFT_HAND) && this->didAnimChangeInCs) {
|
||||
static Vec3f D_80C1D2C8 = { 450.0f, 700.0f, -760.0f };
|
||||
static Vec3s D_80C1D2D4 = { 0x238C, 0, -0x3FFC };
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
Matrix_Push();
|
||||
@@ -321,19 +358,21 @@ void func_80C1CD80(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
if (limbIndex == OBJECT_AN1_LIMB_09) {
|
||||
if (limbIndex == ANJU1_LIMB_HEAD) {
|
||||
static Vec3f D_80C1D2DC = { 1000.0f, 0.0f, 0.0f };
|
||||
|
||||
Matrix_MultVec3f(&D_80C1D2DC, &this->actor.focus.pos);
|
||||
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80C1CEFC(PlayState* play, s32 limbIndex, Actor* thisx) {
|
||||
void DmAn_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
|
||||
DmAn* this = THIS;
|
||||
s16 stepRot;
|
||||
s16 overrideRot;
|
||||
|
||||
if (!(this->unk_2AE & 1)) {
|
||||
if (this->unk_2AE & 2) {
|
||||
if (!(this->stateFlags & DMAN_STATE_LOST_ATTENTION)) {
|
||||
if (this->stateFlags & DMAN_STATE_FACE_TARGET) {
|
||||
overrideRot = true;
|
||||
} else {
|
||||
overrideRot = false;
|
||||
@@ -344,53 +383,57 @@ void func_80C1CEFC(PlayState* play, s32 limbIndex, Actor* thisx) {
|
||||
overrideRot = false;
|
||||
}
|
||||
|
||||
if (limbIndex == OBJECT_AN1_LIMB_09) {
|
||||
SubS_UpdateLimb(this->unk_2BE + this->unk_2C2 + 0x4000,
|
||||
this->unk_2C0 + this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_18C,
|
||||
&this->unk_1A4, stepRot, overrideRot);
|
||||
if (limbIndex == ANJU1_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->unk_18C.x, this->unk_18C.y, this->unk_18C.z, MTXMODE_NEW);
|
||||
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->unk_1A4.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1A4.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1A4.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();
|
||||
} else if (limbIndex == OBJECT_AN1_LIMB_02) {
|
||||
SubS_UpdateLimb(this->unk_2C2 + 0x4000, this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_194,
|
||||
&this->unk_1AA, stepRot, overrideRot);
|
||||
} else if (limbIndex == ANJU1_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->unk_194.x, this->unk_194.y, this->unk_194.z, MTXMODE_NEW);
|
||||
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->unk_1AA.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1AA.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1AA.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();
|
||||
}
|
||||
}
|
||||
|
||||
TexturePtr D_80C1D2E8[] = {
|
||||
object_an1_Tex_00E6E0,
|
||||
object_an1_Tex_00F7A0,
|
||||
object_an1_Tex_0101A0,
|
||||
};
|
||||
|
||||
TexturePtr D_80C1D2F4[] = {
|
||||
object_an1_Tex_00E1E0, object_an1_Tex_00EFA0, object_an1_Tex_00F3A0, object_an1_Tex_00EFA0,
|
||||
object_an1_Tex_00FDA0, object_an1_Tex_00F9A0, object_an1_Tex_0103A0,
|
||||
};
|
||||
|
||||
void func_80C1D0B0(Actor* thisx, PlayState* play) {
|
||||
void DmAn_Draw(Actor* thisx, PlayState* play) {
|
||||
static TexturePtr sMouthTextures[DMAN_MOUTH_MAX] = {
|
||||
gAnju1MouthClosedTex, // DMAN_MOUTH_CLOSED
|
||||
gAnju1MouthHappyTex, // DMAN_MOUTH_HAPPY
|
||||
gAnju1MouthOpenTex, // DMAN_MOUTH_OPEN
|
||||
};
|
||||
static TexturePtr sEyeTextures[DMAN_EYES_MAX] = {
|
||||
gAnju1EyeOpenTex, // DMAN_EYES_OPEN
|
||||
gAnju1EyeHalfTex, // DMAN_EYES_HALF1
|
||||
gAnju1EyeClosedTex, // DMAN_EYES_CLOSED
|
||||
gAnju1EyeHalfTex, // DMAN_EYES_HALF2
|
||||
gAnju1EyeComfortTex, // DMAN_EYES_COMFORT
|
||||
gAnju1EyeSadTex, // DMAN_EYES_SAD
|
||||
gAnju1EyeRelievedClosedTex, // DMAN_EYES_RELIEVED_CLOSED
|
||||
};
|
||||
DmAn* this = THIS;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
Gfx_SetupDL25_Opa(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80C1D2F4[this->unk_2B8]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C1D2E8[0]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sMouthTextures[DMAN_MOUTH_CLOSED]));
|
||||
|
||||
SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, NULL, func_80C1CD80, func_80C1CEFC, &this->actor);
|
||||
this->skelAnime.dListCount, NULL, DmAn_PostLimbDraw, DmAn_TransformLimbDraw,
|
||||
&this->actor);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -8,28 +8,31 @@ struct DmAn;
|
||||
|
||||
typedef void (*DmAnActionFunc)(struct DmAn*, PlayState*);
|
||||
|
||||
#define DMAN_STATE_LOST_ATTENTION (1 << 0)
|
||||
#define DMAN_STATE_FACE_TARGET (1 << 1)
|
||||
|
||||
typedef struct DmAn {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ DmAnActionFunc actionFunc;
|
||||
/* 0x18C */ Vec3f unk_18C;
|
||||
/* 0x18C */ Vec3f unk_194;
|
||||
/* 0x1A4 */ Vec3s unk_1A4;
|
||||
/* 0x1A4 */ Vec3s unk_1AA;
|
||||
/* 0x1B0 */ Vec3s jointTable[OBJECT_AN1_LIMB_MAX];
|
||||
/* 0x22E */ Vec3s morphTable[OBJECT_AN1_LIMB_MAX];
|
||||
/* 0x18C */ Vec3f headComputedPos;
|
||||
/* 0x18C */ Vec3f torsoComputedPos;
|
||||
/* 0x1A4 */ Vec3s headComputedRot;
|
||||
/* 0x1A4 */ Vec3s torsoComputedRot;
|
||||
/* 0x1B0 */ Vec3s jointTable[ANJU1_LIMB_MAX];
|
||||
/* 0x22E */ Vec3s morphTable[ANJU1_LIMB_MAX];
|
||||
/* 0x2AC */ s8 an4ObjectSlot;
|
||||
/* 0x2AD */ s8 msmoObjectSlot;
|
||||
/* 0x2AE */ u16 unk_2AE;
|
||||
/* 0x2AE */ u16 stateFlags;
|
||||
/* 0x2B0 */ u8 cueId;
|
||||
/* 0x2B4 */ Actor* unk_2B4;
|
||||
/* 0x2B8 */ s16 unk_2B8;
|
||||
/* 0x2BA */ s16 unk_2BA;
|
||||
/* 0x2BC */ s16 unk_2BC;
|
||||
/* 0x2BE */ s16 unk_2BE;
|
||||
/* 0x2C0 */ s16 unk_2C0;
|
||||
/* 0x2C2 */ s16 unk_2C2;
|
||||
/* 0x2C4 */ s16 unk_2C4;
|
||||
/* 0x2B4 */ Actor* lookAtActor;
|
||||
/* 0x2B8 */ s16 eyeTexIndex;
|
||||
/* 0x2BA */ s16 eyeTimer;
|
||||
/* 0x2BC */ s16 loseAttentionTimer;
|
||||
/* 0x2BE */ s16 headRotZ;
|
||||
/* 0x2C0 */ s16 headRotY;
|
||||
/* 0x2C2 */ s16 torsoRotZ;
|
||||
/* 0x2C4 */ s16 torsoRotY;
|
||||
/* 0x2C8 */ s32 animIndex;
|
||||
/* 0x2CC */ s32 prevAnimIndex;
|
||||
/* 0x2D0 */ s32 isCutscenePlaying;
|
||||
|
||||
@@ -16,10 +16,10 @@ void DmGm_Init(Actor* thisx, PlayState* play);
|
||||
void DmGm_Destroy(Actor* thisx, PlayState* play);
|
||||
void DmGm_Update(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80C248A8(DmGm* this, PlayState* play);
|
||||
void DmGm_HandleCutscene(DmGm* this, PlayState* play);
|
||||
void DmGm_WaitForObject(DmGm* this, PlayState* play);
|
||||
void DmGm_HandleCouplesMaskCs(DmGm* this, PlayState* play);
|
||||
void DmGm_DoNothing(DmGm* this, PlayState* play);
|
||||
void func_80C25000(Actor* thisx, PlayState* play);
|
||||
void DmGm_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
ActorInit Dm_Gm_InitVars = {
|
||||
ACTOR_DM_GM,
|
||||
@@ -33,40 +33,51 @@ ActorInit Dm_Gm_InitVars = {
|
||||
(ActorFunc)NULL,
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
/* -1 */ DMGM_ANIM_NONE = -1,
|
||||
/* 0x0 */ DMGM_ANIM_0,
|
||||
/* 0x1 */ DMGM_ANIM_1,
|
||||
/* 0x2 */ DMGM_ANIM_2,
|
||||
/* 0x3 */ DMGM_ANIM_3,
|
||||
/* 0x4 */ DMGM_ANIM_4,
|
||||
/* 0x5 */ DMGM_ANIM_5,
|
||||
/* 0x6 */ DMGM_ANIM_6,
|
||||
/* 0x7 */ DMGM_ANIM_7,
|
||||
/* 0x8 */ DMGM_ANIM_8,
|
||||
/* 0x9 */ DMGM_ANIM_9,
|
||||
/* 0xA */ DMGM_ANIM_10,
|
||||
/* 0xB */ DMGM_ANIM_11,
|
||||
/* 0xC */ DMGM_ANIM_12,
|
||||
/* 0xD */ DMGM_ANIM_13,
|
||||
/* 0xE */ DMGM_ANIM_MAX
|
||||
/**
|
||||
* Anju stores her animations across different objects and the ones used by this actor are put together right next to
|
||||
* each other in the sAnimationInfo array. Due to this, animation functions check which object to load by comparing
|
||||
* index ranges. To make this a bit easier to read, this enum includes `DMGM_ANIMOBJ_*` values that mark when a range of
|
||||
* animations of a certain object start
|
||||
*/
|
||||
typedef enum DmGmAnimation {
|
||||
/* -1 */ DMGM_ANIM_NONE = -1,
|
||||
/* 0 */ DMGM_ANIM_SITTING_IN_DISBELIEF,
|
||||
/* 1 */ DMGM_ANIM_SIT,
|
||||
|
||||
/* 2 */ DMGM_ANIMOBJ_AN4,
|
||||
/* 2 */ DMGM_ANIM_MASK_STAND_LOOP = DMGM_ANIMOBJ_AN4,
|
||||
/* 3 */ DMGM_ANIM_HOLD_HANDS, //! @bug See note at `sAnimationInfo`
|
||||
/* 4 */ DMGM_ANIM_MASK_KNEEL,
|
||||
/* 5 */ DMGM_ANIM_MASK_KNEEL_LOOP,
|
||||
/* 6 */ DMGM_ANIM_HUG,
|
||||
/* 7 */ DMGM_ANIM_HUG_LOOP,
|
||||
/* 8 */ DMGM_ANIM_HUG_RELEASE,
|
||||
/* 9 */ DMGM_ANIM_HUG_RELEASE_LOOP,
|
||||
/* 10 */ DMGM_ANIM_COMBINE_MASKS_1,
|
||||
/* 11 */ DMGM_ANIM_COMBINE_MASKS_2,
|
||||
/* 12 */ DMGM_ANIM_LOOK_UP,
|
||||
/* 13 */ DMGM_ANIM_LOOK_UP_LOOP,
|
||||
/* 14 */ DMGM_ANIM_MAX
|
||||
} DmGmAnimation;
|
||||
|
||||
static AnimationInfoS sAnimationInfo[DMGM_ANIM_MAX] = {
|
||||
{ &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_0
|
||||
{ &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_1
|
||||
{ &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DMGM_ANIM_2
|
||||
{ &object_an1_Anim_013E1C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DMGM_ANIM_3
|
||||
{ &object_an4_Anim_007E3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_4
|
||||
{ &object_an4_Anim_0088C0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_5
|
||||
{ &object_an4_Anim_0013C8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_6
|
||||
{ &object_an4_Anim_002550, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_7
|
||||
{ &object_an4_Anim_00353C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_8
|
||||
{ &object_an4_Anim_004498, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_9
|
||||
{ &object_an4_Anim_0060B4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_10
|
||||
{ &object_an4_Anim_00041C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_11
|
||||
{ &object_an4_Anim_004A78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_12
|
||||
{ &object_an4_Anim_00506C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_13
|
||||
{ &gAnju1SittingInDisbeliefAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_SITTING_IN_DISBELIEF
|
||||
{ &gAnju1SitAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_SIT
|
||||
|
||||
// DMGM_ANIMOBJ_AN4
|
||||
{ &gAnju4MaskStandLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DMGM_ANIM_MASK_STAND_LOOP
|
||||
//! @bug Uses symbol from OBJECT_AN1 instead of OBJECT_AN4
|
||||
{ &gAnju1HoldHandsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DMGM_ANIM_HOLD_HANDS
|
||||
{ &gAnju4MaskKneelAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_MASK_KNEEL
|
||||
{ &gAnju4MaskKneelLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_MASK_KNEEL_LOOP
|
||||
{ &gAnju4HugAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_HUG
|
||||
{ &gAnju4HugLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_HUG_LOOP
|
||||
{ &gAnju4HugReleaseAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_HUG_RELEASE
|
||||
{ &gAnju4HugReleaseLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_HUG_RELEASE_LOOP
|
||||
{ &gAnju4CombineMasks1Anim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_COMBINE_MASKS_1
|
||||
{ &gAnju4CombineMasks2Anim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_COMBINE_MASKS_2
|
||||
{ &gAnju4LookUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_LOOK_UP
|
||||
{ &gAnju4LookUpLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_LOOK_UP_LOOP
|
||||
};
|
||||
|
||||
s32 DmGm_UpdateSkelAnime(DmGm* this, PlayState* play) {
|
||||
@@ -74,13 +85,13 @@ s32 DmGm_UpdateSkelAnime(DmGm* this, PlayState* play) {
|
||||
s8 objectIndex2;
|
||||
s32 isAnimFinished = false;
|
||||
|
||||
if (this->animIndex <= DMGM_ANIM_1) {
|
||||
if (this->animIndex < DMGM_ANIMOBJ_AN4) {
|
||||
objectIndex2 = this->actor.objectSlot;
|
||||
} else {
|
||||
objectIndex2 = this->an4ObjectSlot;
|
||||
}
|
||||
|
||||
if (objectIndex2 >= 0) {
|
||||
if (objectIndex2 > OBJECT_SLOT_NONE) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment);
|
||||
isAnimFinished = SkelAnime_Update(&this->skelAnime);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
@@ -89,18 +100,18 @@ s32 DmGm_UpdateSkelAnime(DmGm* this, PlayState* play) {
|
||||
return isAnimFinished;
|
||||
}
|
||||
|
||||
s32 DmGm_ChangeAnim(DmGm* this, PlayState* play, s32 animIndex) {
|
||||
s32 DmGm_ChangeAnim(DmGm* this, PlayState* play, DmGmAnimation animIndex) {
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 objectIndex2;
|
||||
s32 didAnimChange = false;
|
||||
|
||||
if (animIndex <= DMGM_ANIM_1) {
|
||||
if (animIndex < DMGM_ANIMOBJ_AN4) {
|
||||
objectIndex2 = this->actor.objectSlot;
|
||||
} else {
|
||||
objectIndex2 = this->an4ObjectSlot;
|
||||
}
|
||||
|
||||
if ((objectIndex2 >= 0) && (this->animIndex != animIndex)) {
|
||||
if ((objectIndex2 > OBJECT_SLOT_NONE) && (this->animIndex != animIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment);
|
||||
this->animIndex = animIndex;
|
||||
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
|
||||
@@ -110,66 +121,85 @@ s32 DmGm_ChangeAnim(DmGm* this, PlayState* play, s32 animIndex) {
|
||||
return didAnimChange;
|
||||
}
|
||||
|
||||
void func_80C24504(DmGm* this) {
|
||||
if (DECR(this->unk_2BA) == 0) {
|
||||
this->unk_2B8++;
|
||||
if (this->unk_2B8 >= 4) {
|
||||
this->unk_2BA = Rand_S16Offset(30, 30);
|
||||
this->unk_2B8 = 0;
|
||||
typedef enum DmGmEyes {
|
||||
/* 0 */ DMGM_EYES_OPEN,
|
||||
/* 1 */ DMGM_EYES_HALF1,
|
||||
/* 2 */ DMGM_EYES_CLOSED,
|
||||
/* 3 */ DMGM_EYES_HALF2,
|
||||
/* 4 */ DMGM_EYES_COMFORT,
|
||||
/* 5 */ DMGM_EYES_SAD,
|
||||
/* 6 */ DMGM_EYES_RELIEVED_CLOSED,
|
||||
/* 7 */ DMGM_EYES_MAX
|
||||
} DmGmEyes;
|
||||
|
||||
typedef enum DmGmMouth {
|
||||
/* 0 */ DMGM_MOUTH_CLOSED,
|
||||
/* 1 */ DMGM_MOUTH_HAPPY,
|
||||
/* 2 */ DMGM_MOUTH_OPEN,
|
||||
/* 3 */ DMGM_MOUTH_MAX
|
||||
} DmGmMouth;
|
||||
|
||||
void DmGm_Blink(DmGm* this) {
|
||||
if (DECR(this->eyeTimer) == 0) {
|
||||
this->eyeTexIndex++;
|
||||
if (this->eyeTexIndex > DMGM_EYES_HALF2) {
|
||||
this->eyeTimer = Rand_S16Offset(30, 30);
|
||||
this->eyeTexIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_80C2457C(DmGm* this, PlayState* play) {
|
||||
s32 DmGm_UpdateHeadRot(DmGm* this, PlayState* play) {
|
||||
s32 pad;
|
||||
Vec3f sp40;
|
||||
Vec3f sp34;
|
||||
s16 sp32;
|
||||
Vec3f lookAtActorPos;
|
||||
Vec3f pos;
|
||||
s16 yaw;
|
||||
|
||||
Math_Vec3f_Copy(&sp40, &this->unk_2B4->world.pos);
|
||||
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
|
||||
sp32 = Math_Vec3f_Yaw(&sp34, &sp40);
|
||||
Math_Vec3f_Copy(&lookAtActorPos, &this->lookAtActor->world.pos);
|
||||
Math_Vec3f_Copy(&pos, &this->actor.world.pos);
|
||||
yaw = Math_Vec3f_Yaw(&pos, &lookAtActorPos);
|
||||
|
||||
Math_ApproachS(&this->unk_2C0, (sp32 - this->unk_2C4) - this->actor.shape.rot.y, 4, 0x2AA8);
|
||||
this->unk_2C0 = CLAMP(this->unk_2C0, -0x1FFE, 0x1FFE);
|
||||
Math_ApproachS(&this->headRotY, (yaw - this->torsoRotY) - this->actor.shape.rot.y, 4, 0x2AA8);
|
||||
this->headRotY = CLAMP(this->headRotY, -0x1FFE, 0x1FFE);
|
||||
|
||||
Math_ApproachS(&this->unk_2C4, (sp32 - this->unk_2C0) - this->actor.shape.rot.y, 4, 0x2AA8);
|
||||
this->unk_2C4 = CLAMP(this->unk_2C4, -0x1C70, 0x1C70);
|
||||
Math_ApproachS(&this->torsoRotY, (yaw - this->headRotY) - this->actor.shape.rot.y, 4, 0x2AA8);
|
||||
this->torsoRotY = CLAMP(this->torsoRotY, -0x1C70, 0x1C70);
|
||||
|
||||
if (this->unk_2B4->id == ACTOR_PLAYER) {
|
||||
sp40.y = ((Player*)this->unk_2B4)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
|
||||
if (this->lookAtActor->id == ACTOR_PLAYER) {
|
||||
lookAtActorPos.y = ((Player*)this->lookAtActor)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
|
||||
} else {
|
||||
Math_Vec3f_Copy(&sp40, &this->unk_2B4->focus.pos);
|
||||
Math_Vec3f_Copy(&lookAtActorPos, &this->lookAtActor->focus.pos);
|
||||
}
|
||||
|
||||
Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
|
||||
Math_ApproachS(&this->unk_2BE, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_2C2, 4, 0x2AA8);
|
||||
this->unk_2BE = CLAMP(this->unk_2BE, -0x1C70, 0x1C70);
|
||||
Math_Vec3f_Copy(&pos, &this->actor.focus.pos);
|
||||
Math_ApproachS(&this->headRotZ, Math_Vec3f_Pitch(&pos, &lookAtActorPos) - this->torsoRotZ, 4, 0x2AA8);
|
||||
this->headRotZ = CLAMP(this->headRotZ, -0x1C70, 0x1C70);
|
||||
|
||||
Math_ApproachS(&this->torsoRotZ, Math_Vec3f_Pitch(&pos, &lookAtActorPos) - this->headRotZ, 4, 0x2AA8);
|
||||
this->torsoRotZ = CLAMP(this->torsoRotZ, -0x1C70, 0x1C70);
|
||||
|
||||
Math_ApproachS(&this->unk_2C2, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_2BE, 4, 0x2AA8);
|
||||
this->unk_2C2 = CLAMP(this->unk_2C2, -0x1C70, 0x1C70);
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 func_80C2478C(DmGm* this, PlayState* play) {
|
||||
if (this->unk_2B4 != NULL) {
|
||||
func_80C2457C(this, play);
|
||||
this->unk_2AE &= ~1;
|
||||
this->unk_2AE |= 2;
|
||||
} else if (this->unk_2AE & 2) {
|
||||
this->unk_2AE &= ~2;
|
||||
this->unk_2BE = 0;
|
||||
this->unk_2C0 = 0;
|
||||
this->unk_2C2 = 0;
|
||||
this->unk_2C4 = 0;
|
||||
this->unk_2BC = 20;
|
||||
} else if (DECR(this->unk_2BC) == 0) {
|
||||
this->unk_2AE |= 1;
|
||||
s32 DmGm_UpdateAttention(DmGm* this, PlayState* play) {
|
||||
if (this->lookAtActor != NULL) {
|
||||
DmGm_UpdateHeadRot(this, play);
|
||||
this->stateFlags &= ~DMGM_STATE_LOST_ATTENTION;
|
||||
this->stateFlags |= DMGM_STATE_FACE_TARGET;
|
||||
} else if (this->stateFlags & DMGM_STATE_FACE_TARGET) {
|
||||
this->stateFlags &= ~DMGM_STATE_FACE_TARGET;
|
||||
this->headRotZ = 0;
|
||||
this->headRotY = 0;
|
||||
this->torsoRotZ = 0;
|
||||
this->torsoRotY = 0;
|
||||
this->loseAttentionTimer = 20;
|
||||
} else if (DECR(this->loseAttentionTimer) == 0) {
|
||||
this->stateFlags |= DMGM_STATE_LOST_ATTENTION;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Actor* func_80C24838(PlayState* play) {
|
||||
Actor* DmGm_FindAnjusMotherActor(PlayState* play) {
|
||||
Actor* tempActor;
|
||||
Actor* foundActor = NULL;
|
||||
|
||||
@@ -190,34 +220,42 @@ Actor* func_80C24838(PlayState* play) {
|
||||
return foundActor;
|
||||
}
|
||||
|
||||
void func_80C248A8(DmGm* this, PlayState* play) {
|
||||
void DmGm_WaitForObject(DmGm* this, PlayState* play) {
|
||||
if ((this->an4ObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->an4ObjectSlot, play) &&
|
||||
(this->msmoObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->msmoObjectSlot, play)) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &object_an1_Skel_012618, NULL, this->jointTable, this->morphTable,
|
||||
OBJECT_AN1_LIMB_MAX);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gAnju1Skel, NULL, this->jointTable, this->morphTable,
|
||||
ANJU1_LIMB_MAX);
|
||||
|
||||
this->animIndex = DMGM_ANIM_NONE;
|
||||
DmGm_ChangeAnim(this, play, DMGM_ANIM_0);
|
||||
DmGm_ChangeAnim(this, play, DMGM_ANIM_SITTING_IN_DISBELIEF);
|
||||
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->unk_2AE |= 1;
|
||||
this->actor.draw = func_80C25000;
|
||||
this->stateFlags |= 1;
|
||||
this->actor.draw = DmGm_Draw;
|
||||
|
||||
if ((play->sceneId == SCENE_YADOYA) && (play->curSpawn == 4)) {
|
||||
this->unk_2B4 = func_80C24838(play);
|
||||
DmGm_ChangeAnim(this, play, DMGM_ANIM_1);
|
||||
this->lookAtActor = DmGm_FindAnjusMotherActor(play);
|
||||
DmGm_ChangeAnim(this, play, DMGM_ANIM_SIT);
|
||||
this->actionFunc = DmGm_DoNothing;
|
||||
} else {
|
||||
this->actionFunc = DmGm_HandleCutscene;
|
||||
this->actionFunc = DmGm_HandleCouplesMaskCs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DmGm_HandleCutscene(DmGm* this, PlayState* play) {
|
||||
void DmGm_HandleCouplesMaskCs(DmGm* this, PlayState* play) {
|
||||
s32 csAnimIndex[] = {
|
||||
DMGM_ANIM_0, DMGM_ANIM_0, DMGM_ANIM_12, DMGM_ANIM_2, DMGM_ANIM_4,
|
||||
DMGM_ANIM_6, DMGM_ANIM_8, DMGM_ANIM_10, DMGM_ANIM_11, DMGM_ANIM_3,
|
||||
/* 0 */ 0, // no cue
|
||||
/* 1 */ DMGM_ANIM_SITTING_IN_DISBELIEF,
|
||||
/* 2 */ DMGM_ANIM_LOOK_UP,
|
||||
/* 3 */ DMGM_ANIM_MASK_STAND_LOOP,
|
||||
/* 4 */ DMGM_ANIM_MASK_KNEEL,
|
||||
/* 5 */ DMGM_ANIM_HUG,
|
||||
/* 6 */ DMGM_ANIM_HUG_RELEASE,
|
||||
/* 7 */ DMGM_ANIM_COMBINE_MASKS_1,
|
||||
/* 8 */ DMGM_ANIM_COMBINE_MASKS_2,
|
||||
/* 9 */ DMGM_ANIM_HOLD_HANDS,
|
||||
};
|
||||
u16 cueId;
|
||||
s32 cueChannel;
|
||||
@@ -247,8 +285,8 @@ void DmGm_HandleCutscene(DmGm* this, PlayState* play) {
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
if ((this->animIndex == DMGM_ANIM_12) || (this->animIndex == DMGM_ANIM_4) ||
|
||||
(this->animIndex == DMGM_ANIM_6) || (this->animIndex == DMGM_ANIM_8)) {
|
||||
if ((this->animIndex == DMGM_ANIM_LOOK_UP) || (this->animIndex == DMGM_ANIM_MASK_KNEEL) ||
|
||||
(this->animIndex == DMGM_ANIM_HUG) || (this->animIndex == DMGM_ANIM_HUG_RELEASE)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
DmGm_ChangeAnim(this, play, this->animIndex + 1);
|
||||
}
|
||||
@@ -275,7 +313,7 @@ void DmGm_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->an4ObjectSlot = SubS_GetObjectSlot(OBJECT_AN4, play);
|
||||
this->msmoObjectSlot = SubS_GetObjectSlot(OBJECT_MSMO, play);
|
||||
this->actionFunc = func_80C248A8;
|
||||
this->actionFunc = DmGm_WaitForObject;
|
||||
}
|
||||
|
||||
void DmGm_Destroy(Actor* thisx, PlayState* play) {
|
||||
@@ -286,42 +324,43 @@ void DmGm_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->actionFunc(this, play);
|
||||
|
||||
func_80C2478C(this, play);
|
||||
DmGm_UpdateAttention(this, play);
|
||||
|
||||
if (this->actor.draw != NULL) {
|
||||
DmGm_UpdateSkelAnime(this, play);
|
||||
func_80C24504(this);
|
||||
DmGm_Blink(this);
|
||||
}
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_4);
|
||||
}
|
||||
|
||||
Vec3f D_80C25218 = { 450.0f, 700.0f, -760.0f };
|
||||
Vec3s D_80C25224 = { 0x238C, 0, -0x3FFC };
|
||||
Vec3f D_80C2522C = { 1000.0f, 0.0f, 0.0f };
|
||||
|
||||
void DmGm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
s32 pad[2];
|
||||
DmGm* this = THIS;
|
||||
s8 sp2B = this->actor.objectSlot;
|
||||
s8 sp2A = this->msmoObjectSlot;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 msmoObjectSlot = this->msmoObjectSlot;
|
||||
|
||||
if ((limbIndex == ANJU1_LIMB_LEFT_HAND) && this->didAnimChangeInCs) {
|
||||
static Vec3f D_80C25218 = { 450.0f, 700.0f, -760.0f };
|
||||
static Vec3s D_80C25224 = { 0x238C, 0, -0x3FFC };
|
||||
|
||||
if ((limbIndex == OBJECT_AN1_LIMB_05) && this->didAnimChangeInCs) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
Matrix_Push();
|
||||
Matrix_TranslateRotateZYX(&D_80C25218, &D_80C25224);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2A].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[msmoObjectSlot].segment);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gMoonMaskDL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2B].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
if (limbIndex == OBJECT_AN1_LIMB_09) {
|
||||
if (limbIndex == ANJU1_LIMB_HEAD) {
|
||||
static Vec3f D_80C2522C = { 1000.0f, 0.0f, 0.0f };
|
||||
|
||||
Matrix_MultVec3f(&D_80C2522C, &this->actor.focus.pos);
|
||||
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
|
||||
}
|
||||
@@ -332,8 +371,8 @@ void DmGm_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
|
||||
s16 stepRot;
|
||||
s16 overrideRot;
|
||||
|
||||
if (!(this->unk_2AE & 1)) {
|
||||
if (this->unk_2AE & 2) {
|
||||
if (!(this->stateFlags & DMGM_STATE_LOST_ATTENTION)) {
|
||||
if (this->stateFlags & DMGM_STATE_FACE_TARGET) {
|
||||
overrideRot = true;
|
||||
} else {
|
||||
overrideRot = false;
|
||||
@@ -344,50 +383,53 @@ void DmGm_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
|
||||
overrideRot = false;
|
||||
}
|
||||
|
||||
if (limbIndex == OBJECT_AN1_LIMB_09) {
|
||||
SubS_UpdateLimb(this->unk_2BE + this->unk_2C2 + 0x4000,
|
||||
this->unk_2C0 + this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_18C,
|
||||
&this->unk_1A4, stepRot, overrideRot);
|
||||
if (limbIndex == ANJU1_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->unk_18C.x, this->unk_18C.y, this->unk_18C.z, MTXMODE_NEW);
|
||||
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->unk_1A4.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1A4.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1A4.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();
|
||||
} else if (limbIndex == OBJECT_AN1_LIMB_02) {
|
||||
SubS_UpdateLimb(this->unk_2C2 + 0x4000, this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_194,
|
||||
&this->unk_1AA, stepRot, overrideRot);
|
||||
} else if (limbIndex == ANJU1_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->unk_194.x, this->unk_194.y, this->unk_194.z, MTXMODE_NEW);
|
||||
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->unk_1AA.y, MTXMODE_APPLY);
|
||||
Matrix_RotateXS(this->unk_1AA.x, MTXMODE_APPLY);
|
||||
Matrix_RotateZS(this->unk_1AA.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();
|
||||
}
|
||||
}
|
||||
|
||||
TexturePtr D_80C25238[] = {
|
||||
object_an1_Tex_00E6E0,
|
||||
object_an1_Tex_00F7A0,
|
||||
object_an1_Tex_0101A0,
|
||||
};
|
||||
|
||||
TexturePtr D_80C25244[] = {
|
||||
object_an1_Tex_00E1E0, object_an1_Tex_00EFA0, object_an1_Tex_00F3A0, object_an1_Tex_00EFA0,
|
||||
object_an1_Tex_00FDA0, object_an1_Tex_00F9A0, object_an1_Tex_0103A0,
|
||||
};
|
||||
|
||||
void func_80C25000(Actor* thisx, PlayState* play) {
|
||||
void DmGm_Draw(Actor* thisx, PlayState* play) {
|
||||
static TexturePtr sMouthTextures[DMGM_MOUTH_MAX] = {
|
||||
gAnju1MouthClosedTex, // DMGM_MOUTH_CLOSED
|
||||
gAnju1MouthHappyTex, // DMGM_MOUTH_HAPPY
|
||||
gAnju1MouthOpenTex, // DMGM_MOUTH_OPEN
|
||||
};
|
||||
static TexturePtr sEyeTextures[DMGM_EYES_MAX] = {
|
||||
gAnju1EyeOpenTex, // DMGM_EYES_OPEN
|
||||
gAnju1EyeHalfTex, // DMGM_EYES_HALF1
|
||||
gAnju1EyeClosedTex, // DMGM_EYES_CLOSED
|
||||
gAnju1EyeHalfTex, // DMGM_EYES_HALF2
|
||||
gAnju1EyeComfortTex, // DMGM_EYES_COMFORT
|
||||
gAnju1EyeSadTex, // DMGM_EYES_SAD
|
||||
gAnju1EyeRelievedClosedTex, // DMGM_EYES_RELIEVED_CLOSED
|
||||
};
|
||||
DmGm* this = THIS;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
Gfx_SetupDL25_Opa(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80C25244[this->unk_2B8]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C25238[0]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sMouthTextures[DMGM_MOUTH_CLOSED]));
|
||||
|
||||
SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, NULL, DmGm_PostLimbDraw, DmGm_TransformLimbDraw,
|
||||
|
||||
@@ -8,28 +8,31 @@ struct DmGm;
|
||||
|
||||
typedef void (*DmGmActionFunc)(struct DmGm*, PlayState*);
|
||||
|
||||
#define DMGM_STATE_LOST_ATTENTION (1 << 0)
|
||||
#define DMGM_STATE_FACE_TARGET (1 << 1)
|
||||
|
||||
typedef struct DmGm {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ DmGmActionFunc actionFunc;
|
||||
/* 0x18C */ Vec3f unk_18C;
|
||||
/* 0x18C */ Vec3f unk_194;
|
||||
/* 0x1A4 */ Vec3s unk_1A4;
|
||||
/* 0x1A4 */ Vec3s unk_1AA;
|
||||
/* 0x1B0 */ Vec3s jointTable[OBJECT_AN1_LIMB_MAX];
|
||||
/* 0x22E */ Vec3s morphTable[OBJECT_AN1_LIMB_MAX];
|
||||
/* 0x18C */ Vec3f headComputedPos;
|
||||
/* 0x18C */ Vec3f torsoComputedPos;
|
||||
/* 0x1A4 */ Vec3s headComputedRot;
|
||||
/* 0x1A4 */ Vec3s torsoComputedRot;
|
||||
/* 0x1B0 */ Vec3s jointTable[ANJU1_LIMB_MAX];
|
||||
/* 0x22E */ Vec3s morphTable[ANJU1_LIMB_MAX];
|
||||
/* 0x2AC */ s8 an4ObjectSlot;
|
||||
/* 0x2AD */ s8 msmoObjectSlot;
|
||||
/* 0x2AE */ u16 unk_2AE;
|
||||
/* 0x2AE */ u16 stateFlags;
|
||||
/* 0x2B0 */ u8 cueId;
|
||||
/* 0x2B4 */ Actor* unk_2B4;
|
||||
/* 0x2B8 */ s16 unk_2B8;
|
||||
/* 0x2BA */ s16 unk_2BA;
|
||||
/* 0x2BC */ s16 unk_2BC;
|
||||
/* 0x2BE */ s16 unk_2BE;
|
||||
/* 0x2C0 */ s16 unk_2C0;
|
||||
/* 0x2C2 */ s16 unk_2C2;
|
||||
/* 0x2C4 */ s16 unk_2C4;
|
||||
/* 0x2B4 */ Actor* lookAtActor;
|
||||
/* 0x2B8 */ s16 eyeTexIndex;
|
||||
/* 0x2BA */ s16 eyeTimer;
|
||||
/* 0x2BC */ s16 loseAttentionTimer;
|
||||
/* 0x2BE */ s16 headRotZ;
|
||||
/* 0x2C0 */ s16 headRotY;
|
||||
/* 0x2C2 */ s16 torsoRotZ;
|
||||
/* 0x2C4 */ s16 torsoRotY;
|
||||
/* 0x2C8 */ s32 animIndex;
|
||||
/* 0x2CC */ s32 prevAnimIndex;
|
||||
/* 0x2D0 */ s32 isCutscenePlaying;
|
||||
|
||||
@@ -824,7 +824,7 @@ s32 func_80A3FE20(EnTest3* this, PlayState* play) {
|
||||
s32 func_80A3FF10(EnTest3* this, PlayState* play, struct_80A41828* arg2, ScheduleOutput* scheduleOutput) {
|
||||
static Vec3f D_80A418BC = { -420.0f, 210.0f, -162.0f };
|
||||
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_51_40)) {
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_COUPLES_MASK_CUTSCENE_FINISHED)) {
|
||||
D_80A41D68 = 2;
|
||||
Math_Vec3f_Copy(&this->player.actor.world.pos, &D_80A418BC);
|
||||
Math_Vec3f_Copy(&this->player.actor.home.pos, &D_80A418BC);
|
||||
@@ -856,7 +856,7 @@ s32 func_80A3FFD0(EnTest3* this, PlayState* play2) {
|
||||
D_80A41D68 = 2;
|
||||
}
|
||||
} else {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_51_40);
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_COUPLES_MASK_CUTSCENE_FINISHED);
|
||||
play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_110);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user