Document object_uch (Aliens) and remove a dummy label match in EnInvadepoh (#899)

* Document object_uch (Aliens)

* Remove dummy label match that has been annoying me for a year!!!!!!!!!!!!!

* Respond to reviews

* Fix a small thing brought up in review

* Swap to gAlienJerkingAnim
This commit is contained in:
Tom Overton 2022-07-11 19:52:43 -07:00 committed by GitHub
parent d9a39c6ccc
commit acb9216daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 89 additions and 71 deletions

View File

@ -1,46 +1,64 @@
<Root>
<!-- Assets for the Ghosts, more-commonly known as the aliens -->
<File Name="object_uch" Segment="6">
<DList Name="object_uch_DL_000080" Offset="0x80" />
<Texture Name="object_uch_Tex_000130" OutName="tex_000130" Format="i8" Width="32" Height="32" Offset="0x130" />
<TextureAnimation Name="object_uch_Matanimheader_000550" Offset="0x550" />
<TextureAnimation Name="object_uch_Matanimheader_000560" Offset="0x560" />
<Animation Name="object_uch_Anim_000608" Offset="0x608" />
<Animation Name="object_uch_Anim_0006C8" Offset="0x6C8" />
<DList Name="object_uch_DL_000720" Offset="0x720" />
<Texture Name="object_uch_Tex_0007B8" OutName="tex_0007B8" Format="ia16" Width="32" Height="32" Offset="0x7B8" />
<Animation Name="object_uch_Anim_001674" Offset="0x1674" />
<Animation Name="object_uch_Anim_001D80" Offset="0x1D80" />
<DList Name="object_uch_DL_002CD0" Offset="0x2CD0" />
<DList Name="object_uch_DL_002F08" Offset="0x2F08" />
<DList Name="object_uch_DL_002FA8" Offset="0x2FA8" />
<DList Name="object_uch_DL_003048" Offset="0x3048" />
<DList Name="object_uch_DL_003128" Offset="0x3128" />
<DList Name="object_uch_DL_003290" Offset="0x3290" />
<DList Name="object_uch_DL_003410" Offset="0x3410" />
<DList Name="object_uch_DL_0035E8" Offset="0x35E8" />
<DList Name="object_uch_DL_0037E0" Offset="0x37E0" />
<DList Name="object_uch_DL_0038C0" Offset="0x38C0" />
<DList Name="object_uch_DL_003A28" Offset="0x3A28" />
<DList Name="object_uch_DL_003BA8" Offset="0x3BA8" />
<Texture Name="object_uch_TLUT_003D80" OutName="tlut_003D80" Format="rgba16" Width="16" Height="16" Offset="0x3D80" />
<Texture Name="object_uch_Tex_003F80" OutName="tex_003F80" Format="ci8" Width="16" Height="16" Offset="0x3F80" />
<Texture Name="object_uch_Tex_004080" OutName="tex_004080" Format="ci8" Width="16" Height="16" Offset="0x4080" />
<Texture Name="object_uch_Tex_004180" OutName="tex_004180" Format="ci8" Width="16" Height="32" Offset="0x4180" />
<Texture Name="object_uch_Tex_004380" OutName="tex_004380" Format="ci8" Width="16" Height="32" Offset="0x4380" />
<Texture Name="object_uch_Tex_004580" OutName="tex_004580" Format="rgba16" Width="32" Height="32" Offset="0x4580" />
<Limb Name="object_uch_Standardlimb_004D80" Type="Standard" EnumName="OBJECT_UCH_LIMB_01" Offset="0x4D80" />
<Limb Name="object_uch_Standardlimb_004D8C" Type="Standard" EnumName="OBJECT_UCH_LIMB_02" Offset="0x4D8C" />
<Limb Name="object_uch_Standardlimb_004D98" Type="Standard" EnumName="OBJECT_UCH_LIMB_03" Offset="0x4D98" />
<Limb Name="object_uch_Standardlimb_004DA4" Type="Standard" EnumName="OBJECT_UCH_LIMB_04" Offset="0x4DA4" />
<Limb Name="object_uch_Standardlimb_004DB0" Type="Standard" EnumName="OBJECT_UCH_LIMB_05" Offset="0x4DB0" />
<Limb Name="object_uch_Standardlimb_004DBC" Type="Standard" EnumName="OBJECT_UCH_LIMB_06" Offset="0x4DBC" />
<Limb Name="object_uch_Standardlimb_004DC8" Type="Standard" EnumName="OBJECT_UCH_LIMB_07" Offset="0x4DC8" />
<Limb Name="object_uch_Standardlimb_004DD4" Type="Standard" EnumName="OBJECT_UCH_LIMB_08" Offset="0x4DD4" />
<Limb Name="object_uch_Standardlimb_004DE0" Type="Standard" EnumName="OBJECT_UCH_LIMB_09" Offset="0x4DE0" />
<Limb Name="object_uch_Standardlimb_004DEC" Type="Standard" EnumName="OBJECT_UCH_LIMB_0A" Offset="0x4DEC" />
<Limb Name="object_uch_Standardlimb_004DF8" Type="Standard" EnumName="OBJECT_UCH_LIMB_0B" Offset="0x4DF8" />
<Limb Name="object_uch_Standardlimb_004E04" Type="Standard" EnumName="OBJECT_UCH_LIMB_0C" Offset="0x4E04" />
<Limb Name="object_uch_Standardlimb_004E10" Type="Standard" EnumName="OBJECT_UCH_LIMB_0D" Offset="0x4E10" />
<Skeleton Name="object_uch_Skel_004E50" Type="Flex" LimbType="Standard" LimbNone="OBJECT_UCH_LIMB_NONE" LimbMax="OBJECT_UCH_LIMB_MAX" EnumName="object_uch_Limbs" Offset="0x4E50" />
<!-- Assets for the beam of light coming from the alien's eyes. -->
<DList Name="gAlienEyeBeamDL" Offset="0x80" />
<Texture Name="gAlienEyeBeamMaskTex" OutName="alien_eye_beam_mask" Format="i8" Width="32" Height="32" Offset="0x130" />
<TextureAnimation Name="gAlienEyeBeamTexAnim" Offset="0x550" />
<!-- An empty texture animation, seemingly planned to animate something on the alien's body. -->
<TextureAnimation Name="gAlienEmptyTexAnim" Offset="0x560" />
<!-- Alien Animations -->
<Animation Name="gAlienDeathAnim" Offset="0x608" /> <!-- Original name is "uch_die_body" -->
<Animation Name="gAlienJerkingAnim" Offset="0x6C8" /> <!-- Original name is "uch_gaku_body" (probably short for the onomatopoeia for "jerking") -->
<!-- Assets for the flash of light that appears when an alien dies. -->
<DList Name="gAlienDeathFlashDL" Offset="0x720" />
<Texture Name="gAlienDeathFlashMaskTex" OutName="alien_death_flash_mask" Format="ia16" Width="32" Height="32" Offset="0x7B8" />
<!-- Alien Animations -->
<Animation Name="gAlienHoldingCowAnim" Offset="0x1674" /> <!-- Original name is "uch_take_body" -->
<Animation Name="gAlienFloatAnim" Offset="0x1D80" /> <!-- Original name is "uch_wait_body" -->
<!-- Alien Limb DisplayLists -->
<DList Name="gAlienHeadDL" Offset="0x2CD0" />
<DList Name="gAlienRightEyeDL" Offset="0x2F08" />
<DList Name="gAlienLeftEyeDL" Offset="0x2FA8" />
<DList Name="gAlienLeftShoulderDL" Offset="0x3048" />
<DList Name="gAlienLeftUpperArmDL" Offset="0x3128" />
<DList Name="gAlienLeftForearmDL" Offset="0x3290" />
<DList Name="gAlienLeftHandDL" Offset="0x3410" />
<DList Name="gAlienTorsoDL" Offset="0x35E8" />
<DList Name="gAlienRightShoulderDL" Offset="0x37E0" />
<DList Name="gAlienRightUpperArmDL" Offset="0x38C0" />
<DList Name="gAlienRightForearmDL" Offset="0x3A28" />
<DList Name="gAlienRightHandDL" Offset="0x3BA8" />
<!-- Alien Textures -->
<Texture Name="gAlienTLUT" OutName="alien_tlut" Format="rgba16" Width="16" Height="16" Offset="0x3D80" />
<Texture Name="gAlienTorsoTex" OutName="alien_torso" Format="ci8" Width="16" Height="16" Offset="0x3F80" />
<Texture Name="gAlienHandsAndTorsoUndersideTex" OutName="alien_hands_and_torso_underside" Format="ci8" Width="16" Height="16" Offset="0x4080" />
<Texture Name="gAlienHeadFrontAndArmsTex" OutName="alien_head_front_and_arms" Format="ci8" Width="16" Height="32" Offset="0x4180" />
<Texture Name="gAlienHeadBackTex" OutName="alien_head_back" Format="ci8" Width="16" Height="32" Offset="0x4380" />
<Texture Name="gAlienEyeTex" OutName="alien_eye" Format="rgba16" Width="32" Height="32" Offset="0x4580" />
<!-- Alien Limbs -->
<Limb Name="gAlienRootLimb" Type="Standard" EnumName="ALIEN_LIMB_ROOT" Offset="0x4D80" />
<Limb Name="gAlienTorsoLimb" Type="Standard" EnumName="ALIEN_LIMB_TORSO" Offset="0x4D8C" />
<Limb Name="gAlienRightShoulderLimb" Type="Standard" EnumName="ALIEN_LIMB_RIGHT_SHOULDER" Offset="0x4D98" />
<Limb Name="gAlienRightUpperArmLimb" Type="Standard" EnumName="ALIEN_LIMB_RIGHT_UPPER_ARM" Offset="0x4DA4" />
<Limb Name="gAlienRightForearmLimb" Type="Standard" EnumName="ALIEN_LIMB_RIGHT_FOREARM" Offset="0x4DB0" />
<Limb Name="gAlienRightHandLimb" Type="Standard" EnumName="ALIEN_LIMB_RIGHT_HAND" Offset="0x4DBC" />
<Limb Name="gAlienLeftShoulderLimb" Type="Standard" EnumName="ALIEN_LIMB_LEFT_SHOULDER" Offset="0x4DC8" />
<Limb Name="gAlienLeftUpperArmLimb" Type="Standard" EnumName="ALIEN_LIMB_LEFT_UPPER_ARM" Offset="0x4DD4" />
<Limb Name="gAlienLeftForearmLimb" Type="Standard" EnumName="ALIEN_LIMB_LEFT_FOREARM" Offset="0x4DE0" />
<Limb Name="gAlienLeftHandLimb" Type="Standard" EnumName="ALIEN_LIMB_LEFT_HAND" Offset="0x4DEC" />
<Limb Name="gAlienHeadLimb" Type="Standard" EnumName="ALIEN_LIMB_HEAD" Offset="0x4DF8" />
<Limb Name="gAlienLeftEyeLimb" Type="Standard" EnumName="ALIEN_LIMB_LEFT_EYE" Offset="0x4E04" />
<Limb Name="gAlienRightEyeLimb" Type="Standard" EnumName="ALIEN_LIMB_RIGHT_EYE" Offset="0x4E10" />
<!-- Alien Skeleton -->
<Skeleton Name="gAlienSkel" Type="Flex" LimbType="Standard" LimbNone="ALIEN_LIMB_NONE" LimbMax="ALIEN_LIMB_MAX" EnumName="AlienLimbs" Offset="0x4E50" />
</File>
</Root>

View File

@ -618,8 +618,8 @@ unkStruct80B50350 D_80B50350[10];
EnInvadepoh* D_80B503F0;
EnInvadepoh* D_80B503F4;
EnInvadepoh* D_80B503F8;
AnimatedMaterial* D_80B503FC;
AnimatedMaterial* D_80B50400;
AnimatedMaterial* sAlienEyeBeamTexAnim;
AnimatedMaterial* sAlienEmptyTexAnim;
s16 D_80B50404[3];
EnInvadepoh* D_80B5040C;
@ -1225,8 +1225,8 @@ void func_80B44FEC(void) {
}
void func_80B45080(void) {
D_80B50400 = Lib_SegmentedToVirtual(object_uch_Matanimheader_000560);
D_80B503FC = Lib_SegmentedToVirtual(object_uch_Matanimheader_000550);
sAlienEmptyTexAnim = Lib_SegmentedToVirtual(gAlienEmptyTexAnim);
sAlienEyeBeamTexAnim = Lib_SegmentedToVirtual(gAlienEyeBeamTexAnim);
}
s32 func_80B450C0(f32* x1, f32* z1, f32 x2, f32 z2, f32 speed) {
@ -1424,11 +1424,11 @@ EnInvadepoh* func_80B458D8(void) {
s8 func_80B45980(unkstructInvadepoh1* arg0, s32 arg1) {
f32 rand = Rand_ZeroOne();
s32 i;
unkstructInvadepoh1* ptr = arg0;
arg1--;
for (i = 0; i < arg1; i++) {
dummy:;
if (arg0[i].unk04 >= rand) {
for (i = 0; i < arg1; i++, ptr++) {
if (ptr->unk04 >= rand) {
break;
}
}
@ -1680,7 +1680,7 @@ void EnInvadepoh_InitAlien(EnInvadepoh* this, PlayState* play) {
ActorShape_Init(&this->actor.shape, 6800.0f, ActorShadow_DrawWhiteCircle, 150.0f);
this->actor.shape.shadowAlpha = 140;
this->actor.flags = (ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_80000000);
if (INVADEPOH_TYPE(this) == TYPE_ALIEN1) {
if (INVADEPOH_TYPE(this) == TYPE_ALIEN_CARRYING_COW) {
this->actor.update = func_80B4D670;
this->actor.world.pos.y = this->actor.home.pos.y + 150.0f;
} else {
@ -2115,7 +2115,7 @@ void func_80B474DC(EnInvadepoh* this, PlayState* play) {
}
void func_80B47568(EnInvadepoh* this) {
Animation_MorphToLoop(&this->skelAnime, &object_uch_Anim_001D80, -6.0f);
Animation_MorphToLoop(&this->skelAnime, &gAlienFloatAnim, -6.0f);
this->collider.base.atFlags &= ~AT_ON;
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.ocFlags1 &= ~OC1_ON;
@ -2157,8 +2157,8 @@ void func_80B47600(EnInvadepoh* this, PlayState* play) {
}
void func_80B4770C(EnInvadepoh* this) {
if (this->skelAnime.animation != &object_uch_Anim_001D80) {
Animation_MorphToLoop(&this->skelAnime, &object_uch_Anim_001D80, -6.0f);
if (this->skelAnime.animation != &gAlienFloatAnim) {
Animation_MorphToLoop(&this->skelAnime, &gAlienFloatAnim, -6.0f);
}
this->collider.base.atFlags |= AT_ON;
this->collider.base.acFlags |= AC_ON;
@ -2186,7 +2186,7 @@ void func_80B47830(EnInvadepoh* this) {
this->collider.base.atFlags &= ~AT_ON;
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.ocFlags1 |= OC1_ON;
Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_0006C8);
Animation_PlayLoop(&this->skelAnime, &gAlienJerkingAnim);
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16);
this->alienAlpha = 255;
this->actor.draw = func_80B4DB14;
@ -2211,7 +2211,7 @@ void func_80B47938(EnInvadepoh* this) {
this->collider.base.atFlags &= ~AT_ON;
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.ocFlags1 &= ~OC1_ON;
Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_000608);
Animation_PlayLoop(&this->skelAnime, &gAlienDeathAnim);
this->actor.flags &= ~ACTOR_FLAG_1;
this->actionTimer = 10;
this->alienAlpha = 255;
@ -2282,8 +2282,8 @@ void func_80B47BAC(Actor* thisx, PlayState* play) {
Actor_SetObjectDependency(play, &this->actor);
func_80B45080();
this->actor.update = func_80B47D30;
SkelAnime_InitFlex(play, &this->skelAnime, &object_uch_Skel_004E50, &object_uch_Anim_001D80, this->jointTable,
this->morphTable, 14);
SkelAnime_InitFlex(play, &this->skelAnime, &gAlienSkel, &gAlienFloatAnim, this->jointTable, this->morphTable,
ALIEN_LIMB_MAX);
this->skelAnime.curFrame = (this->actor.params & 7) * this->skelAnime.endFrame * 0.125f;
func_80B444BC(this, play);
func_80B442E4(this);
@ -3683,7 +3683,7 @@ void func_80B4BA84(Actor* thisx, PlayState* play) {
D_80B5040C = func_80B458D8();
if (D_80B5040C == NULL) {
temp_v0_2 = (this->unk3BC < 0) ^ 1;
temp_v0_2 = this->unk3BC >= 0;
this->unk3BC = -1;
if (temp_v0_2) {
func_80B4B820(this);
@ -4147,7 +4147,7 @@ void func_80B4D15C(EnInvadepoh* this) {
s32 temp_v1 = this->actor.params & 7;
unkstruct80B4EE0C* temp_v0;
Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_001674);
Animation_PlayLoop(&this->skelAnime, &gAlienHoldingCowAnim);
this->skelAnime.curFrame = ((this->actor.params & 7) * this->skelAnime.endFrame) * 0.25f;
this->alienAlpha = 255;
this->actor.draw = func_80B4DB14;
@ -4199,7 +4199,7 @@ void func_80B4D290(EnInvadepoh* this, PlayState* play) {
}
void func_80B4D3E4(EnInvadepoh* this) {
Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_001674);
Animation_PlayLoop(&this->skelAnime, &gAlienHoldingCowAnim);
this->skelAnime.curFrame = (this->actor.params & 7) * this->skelAnime.endFrame * 0.25f;
this->alienAlpha = 255;
this->actor.draw = NULL;
@ -4276,8 +4276,8 @@ void func_80B4D670(Actor* thisx, PlayState* play) {
Actor_SetObjectDependency(play, &this->actor);
func_80B45080();
this->actor.update = func_80B4D760;
SkelAnime_InitFlex(play, &this->skelAnime, &object_uch_Skel_004E50, &object_uch_Anim_001674, this->jointTable,
this->morphTable, 14);
SkelAnime_InitFlex(play, &this->skelAnime, &gAlienSkel, &gAlienHoldingCowAnim, this->jointTable,
this->morphTable, ALIEN_LIMB_MAX);
if (invadepohType < 3) {
func_80B453F4(this, play, invadepohType);
func_80B4D15C(this);
@ -4373,14 +4373,14 @@ void func_80B4DB14(Actor* thisx, PlayState* play) {
if (this->alienAlpha == 255) {
func_8012C28C(play->state.gfxCtx);
AnimatedMat_Draw(play, D_80B50400);
AnimatedMat_Draw(play, sAlienEmptyTexAnim);
Scene_SetRenderModeXlu(play, 0, 1);
gDPSetEnvColor(spCC->polyOpa.p++, 0, 0, 0, 255);
spCC->polyOpa.p = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, func_80B4D9D8, func_80B4D9F4, &this->actor,
spCC->polyOpa.p);
} else {
AnimatedMat_Draw(play, D_80B50400);
AnimatedMat_Draw(play, sAlienEmptyTexAnim);
Scene_SetRenderModeXlu(play, 1, 2);
gDPSetEnvColor(spCC->polyXlu.p++, 0, 0, 0, this->alienAlpha);
spCC->polyXlu.p = SkelAnime_DrawFlex(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
@ -4389,7 +4389,7 @@ void func_80B4DB14(Actor* thisx, PlayState* play) {
}
if (this->alienBeamAlpha != 0) {
AnimatedMat_Draw(play, D_80B503FC);
AnimatedMat_Draw(play, sAlienEyeBeamTexAnim);
spB8 = play->state.gfxCtx;
gfx = spBC = spB8->polyXlu.p;
gDPPipeSync(spBC++);
@ -4397,10 +4397,10 @@ void func_80B4DB14(Actor* thisx, PlayState* play) {
gDPSetEnvColor(spBC++, 255, 255, 255, this->alienBeamAlpha * (150.0f / 255.0f));
Matrix_Mult(&D_80B502A0, MTXMODE_NEW);
gSPMatrix(spBC++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(spBC++, object_uch_DL_000080);
gSPDisplayList(spBC++, gAlienEyeBeamDL);
Matrix_Mult(&D_80B502E0, MTXMODE_NEW);
gSPMatrix(spBC++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(spBC++, object_uch_DL_000080);
gSPDisplayList(spBC++, gAlienEyeBeamDL);
spB8->polyXlu.p = spBC;
}
}
@ -4411,7 +4411,7 @@ void func_80B4DB14(Actor* thisx, PlayState* play) {
Matrix_Scale(this->alienDeathEffectScale.x, this->alienDeathEffectScale.y, this->alienDeathEffectScale.z,
MTXMODE_APPLY);
gSPMatrix(spCC->polyXlu.p++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(spCC->polyXlu.p++, object_uch_DL_000720);
gSPDisplayList(spCC->polyXlu.p++, gAlienDeathFlashDL);
}
if (this->drawAlien) {

View File

@ -25,7 +25,7 @@ typedef enum{
/* 10 */ TYPE_DOG,
/* 11 */ TYPE_CREMIA,
/* 12 */ TYPE_ROMANI5,
/* 13 */ TYPE_ALIEN1
/* 13 */ TYPE_ALIEN_CARRYING_COW
} EnInvadepohType;
typedef enum {

View File

@ -14626,8 +14626,8 @@
0x80B503F0:("D_80B503F0","UNK_TYPE4","",0x4),
0x80B503F4:("D_80B503F4","UNK_TYPE4","",0x4),
0x80B503F8:("D_80B503F8","UNK_TYPE4","",0x4),
0x80B503FC:("D_80B503FC","UNK_TYPE4","",0x4),
0x80B50400:("D_80B50400","UNK_TYPE4","",0x4),
0x80B503FC:("sAlienEyeBeamTexAnim","UNK_TYPE4","",0x4),
0x80B50400:("sAlienEmptyTexAnim","UNK_TYPE4","",0x4),
0x80B50404:("D_80B50404","UNK_TYPE2","",0x2),
0x80B50406:("D_80B50406","UNK_TYPE2","",0x2),
0x80B5040A:("D_80B5040A","UNK_TYPE1","",0x1),