summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSavino Jossi <sjossi@users.noreply.github.com>2022-01-04 00:38:41 -0500
committerGitHub <noreply@github.com>2022-01-04 05:38:41 +0000
commit06a08a3322a4958e95c8e1de357ebfbfd6852c86 (patch)
treeb2ba5777ca0194838b195ebbad0d91df36740959 /src
parent1d7e721cb7f3154d272d7079652ee9e48af44bae (diff)
Ovl obj jg gakki (#512)
* add gakki decompilation * add gakki header file * modify spec to remove data * Use THIS macro for this = thisx Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * Change reloc include to the generated one Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * spacing variables and functions Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * spacing variables and functions Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * spacing variables and functions Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * clean up unnecessary mips_to_c hints Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * clean up old mips_to_c hints Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * variable cleanup and lookup Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * remove unnecessary cast Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * rerun format after code review * fix naming convention * add variable name hints for data Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * reformatted file * Fix collider naming Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * fix more renaming Co-authored-by: Savino Jossi <sj@redballoonsecurity.com> Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c41
-rw-r--r--src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h3
2 files changed, 36 insertions, 8 deletions
diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c
index e85548758..8a5c99a79 100644
--- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c
+++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c
@@ -15,7 +15,6 @@ void ObjJgGakki_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjJgGakki_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjJgGakki_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
const ActorInit Obj_Jg_Gakki_InitVars = {
ACTOR_OBJ_JG_GAKKI,
ACTORCAT_PROP,
@@ -28,14 +27,42 @@ const ActorInit Obj_Jg_Gakki_InitVars = {
(ActorFunc)ObjJgGakki_Draw,
};
-#endif
+extern AnimationHeader D_0601B1E8; // gGoronElderDrumAnim
+extern SkeletonHeader D_0601B210; // gGoronElderDrumSkel
-extern UNK_TYPE D_0601B1E8;
+void ObjJgGakki_Init(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ ObjJgGakki* this = THIS;
+ f32 frameCount = Animation_GetLastFrame(&D_0601B1E8);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Jg_Gakki/ObjJgGakki_Init.s")
+ ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &D_0601B210, NULL, NULL, NULL, 0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Jg_Gakki/ObjJgGakki_Destroy.s")
+ if (((globalCtx->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7)) &&
+ (globalCtx->csCtx.unk_12 == 0)) {
+ Animation_Change(&this->skelAnime, &D_0601B1E8, 1.0f, frameCount, frameCount, 2, 0.0f);
+ } else if ((globalCtx->sceneNum == SCENE_17SETUGEN) || (globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA)) {
+ Animation_Change(&this->skelAnime, &D_0601B1E8, 1.0f, 0.0f, frameCount, 2, 0.0f);
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+ Actor_SetScale(&this->actor, 0.01f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Jg_Gakki/ObjJgGakki_Update.s")
+void ObjJgGakki_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ ObjJgGakki* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Jg_Gakki/ObjJgGakki_Draw.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void ObjJgGakki_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjJgGakki* this = THIS;
+
+ SkelAnime_Update(&this->skelAnime);
+}
+
+void ObjJgGakki_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ ObjJgGakki* this = THIS;
+
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, &this->actor);
+}
diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h
index 75a02ed4a..a3e8ae8eb 100644
--- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h
+++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.h
@@ -7,7 +7,8 @@ struct ObjJgGakki;
typedef struct ObjJgGakki {
/* 0x000 */ Actor actor;
- /* 0x144 */ char unk_144[0x90];
+ /* 0x144 */ SkelAnime skelAnime;
+ /* 0x188 */ ColliderCylinder collider;
} ObjJgGakki; // size = 0x1D4
extern const ActorInit Obj_Jg_Gakki_InitVars;