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
4 changed files with 89 additions and 71 deletions
@@ -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) {
@@ -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 {