1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-10 17:00:19 +00:00

object_horse_ganon, object_horse_link_child, object_horse_normal and object_horse_zelda OK (#724)

* object_horse_zelda

Signed-off-by: angie <angheloalf95@gmail.com>

* object_horse_normal

Signed-off-by: angie <angheloalf95@gmail.com>

* object_horse_link_child

Signed-off-by: angie <angheloalf95@gmail.com>

* object_horse_ganon

Signed-off-by: angie <angheloalf95@gmail.com>

* object_horse

Signed-off-by: angie <angheloalf95@gmail.com>

* object_hni

Signed-off-by: Angie <angheloalf95@gmail.com>

* ZAPD is falling to do vtx

Signed-off-by: Angie <angheloalf95@gmail.com>

* Testing

Signed-off-by: Angie <angheloalf95@gmail.com>

* Rename horse_link_child variables

Signed-off-by: angie <angheloalf95@gmail.com>

* horse_zelda with names

Signed-off-by: angie <angheloalf95@gmail.com>

* I'm suspecting that this game doesn't use z_en_horse_ganon

Signed-off-by: angie <angheloalf95@gmail.com>

* Child epona eye textures

Signed-off-by: Angie <angheloalf95@gmail.com>

* Extract eyes textures from Epona

Signed-off-by: Angie <angheloalf95@gmail.com>

* Small rename

Signed-off-by: Angie <angheloalf95@gmail.com>

* change references in EnHorseNormal

Signed-off-by: angie <angheloalf95@gmail.com>

* Rename a few HorseNormal animations

Signed-off-by: angie <angheloalf95@gmail.com>

* Add normal horse eye texture

Signed-off-by: angie <angheloalf95@gmail.com>

* Add some textures

Signed-off-by: angie <angheloalf95@gmail.com>

* change pointers in EnViewer

Signed-off-by: angie <angheloalf95@gmail.com>

* Rename some animations of HorseGanon

Signed-off-by: angie <angheloalf95@gmail.com>

* Add a few dlists in object_horse

Signed-off-by: Angie <angheloalf95@gmail.com>

* Add whinnies

Signed-off-by: Angie <angheloalf95@gmail.com>

* Rename last animations remaining in horse_normal and horse_ganon

Signed-off-by: angie <angheloalf95@gmail.com>

* Remove epona and ingo's horse

Signed-off-by: angie <angheloalf95@gmail.com>

* ./format.sh

Signed-off-by: angie <angheloalf95@gmail.com>

* Give a proper name to horses animations

Signed-off-by: angie <angheloalf95@gmail.com>

* add trailling comma

Signed-off-by: Angie <angheloalf95@gmail.com>

* remove union of skeletons

Signed-off-by: angie <angheloalf95@gmail.com>

* change skeletonheader* to void*

Signed-off-by: angie <angheloalf95@gmail.com>

* remove cast

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* remove cast 2

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* format.sh

Signed-off-by: angie <angheloalf95@gmail.com>

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal 2021-03-28 00:44:11 -03:00 committed by GitHub
parent 3aad8f7244
commit b338f12498
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 160 additions and 140 deletions

View file

@ -8,6 +8,8 @@
#include "overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h"
#include "objects/object_zl4/object_zl4.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_horse_zelda/object_horse_zelda.h"
#include "objects/object_horse_ganon/object_horse_ganon.h"
#define FLAGS 0x00000010
@ -25,12 +27,9 @@ void func_80B2A570(EnViewer* this, GlobalContext* globalCtx);
void func_80B2A75C(EnViewer* this, GlobalContext* globalCtx);
// sAnimFuncs
void func_80B2A300(EnViewer* this, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg,
AnimationHeader* animationSeg);
void func_80B2A448(EnViewer* this, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg,
AnimationHeader* animationSeg);
void func_80B2A4D8(EnViewer* this, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg,
AnimationHeader* animationSeg);
void func_80B2A300(EnViewer* this, GlobalContext* globalCtx, void* skeletonHeaderSeg, AnimationHeader* animationSeg);
void func_80B2A448(EnViewer* this, GlobalContext* globalCtx, void* skeletonHeaderSeg, AnimationHeader* animationSeg);
void func_80B2A4D8(EnViewer* this, GlobalContext* globalCtx, void* skeletonHeaderSeg, AnimationHeader* animationSeg);
// sDrawFuncs
void func_80B2B4A8(EnViewer* this, GlobalContext* globalCtx);
@ -48,38 +47,22 @@ extern AnimationHeader D_06001410;
extern AnimationHeader D_060014F4;
extern AnimationHeader D_06001D28;
extern AnimationHeader D_06002574;
extern AnimationHeader D_06002650;
extern AnimationHeader D_06002928;
extern AnimationHeader D_060029CC;
extern UNK_TYPE D_06002EF0;
extern AnimationHeader D_06003284;
extern UNK_TYPE D_060032F0;
extern AnimationHeader D_06003428;
extern UNK_TYPE D_060036F0;
extern AnimationHeader D_06003858;
extern AnimationHeader D_06003D84;
extern UNK_TYPE D_06003EF0;
extern AnimationHeader D_0600420C;
extern AnimationHeader D_06004260;
extern UNK_TYPE D_060042F0;
extern AnimationHeader D_06004534;
extern AnimationHeader D_060048B0;
extern AnimationHeader D_060048FC;
extern AnimationHeader D_06004AA4;
extern UNK_TYPE D_06004EF0;
extern AnimationHeader D_0600504C;
extern AnimationHeader D_060050A8;
extern UNK_TYPE D_060052F0;
extern FlexSkeletonHeader D_06006B2C;
extern AnimationHeader D_06007148;
extern UNK_TYPE D_06007210;
extern FlexSkeletonHeader D_06008668;
extern UNK_TYPE D_0600A4E0;
extern Gfx D_0600BE90[];
extern Gfx D_0600C410[];
extern Gfx D_0600D0D8[];
extern Gfx D_0600DE08[];
extern FlexSkeletonHeader D_0600E038;
extern Gfx D_0600E1A8[];
extern UNK_TYPE D_0600F178;
extern UNK_TYPE D_0600F378;
@ -109,13 +92,13 @@ static InitChainEntry sInitChain[] = {
};
struct_80B2CEE8 D_80B2CEE8[] = {
{ OBJECT_HORSE_ZELDA, OBJECT_HORSE_ZELDA, 1, 0, 2, 20, 1, &D_06006B2C, &D_06007148 },
{ OBJECT_HORSE_ZELDA, OBJECT_HORSE_ZELDA, 1, 0, 2, 20, 1, &gHorseZeldaSkel, &gHorseZeldaGallopingAnim },
{ OBJECT_IM, OBJECT_OPENING_DEMO1, 1, 0, 0, 10, 3, &D_0600F788, &D_060029CC },
{ OBJECT_ZL4, OBJECT_OPENING_DEMO1, 1, 0, 0, 10, 2, &gChildZeldaSkel, &D_06000450 },
{ OBJECT_GNDD, OBJECT_GNDD, 1, -6, 0, 10, 0, &D_060119E8, &D_06002928 },
{ OBJECT_HORSE_GANON, OBJECT_HORSE_GANON, 1, 0, 2, 20, 1, &D_06008668, &D_06003858 },
{ OBJECT_HORSE_GANON, OBJECT_HORSE_GANON, 1, 0, 2, 20, 1, &gHorseGanonSkel, &gHorseGanonRearingAnim },
{ OBJECT_GNDD, OBJECT_GNDD, 1, -6, 0, 10, 0, &D_060119E8, &D_060005B4 },
{ OBJECT_HORSE_GANON, OBJECT_HORSE_GANON, 1, 0, 2, 20, 1, &D_06008668, &D_06002650 },
{ OBJECT_HORSE_GANON, OBJECT_HORSE_GANON, 1, 0, 2, 20, 1, &gHorseGanonSkel, &gHorseGanonGallopingAnim },
{ OBJECT_GNDD, OBJECT_GNDD, 1, -6, 0, 10, 0, &D_060119E8, &D_06004260 },
{ OBJECT_GNDD, OBJECT_GNDD, 1, -6, 0, 10, 0, &D_060119E8, &D_060050A8 },
{ OBJECT_GANON, OBJECT_GANON, 1, -6, 0, 10, 0, &D_060114E8, &D_06011348 },
@ -178,14 +161,13 @@ void EnViewer_Destroy(Actor* thisx, GlobalContext* globalCtx) {
func_800A6888(globalCtx, &this->skin);
}
void func_80B2A300(EnViewer* this, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg,
AnimationHeader* animationSeg) {
void func_80B2A300(EnViewer* this, GlobalContext* globalCtx, void* skeletonHeaderSeg, AnimationHeader* animationSeg) {
s16 params = this->actor.params >> 8;
if (params == 2 || params == 3 || params == 5 || params == 7 || params == 8 || params == 9) {
SkelAnime_InitFlex(globalCtx, &this->skin.skelAnime, skeletonHeaderSeg, NULL, NULL, NULL, 0);
} else {
SkelAnime_Init(globalCtx, &this->skin.skelAnime, &skeletonHeaderSeg->sh, NULL, NULL, NULL, 0);
SkelAnime_Init(globalCtx, &this->skin.skelAnime, skeletonHeaderSeg, NULL, NULL, NULL, 0);
}
gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->animObjBankIndex].segment);
@ -196,18 +178,16 @@ void func_80B2A300(EnViewer* this, GlobalContext* globalCtx, FlexSkeletonHeader*
}
}
void func_80B2A448(EnViewer* this, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg,
AnimationHeader* animationSeg) {
void func_80B2A448(EnViewer* this, GlobalContext* globalCtx, void* skeletonHeaderSeg, AnimationHeader* animationSeg) {
SkelAnime_InitFlex(globalCtx, &this->skin.skelAnime, skeletonHeaderSeg, NULL, NULL, NULL, 0);
gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->animObjBankIndex].segment);
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, animationSeg, 3.0f);
}
void func_80B2A4D8(EnViewer* this, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg,
AnimationHeader* animationSeg) {
void func_80B2A4D8(EnViewer* this, GlobalContext* globalCtx, void* skeletonHeaderSeg, AnimationHeader* animationSeg) {
u8 params;
func_800A663C(globalCtx, &this->skin, &skeletonHeaderSeg->sh, animationSeg);
func_800A663C(globalCtx, &this->skin, skeletonHeaderSeg, animationSeg);
params = this->actor.params >> 8;
if (!(params == 3 || params == 4 || params == 7 || params == 8 || params == 9)) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, animationSeg, 3.0f);
@ -242,7 +222,7 @@ void func_80B2A570(EnViewer* this, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, unkStruct->unk_5 * 100,
sActorShadowDrawFunc[unkStruct->actorShadowDrawFuncIndex], unkStruct->unk_7);
this->drawFuncIndex = unkStruct->drawFuncIndex;
sAnimFuncs[this->drawFuncIndex](this, globalCtx, unkStruct->unk_C, unkStruct->unk_10);
sAnimFuncs[this->drawFuncIndex](this, globalCtx, unkStruct->skel, unkStruct->unk_10);
EnViewer_SetupAction(this, func_80B2A75C);
}
@ -305,18 +285,18 @@ void func_80B2A75C(EnViewer* this, GlobalContext* globalCtx) {
}
} else if (params == 4) {
curFrame = this->skin.skelAnime.curFrame;
if (this->skin.skelAnime.animation == &D_06003858) {
if (this->skin.skelAnime.animation == &gHorseGanonRearingAnim) {
if (curFrame == 8) {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_HORSE_NEIGH);
}
if (curFrame == 30) {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_HORSE_LAND2);
}
} else if (this->skin.skelAnime.animation == &D_06004AA4) {
} else if (this->skin.skelAnime.animation == &gHorseGanonIdleAnim) {
if (curFrame == 25) {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_HORSE_SANDDUST);
}
} else if (this->skin.skelAnime.animation == &D_06002650) {
} else if (this->skin.skelAnime.animation == &gHorseGanonGallopingAnim) {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_HORSE_RUN_LEVEL - SFX_FLAG);
}
}
@ -335,8 +315,8 @@ void func_80B2A75C(EnViewer* this, GlobalContext* globalCtx) {
if (this->skin.skelAnime.animation != &D_06002928) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &D_06002928, 1.0f);
}
} else if (this->skin.skelAnime.animation != &D_06004AA4) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &D_06004AA4, 1.0f);
} else if (this->skin.skelAnime.animation != &gHorseGanonIdleAnim) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &gHorseGanonIdleAnim, 1.0f);
}
} else if (globalCtx->csCtx.npcActions[1]->action == 1) {
D_80B2CFCC = 100;
@ -344,8 +324,8 @@ void func_80B2A75C(EnViewer* this, GlobalContext* globalCtx) {
if (this->skin.skelAnime.animation != &D_06001D28) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &D_06001D28, 1.0f);
}
} else if (this->skin.skelAnime.animation != &D_06003858) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &D_06003858, 1.0f);
} else if (this->skin.skelAnime.animation != &gHorseGanonRearingAnim) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &gHorseGanonRearingAnim, 1.0f);
}
} else if (params == 3) {
switch (this->unk_1E5) {
@ -396,8 +376,9 @@ void func_80B2A75C(EnViewer* this, GlobalContext* globalCtx) {
this->unk_1E5 = 0;
break;
}
} else if (this->skin.skelAnime.animation != &D_06002650 && globalCtx->csCtx.npcActions[1]->action == 12) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &D_06002650, 3.0f);
} else if (this->skin.skelAnime.animation != &gHorseGanonGallopingAnim &&
globalCtx->csCtx.npcActions[1]->action == 12) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &gHorseGanonGallopingAnim, 3.0f);
}
}
} else if (params == 1) {

View file

@ -8,7 +8,7 @@ struct EnViewer;
typedef void (*EnViewerActionFunc)(struct EnViewer*, GlobalContext*);
typedef void (*EnViewerDrawFunc)(struct EnViewer*, GlobalContext*);
typedef void (*EnViewerAnimFunc)(struct EnViewer*, GlobalContext*, FlexSkeletonHeader*, AnimationHeader*);
typedef void (*EnViewerAnimFunc)(struct EnViewer*, GlobalContext*, void*, AnimationHeader*);
typedef struct {
/* 0x00 */ s16 objId1;
@ -18,7 +18,7 @@ typedef struct {
/* 0x06 */ u8 actorShadowDrawFuncIndex;
/* 0x07 */ u8 unk_7;
/* 0x08 */ u8 drawFuncIndex;
/* 0x0C */ FlexSkeletonHeader* unk_C;
/* 0x0C */ void* skel;
/* 0x10 */ AnimationHeader* unk_10;
} struct_80B2CEE8; // size = 0x14