Document object_giant and finish documenting En_Giant (#521)

* First stab at XML

* Use object symbols in En_Giant

* Finish documenting En_Giant

* Document unknown blob and all Vtx

* Improve XML

* Respond to Elliptic's review

* Remove EN_ from the limb enum

* palette -> tlut

* File comment header

* Some reordering to make things more sensible

* One line comment styling

* Preserve ordering
This commit is contained in:
Tom Overton 2022-01-03 21:57:00 -08:00 committed by GitHub
parent d3e4a3368f
commit 4ca8658d77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 154 additions and 153 deletions

View File

@ -1,63 +1,90 @@
<Root>
<!-- Object for the Four Giants -->
<File Name="object_giant" Segment="6">
<Animation Name="object_giant_Anim_002168" Offset="0x2168" />
<!-- <Blob Name="object_giant_Blob_003D40" Size="0x90" Offset="0x3D40" /> -->
<DList Name="object_giant_DL_003DD0" Offset="0x3DD0" />
<DList Name="object_giant_DL_0040C0" Offset="0x40C0" />
<DList Name="object_giant_DL_004200" Offset="0x4200" />
<DList Name="object_giant_DL_004438" Offset="0x4438" />
<DList Name="object_giant_DL_004560" Offset="0x4560" />
<DList Name="object_giant_DL_0046A0" Offset="0x46A0" />
<DList Name="object_giant_DL_0048D8" Offset="0x48D8" />
<DList Name="object_giant_DL_004A00" Offset="0x4A00" />
<DList Name="object_giant_DL_004B10" Offset="0x4B10" />
<DList Name="object_giant_DL_004C38" Offset="0x4C38" />
<DList Name="object_giant_DL_004D58" Offset="0x4D58" />
<DList Name="object_giant_DL_004EC0" Offset="0x4EC0" />
<DList Name="object_giant_DL_004FD0" Offset="0x4FD0" />
<DList Name="object_giant_DL_0050F8" Offset="0x50F8" />
<DList Name="object_giant_DL_005218" Offset="0x5218" />
<Texture Name="object_giant_TLUT_005380" OutName="tlut_005380" Format="rgba16" Width="16" Height="16" Offset="0x5380" />
<Texture Name="object_giant_Tex_005580" OutName="tex_005580" Format="ci8" Width="16" Height="16" Offset="0x5580" />
<Texture Name="object_giant_Tex_005680" OutName="tex_005680" Format="ci8" Width="16" Height="16" Offset="0x5680" />
<Texture Name="object_giant_Tex_005780" OutName="tex_005780" Format="ci8" Width="16" Height="16" Offset="0x5780" />
<Texture Name="object_giant_Tex_005880" OutName="tex_005880" Format="ci8" Width="16" Height="16" Offset="0x5880" />
<Texture Name="object_giant_Tex_005980" OutName="tex_005980" Format="ci8" Width="16" Height="16" Offset="0x5980" />
<!-- <Blob Name="object_giant_Blob_005A80" Size="0x1800" Offset="0x5A80" /> -->
<Texture Name="object_giant_Tex_007280" OutName="tex_007280" Format="ci8" Width="16" Height="16" Offset="0x7280" />
<Texture Name="object_giant_Tex_007380" OutName="tex_007380" Format="ci8" Width="16" Height="32" Offset="0x7380" />
<DList Name="object_giant_DL_007610" Offset="0x7610" />
<Texture Name="object_giant_Tex_0076C0" OutName="tex_0076C0" Format="rgba16" Width="16" Height="16" Offset="0x76C0" />
<Limb Name="object_giant_Standardlimb_0078C0" Type="Standard" Offset="0x78C0" />
<Limb Name="object_giant_Standardlimb_0078CC" Type="Standard" Offset="0x78CC" />
<Limb Name="object_giant_Standardlimb_0078D8" Type="Standard" Offset="0x78D8" />
<Limb Name="object_giant_Standardlimb_0078E4" Type="Standard" Offset="0x78E4" />
<Limb Name="object_giant_Standardlimb_0078F0" Type="Standard" Offset="0x78F0" />
<Limb Name="object_giant_Standardlimb_0078FC" Type="Standard" Offset="0x78FC" />
<Limb Name="object_giant_Standardlimb_007908" Type="Standard" Offset="0x7908" />
<Limb Name="object_giant_Standardlimb_007914" Type="Standard" Offset="0x7914" />
<Limb Name="object_giant_Standardlimb_007920" Type="Standard" Offset="0x7920" />
<Limb Name="object_giant_Standardlimb_00792C" Type="Standard" Offset="0x792C" />
<Limb Name="object_giant_Standardlimb_007938" Type="Standard" Offset="0x7938" />
<Limb Name="object_giant_Standardlimb_007944" Type="Standard" Offset="0x7944" />
<Limb Name="object_giant_Standardlimb_007950" Type="Standard" Offset="0x7950" />
<Limb Name="object_giant_Standardlimb_00795C" Type="Standard" Offset="0x795C" />
<Limb Name="object_giant_Standardlimb_007968" Type="Standard" Offset="0x7968" />
<Skeleton Name="object_giant_Skel_0079B0" Type="Flex" LimbType="Standard" Offset="0x79B0" />
<Animation Name="object_giant_Anim_008394" Offset="0x8394" />
<Animation Name="object_giant_Anim_0096E4" Offset="0x96E4" />
<Animation Name="object_giant_Anim_00A1C4" Offset="0xA1C4" />
<Animation Name="object_giant_Anim_00ACA4" Offset="0xACA4" />
<Animation Name="object_giant_Anim_00B784" Offset="0xB784" />
<Animation Name="object_giant_Anim_00C5D4" Offset="0xC5D4" />
<Animation Name="object_giant_Anim_00D040" Offset="0xD040" />
<Animation Name="object_giant_Anim_00DE84" Offset="0xDE84" />
<Animation Name="object_giant_Anim_0102A4" Offset="0x102A4" />
<Animation Name="object_giant_Anim_0116E4" Offset="0x116E4" />
<Animation Name="object_giant_Anim_012A38" Offset="0x12A38" />
<Animation Name="object_giant_Anim_013004" Offset="0x13004" />
<Animation Name="object_giant_Anim_013FE8" Offset="0x13FE8" />
<Animation Name="object_giant_Anim_015334" Offset="0x15334" />
<Animation Name="object_giant_Anim_017944" Offset="0x17944" />
<Animation Name="gGiantLargeStrideAnim" Offset="0x2168" /> <!-- Original name is "kya_testwalk" -->
<!-- Giant Body Vertices. Contains everything but the beard. -->
<Array Name="gGiantBodyVtx" Count="444" Offset="0x2180">
<Vtx/>
</Array>
<!-- Giant Unused Beard Vertices. An exact duplicate of the beard vertices that are actually used. -->
<Array Name="gGiantUnusedBeardVtx" Count="9" Offset="0x3D40">
<Vtx/>
</Array>
<!-- Giant Limb DisplayLists -->
<DList Name="gGiantHeadDL" Offset="0x3DD0" />
<DList Name="gGiantRightThighDL" Offset="0x40C0" />
<DList Name="gGiantRightShinDL" Offset="0x4200" />
<DList Name="gGiantRightFootDL" Offset="0x4438" />
<DList Name="gGiantLeftThighDL" Offset="0x4560" />
<DList Name="gGiantLeftShinDL" Offset="0x46A0" />
<DList Name="gGiantLeftFootDL" Offset="0x48D8" />
<DList Name="gGiantRightShoulderDL" Offset="0x4A00" />
<DList Name="gGiantRightUpperArmDL" Offset="0x4B10" />
<DList Name="gGiantRightForearmDL" Offset="0x4C38" />
<DList Name="gGiantRightHandDL" Offset="0x4D58" />
<DList Name="gGiantLeftShoulderDL" Offset="0x4EC0" />
<DList Name="gGiantLeftUpperArmDL" Offset="0x4FD0" />
<DList Name="gGiantLeftForearmDL" Offset="0x50F8" />
<DList Name="gGiantLeftHandDL" Offset="0x5218" />
<!-- Giant Textures -->
<Texture Name="gGiantTLUT" OutName="giant_tlut" Format="rgba16" Width="16" Height="16" Offset="0x5380" />
<Texture Name="gGiantFootTex" OutName="giant_foot" Format="ci8" Width="16" Height="16" Offset="0x5580" />
<Texture Name="gGiantShinTex" OutName="giant_shin" Format="ci8" Width="16" Height="16" Offset="0x5680" />
<Texture Name="gGiantForearmAndKneeTex" OutName="giant_forearm_and_knee" Format="ci8" Width="16" Height="16" Offset="0x5780" />
<Texture Name="gGiantUpperArmAndThighTex" OutName="giant_upper_arm_and_thigh" Format="ci8" Width="16" Height="16" Offset="0x5880" />
<Texture Name="gGiantHandTex" OutName="giant_hand" Format="ci8" Width="16" Height="16" Offset="0x5980" />
<Texture Name="gGiantFaceEyeOpenTex" OutName="giant_face_eye_open" Format="ci8" Width="32" Height="64" Offset="0x5A80" TlutOffset="0x5380" />
<Texture Name="gGiantFaceEyeHalfTex" OutName="giant_face_eye_half" Format="ci8" Width="32" Height="64" Offset="0x6280" TlutOffset="0x5380" />
<Texture Name="gGiantFaceEyeClosedTex" OutName="giant_face_eye_closed" Format="ci8" Width="32" Height="64" Offset="0x6A80" TlutOffset="0x5380" />
<Texture Name="gGiantGroinTex" OutName="giant_groin" Format="ci8" Width="16" Height="16" Offset="0x7280" />
<Texture Name="gGiantHairTex" OutName="giant_hair" Format="ci8" Width="16" Height="32" Offset="0x7380" />
<!-- Giant Beard Vertices, DisplayList, and Texture -->
<Array Name="gGiantBeardVtx" Count="9" Offset="0x7580">
<Vtx/>
</Array>
<DList Name="gGiantBeardDL" Offset="0x7610" />
<Texture Name="gGiantBeardTex" OutName="giant_beard" Format="rgba16" Width="16" Height="16" Offset="0x76C0" />
<!-- Giant Limbs -->
<Limb Name="gGiantHeadLimb" Type="Standard" Offset="0x78C0" />
<Limb Name="gGiantLeftThighLimb" Type="Standard" Offset="0x78CC" />
<Limb Name="gGiantLeftShinLimb" Type="Standard" Offset="0x78D8" />
<Limb Name="gGiantLeftFootLimb" Type="Standard" Offset="0x78E4" />
<Limb Name="gGiantRightThighLimb" Type="Standard" Offset="0x78F0" />
<Limb Name="gGiantRightShinLimb" Type="Standard" Offset="0x78FC" />
<Limb Name="gGiantRightFootLimb" Type="Standard" Offset="0x7908" />
<Limb Name="gGiantLeftShoulderLimb" Type="Standard" Offset="0x7914" />
<Limb Name="gGiantLeftUpperArmLimb" Type="Standard" Offset="0x7920" />
<Limb Name="gGiantLeftForearmLimb" Type="Standard" Offset="0x792C" />
<Limb Name="gGiantLeftHandLimb" Type="Standard" Offset="0x7938" />
<Limb Name="gGiantRightShoulderLimb" Type="Standard" Offset="0x7944" />
<Limb Name="gGiantRightUpperArmLimb" Type="Standard" Offset="0x7950" />
<Limb Name="gGiantRightForearmLimb" Type="Standard" Offset="0x795C" />
<Limb Name="gGiantRightHandLimb" Type="Standard" Offset="0x7968" />
<!-- Giant Skeleton -->
<Skeleton Name="gGiantSkel" Type="Flex" LimbType="Standard" Offset="0x79B0" />
<!-- Giant Animations -->
<Animation Name="gGiantLookUpStartAnim" Offset="0x8394" /> <!-- Original name is "kyo_kaoage" ("raising face") -->
<Animation Name="gGiantLookUpLoopAnim" Offset="0x96E4" /> <!-- Original name is "kyo_kaoage_loop" -->
<Animation Name="gGiantBigCallStartAnim" Offset="0xA1C4" /> <!-- Original name is "kyo_sakebi" ("cry"). Stretches his arms outward -->
<Animation Name="gGiantSmallCallStartAnim" Offset="0xACA4" /> <!-- Original name is "kyo_sakebi2" ("cry2"). Places his hands over his mouth -->
<Animation Name="gGiantSmallCallLoopAnim" Offset="0xB784" /> <!-- Original name is "kyo_sakebi2_loop" -->
<Animation Name="gGiantSmallCallEndAnim" Offset="0xC5D4" /> <!-- Original name is "kyo_sakebi2_modori" ("cry2 return") -->
<Animation Name="gGiantBigCallLoopAnim" Offset="0xD040" /> <!-- Original name is "kyo_sakebi_loop" -->
<Animation Name="gGiantBigCallEndAnim" Offset="0xDE84" /> <!-- Original name is "kyo_sakebi_modori" ("cry return") -->
<Animation Name="gGiantFallingOverAnim" Offset="0x102A4" /> <!-- Original name is "kyo_taoreru" ("falling over") -->
<Animation Name="gGiantRaisedArmsStartAnim" Offset="0x116E4" /> <!-- Original name is "kyo_teage" ("raising arm") -->
<Animation Name="gGiantRaisedArmsLoopAnim" Offset="0x12A38" /> <!-- Original name is "kyo_teage_loop" -->
<Animation Name="gGiantStruggleStartAnim" Offset="0x13004" /> <!-- Original name is "kyo_tukisasae" ("holding up the moon") -->
<Animation Name="gGiantStruggleLoopAnim" Offset="0x13FE8" /> <!-- Original name is "kyo_tukisasae_loop" -->
<Animation Name="gGiantIdleAnim" Offset="0x15334" /> <!-- Original name is "kyo_wait" -->
<Animation Name="gGiantWalkingAnim" Offset="0x17944" /> <!-- Original name is "kyo_walk" -->
</File>
</Root>

View File

@ -5,6 +5,7 @@
*/
#include "z_en_giant.h"
#include "objects/object_giant/object_giant.h"
#define FLAGS 0x00000030
@ -31,41 +32,21 @@ const ActorInit En_Giant_InitVars = {
(ActorFunc)EnGiant_Draw,
};
extern AnimationHeader D_06002168;
extern Gfx D_06005A80[];
extern Gfx D_06006280[];
extern Gfx D_06007610[];
extern Gfx D_06006A80[];
extern FlexSkeletonHeader D_060079B0;
extern AnimationHeader D_06008394;
extern AnimationHeader D_060096E4;
extern AnimationHeader D_0600A1C4;
extern AnimationHeader D_0600ACA4;
extern AnimationHeader D_0600B784;
extern AnimationHeader D_0600C5D4;
extern AnimationHeader D_0600D040;
extern AnimationHeader D_0600DE84;
extern AnimationHeader D_060102A4;
extern AnimationHeader D_060116E4;
extern AnimationHeader D_06012A38;
extern AnimationHeader D_06013004;
extern AnimationHeader D_06013FE8;
extern AnimationHeader D_06015334;
extern AnimationHeader D_06017944;
static AnimationHeader* sAnimationTable[] = {
&D_06008394, &D_060096E4, &D_060102A4, &D_060116E4, &D_06012A38, &D_06013004, &D_06013FE8, &D_06015334,
&D_06017944, &D_0600A1C4, &D_0600D040, &D_0600DE84, &D_0600ACA4, &D_0600B784, &D_0600C5D4,
static AnimationHeader* sAnimations[] = {
&gGiantLookUpStartAnim, &gGiantLookUpLoopAnim, &gGiantFallingOverAnim, &gGiantRaisedArmsStartAnim,
&gGiantRaisedArmsLoopAnim, &gGiantStruggleStartAnim, &gGiantStruggleLoopAnim, &gGiantIdleAnim,
&gGiantWalkingAnim, &gGiantBigCallStartAnim, &gGiantBigCallLoopAnim, &gGiantBigCallEndAnim,
&gGiantSmallCallStartAnim, &gGiantSmallCallLoopAnim, &gGiantSmallCallEndAnim,
};
void EnGiant_ChangeAnimation(EnGiant* this, s16 newAnimationId) {
if (newAnimationId >= GIANT_ANIMATION_LOOK_UP_START && newAnimationId < GIANT_ANIMATION_MAX) {
if ((this->animationId == GIANT_ANIMATION_WALKING_LOOP && newAnimationId != GIANT_ANIMATION_WALKING_LOOP) ||
(newAnimationId == GIANT_ANIMATION_WALKING_LOOP && this->animationId != GIANT_ANIMATION_WALKING_LOOP)) {
Animation_Change(&this->skelAnime, sAnimationTable[newAnimationId], 1.0f, 0.0f,
Animation_GetLastFrame(&sAnimationTable[newAnimationId]->common), 2, 10.0f);
Animation_Change(&this->skelAnime, sAnimations[newAnimationId], 1.0f, 0.0f,
Animation_GetLastFrame(&sAnimations[newAnimationId]->common), 2, 10.0f);
} else {
Animation_PlayOnce(&this->skelAnime, sAnimationTable[newAnimationId]);
Animation_PlayOnce(&this->skelAnime, sAnimations[newAnimationId]);
}
this->animationId = newAnimationId;
}
@ -118,7 +99,8 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.uncullZoneScale = 2000.0f;
this->actor.uncullZoneDownward = 2400.0f;
Actor_SetScale(&this->actor, 0.32f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060079B0, &D_06002168, this->jointTable, this->morphTable, 16);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGiantSkel, &gGiantLargeStrideAnim, this->jointTable,
this->morphTable, GIANT_LIMB_MAX);
EnGiant_ChangeAnimation(this, GIANT_ANIMATION_IDLE_LOOP);
this->csAction = GIANT_CS_ACTION_NONE;
this->actionFunc = EnGiant_PerformCutsceneActions;
@ -131,20 +113,20 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) {
case GIANT_TYPE_CANYON_TERMINA_FIELD:
case GIANT_TYPE_CANYON_CLOCK_TOWER_SUCCESS:
case GIANT_TYPE_CANYON_GIANTS_CHAMBER_AND_ENDING:
this->unk_24A = 0x1C6;
this->actorActionCommand = 0x1C6;
break;
case GIANT_TYPE_SWAMP_TERMINA_FIELD:
case GIANT_TYPE_SWAMP_CLOCK_TOWER_SUCCESS:
case GIANT_TYPE_SWAMP_GIANTS_CHAMBER_AND_ENDING:
this->unk_24A = 0x1C7;
this->actorActionCommand = 0x1C7;
break;
case GIANT_TYPE_OCEAN_TERMINA_FIELD:
case GIANT_TYPE_OCEAN_CLOCK_TOWER_SUCCESS:
case GIANT_TYPE_OCEAN_GIANTS_CHAMBER_AND_ENDING:
this->unk_24A = 0x1C8;
this->actorActionCommand = 0x1C8;
break;
default:
this->unk_24A = 0x1C5;
this->actorActionCommand = 0x1C5;
break;
}
@ -153,11 +135,12 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
return;
}
this->unk_24A = 0x1C5;
this->actorActionCommand = 0x1C5;
Actor_SetScale(&this->actor, 0.32f);
this->actionFunc = EnGiant_PerformClockTowerSuccessActions;
Animation_Change(&this->skelAnime, &D_060116E4, 0.0f, Animation_GetLastFrame(&D_060116E4) - 1.0f,
Animation_GetLastFrame(&D_060116E4), 2, 0.0f);
Animation_Change(&this->skelAnime, &gGiantRaisedArmsStartAnim, 0.0f,
Animation_GetLastFrame(&gGiantRaisedArmsStartAnim) - 1.0f,
Animation_GetLastFrame(&gGiantRaisedArmsStartAnim), 2, 0.0f);
this->actor.draw = EnGiant_Draw;
this->actor.velocity.y = 0.0f;
this->actor.minVelocityY = 0.0f;
@ -167,7 +150,8 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) {
if (GIANT_TYPE_IS_CLOCK_TOWER_FAILURE(type)) {
Actor_SetScale(&this->actor, 0.32f);
this->actionFunc = EnGiant_PlayClockTowerFailureAnimation;
Animation_Change(&this->skelAnime, &D_06013FE8, 1.0f, 0.0f, Animation_GetLastFrame(&D_06013004), 0, 0.0f);
Animation_Change(&this->skelAnime, &gGiantStruggleLoopAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gGiantStruggleStartAnim), 0, 0.0f);
this->actor.draw = EnGiant_Draw;
this->actor.velocity.y = 0.0f;
this->actor.minVelocityY = 0.0f;
@ -204,7 +188,7 @@ void EnGiant_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
/**
* The animations in sAnimationTable are organized such that looping animations
* The animations in sAnimations are organized such that looping animations
* appear immediately after their respective starting animations. The point of
* this function is to play the requested start animation if it has not been
* played yet and play the respetive looping animation otherwise.
@ -266,8 +250,9 @@ void EnGiant_ChangeAnimationBasedOnCsAction(EnGiant* this) {
}
break;
case GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER:
Animation_Change(&this->skelAnime, &D_060116E4, 0.0f, Animation_GetLastFrame(&D_060116E4) - 1.0f,
Animation_GetLastFrame(&D_060116E4), 2, 0.0f);
Animation_Change(&this->skelAnime, &gGiantRaisedArmsStartAnim, 0.0f,
Animation_GetLastFrame(&gGiantRaisedArmsStartAnim) - 1.0f,
Animation_GetLastFrame(&gGiantRaisedArmsStartAnim), 2, 0.0f);
break;
}
}
@ -352,20 +337,19 @@ void EnGiant_PlaySound(EnGiant* this) {
void EnGiant_UpdatePosition(EnGiant* this, GlobalContext* globalCtx, u32 actionIndex) {
CsCmdActorAction* actorAction = globalCtx->csCtx.npcActions[actionIndex];
f32 floatUnk10 = actorAction->unk0C.y;
f32 startPosY = actorAction->unk0C.y;
s32 pad[2];
f32 floatUnk1C = actorAction->unk18.y;
f32 functionTemp;
f32 endPosY = actorAction->unk18.y;
f32 scale = func_800F5A8C(actorAction->endFrame, actorAction->startFrame, globalCtx->csCtx.frames, globalCtx);
functionTemp = func_800F5A8C(actorAction->endFrame, actorAction->startFrame, globalCtx->csCtx.frames, globalCtx);
this->actor.world.pos.y = ((floatUnk1C - floatUnk10) * functionTemp) + floatUnk10;
this->actor.world.pos.y = ((endPosY - startPosY) * scale) + startPosY;
}
void EnGiant_PerformClockTowerSuccessActions(EnGiant* this, GlobalContext* globalCtx) {
if (func_800EE29C(globalCtx, this->unk_24A)) {
EnGiant_UpdatePosition(this, globalCtx, func_800EE200(globalCtx, this->unk_24A));
if (this->csAction != globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->unk_24A)]->unk0) {
this->csAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->unk_24A)]->unk0;
if (func_800EE29C(globalCtx, this->actorActionCommand)) {
EnGiant_UpdatePosition(this, globalCtx, func_800EE200(globalCtx, this->actorActionCommand));
if (this->csAction != globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->actorActionCommand)]->unk0) {
this->csAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->actorActionCommand)]->unk0;
EnGiant_ChangeAnimationBasedOnCsAction(this);
}
EnGiant_UpdateAlpha(this);
@ -385,10 +369,10 @@ void EnGiant_PlayClockTowerFailureAnimation(EnGiant* this, GlobalContext* global
void EnGiant_PerformCutsceneActions(EnGiant* this, GlobalContext* globalCtx) {
this->actor.draw = EnGiant_Draw;
if (func_800EE29C(globalCtx, this->unk_24A)) {
func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, this->unk_24A));
if (this->csAction != globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->unk_24A)]->unk0) {
this->csAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->unk_24A)]->unk0;
if (func_800EE29C(globalCtx, this->actorActionCommand)) {
func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, this->actorActionCommand));
if (this->csAction != globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->actorActionCommand)]->unk0) {
this->csAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->actorActionCommand)]->unk0;
EnGiant_ChangeAnimationBasedOnCsAction(this);
}
EnGiant_UpdateAlpha(this);
@ -427,10 +411,10 @@ void EnGiant_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void EnGiant_PostLimbDrawOpa(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
if (limbIndex == 1) {
if (limbIndex == GIANT_LIMB_HEAD) {
OPEN_DISPS(globalCtx->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, D_06007610);
gSPDisplayList(POLY_OPA_DISP++, gGiantBeardDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@ -440,21 +424,15 @@ void EnGiant_PostLimbDrawXlu(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
Gfx** gfx) {
EnGiant* this = THIS;
if (limbIndex == 1) {
Matrix_CopyCurrentState(&this->unk_254);
if (limbIndex == GIANT_LIMB_HEAD) {
Matrix_CopyCurrentState(&this->headDrawMtxF);
}
}
void EnGiant_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnGiant* this = THIS;
/**
* 0 = eyes fully open face
* 1 = eyes half-closed face
* 2 = eyes fully closed face
*/
static TexturePtr sFaceTextures[] = { D_06005A80, D_06006280, D_06006A80 };
static TexturePtr sFaceTextures[] = { gGiantFaceEyeOpenTex, gGiantFaceEyeHalfTex, gGiantFaceEyeClosedTex };
if (this->alpha > 0) {
OPEN_DISPS(globalCtx->state.gfxCtx);
@ -479,10 +457,10 @@ void EnGiant_Draw(Actor* thisx, GlobalContext* globalCtx) {
POLY_XLU_DISP =
SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, NULL, EnGiant_PostLimbDrawXlu, thisx, POLY_XLU_DISP);
Matrix_InsertMatrix(&this->unk_254, MTXMODE_NEW);
Matrix_InsertMatrix(&this->headDrawMtxF, MTXMODE_NEW);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_06007610);
gSPDisplayList(POLY_XLU_DISP++, gGiantBeardDL);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);

View File

@ -86,6 +86,26 @@ typedef enum {
/* 15 */ GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER
} GiantCsActionIndex;
typedef enum {
/* 0 */ GIANT_LIMB_NONE,
/* 1 */ GIANT_LIMB_HEAD,
/* 2 */ GIANT_LIMB_LEFT_THIGH,
/* 3 */ GIANT_LIMB_LEFT_LOWER_LEG,
/* 4 */ GIANT_LIMB_LEFT_FOOT,
/* 5 */ GIANT_LIMB_RIGHT_THIGH,
/* 6 */ GIANT_LIMB_RIGHT_LOWER_LEG,
/* 7 */ GIANT_LIMB_RIGHT_FOOT,
/* 8 */ GIANT_LIMB_LEFT_SHOULDER,
/* 9 */ GIANT_LIMB_LEFT_UPPER_ARM,
/* 10 */ GIANT_LIMB_LEFT_FOREARM,
/* 11 */ GIANT_LIMB_LEFT_HAND,
/* 12 */ GIANT_LIMB_RIGHT_SHOULDER,
/* 13 */ GIANT_LIMB_RIGHT_UPPER_ARM,
/* 14 */ GIANT_LIMB_RIGHT_FOREARM,
/* 15 */ GIANT_LIMB_RIGHT_HAND,
/* 16 */ GIANT_LIMB_MAX,
} EnGiantLimbs;
struct EnGiant;
typedef void (*EnGiantActionFunc)(struct EnGiant*, GlobalContext*);
@ -93,14 +113,14 @@ typedef void (*EnGiantActionFunc)(struct EnGiant*, GlobalContext*);
typedef struct EnGiant {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[16];
/* 0x1E8 */ Vec3s morphTable[16];
/* 0x188 */ Vec3s jointTable[GIANT_LIMB_MAX];
/* 0x1E8 */ Vec3s morphTable[GIANT_LIMB_MAX];
/* 0x248 */ s16 animationId;
/* 0x24A */ u16 unk_24A;
/* 0x24A */ u16 actorActionCommand;
/* 0x24C */ u16 csAction;
/* 0x24E */ s16 alpha;
/* 0x250 */ u16 sfxId;
/* 0x254 */ MtxF unk_254;
/* 0x254 */ MtxF headDrawMtxF;
/* 0x294 */ s16 faceIndex;
/* 0x296 */ s16 blinkTimer;
/* 0x298 */ EnGiantActionFunc actionFunc;

View File

@ -2308,30 +2308,6 @@ D_0600F6C0 = 0x0600F6C0;
D_0600F578 = 0x0600F578;
D_0600F6C0 = 0x0600F6C0;
// ovl_En_Giant
D_06002168 = 0x06002168;
D_06005A80 = 0x06005A80;
D_06006280 = 0x06006280;
D_06006A80 = 0x06006A80;
D_06007610 = 0x06007610;
D_060079B0 = 0x060079B0;
D_06008394 = 0x06008394;
D_060096E4 = 0x060096E4;
D_0600A1C4 = 0x0600A1C4;
D_0600ACA4 = 0x0600ACA4;
D_0600B784 = 0x0600B784;
D_0600C5D4 = 0x0600C5D4;
D_0600D040 = 0x0600D040;
D_0600DE84 = 0x0600DE84;
D_060102A4 = 0x060102A4;
D_060116E4 = 0x060116E4;
D_06012A38 = 0x06012A38;
D_06013004 = 0x06013004;
D_06013FE8 = 0x06013FE8;
D_06015334 = 0x06015334;
D_06017944 = 0x06017944;
// ovl_En_Ginko_Man
D_060008C0 = 0x060008C0;