mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-29 03:34:07 +00:00
Responding to PR comments
This commit is contained in:
parent
d7b0ba7c06
commit
fd7c3c9e56
6 changed files with 144 additions and 163 deletions
|
@ -389,7 +389,7 @@ void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1);
|
||||||
void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4);
|
void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4);
|
||||||
Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx);
|
Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx);
|
||||||
Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx);
|
Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx);
|
||||||
s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, s16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*));
|
s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*));
|
||||||
s16 func_800347E8(s16 arg0);
|
s16 func_800347E8(s16 arg0);
|
||||||
void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha);
|
void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha);
|
||||||
void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha);
|
void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha);
|
||||||
|
|
|
@ -303,12 +303,6 @@ typedef struct
|
||||||
} MeshHeader2;
|
} MeshHeader2;
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
/* 0x00 */ u8 nPoints;
|
|
||||||
/* 0x04 */ Vec3s* pointArray;
|
|
||||||
} Path; // size = 0x8
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
u8 ambientClrR, ambientClrG, ambientClrB;
|
u8 ambientClrR, ambientClrG, ambientClrB;
|
||||||
|
|
|
@ -4040,7 +4040,7 @@ Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx)
|
||||||
return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, s16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*))
|
s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*))
|
||||||
{
|
{
|
||||||
s16 sp26;
|
s16 sp26;
|
||||||
s16 sp24;
|
s16 sp24;
|
||||||
|
|
|
@ -15,14 +15,14 @@ typedef struct
|
||||||
#define ROOM 0x00
|
#define ROOM 0x00
|
||||||
#define FLAGS 0x00000009
|
#define FLAGS 0x00000009
|
||||||
|
|
||||||
s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt);
|
s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *globalCtx);
|
||||||
void EnTk_Init(Actor *this, GlobalContext *ctxt);
|
void EnTk_Init(EnTk *this, GlobalContext *globalCtx);
|
||||||
void EnTk_Destroy(Actor *this, GlobalContext *ctxt);
|
void EnTk_Destroy(EnTk *this, GlobalContext *globalCtx);
|
||||||
void EnTk_Rest(EnTk *this, GlobalContext *ctxt);
|
void EnTk_Rest(EnTk *this, GlobalContext *globalCtx);
|
||||||
void EnTk_Walk(EnTk *this, GlobalContext *ctxt);
|
void EnTk_Walk(EnTk *this, GlobalContext *globalCtx);
|
||||||
void EnTk_Dig(EnTk *this, GlobalContext *ctxt);
|
void EnTk_Dig(EnTk *this, GlobalContext *globalCtx);
|
||||||
void EnTk_Update(Actor *this, GlobalContext *ctxt);
|
void EnTk_Update(EnTk *this, GlobalContext *globalCtx);
|
||||||
void EnTk_Draw(Actor *this, GlobalContext *ctxt);
|
void EnTk_Draw(EnTk *this, GlobalContext *globalCtx);
|
||||||
|
|
||||||
extern UNK_TYPE D_04051DB0;
|
extern UNK_TYPE D_04051DB0;
|
||||||
extern UNK_TYPE D_040521B0;
|
extern UNK_TYPE D_040521B0;
|
||||||
|
@ -51,10 +51,10 @@ const ActorInit En_Tk_InitVars =
|
||||||
FLAGS,
|
FLAGS,
|
||||||
OBJECT_TK,
|
OBJECT_TK,
|
||||||
sizeof(EnTk),
|
sizeof(EnTk),
|
||||||
EnTk_Init,
|
(ActorFunc)EnTk_Init,
|
||||||
EnTk_Destroy,
|
(ActorFunc)EnTk_Destroy,
|
||||||
EnTk_Update,
|
(ActorFunc)EnTk_Update,
|
||||||
EnTk_Draw,
|
(ActorFunc)EnTk_Draw,
|
||||||
};
|
};
|
||||||
|
|
||||||
void EnTkEff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel,
|
void EnTkEff_Create(EnTk *this, Vec3f *pos, Vec3f *speed, Vec3f *accel,
|
||||||
|
@ -109,22 +109,22 @@ void EnTkEff_Update(EnTk *this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt)
|
void EnTkEff_Draw(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
static u32 images[] =
|
static UNK_PTR images[] =
|
||||||
{
|
{
|
||||||
(u32)&D_040539B0,
|
&D_040539B0,
|
||||||
(u32)&D_040535B0,
|
&D_040535B0,
|
||||||
(u32)&D_040531B0,
|
&D_040531B0,
|
||||||
(u32)&D_04052DB0,
|
&D_04052DB0,
|
||||||
(u32)&D_040529B0,
|
&D_040529B0,
|
||||||
(u32)&D_040525B0,
|
&D_040525B0,
|
||||||
(u32)&D_040521B0,
|
&D_040521B0,
|
||||||
(u32)&D_04051DB0,
|
&D_04051DB0,
|
||||||
};
|
};
|
||||||
|
|
||||||
EnTkEff *eff = this->eff;
|
EnTkEff *eff = this->eff;
|
||||||
GraphicsContext *gfx;
|
GraphicsContext *gfxCtx;
|
||||||
s16 gfxSetup;
|
s16 gfxSetup;
|
||||||
s16 i;
|
s16 i;
|
||||||
s16 alpha;
|
s16 alpha;
|
||||||
|
@ -136,8 +136,8 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt)
|
||||||
* makes me suspect that they're inside a macro where the function call
|
* makes me suspect that they're inside a macro where the function call
|
||||||
* is present only for debug builds. Same for func_800C6B54 most likely.
|
* is present only for debug builds. Same for func_800C6B54 most likely.
|
||||||
*/
|
*/
|
||||||
gfx = ctxt->state.gfxCtx;
|
gfxCtx = globalCtx->state.gfxCtx;
|
||||||
func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk_eff.c", 114);
|
func_800C6AC4(pgdl, globalCtx->state.gfxCtx, "../z_en_tk_eff.c", 114);
|
||||||
|
|
||||||
gfxSetup = 0;
|
gfxSetup = 0;
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt)
|
||||||
* Same code is generated without the if,
|
* Same code is generated without the if,
|
||||||
* but that would make the do...while redundant so there's probably an if.
|
* but that would make the do...while redundant so there's probably an if.
|
||||||
*/
|
*/
|
||||||
do { if (1) { func_80093D84(ctxt->state.gfxCtx); } } while (0);
|
do { if (1) { func_80093D84(globalCtx->state.gfxCtx); } } while (0);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(this->eff); i++)
|
for (i = 0; i < ARRAY_COUNT(this->eff); i++)
|
||||||
{
|
{
|
||||||
|
@ -153,35 +153,35 @@ void EnTkEff_Draw(EnTk *this, GlobalContext *ctxt)
|
||||||
{
|
{
|
||||||
if (gfxSetup == 0)
|
if (gfxSetup == 0)
|
||||||
{
|
{
|
||||||
gfx->polyXlu.p = func_80093774(gfx->polyXlu.p, 0);
|
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0);
|
||||||
gSPDisplayList(gfx->polyXlu.p++, &D_0600BC90);
|
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600BC90);
|
||||||
gDPSetEnvColor(gfx->polyXlu.p++, 0x64, 0x3C, 0x14, 0x00);
|
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x64, 0x3C, 0x14, 0x00);
|
||||||
gfxSetup = 1;
|
gfxSetup = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
alpha = eff->timeLeft * (255.f / eff->timeTotal);
|
alpha = eff->timeLeft * (255.f / eff->timeTotal);
|
||||||
gDPSetPrimColor(gfx->polyXlu.p++, 0, 0, 0xAA, 0x82, 0x5A, alpha);
|
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0xAA, 0x82, 0x5A, alpha);
|
||||||
|
|
||||||
gDPPipeSync(gfx->polyXlu.p++);
|
gDPPipeSync(gfxCtx->polyXlu.p++);
|
||||||
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, 0);
|
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
|
||||||
func_800D1FD4(&ctxt->mf_11DA0);
|
func_800D1FD4(&globalCtx->mf_11DA0);
|
||||||
Matrix_Scale(eff->size, eff->size, 1.f, 1);
|
Matrix_Scale(eff->size, eff->size, 1.f, MTXMODE_APPLY);
|
||||||
gSPMatrix(gfx->polyXlu.p++,
|
gSPMatrix(gfxCtx->polyXlu.p++,
|
||||||
Matrix_NewMtx(ctxt->state.gfxCtx, "../z_en_tk_eff.c",
|
Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_tk_eff.c",
|
||||||
140),
|
140),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
|
||||||
imageIdx = eff->timeLeft *
|
imageIdx = eff->timeLeft *
|
||||||
((f32)ARRAY_COUNT(images) / eff->timeTotal);
|
((f32)ARRAY_COUNT(images) / eff->timeTotal);
|
||||||
gSPSegment(gfx->polyXlu.p++, 0x08,
|
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
|
||||||
SEGMENTED_TO_VIRTUAL(images[imageIdx]));
|
SEGMENTED_TO_VIRTUAL(images[imageIdx]));
|
||||||
|
|
||||||
gSPDisplayList(gfx->polyXlu.p++, &D_0600BCA0);
|
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600BCA0);
|
||||||
}
|
}
|
||||||
eff++;
|
eff++;
|
||||||
}
|
}
|
||||||
|
|
||||||
func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk_eff.c", 154);
|
func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk_eff.c", 154);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 EnTkEff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size,
|
s32 EnTkEff_CreateDflt(EnTk *this, Vec3f *pos, u8 duration, f32 size,
|
||||||
|
@ -221,7 +221,7 @@ static EnTk_SubActorStruct98Init D_80B1D534 =
|
||||||
0xFF,
|
0xFF,
|
||||||
};
|
};
|
||||||
|
|
||||||
void EnTk_RestAnim(EnTk *this, GlobalContext *ctxt)
|
void EnTk_RestAnim(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
UNK_PTR anim = &D_06002F84;
|
UNK_PTR anim = &D_06002F84;
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ void EnTk_RestAnim(EnTk *this, GlobalContext *ctxt)
|
||||||
this->actor.speedXZ = 0.f;
|
this->actor.speedXZ = 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_WalkAnim(EnTk *this, GlobalContext *ctxt)
|
void EnTk_WalkAnim(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
UNK_PTR anim = &D_06001FA8;
|
UNK_PTR anim = &D_06001FA8;
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ void EnTk_WalkAnim(EnTk *this, GlobalContext *ctxt)
|
||||||
this->actionCountdown = Math_Rand_S16Offset(240, 240);
|
this->actionCountdown = Math_Rand_S16Offset(240, 240);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_DigAnim(EnTk *this, GlobalContext *ctxt)
|
void EnTk_DigAnim(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
UNK_PTR anim = &D_06001144;
|
UNK_PTR anim = &D_06001144;
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ void EnTk_DigAnim(EnTk *this, GlobalContext *ctxt)
|
||||||
SkelAnime_GetFrameCount((u32)&D_06001144), 0,
|
SkelAnime_GetFrameCount((u32)&D_06001144), 0,
|
||||||
-10.f);
|
-10.f);
|
||||||
|
|
||||||
if (EnTk_CheckNextSpot(this, ctxt) >= 0)
|
if (EnTk_CheckNextSpot(this, globalCtx) >= 0)
|
||||||
{
|
{
|
||||||
this->validDigHere = 1;
|
this->validDigHere = 1;
|
||||||
}
|
}
|
||||||
|
@ -305,13 +305,13 @@ s32 EnTk_CheckFacingPlayer(EnTk *this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *ctxt)
|
s32 EnTk_CheckNextSpot(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
Actor *prop;
|
Actor *prop;
|
||||||
f32 dxz;
|
f32 dxz;
|
||||||
f32 dy;
|
f32 dy;
|
||||||
|
|
||||||
prop = ctxt->actorCtx.actorList[ACTORTYPE_PROP].first;
|
prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
|
||||||
|
|
||||||
while (prop != NULL)
|
while (prop != NULL)
|
||||||
{
|
{
|
||||||
|
@ -358,7 +358,7 @@ void EnTk_CheckCurrentSpot(EnTk *this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
f32 EnTk_Step(EnTk *this, GlobalContext *ctxt)
|
f32 EnTk_Step(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
f32 stepFrames[] = {36.f, 10.f};
|
f32 stepFrames[] = {36.f, 10.f};
|
||||||
f32 a1_;
|
f32 a1_;
|
||||||
|
@ -370,7 +370,7 @@ f32 EnTk_Step(EnTk *this, GlobalContext *ctxt)
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->skelAnim.animCurrent != (u32)&D_06001FA8)
|
if (this->skelAnim.animCurrent != (u32 *)&D_06001FA8)
|
||||||
{
|
{
|
||||||
return 0.f;
|
return 0.f;
|
||||||
}
|
}
|
||||||
|
@ -394,7 +394,7 @@ f32 EnTk_Step(EnTk *this, GlobalContext *ctxt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt)
|
s32 EnTk_Orient(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
Path *path;
|
Path *path;
|
||||||
Vec3s *point;
|
Vec3s *point;
|
||||||
|
@ -406,22 +406,21 @@ s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = &ctxt->setupPathList[0];
|
path = &globalCtx->setupPathList[0];
|
||||||
point = SEGMENTED_TO_VIRTUAL(path->pointArray);
|
point = SEGMENTED_TO_VIRTUAL(path->path);
|
||||||
point += this->currentWaypoint;
|
point += this->currentWaypoint;
|
||||||
|
|
||||||
dx = point->x - this->actor.posRot.pos.x;
|
dx = point->x - this->actor.posRot.pos.x;
|
||||||
dz = point->z - this->actor.posRot.pos.z;
|
dz = point->z - this->actor.posRot.pos.z;
|
||||||
|
|
||||||
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y,
|
Math_SmoothScaleMaxMinS(&this->actor.shape.rot.y,
|
||||||
func_800FD250(dx, dz) * (0x8000 / M_PI),
|
Math_atan2f(dx, dz) * (0x8000 / M_PI), 10, 1000, 1);
|
||||||
10, 1000, 1);
|
|
||||||
this->actor.posRot.rot = this->actor.shape.rot;
|
this->actor.posRot.rot = this->actor.shape.rot;
|
||||||
|
|
||||||
if (SQ(dx) + SQ(dz) < 10.f)
|
if (SQ(dx) + SQ(dz) < 10.f)
|
||||||
{
|
{
|
||||||
this->currentWaypoint++;
|
this->currentWaypoint++;
|
||||||
if (this->currentWaypoint >= path->nPoints)
|
if (this->currentWaypoint >= path->count)
|
||||||
{
|
{
|
||||||
this->currentWaypoint = 0;
|
this->currentWaypoint = 0;
|
||||||
}
|
}
|
||||||
|
@ -434,11 +433,11 @@ s32 EnTk_Orient(EnTk *this, GlobalContext *ctxt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 func_80B1C54C(GlobalContext *ctxt, Actor *a1)
|
u16 func_80B1C54C(GlobalContext *globalCtx, Actor *a1)
|
||||||
{
|
{
|
||||||
u16 ret;
|
u16 ret;
|
||||||
|
|
||||||
ret = func_8006C360(ctxt, 14);
|
ret = func_8006C360(globalCtx, 14);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -456,16 +455,13 @@ u16 func_80B1C54C(GlobalContext *ctxt, Actor *a1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s16 func_80B1C5A0(GlobalContext *ctxt, Actor *actor)
|
s16 func_80B1C5A0(GlobalContext *globalCtx, Actor *actor)
|
||||||
{
|
{
|
||||||
s32 ret = 1;
|
s32 ret = 1;
|
||||||
|
|
||||||
switch (func_8010BDBC(&ctxt->msgCtx))
|
switch (func_8010BDBC(&globalCtx->msgCtx))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -486,10 +482,10 @@ s16 func_80B1C5A0(GlobalContext *ctxt, Actor *actor)
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
if (func_80106BC8(ctxt) != 0 &&
|
if (func_80106BC8(globalCtx) != 0 &&
|
||||||
(actor->textId == 0x5018 || actor->textId == 0x5019))
|
(actor->textId == 0x5018 || actor->textId == 0x5019))
|
||||||
{
|
{
|
||||||
if (ctxt->msgCtx.choiceIndex == 1)
|
if (globalCtx->msgCtx.choiceIndex == 1)
|
||||||
{
|
{
|
||||||
/* "Thanks a lot!" */
|
/* "Thanks a lot!" */
|
||||||
actor->textId = 0x0084;
|
actor->textId = 0x0084;
|
||||||
|
@ -501,38 +497,29 @@ s16 func_80B1C5A0(GlobalContext *ctxt, Actor *actor)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ctxt->msgCtx.msgMode = 0x37;
|
globalCtx->msgCtx.msgMode = 0x37;
|
||||||
Rupees_ChangeBy(-10);
|
Rupees_ChangeBy(-10);
|
||||||
gSaveContext.inf_table[13] |= 0x0200;
|
gSaveContext.inf_table[13] |= 0x0200;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
func_8010B720(ctxt, actor->textId);
|
func_8010B720(globalCtx, actor->textId);
|
||||||
gSaveContext.inf_table[13] |= 0x0200;
|
gSaveContext.inf_table[13] |= 0x0200;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 5:
|
case 5:
|
||||||
{
|
{
|
||||||
if (func_80106BC8(ctxt) != 0 &&
|
if (func_80106BC8(globalCtx) != 0 &&
|
||||||
(actor->textId == 0x0084 || actor->textId == 0x0085))
|
(actor->textId == 0x0084 || actor->textId == 0x0085))
|
||||||
{
|
{
|
||||||
func_80106CCC(ctxt);
|
func_80106CCC(globalCtx);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 6:
|
case 6:
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 7:
|
case 7:
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 8:
|
case 8:
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 9:
|
case 9:
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -654,49 +641,51 @@ void EnTk_DigEff(EnTk *this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_Init(Actor *this, GlobalContext *ctxt)
|
void EnTk_Init(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
EnTk *tk = (EnTk *)this;
|
EnTk *thisAgain = this;
|
||||||
UNK_PTR anim = &D_06002F84;
|
UNK_PTR anim = &D_06002F84;
|
||||||
|
|
||||||
ActorShape_Init(&tk->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.f);
|
ActorShape_Init(&thisAgain->actor.shape, 0, ActorShadow_DrawFunc_Circle,
|
||||||
|
24.f);
|
||||||
|
|
||||||
func_800A46F8(ctxt, &tk->skelAnim, (u32)&D_0600BE40, 0, tk->hz_22A,
|
func_800A46F8(globalCtx, &thisAgain->skelAnim, (u32)&D_0600BE40, 0,
|
||||||
tk->hz_296, 18);
|
thisAgain->hz_22A, thisAgain->hz_296, 18);
|
||||||
SkelAnime_ChangeAnimation(&tk->skelAnim, (u32)anim, 1.f, 0.f,
|
SkelAnime_ChangeAnimation(&thisAgain->skelAnim, (u32)anim, 1.f, 0.f,
|
||||||
SkelAnime_GetFrameCount((u32)&D_06002F84),
|
SkelAnime_GetFrameCount((u32)&D_06002F84),
|
||||||
0, 0.f);
|
0, 0.f);
|
||||||
|
|
||||||
ActorCollider_AllocCylinder(ctxt, &tk->collider);
|
ActorCollider_AllocCylinder(globalCtx, &thisAgain->collider);
|
||||||
ActorCollider_InitCylinder(ctxt, &tk->collider, &tk->actor, &D_80B1D508);
|
ActorCollider_InitCylinder(globalCtx, &thisAgain->collider,
|
||||||
|
&thisAgain->actor, &D_80B1D508);
|
||||||
|
|
||||||
func_80061EFC(&tk->actor.sub_98, NULL, &D_80B1D534);
|
func_80061EFC(&thisAgain->actor.sub_98, NULL, &D_80B1D534);
|
||||||
|
|
||||||
if (gSaveContext.day_time <= 0xC000 ||
|
if (gSaveContext.day_time <= 0xC000 ||
|
||||||
gSaveContext.day_time >= 0xE000 ||
|
gSaveContext.day_time >= 0xE000 ||
|
||||||
!LINK_IS_CHILD ||
|
!LINK_IS_CHILD ||
|
||||||
ctxt->sceneNum != SCENE_SPOT02)
|
globalCtx->sceneNum != SCENE_SPOT02)
|
||||||
{
|
{
|
||||||
Actor_Kill(&tk->actor);
|
Actor_Kill(&thisAgain->actor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Actor_SetScale(&tk->actor, 0.01f);
|
Actor_SetScale(&thisAgain->actor, 0.01f);
|
||||||
|
|
||||||
tk->actor.unk_1F = 6;
|
thisAgain->actor.unk_1F = 6;
|
||||||
tk->actor.gravity = -0.1f;
|
thisAgain->actor.gravity = -0.1f;
|
||||||
tk->currentReward = -1;
|
thisAgain->currentReward = -1;
|
||||||
tk->currentSpot = NULL;
|
thisAgain->currentSpot = NULL;
|
||||||
tk->actionFunc = EnTk_Rest;
|
thisAgain->actionFunc = EnTk_Rest;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_Destroy(Actor *this, GlobalContext *ctxt)
|
void EnTk_Destroy(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
EnTk *tk = (EnTk *)this;
|
EnTk *thisAgain = this;
|
||||||
ActorCollider_FreeCylinder(ctxt, &tk->collider);
|
ActorCollider_FreeCylinder(globalCtx, &thisAgain->collider);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_Rest(EnTk *this, GlobalContext *ctxt)
|
void EnTk_Rest(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
s16 v1;
|
s16 v1;
|
||||||
s16 a1_;
|
s16 a1_;
|
||||||
|
@ -709,13 +698,13 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt)
|
||||||
|
|
||||||
if (this->h_1E0 == 2)
|
if (this->h_1E0 == 2)
|
||||||
{
|
{
|
||||||
EnTk_DigAnim(this, ctxt);
|
EnTk_DigAnim(this, globalCtx);
|
||||||
this->h_1E0 = 0;
|
this->h_1E0 = 0;
|
||||||
this->actionFunc = EnTk_Dig;
|
this->actionFunc = EnTk_Dig;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
func_800343CC(ctxt, &this->actor, &this->h_1E0,
|
func_800343CC(globalCtx, &this->actor, &this->h_1E0,
|
||||||
this->collider.dim.radius + 30.f,
|
this->collider.dim.radius + 30.f,
|
||||||
func_80B1C54C, func_80B1C5A0);
|
func_80B1C54C, func_80B1C5A0);
|
||||||
}
|
}
|
||||||
|
@ -726,11 +715,11 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt)
|
||||||
v1 = this->actor.rotTowardsLinkY - v1;
|
v1 = this->actor.rotTowardsLinkY - v1;
|
||||||
|
|
||||||
this->actionCountdown = 0;
|
this->actionCountdown = 0;
|
||||||
func_800343CC(ctxt, &this->actor, &this->h_1E0,
|
func_800343CC(globalCtx, &this->actor, &this->h_1E0,
|
||||||
this->collider.dim.radius + 30.f,
|
this->collider.dim.radius + 30.f,
|
||||||
func_80B1C54C, func_80B1C5A0);
|
func_80B1C54C, func_80B1C5A0);
|
||||||
}
|
}
|
||||||
else if (func_8002F194(&this->actor, ctxt) != 0)
|
else if (func_8002F194(&this->actor, globalCtx) != 0)
|
||||||
{
|
{
|
||||||
v1 = this->actor.shape.rot.y;
|
v1 = this->actor.shape.rot.y;
|
||||||
v1 -= this->h_21E;
|
v1 -= this->h_21E;
|
||||||
|
@ -741,7 +730,7 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt)
|
||||||
}
|
}
|
||||||
else if (DECR(this->actionCountdown) == 0)
|
else if (DECR(this->actionCountdown) == 0)
|
||||||
{
|
{
|
||||||
EnTk_WalkAnim(this, ctxt);
|
EnTk_WalkAnim(this, globalCtx);
|
||||||
this->actionFunc = EnTk_Walk;
|
this->actionFunc = EnTk_Walk;
|
||||||
|
|
||||||
/*! @bug v1 is uninitialized past this branch */
|
/*! @bug v1 is uninitialized past this branch */
|
||||||
|
@ -755,31 +744,31 @@ void EnTk_Rest(EnTk *this, GlobalContext *ctxt)
|
||||||
Math_SmoothScaleMaxMinS(&this->headRot, a1_, 6, 1000, 1);
|
Math_SmoothScaleMaxMinS(&this->headRot, a1_, 6, 1000, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_Walk(EnTk *this, GlobalContext *ctxt)
|
void EnTk_Walk(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
if (this->h_1E0 == 2)
|
if (this->h_1E0 == 2)
|
||||||
{
|
{
|
||||||
EnTk_DigAnim(this, ctxt);
|
EnTk_DigAnim(this, globalCtx);
|
||||||
this->h_1E0 = 0;
|
this->h_1E0 = 0;
|
||||||
this->actionFunc = EnTk_Dig;
|
this->actionFunc = EnTk_Dig;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->actor.speedXZ = EnTk_Step(this, ctxt);
|
this->actor.speedXZ = EnTk_Step(this, globalCtx);
|
||||||
EnTk_Orient(this, ctxt);
|
EnTk_Orient(this, globalCtx);
|
||||||
Math_SmoothScaleMaxMinS(&this->headRot, 0, 6, 1000, 1);
|
Math_SmoothScaleMaxMinS(&this->headRot, 0, 6, 1000, 1);
|
||||||
EnTk_CheckCurrentSpot(this);
|
EnTk_CheckCurrentSpot(this);
|
||||||
|
|
||||||
DECR(this->actionCountdown);
|
DECR(this->actionCountdown);
|
||||||
if (EnTk_CheckFacingPlayer(this) != 0 || this->actionCountdown == 0)
|
if (EnTk_CheckFacingPlayer(this) != 0 || this->actionCountdown == 0)
|
||||||
{
|
{
|
||||||
EnTk_RestAnim(this, ctxt);
|
EnTk_RestAnim(this, globalCtx);
|
||||||
this->actionFunc = EnTk_Rest;
|
this->actionFunc = EnTk_Rest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_Dig(EnTk *this, GlobalContext *ctxt)
|
void EnTk_Dig(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
Vec3f rewardOrigin;
|
Vec3f rewardOrigin;
|
||||||
Vec3f rewardPos;
|
Vec3f rewardPos;
|
||||||
|
@ -807,7 +796,7 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt)
|
||||||
rewardOrigin.y = 0.f;
|
rewardOrigin.y = 0.f;
|
||||||
rewardOrigin.z = -40.f;
|
rewardOrigin.z = -40.f;
|
||||||
|
|
||||||
Matrix_RotateY(this->actor.shape.rot.y, 0);
|
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
|
||||||
Matrix_MultVec3f(&rewardOrigin, &rewardPos);
|
Matrix_MultVec3f(&rewardOrigin, &rewardPos);
|
||||||
|
|
||||||
rewardPos.x += this->actor.posRot.pos.x;
|
rewardPos.x += this->actor.posRot.pos.x;
|
||||||
|
@ -828,7 +817,7 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item_DropCollectible(ctxt, &rewardPos,
|
Item_DropCollectible(globalCtx, &rewardPos,
|
||||||
rewardParams[this->currentReward]);
|
rewardParams[this->currentReward]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -860,14 +849,14 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt)
|
||||||
if (this->currentReward < 0)
|
if (this->currentReward < 0)
|
||||||
{
|
{
|
||||||
/* "Nope, nothing here!" */
|
/* "Nope, nothing here!" */
|
||||||
func_8010B680(ctxt, 0x501A, 0);
|
func_8010B680(globalCtx, 0x501A, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
func_80106CCC(ctxt);
|
func_80106CCC(globalCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
EnTk_RestAnim(this, ctxt);
|
EnTk_RestAnim(this, globalCtx);
|
||||||
|
|
||||||
this->currentReward = -1;
|
this->currentReward = -1;
|
||||||
this->validDigHere = 0;
|
this->validDigHere = 0;
|
||||||
|
@ -875,38 +864,38 @@ void EnTk_Dig(EnTk *this, GlobalContext *ctxt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_Update(Actor *this, GlobalContext *ctxt)
|
void EnTk_Update(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
EnTk *tk = (EnTk *)this;
|
EnTk *thisAgain = this;
|
||||||
ColliderCylinderMain *collider = &tk->collider;
|
ColliderCylinderMain *collider = &thisAgain->collider;
|
||||||
|
|
||||||
ActorCollider_Cylinder_Update(&tk->actor, collider);
|
ActorCollider_Cylinder_Update(&thisAgain->actor, collider);
|
||||||
Actor_CollisionCheck_SetOT(ctxt, &ctxt->sub_11E60, collider);
|
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, collider);
|
||||||
|
|
||||||
SkelAnime_FrameUpdateMatrix(&tk->skelAnim);
|
SkelAnime_FrameUpdateMatrix(&thisAgain->skelAnim);
|
||||||
|
|
||||||
Actor_MoveForward(&tk->actor);
|
Actor_MoveForward(&thisAgain->actor);
|
||||||
|
|
||||||
func_8002E4B4(ctxt, &tk->actor, 40.f, 10.f, 0.f, 5);
|
func_8002E4B4(globalCtx, &thisAgain->actor, 40.f, 10.f, 0.f, 5);
|
||||||
|
|
||||||
tk->actionFunc(tk, ctxt);
|
thisAgain->actionFunc(thisAgain, globalCtx);
|
||||||
|
|
||||||
EnTkEff_Update(tk);
|
EnTkEff_Update(thisAgain);
|
||||||
|
|
||||||
EnTk_UpdateEyes(tk);
|
EnTk_UpdateEyes(thisAgain);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B1D200(GlobalContext *ctxt)
|
void func_80B1D200(GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
GraphicsContext *gfx;
|
GraphicsContext *gfxCtx;
|
||||||
Gfx *pgdl[4];
|
Gfx *pgdl[4];
|
||||||
|
|
||||||
gfx = ctxt->state.gfxCtx;
|
gfxCtx = globalCtx->state.gfxCtx;
|
||||||
func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1188);
|
func_800C6AC4(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1188);
|
||||||
|
|
||||||
gSPDisplayList(gfx->polyOpa.p++, &D_0600ACE0);
|
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0600ACE0);
|
||||||
|
|
||||||
func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1190);
|
func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1190);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s *sp10,
|
s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s *sp10,
|
||||||
|
@ -934,8 +923,8 @@ s32 func_80B1D278(s16 a0, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Vec3s *sp10,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80B1D2E4(GlobalContext *ctxt, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3,
|
void func_80B1D2E4(GlobalContext *globalCtx, UNK_TYPE a1, UNK_TYPE a2,
|
||||||
Actor *actor)
|
UNK_TYPE a3, Actor *actor)
|
||||||
{
|
{
|
||||||
EnTk *this = (EnTk *)actor;
|
EnTk *this = (EnTk *)actor;
|
||||||
Vec3f sp28 = {0.f, 0.f, 4600.f};
|
Vec3f sp28 = {0.f, 0.f, 4600.f};
|
||||||
|
@ -951,38 +940,39 @@ void func_80B1D2E4(GlobalContext *ctxt, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3,
|
||||||
if (a1 == 14)
|
if (a1 == 14)
|
||||||
{
|
{
|
||||||
Matrix_MultVec3f(&sp28, &this->v3f_304);
|
Matrix_MultVec3f(&sp28, &this->v3f_304);
|
||||||
func_80B1D200(ctxt);
|
func_80B1D200(globalCtx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnTk_Draw(Actor *this, GlobalContext *ctxt)
|
void EnTk_Draw(EnTk *this, GlobalContext *globalCtx)
|
||||||
{
|
{
|
||||||
static u32 eyeImages[] =
|
static UNK_PTR eyeImages[] =
|
||||||
{
|
{
|
||||||
(u32)&D_06003B40,
|
&D_06003B40,
|
||||||
(u32)&D_06004340,
|
&D_06004340,
|
||||||
(u32)&D_06004B40,
|
&D_06004B40,
|
||||||
};
|
};
|
||||||
|
|
||||||
EnTk *tk = (EnTk *)this;
|
EnTk *thisAgain = this;
|
||||||
GraphicsContext *gfx;
|
GraphicsContext *gfxCtx;
|
||||||
Gfx *pgdl[4];
|
Gfx *pgdl[4];
|
||||||
|
|
||||||
Matrix_Push();
|
Matrix_Push();
|
||||||
EnTkEff_Draw(tk, ctxt);
|
EnTkEff_Draw(thisAgain, globalCtx);
|
||||||
Matrix_Pull();
|
Matrix_Pull();
|
||||||
|
|
||||||
gfx = ctxt->state.gfxCtx;
|
gfxCtx = globalCtx->state.gfxCtx;
|
||||||
func_800C6AC4(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1294);
|
func_800C6AC4(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1294);
|
||||||
|
|
||||||
func_80093D18(ctxt->state.gfxCtx);
|
func_80093D18(globalCtx->state.gfxCtx);
|
||||||
|
|
||||||
gSPSegment(gfx->polyOpa.p++, 0x08,
|
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
|
||||||
SEGMENTED_TO_VIRTUAL(eyeImages[tk->eyeImageIdx]));
|
SEGMENTED_TO_VIRTUAL(eyeImages[thisAgain->eyeImageIdx]));
|
||||||
|
|
||||||
func_800A1AC8(ctxt, tk->skelAnim.limbIndex,
|
func_800A1AC8(globalCtx, thisAgain->skelAnim.limbIndex,
|
||||||
tk->skelAnim.actorDrawTbl, tk->skelAnim.dListCount,
|
thisAgain->skelAnim.actorDrawTbl,
|
||||||
func_80B1D278, func_80B1D2E4, &tk->actor);
|
thisAgain->skelAnim.dListCount, func_80B1D278, func_80B1D2E4,
|
||||||
|
&thisAgain->actor);
|
||||||
|
|
||||||
func_800C6B54(pgdl, ctxt->state.gfxCtx, "../z_en_tk.c", 1312);
|
func_800C6B54(pgdl, globalCtx->state.gfxCtx, "../z_en_tk.c", 1312);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <ultra64.h>
|
#include <ultra64.h>
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
|
|
||||||
/* Dust particle effect */
|
/* Dirt particle effect */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/* 0x0000 */ u8 active;
|
/* 0x0000 */ u8 active;
|
||||||
|
@ -16,8 +16,7 @@ typedef struct
|
||||||
/* 0x0014 */ Vec3f pos;
|
/* 0x0014 */ Vec3f pos;
|
||||||
/* 0x0020 */ Vec3f speed;
|
/* 0x0020 */ Vec3f speed;
|
||||||
/* 0x002C */ Vec3f accel;
|
/* 0x002C */ Vec3f accel;
|
||||||
/* 0x0038 */
|
} EnTkEff; // size = 0x0038
|
||||||
} EnTkEff;
|
|
||||||
|
|
||||||
typedef struct EnTk EnTk;
|
typedef struct EnTk EnTk;
|
||||||
|
|
||||||
|
@ -49,8 +48,7 @@ struct EnTk
|
||||||
/* 0x022A */ u16 hz_296[55];
|
/* 0x022A */ u16 hz_296[55];
|
||||||
/* 0x0304 */ Vec3f v3f_304;
|
/* 0x0304 */ Vec3f v3f_304;
|
||||||
/* 0x0310 */ EnTkEff eff[20];
|
/* 0x0310 */ EnTkEff eff[20];
|
||||||
/* 0x0770 */
|
}; // size = 0x0770
|
||||||
};
|
|
||||||
|
|
||||||
extern const ActorInit En_Tk_InitVars;
|
extern const ActorInit En_Tk_InitVars;
|
||||||
|
|
||||||
|
|
|
@ -332,7 +332,6 @@ D_0600ACE0 = 0x0600ACE0;
|
||||||
D_0600BC90 = 0x0600BC90;
|
D_0600BC90 = 0x0600BC90;
|
||||||
D_0600BCA0 = 0x0600BCA0;
|
D_0600BCA0 = 0x0600BCA0;
|
||||||
D_0600BE40 = 0x0600BE40;
|
D_0600BE40 = 0x0600BE40;
|
||||||
D_8002B5EC = 0x8002B5EC;
|
|
||||||
|
|
||||||
// z_arms_hook
|
// z_arms_hook
|
||||||
D_0602B288 = 0x0602B288;
|
D_0602B288 = 0x0602B288;
|
||||||
|
|
Loading…
Reference in a new issue