Document stray fairy related objects (#552)

This commit is contained in:
Tom Overton
2022-01-03 23:10:18 -08:00
committed by GitHub
parent 6125d48b07
commit e7ba2c507d
4 changed files with 62 additions and 48 deletions
@@ -5,6 +5,7 @@
*/
#include "z_en_elforg.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#define FLAGS 0x00000010
@@ -72,7 +73,8 @@ void EnElforg_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.01f);
this->flags = 0;
this->direction = 0;
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0402CA98, &D_0402B494, this->jointTable, this->jointTable, 10);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gStrayFairySkel, &gStrayFairyFlyingAnim, this->jointTable,
this->jointTable, STRAY_FAIRY_LIMB_MAX);
this->skelAnime.playSpeed = 1.0f;
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
this->actor.shape.shadowAlpha = 255;
@@ -575,13 +577,14 @@ s32 EnElforg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
EnElforg* this = THIS;
if (this->direction < 0) {
if (limbIndex == 9) {
if (limbIndex == STRAY_FAIRY_LIMB_LEFT_FACING_HEAD) {
*dList = NULL;
}
} else if (limbIndex == 1) {
} else if (limbIndex == STRAY_FAIRY_LIMB_RIGHT_FACING_HEAD) {
*dList = NULL;
}
return 0;
return false;
}
void EnElforg_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -589,22 +592,23 @@ void EnElforg_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnElforg* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
switch (this->area) {
case STRAY_FAIRY_AREA_WOODFALL:
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_0402C908));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gStrayFairyWoodfallTexAnim));
break;
case STRAY_FAIRY_AREA_SNOWHEAD:
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_0402C890));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gStrayFairySnowheadTexAnim));
break;
case STRAY_FAIRY_AREA_GREAT_BAY:
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_0402C980));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gStrayFairyGreatBayTexAnim));
break;
case STRAY_FAIRY_AREA_STONE_TOWER:
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_0402C9F8));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gStrayFairyStoneTowerTexAnim));
break;
default:
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_0402C818));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gStrayFairyClockTownTexAnim));
break;
}
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
@@ -33,6 +33,20 @@ typedef enum {
STRAY_FAIRY_AREA_MAX
} StrayFairyArea;
typedef enum {
/* 0 */ STRAY_FAIRY_LIMB_NONE,
/* 1 */ STRAY_FAIRY_LIMB_RIGHT_FACING_HEAD,
/* 2 */ STRAY_FAIRY_LIMB_LEFT_WING,
/* 3 */ STRAY_FAIRY_LIMB_RIGHT_WING,
/* 4 */ STRAY_FAIRY_LIMB_GLOW,
/* 5 */ STRAY_FAIRY_LIMB_TORSO,
/* 6 */ STRAY_FAIRY_LIMB_RIGHT_ARM,
/* 7 */ STRAY_FAIRY_LIMB_PELVIS_AND_LEGS,
/* 8 */ STRAY_FAIRY_LIMB_LEFT_ARM,
/* 9 */ STRAY_FAIRY_LIMB_LEFT_FACING_HEAD,
/* 10 */ STRAY_FAIRY_LIMB_MAX,
} StrayFairyLimbs;
struct EnElforg;
typedef void (*EnElforgActionFunc)(struct EnElforg*, GlobalContext*);
@@ -40,11 +54,11 @@ typedef void (*EnElforgActionFunc)(struct EnElforg*, GlobalContext*);
typedef struct EnElforg {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[10];
/* 0x188 */ Vec3s jointTable[STRAY_FAIRY_LIMB_MAX];
/* 0x1C4 */ ColliderCylinder collider;
/* 0x210 */ Actor* enemy;
/* 0x214 */ u16 flags;
/* 0x216 */ s16 direction; // negative when facing left, positive when facing right
/* 0x216 */ s16 direction; // negative when facing right, positive when facing left
/* 0x218 */ s16 area;
/* 0x21C */ s32 timer;
/* 0x220 */ s32 secondaryTimer;