mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-09 10:52:09 -04:00
z_demo_tre_lgt OK
This commit is contained in:
@@ -22,28 +22,29 @@
|
||||
<Limb Name="object_box_Standardlimb_006678" Type="Standard" Offset="0x6678" />
|
||||
<Limb Name="object_box_Standardlimb_006684" Type="Standard" Offset="0x6684" />
|
||||
<Skeleton Name="gBoxChestSkel" Type="Normal" LimbType="Standard" Offset="0x66A0" />
|
||||
<!-- <Blob Name="object_box_Blob_0066A8" Size="0x798" Offset="0x66A8" /> -->
|
||||
<CurveAnimation Name="gBoxLight0CurveAnim" SkelOffset="0x7D78" Offset="0x6A20"/>
|
||||
<CurveAnimation Name="gBoxLight1CurveAnim" SkelOffset="0x7D78" Offset="0x6E30"/>
|
||||
<Texture Name="gBoxLightTex" OutName="box_light_tex" Format="i8" Width="64" Height="32" Offset="0x6E40" />
|
||||
<DList Name="object_box_DL_007890" Offset="0x7890" />
|
||||
<DList Name="object_box_DL_007978" Offset="0x7978" />
|
||||
<DList Name="object_box_DL_007A40" Offset="0x7A40" />
|
||||
<DList Name="object_box_DL_007B08" Offset="0x7B08" />
|
||||
<DList Name="object_box_DL_007BD0" Offset="0x7BD0" />
|
||||
<Limb Name="object_box_Standardlimb_007C98" Type="Standard" Offset="0x7C98" />
|
||||
<Limb Name="object_box_Standardlimb_007CA4" Type="Standard" Offset="0x7CA4" />
|
||||
<Limb Name="object_box_Standardlimb_007CB0" Type="Standard" Offset="0x7CB0" />
|
||||
<Limb Name="object_box_Standardlimb_007CBC" Type="Standard" Offset="0x7CBC" />
|
||||
<Limb Name="object_box_Standardlimb_007CC8" Type="Standard" Offset="0x7CC8" />
|
||||
<Limb Name="object_box_Standardlimb_007CD4" Type="Standard" Offset="0x7CD4" />
|
||||
<Limb Name="object_box_Standardlimb_007CE0" Type="Standard" Offset="0x7CE0" />
|
||||
<Limb Name="object_box_Standardlimb_007CEC" Type="Standard" Offset="0x7CEC" />
|
||||
<Limb Name="object_box_Standardlimb_007CF8" Type="Standard" Offset="0x7CF8" />
|
||||
<Limb Name="object_box_Standardlimb_007D04" Type="Standard" Offset="0x7D04" />
|
||||
<Limb Name="object_box_Standardlimb_007D10" Type="Standard" Offset="0x7D10" />
|
||||
<Limb Name="object_box_Standardlimb_007D1C" Type="Standard" Offset="0x7D1C" />
|
||||
<Limb Name="object_box_Standardlimb_007D28" Type="Standard" Offset="0x7D28" />
|
||||
<Limb Name="object_box_Standardlimb_007D34" Type="Standard" Offset="0x7D34" />
|
||||
<Skeleton Name="gBoxLightSkel" Type="Normal" LimbType="Standard" Offset="0x7D78" />
|
||||
<Limb Name="object_box_Standardlimb_007C98" Type="Curve" Offset="0x7C98" />
|
||||
<Limb Name="object_box_Standardlimb_007CA4" Type="Curve" Offset="0x7CA4" />
|
||||
<Limb Name="object_box_Standardlimb_007CB0" Type="Curve" Offset="0x7CB0" />
|
||||
<Limb Name="object_box_Standardlimb_007CBC" Type="Curve" Offset="0x7CBC" />
|
||||
<Limb Name="object_box_Standardlimb_007CC8" Type="Curve" Offset="0x7CC8" />
|
||||
<Limb Name="object_box_Standardlimb_007CD4" Type="Curve" Offset="0x7CD4" />
|
||||
<Limb Name="object_box_Standardlimb_007CE0" Type="Curve" Offset="0x7CE0" />
|
||||
<Limb Name="object_box_Standardlimb_007CEC" Type="Curve" Offset="0x7CEC" />
|
||||
<Limb Name="object_box_Standardlimb_007CF8" Type="Curve" Offset="0x7CF8" />
|
||||
<Limb Name="object_box_Standardlimb_007D04" Type="Curve" Offset="0x7D04" />
|
||||
<Limb Name="object_box_Standardlimb_007D10" Type="Curve" Offset="0x7D10" />
|
||||
<Limb Name="object_box_Standardlimb_007D1C" Type="Curve" Offset="0x7D1C" />
|
||||
<Limb Name="object_box_Standardlimb_007D28" Type="Curve" Offset="0x7D28" />
|
||||
<Limb Name="object_box_Standardlimb_007D34" Type="Curve" Offset="0x7D34" />
|
||||
<Skeleton Name="gBoxLightCurveSkel" Type="Curve" LimbType="Curve" Offset="0x7D78" />
|
||||
<Animation Name="gBoxChestOpenGoronAnim" Offset="0x7E54" />
|
||||
<Animation Name="gBoxChestOpenDekuAnim" Offset="0x7F30" />
|
||||
<!-- <Blob Name="object_box_zeroes_unk_00007F40" Size="0xA0" Offset="0x7F40" /> -->
|
||||
|
||||
@@ -1225,8 +1225,7 @@ beginseg
|
||||
name "ovl_Demo_Tre_Lgt"
|
||||
compress
|
||||
include "build/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.o"
|
||||
include "build/data/ovl_Demo_Tre_Lgt/ovl_Demo_Tre_Lgt.data.o"
|
||||
include "build/data/ovl_Demo_Tre_Lgt/ovl_Demo_Tre_Lgt.reloc.o"
|
||||
include "build/src/overlays/actors/ovl_Demo_Tre_Lgt/ovl_Demo_Tre_Lgt_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
*/
|
||||
|
||||
#include "z_demo_tre_lgt.h"
|
||||
#include "../ovl_En_Box/z_en_box.h"
|
||||
#include "objects/object_box/object_box.h"
|
||||
|
||||
#define FLAGS 0x00000010
|
||||
|
||||
@@ -15,7 +17,24 @@ void DemoTreLgt_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void DemoTreLgt_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void DemoTreLgt_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
#if 0
|
||||
void DemoTreLgt_SetupWait(DemoTreLgt* this);
|
||||
|
||||
void DemoTreLgt_Wait(DemoTreLgt* this, GlobalContext* globalCtx);
|
||||
void DemoTreLgt_SetupAnimate(DemoTreLgt* this, GlobalContext* globalCtx, f32 frame);
|
||||
void DemoTreLgt_Animate(DemoTreLgt* this, GlobalContext* globalCtx);
|
||||
|
||||
typedef struct {
|
||||
f32 unk0;
|
||||
f32 unk4;
|
||||
f32 unk8;
|
||||
f32 unkC;
|
||||
} DemoTreLgtInfo;
|
||||
|
||||
static DemoTreLgtInfo D_808E1490[2] = {
|
||||
{ 1.0f, 136.0f, 190.0f, 40.0f },
|
||||
{ 1.0f, 136.0f, 220.0f, 50.0f },
|
||||
};
|
||||
|
||||
const ActorInit Demo_Tre_Lgt_InitVars = {
|
||||
ACTOR_DEMO_TRE_LGT,
|
||||
ACTORCAT_ITEMACTION,
|
||||
@@ -28,24 +47,122 @@ const ActorInit Demo_Tre_Lgt_InitVars = {
|
||||
(ActorFunc)DemoTreLgt_Draw,
|
||||
};
|
||||
|
||||
#endif
|
||||
static TransformUpdateIndex* sBoxLightAnimations[] = {
|
||||
&gBoxLight0CurveAnim,
|
||||
&gBoxLight1CurveAnim,
|
||||
};
|
||||
|
||||
extern UNK_TYPE D_06007D78;
|
||||
static DemoTreLgtActionFunc sActionFuncs[] = {
|
||||
DemoTreLgt_Wait,
|
||||
DemoTreLgt_Animate,
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/DemoTreLgt_Init.s")
|
||||
void DemoTreLgt_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DemoTreLgt* this = (DemoTreLgt*)thisx;
|
||||
SkelCurve_Init(globalCtx, &this->skelCurve, &gBoxLightCurveSkel, sBoxLightAnimations[0]);
|
||||
this->colorAlpha1 = 255;
|
||||
this->colorAlpha2 = 255;
|
||||
this->status = 0;
|
||||
if (gSaveContext.playerForm == 0) {
|
||||
this->animationType = 0;
|
||||
} else {
|
||||
this->animationType = 1;
|
||||
}
|
||||
DemoTreLgt_SetupWait(this);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/DemoTreLgt_Destroy.s")
|
||||
void DemoTreLgt_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DemoTreLgt* this = (DemoTreLgt*)thisx;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/func_808E0EE8.s")
|
||||
SkelCurve_Destroy(globalCtx, &this->skelCurve);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/func_808E0EF4.s")
|
||||
void DemoTreLgt_SetupWait(DemoTreLgt* this) {
|
||||
this->action = DEMO_TRE_LGT_ACTION_WAIT;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/func_808E0F4C.s")
|
||||
void DemoTreLgt_Wait(DemoTreLgt* this, GlobalContext* globalCtx) {
|
||||
EnBox* chest = (EnBox*)this->actor.parent;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/func_808E0FE0.s")
|
||||
if (chest != NULL) {
|
||||
if (Animation_OnFrame(&chest->skelAnime, 10.0f) != 0) {
|
||||
DemoTreLgt_SetupAnimate(this, globalCtx, chest->skelAnime.curFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/DemoTreLgt_Update.s")
|
||||
void DemoTreLgt_SetupAnimate(DemoTreLgt* this, GlobalContext* globalCtx, f32 frame) {
|
||||
this->action = DEMO_TRE_LGT_ACTION_ANIMATE;
|
||||
SkelCurve_SetAnim(&this->skelCurve, sBoxLightAnimations[this->animationType], 1.0f,
|
||||
D_808E1490[this->animationType].unk4 + D_808E1490[this->animationType].unk8, frame, 1.0f);
|
||||
SkelCurve_Update(globalCtx, &this->skelCurve);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/func_808E12A4.s")
|
||||
void DemoTreLgt_Animate(DemoTreLgt* this, GlobalContext* globalCtx) {
|
||||
f32 curFrame = this->skelCurve.animCurFrame;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Demo_Tre_Lgt/DemoTreLgt_Draw.s")
|
||||
if (curFrame < D_808E1490[this->animationType].unk4) {
|
||||
this->colorAlpha1 = 255;
|
||||
} else if (curFrame <= (D_808E1490[this->animationType].unk4 + D_808E1490[this->animationType].unk8)) {
|
||||
this->colorAlpha1 = ((D_808E1490[this->animationType].unk4 - curFrame) / D_808E1490[this->animationType].unk8) * 255 + 255;
|
||||
} else {
|
||||
this->colorAlpha1 = 0;
|
||||
}
|
||||
|
||||
if (curFrame < D_808E1490[this->animationType].unkC) {
|
||||
this->colorAlpha2 = 255;
|
||||
} else if (curFrame < (D_808E1490[this->animationType].unkC + 10.0f)) {
|
||||
this->colorAlpha2 = ((D_808E1490[this->animationType].unkC - curFrame) / 10.0f) * 255 + 255;
|
||||
} else {
|
||||
this->colorAlpha2 = 0;
|
||||
}
|
||||
if (curFrame > 30.0f) {
|
||||
if (!(this->status & 1)) {
|
||||
this->status |= 1;
|
||||
Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_FLASH);
|
||||
}
|
||||
}
|
||||
if (SkelCurve_Update(globalCtx, &this->skelCurve) != 0) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
void DemoTreLgt_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DemoTreLgt* this = (DemoTreLgt*)thisx;
|
||||
|
||||
sActionFuncs[this->action](this, globalCtx);
|
||||
}
|
||||
|
||||
s32 DemoTreLgt_OverrideLimbDraw(GlobalContext* globalCtx, SkelAnimeCurve* skelCuve, s32 limbIndex, Actor* thisx) {
|
||||
s32 pad;
|
||||
DemoTreLgt* this = (DemoTreLgt*)thisx;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (globalCtx->state.frames * 2) % 256, 0, 64, 32, 1,
|
||||
(globalCtx->state.frames * -2) % 256, 0, 64, 32));
|
||||
|
||||
if (limbIndex == 1) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 180, this->colorAlpha1);
|
||||
} else if (limbIndex == 13 || limbIndex == 7 || limbIndex == 4 || limbIndex == 10) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 180, this->colorAlpha2);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DemoTreLgt_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
DemoTreLgt* this = (DemoTreLgt*)thisx;
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
if (this->action == DEMO_TRE_LGT_ACTION_ANIMATE) {
|
||||
func_8012C2DC(gfxCtx);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 200, 255, 0, 0);
|
||||
SkelCurve_Draw(&this->actor, globalCtx, &this->skelCurve, DemoTreLgt_OverrideLimbDraw, NULL, 1, &this->actor);
|
||||
}
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
||||
@@ -5,11 +5,23 @@
|
||||
|
||||
struct DemoTreLgt;
|
||||
|
||||
typedef void (*DemoTreLgtActionFunc)(struct DemoTreLgt* this, GlobalContext* globalCtx);
|
||||
|
||||
typedef struct DemoTreLgt {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x34];
|
||||
/* 0x144 */ SkelAnimeCurve skelCurve;
|
||||
/* 0x164 */ s32 action;
|
||||
/* 0x168 */ u32 colorAlpha1;
|
||||
/* 0x16C */ u32 colorAlpha2;
|
||||
/* 0x170 */ u8 status;
|
||||
/* 0x174 */ s32 animationType;
|
||||
} DemoTreLgt; // size = 0x178
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ DEMO_TRE_LGT_ACTION_WAIT, // wait until animation is needed
|
||||
/* 0x01 */ DEMO_TRE_LGT_ACTION_ANIMATE
|
||||
} DemoTreLgtAction;
|
||||
|
||||
extern const ActorInit Demo_Tre_Lgt_InitVars;
|
||||
|
||||
#endif // Z_DEMO_TRE_LGT_H
|
||||
|
||||
@@ -6508,12 +6508,12 @@
|
||||
0x808E0DA8:("EnEncount1_Update",),
|
||||
0x808E0E40:("DemoTreLgt_Init",),
|
||||
0x808E0EBC:("DemoTreLgt_Destroy",),
|
||||
0x808E0EE8:("func_808E0EE8",),
|
||||
0x808E0EF4:("func_808E0EF4",),
|
||||
0x808E0F4C:("func_808E0F4C",),
|
||||
0x808E0FE0:("func_808E0FE0",),
|
||||
0x808E0EE8:("DemoTreLgt_SetupWait",),
|
||||
0x808E0EF4:("DemoTreLgt_Wait",),
|
||||
0x808E0F4C:("DemoTreLgt_SetupAnimate",),
|
||||
0x808E0FE0:("DemoTreLgt_Animate",),
|
||||
0x808E1270:("DemoTreLgt_Update",),
|
||||
0x808E12A4:("func_808E12A4",),
|
||||
0x808E12A4:("DemoTreLgt_OverrideLimbDraw",),
|
||||
0x808E13FC:("DemoTreLgt_Draw",),
|
||||
0x808E1560:("EnEncount2_Init",),
|
||||
0x808E16B4:("EnEncount2_Destroy",),
|
||||
|
||||
@@ -7205,8 +7205,8 @@
|
||||
0x808E0DF8:("D_808E0DF8","UNK_TYPE1","",0x1),
|
||||
0x808E1490:("D_808E1490","UNK_TYPE1","",0x1),
|
||||
0x808E14B0:("Demo_Tre_Lgt_InitVars","UNK_TYPE1","",0x1),
|
||||
0x808E14D0:("D_808E14D0","UNK_TYPE4","",0x4),
|
||||
0x808E14D8:("D_808E14D8","UNK_TYPE1","",0x1),
|
||||
0x808E14D0:("sBoxLightAnimations","UNK_TYPE4","[2]",0x8),
|
||||
0x808E14D8:("sActionFuncs","UNK_TYPE4","[2]",0x8),
|
||||
0x808E1ED0:("En_Encount2_InitVars","UNK_TYPE1","",0x1),
|
||||
0x808E1EF0:("D_808E1EF0","UNK_TYPE1","",0x1),
|
||||
0x808E1F14:("D_808E1F14","UNK_TYPE1","",0x1),
|
||||
|
||||
Reference in New Issue
Block a user