object_firefly Decomp (#1285)

* object_firefly dLists and skel

* most limbs, textures

* more limbs, comments, outnames.

* fixed d list name in z_en_firefly

* enum name fix, limbIndex numbers fix, root name fix

* llvm changes because of format.py

* deleted llvms and max limbs number fixed

* z_en_firefly changes after clang format

* error in the build because of these two

* fixed limbIndex issue and added enum names instead

* equal sign that was missing

* limbIndex number was wrong

* z_en_firefly.h include changes and morph/joint table changes

* build retry

* format.py again and build retry
This commit is contained in:
SeDan01 2023-06-20 04:09:50 -04:00 committed by GitHub
parent bea420f8a1
commit 7194936203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 93 additions and 64 deletions

View File

@ -1,54 +1,83 @@
<Root>
<File Name="object_firefly" Segment="6">
<Animation Name="object_firefly_Anim_00017C" Offset="0x17C" /> <!-- Original name is "firefly_foot_fly" -->
<Texture Name="object_firefly_Tex_000190" OutName="tex_000190" Format="rgba16" Width="8" Height="8" Offset="0x190" />
<Texture Name="object_firefly_Tex_000210" OutName="tex_000210" Format="rgba16" Width="8" Height="8" Offset="0x210" />
<Texture Name="object_firefly_Tex_000290" OutName="tex_000290" Format="rgba16" Width="8" Height="8" Offset="0x290" />
<Texture Name="object_firefly_Tex_000310" OutName="tex_000310" Format="rgba16" Width="16" Height="8" Offset="0x310" />
<Texture Name="object_firefly_Tex_000410" OutName="tex_000410" Format="rgba16" Width="8" Height="16" Offset="0x410" />
<Texture Name="object_firefly_Tex_000510" OutName="tex_000510" Format="rgba16" Width="4" Height="16" Offset="0x510" />
<Texture Name="object_firefly_Tex_000590" OutName="tex_000590" Format="rgba16" Width="8" Height="8" Offset="0x590" />
<Texture Name="object_firefly_Tex_000610" OutName="tex_000610" Format="rgba16" Width="8" Height="16" Offset="0x610" />
<Texture Name="object_firefly_Tex_000710" OutName="tex_000710" Format="rgba16" Width="4" Height="16" Offset="0x710" />
<Texture Name="object_firefly_Tex_000790" OutName="tex_000790" Format="rgba16" Width="16" Height="8" Offset="0x790" />
<DList Name="object_firefly_DL_000D30" Offset="0xD30" />
<DList Name="object_firefly_DL_000F40" Offset="0xF40" />
<DList Name="object_firefly_DL_001038" Offset="0x1038" />
<DList Name="object_firefly_DL_001100" Offset="0x1100" />
<DList Name="object_firefly_DL_0011C8" Offset="0x11C8" />
<DList Name="object_firefly_DL_001290" Offset="0x1290" />
<DList Name="object_firefly_DL_001358" Offset="0x1358" />
<DList Name="object_firefly_DL_001420" Offset="0x1420" />
<DList Name="object_firefly_DL_0014E8" Offset="0x14E8" />
<DList Name="object_firefly_DL_0015B0" Offset="0x15B0" />
<DList Name="object_firefly_DL_001678" Offset="0x1678" />
<Limb Name="object_firefly_Standardlimb_001708" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_01" Offset="0x1708" />
<Limb Name="object_firefly_Standardlimb_001714" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_02" Offset="0x1714" />
<Limb Name="object_firefly_Standardlimb_001720" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_03" Offset="0x1720" />
<Limb Name="object_firefly_Standardlimb_00172C" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_04" Offset="0x172C" />
<Limb Name="object_firefly_Standardlimb_001738" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_05" Offset="0x1738" />
<Limb Name="object_firefly_Standardlimb_001744" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_06" Offset="0x1744" />
<Limb Name="object_firefly_Standardlimb_001750" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_07" Offset="0x1750" />
<Limb Name="object_firefly_Standardlimb_00175C" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_08" Offset="0x175C" />
<Limb Name="object_firefly_Standardlimb_001768" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_09" Offset="0x1768" />
<Limb Name="object_firefly_Standardlimb_001774" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_0A" Offset="0x1774" />
<Limb Name="object_firefly_Standardlimb_001780" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_0B" Offset="0x1780" />
<Limb Name="object_firefly_Standardlimb_00178C" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_0C" Offset="0x178C" />
<Limb Name="object_firefly_Standardlimb_001798" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_0D" Offset="0x1798" />
<Limb Name="object_firefly_Standardlimb_0017A4" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_0E" Offset="0x17A4" />
<Limb Name="object_firefly_Standardlimb_0017B0" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_0F" Offset="0x17B0" />
<Limb Name="object_firefly_Standardlimb_0017BC" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_10" Offset="0x17BC" />
<Limb Name="object_firefly_Standardlimb_0017C8" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_11" Offset="0x17C8" />
<Limb Name="object_firefly_Standardlimb_0017D4" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_12" Offset="0x17D4" />
<Limb Name="object_firefly_Standardlimb_0017E0" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_13" Offset="0x17E0" />
<Limb Name="object_firefly_Standardlimb_0017EC" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_14" Offset="0x17EC" />
<Limb Name="object_firefly_Standardlimb_0017F8" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_15" Offset="0x17F8" />
<Limb Name="object_firefly_Standardlimb_001804" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_16" Offset="0x1804" />
<Limb Name="object_firefly_Standardlimb_001810" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_17" Offset="0x1810" />
<Limb Name="object_firefly_Standardlimb_00181C" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_18" Offset="0x181C" />
<Limb Name="object_firefly_Standardlimb_001828" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_19" Offset="0x1828" />
<Limb Name="object_firefly_Standardlimb_001834" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_1A" Offset="0x1834" />
<Limb Name="object_firefly_Standardlimb_001840" Type="Standard" EnumName="OBJECT_FIREFLY_LIMB_1B" Offset="0x1840" />
<Skeleton Name="object_firefly_Skel_0018B8" Type="Normal" LimbType="Standard" LimbNone="OBJECT_FIREFLY_LIMB_NONE" LimbMax="OBJECT_FIREFLY_LIMB_MAX" EnumName="ObjectFireflyLimb" Offset="0x18B8" />
<!-- Assets for the Fire Keese-->
<!-- Fire Keese Flying Animation-->
<Animation Name="gFireKeeseFlyAnim" Offset="0x17C" /> <!-- Original name is "firefly_foot_fly" -->
<!--Fire Keese Textures-->
<Texture Name="gFireKeeseBodyTex" OutName="fire_keese_body" Format="rgba16" Width="8" Height="8" Offset="0x210" />
<Texture Name="gFireKeeseEyeTex" OutName="fire_keese_eye" Format="rgba16" Width="8" Height="8" Offset="0x290" />
<Texture Name="gFireKeeseEarTex" OutName="fire_keese_ear" Format="rgba16" Width="16" Height="8" Offset="0x310" />
<Texture Name="gFireKeeseTalonTex" OutName="fire_keese_talon" Format="rgba16" Width="8" Height="16" Offset="0x410" />
<Texture Name="gFireKeeseWingTex" OutName="fire_keese_wing" Format="rgba16" Width="4" Height="16" Offset="0x510" />
<!--Regular Keese Textures-->
<Texture Name="gKeeseRedEyeTex" OutName="keese_red_eye" Format="rgba16" Width="8" Height="8" Offset="0x190" />
<Texture Name="gKeeseBodyTex" OutName="keese_body" Format="rgba16" Width="8" Height="8" Offset="0x590" />
<Texture Name="gKeeseTalonTex" OutName="keese_talon" Format="rgba16" Width="8" Height="16" Offset="0x610" />
<Texture Name="gKeeseWingTex" OutName="keese_wing" Format="rgba16" Width="4" Height="16" Offset="0x710" />
<Texture Name="gKeeseEarTex" OutName="keese_ear" Format="rgba16" Width="16" Height="8" Offset="0x790" />
<!--DLists-->
<DList Name="gFireKeeseHeadDL" Offset="0xD30" />
<DList Name="gFireKeeseBodyDL" Offset="0xF40" />
<DList Name="gFireKeeseLeftFootDL" Offset="0x1038" />
<DList Name="gFireKeeseRightFootDL" Offset="0x1100" />
<DList Name="gFireKeeseRightWingStartDL" Offset="0x11C8" />
<DList Name="gFireKeeseRightWingMidDL" Offset="0x1290" />
<DList Name="gFireKeeseRightWingEndDL" Offset="0x1358" />
<DList Name="gFireKeeseLeftWingEndDL" Offset="0x1420" />
<DList Name="gFireKeeseLeftWingMidDL" Offset="0x14E8" />
<DList Name="gFireKeeseLeftWingStartDL" Offset="0x15B0" />
<DList Name="gKeeseRedEyesDL" Offset="0x1678" />
<!--Limbs for the whole thing-->
<Limb Name="gFireKeeseRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_ROOT" Offset="0x1708" />
<Limb Name="gFireKeeseRootWrapperLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_ROOT_WRAPPER" Offset="0x1714" />
<!--Root Limb for all feet-->
<Limb Name="gFireKeeseFeetRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_FEET_ROOT" Offset="0x1720" />
<!--Right Foot Limbs-->
<Limb Name="gFireKeeseRightFootRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_FOOT_ROOT" Offset="0x172C" />
<Limb Name="gFirekeeseRightFootWrapperLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_FOOT_WRAPPER" Offset="0x1738" />
<Limb Name="gFireKeeseRightFootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_FOOT" Offset="0x1744" />
<!--Left Foot Limbs-->
<Limb Name="gFireKeeseLeftFootRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_FOOT_ROOT" Offset="0x1750" />
<Limb Name="gFireKeeseLeftFootWrapperLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_FOOT_WRAPPER" Offset="0x175C" />
<Limb Name="gFireKeeseLeftFootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_FOOT" Offset="0x1768" />
<!--Body Limb-->
<Limb Name="gFireKeeseBodyLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_BODY" Offset="0x1774" />
<!--Left Wing Limbs-->
<Limb Name="gFireKeeseLeftWingRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_WING_ROOT" Offset="0x1780" />
<Limb Name="gFireKeeseLeftWingWrapperLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_WING_WRAPPER" Offset="0x178C" />
<Limb Name="gFireKeeseLeftWingEndMidRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_WING_END_MID_ROOT" Offset="0x1798" />
<Limb Name="gFireKeeseLeftWingEndRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_WING_END_ROOT" Offset="0x17A4" />
<Limb Name="gFireKeeseLeftWingEndLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_WING_END" Offset="0x17B0" />
<Limb Name="gFireKeeseLeftWingMidLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_WING_MID" Offset="0x17BC" />
<Limb Name="gFireKeeseLeftWingStartLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_LEFT_WING_START" Offset="0x17C8" />
<!--Right Wing Limbs-->
<Limb Name="gFireKeeseRightWingRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_WING_ROOT" Offset="0x17D4" />
<Limb Name="gFireKeeseRightWingWrapperLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_WING_WRAPPER" Offset="0x17E0" />
<Limb Name="gFireKeeseRightWingEndMidRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_WING_END_MID_ROOT" Offset="0x17EC" />
<Limb Name="gFireKeeseRightWingEndRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_WING_END_ROOT" Offset="0x17F8" />
<Limb Name="gFireKeeseRightWingEndLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_WING_END" Offset="0x1804" />
<Limb Name="gFireKeeseRightWingMidLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_WING_MID" Offset="0x1810" />
<Limb Name="gFireKeeseRightWingStartLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_RIGHT_WING_START" Offset="0x181C" />
<!--Head Limbs-->
<Limb Name="gFireKeeseHeadRootLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_HEAD_ROOT" Offset="0x1828" />
<Limb Name="gFireKeeseHeadWrapperLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_HEAD_WRAPPER" Offset="0x1834" />
<Limb Name="gFireKeeseHeadLimb" Type="Standard" EnumName="FIRE_KEESE_LIMB_HEAD" Offset="0x1840" />
<!--Skeleton-->
<Skeleton Name="gFireKeeseSkel" Type="Normal" LimbType="Standard" LimbNone="FIRE_KEESE_LIMB_NONE" LimbMax="FIRE_KEESE_LIMB_MAX" EnumName="FireKeeseLimb" Offset="0x18B8" />
</File>
</Root>

View File

@ -6,7 +6,6 @@
#include "z_en_firefly.h"
#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h"
#include "objects/object_firefly/object_firefly.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_4000)
@ -134,8 +133,8 @@ void EnFirefly_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
SkelAnime_Init(play, &this->skelAnime, &object_firefly_Skel_0018B8, &object_firefly_Anim_00017C, this->jointTable,
this->morphTable, 28);
SkelAnime_Init(play, &this->skelAnime, &gFireKeeseSkel, &gFireKeeseFlyAnim, this->jointTable, this->morphTable,
FIRE_KEESE_LIMB_MAX);
Collider_InitAndSetSphere(play, &this->collider, &this->actor, &sSphereInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
@ -340,7 +339,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) {
void EnFirefly_SetupFall(EnFirefly* this, PlayState* play) {
this->timer = 40;
this->actor.velocity.y = 0.0f;
Animation_Change(&this->skelAnime, &object_firefly_Anim_00017C, 0.0f, 6.0f, 6.0f, ANIMMODE_ONCE, 0.0f);
Animation_Change(&this->skelAnime, &gFireKeeseFlyAnim, 0.0f, 6.0f, 6.0f, ANIMMODE_ONCE, 0.0f);
Actor_PlaySfx(&this->actor, NA_SE_EN_FFLY_DEAD);
this->actor.flags |= ACTOR_FLAG_10;
@ -747,7 +746,7 @@ s32 EnFirefly_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
if (this->isInvisible && (play->actorCtx.lensMaskSize != LENS_MASK_ACTIVE_SIZE)) {
*dList = NULL;
} else if (limbIndex == 1) {
} else if (limbIndex == FIRE_KEESE_LIMB_ROOT) {
pos->y += 2300.0f;
}
return false;
@ -768,11 +767,11 @@ void EnFirefly_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
s32 pad;
EnFirefly* this = THIS;
if ((this->currentType != KEESE_FIRE) && (limbIndex == 27)) {
gSPDisplayList((*gfx)++, object_firefly_DL_001678);
if ((this->currentType != KEESE_FIRE) && (limbIndex == FIRE_KEESE_LIMB_HEAD)) {
gSPDisplayList((*gfx)++, gKeeseRedEyesDL);
} else if ((this->lastDrawnFrame != play->gameplayFrames) &&
((this->auraType == KEESE_AURA_FIRE) || (this->auraType == KEESE_AURA_ICE)) &&
((limbIndex == 15) || (limbIndex == 21))) {
((limbIndex == FIRE_KEESE_LIMB_LEFT_WING_END) || (limbIndex == FIRE_KEESE_LIMB_RIGHT_WING_END_ROOT))) {
if (this->actionFunc != EnFirefly_Die) {
Matrix_MultZero(&auraPos);
auraPos.x += Rand_ZeroFloat(5.0f);
@ -781,7 +780,7 @@ void EnFirefly_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
auraScaleStep = -40;
auraLife = 3;
} else {
if (limbIndex == 15) {
if (limbIndex == FIRE_KEESE_LIMB_LEFT_WING_END) {
auraPos.x = Math_SinS(9100 * this->timer) * this->timer + this->actor.world.pos.x;
auraPos.z = Math_CosS(9100 * this->timer) * this->timer + this->actor.world.pos.z;
} else {
@ -806,11 +805,11 @@ void EnFirefly_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
auraLife);
}
if (limbIndex == 15) {
if (limbIndex == FIRE_KEESE_LIMB_LEFT_WING_END) {
Matrix_MultZero(&this->limbPos[0]);
} else if (limbIndex == 21) {
} else if (limbIndex == FIRE_KEESE_LIMB_RIGHT_WING_END_ROOT) {
Matrix_MultZero(&this->limbPos[1]);
} else if (limbIndex == 10) {
} else if (limbIndex == FIRE_KEESE_LIMB_BODY) {
Matrix_MultZero(&this->limbPos[2]);
}
}

View File

@ -2,6 +2,7 @@
#define Z_EN_FIREFLY_H
#include "global.h"
#include "objects/object_firefly/object_firefly.h"
struct EnFirefly;
@ -27,8 +28,8 @@ typedef struct EnFirefly {
/* 0x18F */ u8 drawDmgEffType;
/* 0x190 */ s16 timer;
/* 0x192 */ s16 pitchTarget;
/* 0x194 */ Vec3s jointTable[28];
/* 0x23C */ Vec3s morphTable[28];
/* 0x194 */ Vec3s jointTable[FIRE_KEESE_LIMB_MAX];
/* 0x23C */ Vec3s morphTable[FIRE_KEESE_LIMB_MAX];
/* 0x2E4 */ f32 maxAltitude;
/* 0x2E8 */ f32 drawDmgEffAlpha;
/* 0x2E8 */ f32 drawDmgEffScale;