1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-26 22:56:20 +00:00

pr review changes

This commit is contained in:
fig02 2020-03-20 20:42:57 -04:00
parent ea075560c8
commit dff17518ef
4 changed files with 31 additions and 34 deletions

View file

@ -209,7 +209,7 @@ typedef struct
/* 0x1418 */ u8 fade_duration; /* 0x1418 */ u8 fade_duration;
/* 0x1419 */ u8 unk_1419; // transition related /* 0x1419 */ u8 unk_1419; // transition related
/* 0x141A */ u16 environment_time; /* 0x141A */ u16 environment_time;
/* 0x141C */ u8 richardIsLost; /* 0x141C */ u8 dogIsLost;
/* 0x141D */ u8 transition_type; /* 0x141D */ u8 transition_type;
/* 0x141E */ char unk_141E[0x0002]; /* 0x141E */ char unk_141E[0x0002];
/* 0x1420 */ s16 world_map_area; /* 0x1420 */ s16 world_map_area;

View file

@ -14,7 +14,7 @@ void SaveContext_Init(void)
gSaveContext.chamber_cutscene_num = 0; gSaveContext.chamber_cutscene_num = 0;
gSaveContext.next_day_time = 0xFFFF; gSaveContext.next_day_time = 0xFFFF;
gSaveContext.environment_time = 0; gSaveContext.environment_time = 0;
gSaveContext.richardIsLost = 1; gSaveContext.dogIsLost = 1;
gSaveContext.transition_type = 0xFF; gSaveContext.transition_type = 0xFF;
gSaveContext.unk_13EE = 50; gSaveContext.unk_13EE = 50;
} }

View file

@ -105,7 +105,7 @@ extern UNK_PTR D_06001368;
extern UNK_PTR D_06000D78; extern UNK_PTR D_06000D78;
extern UNK_PTR D_06000278; extern UNK_PTR D_06000278;
static void EnDog_WalkSFX(EnDog* this) static void EnDog_PlayWalkSFX(EnDog* this)
{ {
u32* walk = &D_06001368; u32* walk = &D_06001368;
if (this->skelAnime.animCurrent == walk) if (this->skelAnime.animCurrent == walk)
@ -117,7 +117,7 @@ static void EnDog_WalkSFX(EnDog* this)
} }
} }
static void EnDog_RunSFX(EnDog* this) static void EnDog_PlayRunSFX(EnDog* this)
{ {
u32* run = &D_06000D78; u32* run = &D_06000D78;
if (this->skelAnime.animCurrent == run) if (this->skelAnime.animCurrent == run)
@ -129,7 +129,7 @@ static void EnDog_RunSFX(EnDog* this)
} }
} }
static void EnDog_BarkSFX(EnDog* this) static void EnDog_PlayBarkSFX(EnDog* this)
{ {
u32* bark = &D_06000278; u32* bark = &D_06000278;
if (this->skelAnime.animCurrent == bark) if (this->skelAnime.animCurrent == bark)
@ -141,7 +141,7 @@ static void EnDog_BarkSFX(EnDog* this)
} }
} }
static s32 EnDog_PlayAnimSFX(EnDog* this) static s32 EnDog_PlayAnimAndSFX(EnDog* this)
{ {
s32 animation; s32 animation;
@ -195,13 +195,13 @@ static s32 EnDog_PlayAnimSFX(EnDog* this)
} }
break; break;
case DOG_WALK: case DOG_WALK:
EnDog_WalkSFX(this); EnDog_PlayWalkSFX(this);
break; break;
case DOG_RUN: case DOG_RUN:
EnDog_RunSFX(this); EnDog_PlayRunSFX(this);
break; break;
case DOG_BARK: case DOG_BARK:
EnDog_BarkSFX(this); EnDog_PlayBarkSFX(this);
if (this){} // needed for regalloc if (this){} // needed for regalloc
break; break;
} }
@ -210,9 +210,9 @@ static s32 EnDog_PlayAnimSFX(EnDog* this)
static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx)
{ {
if ((this->collider.base.collideFlags & 2) != 0) if ((this->collider.base.collideFlags & 2))
{ {
this->collider.base.collideFlags &= 0xFFFD; this->collider.base.collideFlags &= ~2;
return 2; return 2;
} }
@ -221,9 +221,9 @@ static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx)
return 0; return 0;
} }
if ((this->collider.base.maskB & 1) != 0) if ((this->collider.base.maskB & 1))
{ {
this->collider.base.maskB &= 0xFFFE; this->collider.base.maskB &= ~1;
if (gSaveContext.dogParams != 0) if (gSaveContext.dogParams != 0)
{ {
return 0; return 0;
@ -255,7 +255,7 @@ static EnDog_UpdateWaypoint(EnDog* this, GlobalContext* globalCtx)
this->waypoint += change; this->waypoint += change;
if (this->reverse != 0) if (this->reverse)
{ {
if (this->waypoint < 0) if (this->waypoint < 0)
{ {
@ -326,16 +326,15 @@ static void EnDog_Init(EnDog* this, GlobalContext* globalCtx)
switch (globalCtx->sceneNum) switch (globalCtx->sceneNum)
{ {
case SCENE_MARKET_NIGHT: case SCENE_MARKET_NIGHT:
if ((gSaveContext.richardIsLost == 0) && (((this->actor.params & 0x0F00) >> 8) == 1)) if ((gSaveContext.dogIsLost == 0) && (((this->actor.params & 0x0F00) >> 8) == 1))
{ {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
} }
break; break;
// Richard's Home case SCENE_IMPA: // Richard's Home
case SCENE_IMPA:
if ((u32)(this->actor.params & 0x8000) == 0) if ((u32)(this->actor.params & 0x8000) == 0)
{ {
if (gSaveContext.richardIsLost == 0) if (gSaveContext.dogIsLost == 0)
{ {
this->nextBehavior = DOG_SIT; this->nextBehavior = DOG_SIT;
this->actionFunc = EnDog_Wait; this->actionFunc = EnDog_Wait;
@ -349,8 +348,6 @@ static void EnDog_Init(EnDog* this, GlobalContext* globalCtx)
} }
} }
break; break;
default: break;
} }
if ((u32)(this->actor.params & 0x8000) != 0) if ((u32)(this->actor.params & 0x8000) != 0)
@ -373,7 +370,7 @@ static void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx)
static void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) static void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx)
{ {
s16ArrEntry behaviors[] = { 3, 5, 2 }; s16ArrEntry behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK };
s16ArrEntry unused[] = { 40, 80, 20 }; s16ArrEntry unused[] = { 40, 80, 20 };
f32 speed; f32 speed;
s32 frame; s32 frame;
@ -383,7 +380,7 @@ static void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx)
this->actionFunc = EnDog_FollowLink; this->actionFunc = EnDog_FollowLink;
} }
if(DECR(this->behaviorTimer)) if (DECR(this->behaviorTimer) != 0)
{ {
if (this->nextBehavior == DOG_WALK) if (this->nextBehavior == DOG_WALK)
{ {
@ -427,7 +424,7 @@ static void EnDog_ChooseMovement(EnDog* this, GlobalContext* globalCtx)
this->actionFunc = EnDog_FollowLink; this->actionFunc = EnDog_FollowLink;
} }
if(DECR(this->behaviorTimer) == 0) if (DECR(this->behaviorTimer) == 0)
{ {
this->behaviorTimer = Math_Rand_S16Offset(200, 100); this->behaviorTimer = Math_Rand_S16Offset(200, 100);
if (globalCtx->state.frames % 2) if (globalCtx->state.frames % 2)
@ -441,7 +438,7 @@ static void EnDog_ChooseMovement(EnDog* this, GlobalContext* globalCtx)
if (this->nextBehavior == DOG_RUN) if (this->nextBehavior == DOG_RUN)
{ {
this->behaviorTimer = (this->behaviorTimer / 2); this->behaviorTimer /= 2;
} }
this->actionFunc = EnDog_FollowPath; this->actionFunc = EnDog_FollowPath;
} }
@ -533,7 +530,7 @@ static void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx)
absAngleDiff = fabsf(absAngleDiff); absAngleDiff = fabsf(absAngleDiff);
if (absAngleDiff < 200.0f) if (absAngleDiff < 200.0f)
{ {
this->nextBehavior = 3; this->nextBehavior = DOG_SIT;
this->actionFunc = EnDog_Wait; this->actionFunc = EnDog_Wait;
this->actor.speedXZ = 0.0f; this->actor.speedXZ = 0.0f;
} }
@ -563,10 +560,10 @@ static void EnDog_Update(EnDog* this, GlobalContext* globalCtx)
s32 pad1; s32 pad1;
s32 pad2; s32 pad2;
EnDog_PlayAnimSFX(this); EnDog_PlayAnimAndSFX(this);
SkelAnime_FrameUpdateMatrix(&this->skelAnime); SkelAnime_FrameUpdateMatrix(&this->skelAnime);
func_8002E4B4(globalCtx, &this->actor, (f32)this->collider.dim.radius, func_8002E4B4(globalCtx, &this->actor, this->collider.dim.radius,
(f32)this->collider.dim.height * 0.5f, 0.0f, 5); this->collider.dim.height * 0.5f, 0.0f, 5);
Actor_MoveForward(&this->actor); Actor_MoveForward(&this->actor);
this->actionFunc(this, globalCtx); this->actionFunc(this, globalCtx);
ActorCollider_Cylinder_Update(&this->actor, &this->collider); ActorCollider_Cylinder_Update(&this->actor, &this->collider);

View file

@ -14,15 +14,15 @@ typedef struct
/* 0x01E4 */ u8 reverse; /* 0x01E4 */ u8 reverse;
/* 0x01E6 */ s16 waypoint; /* 0x01E6 */ s16 waypoint;
/* 0x01E8 */ s16 unusedAngle; /* 0x01E8 */ s16 unusedAngle;
/* 0x01EA */ char unk_1EA[0x2]; /* 0x01EA */ s16 pad1;
/* 0x01EC */ s16 behaviorTimer; /* 0x01EC */ s16 behaviorTimer;
/* 0x01EE */ char unk_1EE[0x2]; /* 0x01EE */ s16 pad2;
/* 0x01F0 */ s16 nextBehavior; /* 0x01F0 */ s16 nextBehavior;
/* 0x01F2 */ s16 behavior; /* 0x01F2 */ s16 behavior;
/* 0x01F4 */ u8 unk_1F4; //gets passed to skelanime thing /* 0x01F4 */ u8 unk_1F4; // I believe this and the rest below belong to something skelanime
/* 0x01F5 */ char unk_1F5[0x4D]; //something allocated by skelanime /* 0x01F5 */ char unk_1F5[0x4D];
/* 0x0242 */ u8 unk_242; //very likley a variable from some skelanime struct /* 0x0242 */ u8 unk_242;
/* 0x0243 */ char unk_243[0x4D]; //something allocated by skelanime /* 0x0243 */ char unk_243[0x4D];
} EnDog; // size = 0x0290 } EnDog; // size = 0x0290
extern const ActorInit En_Dog_InitVars; extern const ActorInit En_Dog_InitVars;