mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-08 15:30:14 +00:00
Object_RU1, Object_MA1, and warp pad objects Decompiled (#828)
* Ruto limbs * RutoLimb enum * the enum doesn't go in en_door * Limb DLists * Name almost all textures and clean up EnRu1.c * remove padding * Name all but 1 animation and remove undefined syms * Object MA limbs OK * (MA1)Most textures * Small renames in EnMa1.c * Object MA1 OK * add base object for Mjin * Mjin OK * Update object_ma1.xml * PR fixes (Fig) * PR fixes * Missed one * Update assets/xml/objects/object_ru1.xml Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
parent
f6470eaa08
commit
9de0b13141
17 changed files with 411 additions and 419 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "z_en_ma1.h"
|
||||
#include "objects/object_ma1/object_ma1.h"
|
||||
|
||||
#define FLAGS 0x02000039
|
||||
|
||||
|
@ -25,7 +26,7 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx);
|
|||
void func_80AA106C(EnMa1* this, GlobalContext* globalCtx);
|
||||
void func_80AA10EC(EnMa1* this, GlobalContext* globalCtx);
|
||||
void func_80AA1150(EnMa1* this, GlobalContext* globalCtx);
|
||||
void func_80AA11C8(EnMa1* this, GlobalContext* globalCtx);
|
||||
void EnMa1_DoNothing(EnMa1* this, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit En_Ma1_InitVars = {
|
||||
ACTOR_EN_MA1,
|
||||
|
@ -61,31 +62,27 @@ static ColliderCylinderInit sCylinderInit = {
|
|||
|
||||
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
|
||||
|
||||
static struct_D_80AA1678 D_80AA1678[] = {
|
||||
{ 0x06000820, 1.0f, ANIMMODE_LOOP, 0.0f },
|
||||
{ 0x06000820, 1.0f, ANIMMODE_LOOP, -10.0f },
|
||||
{ 0x06008D64, 1.0f, ANIMMODE_LOOP, 0.0f },
|
||||
{ 0x06008D64, 1.0f, ANIMMODE_LOOP, -10.0f },
|
||||
static struct_D_80AA1678 sAnimationInfo[] = {
|
||||
{ &gMalonChildIdleAnim, 1.0f, ANIMMODE_LOOP, 0.0f },
|
||||
{ &gMalonChildIdleAnim, 1.0f, ANIMMODE_LOOP, -10.0f },
|
||||
{ &gMalonChildSingAnim, 1.0f, ANIMMODE_LOOP, 0.0f },
|
||||
{ &gMalonChildSingAnim, 1.0f, ANIMMODE_LOOP, -10.0f },
|
||||
};
|
||||
|
||||
static Vec3f D_80AA16B8 = { 800.0f, 0.0f, 0.0f };
|
||||
|
||||
static UNK_PTR D_80AA16C4[] = {
|
||||
0x06001F18,
|
||||
0x06002B18,
|
||||
0x06002F18,
|
||||
static void* sMouthTextures[] = {
|
||||
gMalonChildNeutralMouthTex,
|
||||
gMalonChildSmilingMouthTex,
|
||||
gMalonChildTalkingMouthTex,
|
||||
};
|
||||
|
||||
static UNK_PTR D_80AA16D0[] = {
|
||||
0x06001B18,
|
||||
0x06002318,
|
||||
0x06002718,
|
||||
static void* sEyeTextures[] = {
|
||||
gMalonChildEyeOpenTex,
|
||||
gMalonChildEyeHalfTex,
|
||||
gMalonChildEyeClosedTex,
|
||||
};
|
||||
|
||||
extern AnimationHeader D_06000820;
|
||||
extern FlexSkeletonHeader D_06008460;
|
||||
extern AnimationHeader D_06008D64;
|
||||
|
||||
u16 EnMa1_GetText(GlobalContext* globalCtx, Actor* thisx) {
|
||||
u16 faceReaction = Text_GetFaceReaction(globalCtx, 0x17);
|
||||
if (faceReaction != 0) {
|
||||
|
@ -207,28 +204,28 @@ s32 func_80AA08C4(EnMa1* this, GlobalContext* globalCtx) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void func_80AA0A0C(EnMa1* this) {
|
||||
if (DECR(this->unk_1E2) == 0) {
|
||||
this->unk_1E4 += 1;
|
||||
if (this->unk_1E4 >= 3) {
|
||||
this->unk_1E2 = Rand_S16Offset(0x1E, 0x1E);
|
||||
this->unk_1E4 = 0;
|
||||
void EnMa1_UpdateEyes(EnMa1* this) {
|
||||
if (DECR(this->blinkTimer) == 0) {
|
||||
this->eyeIndex += 1;
|
||||
if (this->eyeIndex >= 3) {
|
||||
this->blinkTimer = Rand_S16Offset(30, 30);
|
||||
this->eyeIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AA0A84(EnMa1* this, UNK_TYPE idx) {
|
||||
f32 frameCount = Animation_GetLastFrame(D_80AA1678[idx].animation);
|
||||
void EnMa1_ChangeAnimation(EnMa1* this, UNK_TYPE idx) {
|
||||
f32 frameCount = Animation_GetLastFrame(sAnimationInfo[idx].animation);
|
||||
|
||||
Animation_Change(&this->skelAnime, D_80AA1678[idx].animation, 1.0f, 0.0f, frameCount, D_80AA1678[idx].mode,
|
||||
D_80AA1678[idx].transitionRate);
|
||||
Animation_Change(&this->skelAnime, sAnimationInfo[idx].animation, 1.0f, 0.0f, frameCount, sAnimationInfo[idx].mode,
|
||||
sAnimationInfo[idx].transitionRate);
|
||||
}
|
||||
|
||||
void func_80AA0AF4(EnMa1* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
s16 phi_a3;
|
||||
|
||||
if ((this->unk_1E8.unk_00 == 0) && (this->skelAnime.animation == &D_06008D64)) {
|
||||
if ((this->unk_1E8.unk_00 == 0) && (this->skelAnime.animation == &gMalonChildSingAnim)) {
|
||||
phi_a3 = 1;
|
||||
} else {
|
||||
phi_a3 = 0;
|
||||
|
@ -241,7 +238,7 @@ void func_80AA0AF4(EnMa1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80AA0B74(EnMa1* this) {
|
||||
if (this->skelAnime.animation == &D_06008D64) {
|
||||
if (this->skelAnime.animation == &gMalonChildSingAnim) {
|
||||
if (this->unk_1E8.unk_00 == 0) {
|
||||
if (this->unk_1E0 != 0) {
|
||||
this->unk_1E0 = 0;
|
||||
|
@ -261,7 +258,7 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
s32 pad;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008460, NULL, NULL, NULL, 0);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gMalonChildSkel, NULL, NULL, NULL, 0);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit);
|
||||
|
@ -278,10 +275,10 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
if ((!(gSaveContext.eventChkInf[1] & 0x10)) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA))) {
|
||||
this->actionFunc = func_80AA0D88;
|
||||
func_80AA0A84(this, 2);
|
||||
EnMa1_ChangeAnimation(this, 2);
|
||||
} else {
|
||||
this->actionFunc = func_80AA0F44;
|
||||
func_80AA0A84(this, 2);
|
||||
EnMa1_ChangeAnimation(this, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,12 +291,12 @@ void EnMa1_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80AA0D88(EnMa1* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_1E8.unk_00 != 0) {
|
||||
if (this->skelAnime.animation != &D_06000820) {
|
||||
func_80AA0A84(this, 1);
|
||||
if (this->skelAnime.animation != &gMalonChildIdleAnim) {
|
||||
EnMa1_ChangeAnimation(this, 1);
|
||||
}
|
||||
} else {
|
||||
if (this->skelAnime.animation != &D_06008D64) {
|
||||
func_80AA0A84(this, 3);
|
||||
if (this->skelAnime.animation != &gMalonChildSingAnim) {
|
||||
EnMa1_ChangeAnimation(this, 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,12 +333,12 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) {
|
|||
Player* player = PLAYER;
|
||||
|
||||
if (this->unk_1E8.unk_00 != 0) {
|
||||
if (this->skelAnime.animation != &D_06000820) {
|
||||
func_80AA0A84(this, 1);
|
||||
if (this->skelAnime.animation != &gMalonChildIdleAnim) {
|
||||
EnMa1_ChangeAnimation(this, 1);
|
||||
}
|
||||
} else {
|
||||
if (this->skelAnime.animation != &D_06008D64) {
|
||||
func_80AA0A84(this, 3);
|
||||
if (this->skelAnime.animation != &gMalonChildSingAnim) {
|
||||
EnMa1_ChangeAnimation(this, 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -385,11 +382,11 @@ void func_80AA1150(EnMa1* this, GlobalContext* globalCtx) {
|
|||
gSaveContext.nextCutsceneIndex = 0xFFF1;
|
||||
globalCtx->fadeTransition = 42;
|
||||
globalCtx->sceneLoadFlag = 0x14;
|
||||
this->actionFunc = func_80AA11C8;
|
||||
this->actionFunc = EnMa1_DoNothing;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AA11C8(EnMa1* this, GlobalContext* globalCtx) {
|
||||
void EnMa1_DoNothing(EnMa1* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnMa1_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
@ -399,9 +396,9 @@ void EnMa1_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80AA0A0C(this);
|
||||
EnMa1_UpdateEyes(this);
|
||||
this->actionFunc(this, globalCtx);
|
||||
if (this->actionFunc != func_80AA11C8) {
|
||||
if (this->actionFunc != EnMa1_DoNothing) {
|
||||
func_800343CC(globalCtx, &this->actor, &this->unk_1E8.unk_00, (f32)this->collider.dim.radius + 30.0f,
|
||||
EnMa1_GetText, func_80AA0778);
|
||||
}
|
||||
|
@ -443,18 +440,18 @@ void EnMa1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
|||
void EnMa1_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnMa1* this = THIS;
|
||||
Camera* camera;
|
||||
f32 someFloat;
|
||||
f32 distFromCamera;
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma1.c", 1226);
|
||||
|
||||
camera = ACTIVE_CAM;
|
||||
someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &camera->eye);
|
||||
func_800F6268(someFloat, 0x2F);
|
||||
distFromCamera = Math_Vec3f_DistXZ(&this->actor.world.pos, &camera->eye);
|
||||
func_800F6268(distFromCamera, 0x2F);
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(D_80AA16C4[this->unk_1E6]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80AA16D0[this->unk_1E4]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[this->mouthIndex]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[this->eyeIndex]));
|
||||
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnMa1_OverrideLimbDraw, EnMa1_PostLimbDraw, this);
|
||||
|
|
|
@ -14,9 +14,9 @@ typedef struct EnMa1 {
|
|||
/* 0x0190 */ EnMa1ActionFunc actionFunc;
|
||||
/* 0x0194 */ ColliderCylinder collider;
|
||||
/* 0x01E0 */ s16 unk_1E0;
|
||||
/* 0x01E2 */ s16 unk_1E2;
|
||||
/* 0x01E4 */ s16 unk_1E4;
|
||||
/* 0x01E6 */ s16 unk_1E6;
|
||||
/* 0x01E2 */ s16 blinkTimer;
|
||||
/* 0x01E4 */ s16 eyeIndex;
|
||||
/* 0x01E6 */ s16 mouthIndex;
|
||||
/* 0x01E8 */ struct_80034A14_arg1 unk_1E8;
|
||||
} EnMa1; // size = 0x0210
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue