mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-07 14:50:15 +00:00
Fix most actor compiler warnings (#656)
* functions.h * Bg_Hidan_Kowarerukabe * Demo_Geff * Arrow_Fire * Demo_Sa * Arms_Hook * En_Okarina_Effect * Demo_Im * Bg_Menkuri_Kaiten * Bg_Spot09_Obj (minus CollisionHeader) * Obj_Hsblock * Obj_Elevator * En_Anubice_Tag * Bg_Ydan_Hasi (minus BgYdanHasi_MoveWater return shenanigans) * En_Heishi4 * Demo_Go * Bg_Spot00_Break * Bg_Hidan_Kousi * Bg_Spot17_Bakudankabe * Bg_Spot18_Basket * En_Dha * Bg_Jya_Goroiwa * En_Js * Bg_Mori_Hineri * Bg_Spot18_Shutter * Bg_Jya_Bombchuiwa * Bg_Bdan_Objects * Bg_Jya_Amishutter * Bg_Toki_Swd * En_Heishi2 * En_Fu * Bg_Jya_Kanaami * Bg_Pushbox * Bg_Spot12_Saku * En_Ani * En_Zl1 * En_Vase * Bg_Spot05_Soko * En_Crow (and a rename in En_Firefly) * Bg_Hidan_Fslift * En_Dog * Bg_Heavy_Block * En_Boom * Bg_Ddan_Kd * Bg_Spot16_Bombstone * Demo_Effect * Bg_Hidan_Syoku * En_Firefly * En_Fw * Bg_Jya_Bombiwa * En_Fd * ovl_Bg_Spot15_Saku * En_Mb * Bg_Spot18_Obj * Bg_Zg * Bg_Bdan_Switch * En_Md * En_Box * En_Bw * En_Viewer * En_Hs2 * Bg_Ydan_Maruta * En_St * En_Ru1 * Bg_Ddan_Jd * En_Sb * Bg_Jya_Cobra * Bg_Spot12_Gate * Bg_Haka_Trap * En_Ms * En_Kakasi2 * En_Horse_Link_Child * Obj_Bombiwa * En_Ds * En_Kz * Bg_Umajump * Bg_Spot03_Taki * Door_Toki * Item_Etcetera * En_Ru2 * En_Niw * Bg_Spot15_Rrbox * Demo_Tre_Lgt * Obj_Oshihiki * Bg_Mjin * Bg_Spot18_Futa * Bg_Spot01_Idosoko * En_Arow_Trap * Bg_Mizu_Uzu * En_Horse_Zelda * Player * fix func_800358DC to work in functions.h * fix fix to functions.h * enum fixes * Some review comments addressed * DynaPoly_GetActor standardisation * ovl_Daiku_Kakariko * ovl_En_Vase * ovl_En_Mk * ovl_Bg_Spot00_Hanebasi * ovl_Bg_Spot06_Objects * ovl_En_Go * ovl_En_Go2 * ovl_Bg_Jya_Bombiwa * ovl_En_Cs * ovl_En_Dodojr * ovl_En_Ny * ovl_En_Mm2 * Apply review suggestion
This commit is contained in:
parent
ced724fb9b
commit
02b3640bde
122 changed files with 1129 additions and 1125 deletions
|
@ -64,26 +64,20 @@ static ColliderCylinderInit sCylinderInit = {
|
|||
{ 30, 40, 0, { 0 } },
|
||||
};
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(uncullZoneForward, 850, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
static Vec3f sMultVec = { 800.0f, 500.0f, 0.0f };
|
||||
|
||||
static UNK_PTR D_809B0F80[] = {
|
||||
0x06000408,
|
||||
0x06001518,
|
||||
0x06001D18,
|
||||
};
|
||||
|
||||
void EnAni_SetupAction(EnAni* this, EnAniActionFunc actionFunc) {
|
||||
this->actionFunc = actionFunc;
|
||||
}
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(uncullZoneForward, 850, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnAni* this = THIS;
|
||||
s32 pad;
|
||||
EnAni* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawCircle, 36.0f);
|
||||
|
@ -117,13 +111,13 @@ s32 EnAni_SetText(EnAni* this, GlobalContext* globalCtx, u16 textId) {
|
|||
}
|
||||
|
||||
void func_809B04F0(EnAni* this, GlobalContext* globalCtx) {
|
||||
if (func_8002F334(&this->actor, globalCtx) != 0) {
|
||||
if (func_8002F334(&this->actor, globalCtx)) {
|
||||
EnAni_SetupAction(this, func_809B064C);
|
||||
}
|
||||
}
|
||||
|
||||
void func_809B0524(EnAni* this, GlobalContext* globalCtx) {
|
||||
if (func_8002F334(&this->actor, globalCtx) != 0) {
|
||||
if (func_8002F334(&this->actor, globalCtx)) {
|
||||
EnAni_SetupAction(this, func_809B07F8);
|
||||
}
|
||||
}
|
||||
|
@ -143,10 +137,10 @@ void func_809B0558(EnAni* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_809B05F0(EnAni* this, GlobalContext* globalCtx) {
|
||||
if (func_8002F334(this, globalCtx) != 0) {
|
||||
if (func_8002F334(&this->actor, globalCtx)) {
|
||||
EnAni_SetupAction(this, func_809B0558);
|
||||
}
|
||||
func_8002F434(this, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
}
|
||||
|
||||
void func_809B064C(EnAni* this, GlobalContext* globalCtx) {
|
||||
|
@ -165,7 +159,7 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
|
||||
if (func_8002F194(&this->actor, globalCtx) != 0) {
|
||||
if (func_8002F194(&this->actor, globalCtx)) {
|
||||
if (this->actor.textId == 0x5056) { // "To get a good view..."
|
||||
EnAni_SetupAction(this, func_809B04F0);
|
||||
} else if (this->actor.textId == 0x5055) { // "...I'll give you this as a memento."
|
||||
|
@ -191,7 +185,7 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) {
|
|||
u16 textId;
|
||||
|
||||
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
|
||||
if (func_8002F194(&this->actor, globalCtx) != 0) {
|
||||
if (func_8002F194(&this->actor, globalCtx)) {
|
||||
if (this->actor.textId == 0x5056) { // "To get a good view..."
|
||||
EnAni_SetupAction(this, func_809B0524);
|
||||
} else if (this->actor.textId == 0x5055) { // "...I'll give you this as a memento."
|
||||
|
@ -199,15 +193,15 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) {
|
|||
} else {
|
||||
EnAni_SetupAction(this, func_809B0524);
|
||||
}
|
||||
} else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f &&
|
||||
} else if (yawDiff > -0x36B0 && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f &&
|
||||
-80.0f < this->actor.yDistToPlayer) {
|
||||
if ((gSaveContext.itemGetInf[1] & 0x20) != 0) {
|
||||
if (gSaveContext.itemGetInf[1] & 0x20) {
|
||||
EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..."
|
||||
} else {
|
||||
EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento."
|
||||
}
|
||||
} else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) {
|
||||
if ((gSaveContext.eventChkInf[2] & 0x8000) == 0) {
|
||||
} else if (yawDiff > -0x3E8 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) {
|
||||
if (!(gSaveContext.eventChkInf[2] & 0x8000)) {
|
||||
textId = 0x5052; // "...Something is happening on Death Mountain!"
|
||||
} else {
|
||||
textId = (gSaveContext.itemGetInf[1] & 0x20) ? 0x5054 : 0x5053; // "I don't feel like getting down..."
|
||||
|
@ -296,12 +290,12 @@ void EnAni_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->unk_2A2.y, 0, 6, 6200, 100);
|
||||
}
|
||||
|
||||
if (DECR(this->unk_2AE) == 0) {
|
||||
this->unk_2AE = Rand_S16Offset(60, 60);
|
||||
if (DECR(this->blinkTimer) == 0) {
|
||||
this->blinkTimer = Rand_S16Offset(60, 60);
|
||||
}
|
||||
this->unk_2AC = this->unk_2AE;
|
||||
if (this->unk_2AC >= 3) {
|
||||
this->unk_2AC = 0;
|
||||
this->eyeIndex = this->blinkTimer;
|
||||
if (this->eyeIndex >= 3) {
|
||||
this->eyeIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,6 +310,7 @@ s32 EnAni_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
|||
}
|
||||
|
||||
void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
|
||||
static Vec3f sMultVec = { 800.0f, 500.0f, 0.0f };
|
||||
EnAni* this = THIS;
|
||||
|
||||
if (limbIndex == 15) {
|
||||
|
@ -323,6 +318,12 @@ void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
|||
}
|
||||
}
|
||||
|
||||
static u64* sEyeTextures[] = {
|
||||
0x06000408,
|
||||
0x06001518,
|
||||
0x06001D18,
|
||||
};
|
||||
|
||||
void EnAni_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnAni* this = THIS;
|
||||
s32 pad;
|
||||
|
@ -331,7 +332,7 @@ void EnAni_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
func_800943C8(globalCtx->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809B0F80[this->unk_2AC]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[this->eyeIndex]));
|
||||
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnAni_OverrideLimbDraw, EnAni_PostLimbDraw, this);
|
||||
|
|
|
@ -18,8 +18,8 @@ typedef struct EnAni {
|
|||
/* 0x02A2 */ Vec3s unk_2A2;
|
||||
/* 0x02A8 */ u16 unk_2A8;
|
||||
/* 0x02AA */ u16 unk_2AA;
|
||||
/* 0x02AC */ s16 unk_2AC;
|
||||
/* 0x02AE */ s16 unk_2AE;
|
||||
/* 0x02AC */ s16 eyeIndex;
|
||||
/* 0x02AE */ s16 blinkTimer;
|
||||
/* 0x02B0 */ EnAniActionFunc actionFunc;
|
||||
} EnAni; // size = 0x02B4
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue