1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-11 19:43:44 +00:00

Fix Draw Callbacks, fix segmented address in z_en_bird

This commit is contained in:
KrimtonZ 2020-03-25 11:43:11 -05:00
parent 095924d05a
commit 582b32d39c
7 changed files with 32 additions and 32 deletions

View file

@ -397,10 +397,10 @@ Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx);
s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*),
s16 (*unkFunc2)(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, void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, SkelAnime_LimbUpdateMatrix2 unkFunc1,
s16 alpha); SkelAnime_LimbAppendDlist2 unkFunc2, Actor* actor, s16 alpha);
void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, SkelAnime_LimbUpdateMatrix2 unkFunc1,
s16 alpha); SkelAnime_LimbAppendDlist2 unkFunc2, Actor* actor, s16 alpha);
void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2); void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2);
void Actor_Noop(Actor* actor, GlobalContext* globalCtx); void Actor_Noop(Actor* actor, GlobalContext* globalCtx);
void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist); void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist);

View file

@ -3884,8 +3884,8 @@ Gfx* func_80034B54(GraphicsContext* gfxCtx) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_80034B54.s") #pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_80034B54.s")
#endif #endif
void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, SkelAnime_LimbUpdateMatrix2 unkFunc1,
s16 alpha) { SkelAnime_LimbAppendDlist2 unkFunc2, Actor* actor, s16 alpha) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4]; Gfx* gfxArr[4];
@ -3904,8 +3904,8 @@ void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8860); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8860);
} }
void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, SkelAnime_LimbUpdateMatrix2 unkFunc1,
s16 alpha) { SkelAnime_LimbAppendDlist2 unkFunc2, Actor* actor, s16 alpha) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4]; Gfx* gfxArr[4];

View file

@ -89,7 +89,7 @@ void EnBird_Destroy(EnBird* this, GlobalContext* globalCtx) {
void func_809C1CAC(EnBird* this, s16 params) { void func_809C1CAC(EnBird* this, s16 params) {
f32 frameCount = SkelAnime_GetFrameCount(&D_0600006C); f32 frameCount = SkelAnime_GetFrameCount(&D_0600006C);
f32 playbackSpeed = this->unk_19C ? 0.0f : 1.0f; f32 playbackSpeed = this->unk_19C ? 0.0f : 1.0f;
u32* anim = &D_0600006C; AnimationHeader* anim = &D_0600006C;
this->unk_198 = Math_Rand_S16Offset(5, 0x23); this->unk_198 = Math_Rand_S16Offset(5, 0x23);
SkelAnime_ChangeAnimation(&this->skelAnime, anim, playbackSpeed, 0.0f, frameCount, 0, 0.0f); SkelAnime_ChangeAnimation(&this->skelAnime, anim, playbackSpeed, 0.0f, frameCount, 0, 0.0f);

View file

@ -457,11 +457,12 @@ static void EnDog_Update(EnDog* this, GlobalContext* globalCtx) {
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
} }
static UNK_TYPE EnDog_Callback1(UNK_TYPE unused1, UNK_TYPE unused2, UNK_TYPE unused3, UNK_TYPE unused4) { static UNK_TYPE EnDog_Callback1(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* actor) {
return 0; return 0;
} }
static void EnDog_Callback2(UNK_TYPE unused1, UNK_TYPE unused2, UNK_TYPE unused3, UNK_TYPE unused4) { static void EnDog_Callback2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) {
} }
static void EnDog_Draw(EnDog* this, GlobalContext* globalCtx) { static void EnDog_Draw(EnDog* this, GlobalContext* globalCtx) {

View file

@ -191,6 +191,6 @@ static void EnMs_Update(EnMs* this, GlobalContext* globalCtx) {
void EnMs_Draw(EnMs* this, GlobalContext* globalCtx) { void EnMs_Draw(EnMs* this, GlobalContext* globalCtx) {
func_80093D18(globalCtx->state.gfxCtx); func_80093D18(globalCtx->state.gfxCtx);
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.actorDrawTbl, this->skelAnime.dListCount, 0, SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.actorDrawTbl, this->skelAnime.dListCount,
0, &this->actor); NULL, NULL, &this->actor);
} }

View file

@ -712,36 +712,36 @@ void func_80B1D200(GlobalContext* globalCtx) {
func_800C6B54(pgdl, globalCtx->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, Actor* actor) { s32 func_80B1D278(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) {
EnTk* tk = (EnTk*)actor; EnTk* tk = (EnTk*)actor;
switch (a1) { switch (limbIndex) {
/* Limb 15 - Head */ /* Limb 15 - Head */
case 15: case 15:
tk->h_21E = sp10->y; tk->h_21E = rot->y;
break; break;
/* Limb 16 - Jaw */ /* Limb 16 - Jaw */
case 16: case 16:
tk->h_21E += sp10->y; tk->h_21E += rot->y;
sp10->y += tk->headRot; rot->y += tk->headRot;
break; break;
} }
return 0; return 0;
} }
void func_80B1D2E4(GlobalContext* globalCtx, UNK_TYPE a1, UNK_TYPE a2, UNK_TYPE a3, Actor* actor) { void func_80B1D2E4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, 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 };
Vec3f sp1C = { 0.f, 0.f, 0.f }; Vec3f sp1C = { 0.f, 0.f, 0.f };
/* Limb 16 - Jaw */ /* Limb 16 - Jaw */
if (a1 == 16) { if (limbIndex == 16) {
Matrix_MultVec3f(&sp1C, &this->actor.posRot2.pos); Matrix_MultVec3f(&sp1C, &this->actor.posRot2.pos);
} }
/* Limb 14 - Neck */ /* Limb 14 - Neck */
if (a1 == 14) { if (limbIndex == 14) {
Matrix_MultVec3f(&sp28, &this->v3f_304); Matrix_MultVec3f(&sp28, &this->v3f_304);
func_80B1D200(globalCtx); func_80B1D200(globalCtx);
} }

View file

@ -36,8 +36,6 @@ static void EnWallmas_WaitForSwitchFlag(EnWallmas* this, GlobalContext* globalCt
static void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx); static void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx);
static void EnWallmas_Update(EnWallmas* this, GlobalContext* globalCtx); static void EnWallmas_Update(EnWallmas* this, GlobalContext* globalCtx);
static void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx); static void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx);
static s32 EnWallMas_UpdatePos(GlobalContext* globalCtx, s32 arg1, s32 arg2, Actor* arg3, void* arg4, EnWallmas* arg5);
static void EnWallmas_DrawOpa(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3);
static void EnWallmas_Draw(EnWallmas* this, GlobalContext* globalCtx); static void EnWallmas_Draw(EnWallmas* this, GlobalContext* globalCtx);
const ActorInit En_Wallmas_InitVars = { const ActorInit En_Wallmas_InitVars = {
@ -591,24 +589,25 @@ static void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) {
func_800C6B54(gfx, globalCtx->state.gfxCtx, "../z_en_wallmas.c", 1426); func_800C6B54(gfx, globalCtx->state.gfxCtx, "../z_en_wallmas.c", 1426);
} }
static s32 EnWallMas_UpdatePos(GlobalContext* globalCtx, s32 arg1, s32 arg2, Actor* arg3, void* arg4, EnWallmas* arg5) { static s32 EnWallMas_UpdatePos(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
if (arg1 == 1) { Actor* actor) {
if (arg5->actionFunc != (ActorFunc)EnWallmas_TakePlayer) { EnWallmas* this = (EnWallmas*)actor;
arg3->initPosRot.pos.x = arg3->initPosRot.pos.x - 1600.0f; if (limbIndex == 1) {
if (this->actionFunc != (ActorFunc)EnWallmas_TakePlayer) {
pos->z -= 1600.0f;
} else { } else {
arg3->initPosRot.pos.x = arg3->initPosRot.pos.x - pos->z -= ((1600.0f * (this->skelAnime.animFrameCount - this->skelAnime.animCurrentFrame)) /
((1600.0f * (arg5->skelAnime.animFrameCount - arg5->skelAnime.animCurrentFrame)) / this->skelAnime.animFrameCount);
arg5->skelAnime.animFrameCount);
} }
} }
return 0; return 0;
} }
static void EnWallmas_DrawOpa(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3) { static void EnWallmas_DrawOpa(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) {
GraphicsContext* gfxCtx; GraphicsContext* gfxCtx;
Gfx* gfx[4]; Gfx* gfx[4];
if (arg1 == 2) { if (limbIndex == 2) {
gfxCtx = globalCtx->state.gfxCtx; gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(&gfx, globalCtx->state.gfxCtx, "../z_en_wallmas.c", 1478); func_800C6AC4(&gfx, globalCtx->state.gfxCtx, "../z_en_wallmas.c", 1478);