Skip to content

Commit 60af05a

Browse files
committed
Interpolation: Tag SyShogun engine thrusters
1 parent c47f7b3 commit 60af05a

2 files changed

Lines changed: 172 additions & 4 deletions

File tree

patches/assets.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,4 +1665,5 @@ extern Limb* aSxSpyborgSkel[45];
16651665
extern f32 D_i2_80195D88[3];
16661666
extern f32 D_i2_80195D98[3];
16671667
extern s32 D_i2_80195640;
1668-
#endif
1668+
extern f32 D_i6_801A69AC[20];
1669+
#endif

patches/boss_tagging.c

Lines changed: 170 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ extern Gfx aKaFLBaseDestroyedDL[];
88

99
void Meteo_MeCrusherEngineGlow_Draw(s32 scale);
1010
bool Andross_AndBrain_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx);
11+
bool SectorY_SyShogun_OverrideLimbDraw(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx);
12+
void SectorY_SyShogun_PostLimbDraw(s32 limbIndex, Vec3f* rot, void* thisx);
1113

1214
RECOMP_PATCH void Andross_AndBrain_Draw(AndBrain* this) {
1315
s32 j;
@@ -23,7 +25,8 @@ RECOMP_PATCH void Andross_AndBrain_Draw(AndBrain* this) {
2325
Matrix_RotateZ(gGfxMatrix, gGameFrameCount * 20.0f * M_DTOR, MTXF_APPLY);
2426
Matrix_Scale(gGfxMatrix, this->fwork[23] + 1.0f, 1.0f - this->fwork[23], 1.0f, MTXF_APPLY);
2527
Matrix_Scale(gGfxMatrix, this->scale, this->scale, this->scale, MTXF_APPLY);
26-
Animation_DrawSkeleton(0, aVe2AndBrainSkel, this->vwork, Andross_AndBrain_OverrideLimbDraw, NULL, this, &gIdentityMatrix);
28+
Animation_DrawSkeleton(0, aVe2AndBrainSkel, this->vwork, Andross_AndBrain_OverrideLimbDraw, NULL, this,
29+
&gIdentityMatrix);
2730
if (this->fwork[21] >= 254) {
2831
RCP_SetupDL(&gMasterDisp, SETUPDL_54);
2932
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 64, 64, 255);
@@ -439,8 +442,8 @@ RECOMP_PATCH void Area6_8018BCD4(Vec3f* arg0, f32 arg1, f32 arg2, Vec3f* arg3, s
439442
Matrix_Push(&gCalcMatrix);
440443

441444
// @recomp Tag the transform.
442-
gEXMatrixGroupDecomposedNormal(gMasterDisp++, TAG_BOSS_GORGON(arg0) | ((i << 16) & 0x00FF0000), G_EX_PUSH, G_MTX_MODELVIEW,
443-
G_EX_EDIT_ALLOW);
445+
gEXMatrixGroupDecomposedNormal(gMasterDisp++, TAG_BOSS_GORGON(arg0) | ((i << 16) & 0x00FF0000), G_EX_PUSH,
446+
G_MTX_MODELVIEW, G_EX_EDIT_ALLOW);
444447

445448
if (i == 11) {
446449
Matrix_Scale(gCalcMatrix, 1.5f, 1.5f, 1.5f, MTXF_APPLY);
@@ -475,6 +478,170 @@ RECOMP_PATCH void Area6_8018BCD4(Vec3f* arg0, f32 arg1, f32 arg2, Vec3f* arg3, s
475478
}
476479
}
477480

481+
RECOMP_PATCH void SectorY_SyShogun_Draw(SyShogun* this) {
482+
f32 sp9C;
483+
f32 sp98;
484+
f32 sp94;
485+
f32 sp90;
486+
f32 sp8C;
487+
f32 sp88;
488+
489+
if ((this->index != 0) || ((this->swork[24] % 2) != 0) || ((this->timer_05C % 2) != 0)) {
490+
RCP_SetupDL_30(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
491+
} else {
492+
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
493+
}
494+
495+
if ((this->health > 0) || (this->swork[36] == 0)) {
496+
Animation_DrawSkeleton(2, D_SY_602D140, this->vwork, SectorY_SyShogun_OverrideLimbDraw,
497+
SectorY_SyShogun_PostLimbDraw, this, gCalcMatrix);
498+
if (this->timer_054 != 0) {
499+
sp9C = D_i6_801A69AC[this->timer_054];
500+
RCP_SetupDL_49();
501+
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
502+
gDPSetEnvColor(gMasterDisp++, 255, 48, 0, 255);
503+
Matrix_Pop(&gGfxMatrix);
504+
505+
// @recomp Tag the transform.
506+
gEXMatrixGroupDecomposedNormal(gMasterDisp++, TAG_BOSS(this) + 1, G_EX_PUSH, G_MTX_MODELVIEW,
507+
G_EX_EDIT_ALLOW);
508+
509+
Matrix_Push(&gGfxMatrix);
510+
Matrix_Translate(gGfxMatrix, this->fwork[1], this->fwork[2], this->fwork[3], MTXF_APPLY);
511+
Matrix_Scale(gGfxMatrix, sp9C, sp9C, sp9C, MTXF_APPLY);
512+
Matrix_SetGfxMtx(&gMasterDisp);
513+
gSPDisplayList(gMasterDisp++, aOrbDL);
514+
515+
// @recomp Pop the transform id.
516+
gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW);
517+
}
518+
519+
if (this->fwork[34] != 0.0f) {
520+
RCP_SetupDL_49();
521+
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
522+
gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255);
523+
Matrix_Pop(&gGfxMatrix);
524+
525+
// @recomp Tag the transform.
526+
gEXMatrixGroupDecomposedNormal(gMasterDisp++, TAG_BOSS(this) + 2, G_EX_PUSH, G_MTX_MODELVIEW,
527+
G_EX_EDIT_ALLOW);
528+
529+
Matrix_Push(&gGfxMatrix);
530+
Matrix_Translate(gGfxMatrix, this->fwork[31], this->fwork[32], this->fwork[33], MTXF_APPLY);
531+
Matrix_Scale(gGfxMatrix, this->fwork[34], this->fwork[34], this->fwork[34], MTXF_APPLY);
532+
Matrix_RotateX(gGfxMatrix, -this->obj.rot.x * M_DTOR, MTXF_APPLY);
533+
Matrix_RotateZ(gGfxMatrix, -this->obj.rot.z * M_DTOR, MTXF_APPLY);
534+
sp98 = gPlayer[0].cam.eye.x - this->obj.pos.x;
535+
sp94 = gPlayer[0].cam.eye.y - this->obj.pos.y;
536+
sp90 = gPlayer[0].cam.eye.z - (this->obj.pos.z + gPathProgress);
537+
sp8C = -Math_Atan2F(sp98, sp90);
538+
sp9C = sqrtf(SQ(sp90) + SQ(sp98));
539+
sp88 = Math_Atan2F(sp94, sp9C);
540+
Matrix_RotateY(gGfxMatrix, -sp8C, MTXF_APPLY);
541+
Matrix_RotateX(gGfxMatrix, -sp88, MTXF_APPLY);
542+
Matrix_SetGfxMtx(&gMasterDisp);
543+
gSPDisplayList(gMasterDisp++, aOrbDL);
544+
545+
// @recomp Pop the transform id.
546+
gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW);
547+
}
548+
549+
if (this->index == 0) {
550+
if (this->fwork[41] != 0.0f) {
551+
RCP_SetupDL_49();
552+
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
553+
gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255);
554+
Matrix_Pop(&gGfxMatrix);
555+
556+
// @recomp Tag the transform.
557+
gEXMatrixGroupDecomposedNormal(gMasterDisp++, TAG_BOSS(this) + 3, G_EX_PUSH, G_MTX_MODELVIEW,
558+
G_EX_EDIT_ALLOW);
559+
560+
Matrix_Push(&gGfxMatrix);
561+
Matrix_Translate(gGfxMatrix, this->fwork[35], this->fwork[36], this->fwork[37], MTXF_APPLY);
562+
Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
563+
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
564+
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
565+
Matrix_Scale(gGfxMatrix, this->fwork[41] * 2.0f, this->fwork[41], this->fwork[41] * 2.0f, MTXF_APPLY);
566+
Matrix_SetGfxMtx(&gMasterDisp);
567+
gSPDisplayList(gMasterDisp++, aOrbDL);
568+
569+
// @recomp Pop the transform id.
570+
gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW);
571+
}
572+
573+
if (this->fwork[42] != 0.0f) {
574+
RCP_SetupDL_49();
575+
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, 255);
576+
gDPSetEnvColor(gMasterDisp++, 32, 255, 32, 255);
577+
Matrix_Pop(&gGfxMatrix);
578+
579+
// @recomp Tag the transform.
580+
gEXMatrixGroupDecomposedNormal(gMasterDisp++, TAG_BOSS(this) + 4, G_EX_PUSH, G_MTX_MODELVIEW,
581+
G_EX_EDIT_ALLOW);
582+
583+
Matrix_Push(&gGfxMatrix);
584+
Matrix_Translate(gGfxMatrix, this->fwork[38], this->fwork[39], this->fwork[40], MTXF_APPLY);
585+
Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
586+
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
587+
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
588+
Matrix_Scale(gGfxMatrix, this->fwork[42] * 2.0f, this->fwork[42], this->fwork[42] * 2.0f, MTXF_APPLY);
589+
Matrix_SetGfxMtx(&gMasterDisp);
590+
gSPDisplayList(gMasterDisp++, aOrbDL);
591+
592+
// @recomp Pop the transform id.
593+
gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW);
594+
}
595+
}
596+
597+
if (this->fwork[43] != 0.0f) {
598+
RCP_SetupDL_49();
599+
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, 255);
600+
gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0);
601+
Matrix_Pop(&gGfxMatrix);
602+
603+
// @recomp Tag the transform.
604+
gEXMatrixGroupDecomposedNormal(gMasterDisp++, TAG_BOSS(this) + 5, G_EX_PUSH, G_MTX_MODELVIEW,
605+
G_EX_EDIT_ALLOW);
606+
607+
Matrix_Push(&gGfxMatrix);
608+
Matrix_Translate(gGfxMatrix, this->obj.pos.x, 157.0f, this->obj.pos.z, MTXF_APPLY);
609+
Matrix_RotateX(gGfxMatrix, M_PI / 2, MTXF_APPLY);
610+
Matrix_Scale(gGfxMatrix, this->fwork[43], this->fwork[43], this->fwork[43], MTXF_APPLY);
611+
Matrix_SetGfxMtx(&gMasterDisp);
612+
gSPDisplayList(gMasterDisp++, aOrbDL);
613+
614+
// @recomp Pop the transform id.
615+
gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW);
616+
}
617+
618+
if (this->fwork[46] != 0.0f) {
619+
RCP_SetupDL_49();
620+
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) this->fwork[46], (s32) this->fwork[46], 0,
621+
(s32) this->fwork[46]);
622+
gDPSetEnvColor(gMasterDisp++, 0, 0, 0, 0);
623+
Matrix_Pop(&gGfxMatrix);
624+
625+
// @recomp Tag the transform.
626+
gEXMatrixGroupDecomposedNormal(gMasterDisp++, TAG_BOSS(this) + 6, G_EX_PUSH, G_MTX_MODELVIEW,
627+
G_EX_EDIT_ALLOW);
628+
629+
Matrix_Push(&gGfxMatrix);
630+
Matrix_Translate(gGfxMatrix, this->obj.pos.x + 10.0f, this->obj.pos.y + 70.0f, this->obj.pos.z + 60.0f,
631+
MTXF_APPLY);
632+
Matrix_Scale(gGfxMatrix, 0.4f, 0.2f, 0.2f, MTXF_APPLY);
633+
Matrix_SetGfxMtx(&gMasterDisp);
634+
gSPDisplayList(gMasterDisp++, aOrbDL);
635+
Matrix_Translate(gGfxMatrix, -46.0f, 0, 0, MTXF_APPLY);
636+
Matrix_SetGfxMtx(&gMasterDisp);
637+
gSPDisplayList(gMasterDisp++, aOrbDL);
638+
639+
// @recomp Pop the transform id.
640+
gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW);
641+
}
642+
}
643+
}
644+
478645
// TODO Tag Vertices
479646
#if 0
480647
RECOMP_PATCH void Aquas_AqBacoonMuscle_Draw(AqBacoonMuscle* this) {

0 commit comments

Comments
 (0)