From 777a71057037cd2157fe87ff77b72bc0ed356c1d Mon Sep 17 00:00:00 2001 From: angie Date: Thu, 28 Jan 2021 22:25:14 -0300 Subject: [PATCH] format Signed-off-by: angie --- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 829 +++++++++----------- 1 file changed, 374 insertions(+), 455 deletions(-) diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 4a0117ed78..e98fa096f9 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -28,7 +28,6 @@ extern CollisionHeader D_060033E0; extern Gfx D_06003710; extern CollisionHeader D_06003AF0; - // sCylinderInit static ColliderCylinderInitType1 sCylinderInit1 = { { @@ -88,57 +87,32 @@ static ColliderCylinderInitType1 sCylinderInit3 = { }; // velocity -static Vec3f sVelocity = { - 0.0f, 6.0f, 0.0f -}; +static Vec3f sVelocity = { 0.0f, 6.0f, 0.0f }; -// accel -static Vec3f sAccel = { - 0.0f, 0.0f, 0.0f -}; +// accel +static Vec3f sAccel = { 0.0f, 0.0f, 0.0f }; // primColor -static Color_RGBA8 sPrimColor = { - 0, 0, 0, 0 -}; +static Color_RGBA8 sPrimColor = { 0, 0, 0, 0 }; // envColor -static Color_RGBA8 sEnvColor = { - 0, 0, 0, 0 -}; - +static Color_RGBA8 sEnvColor = { 0, 0, 0, 0 }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; +static Vec3f D_8097BE88 = { -371.0f, 1188.0f, -303.0f }; -static Vec3f D_8097BE88 = { - -371.0f, 1188.0f, -303.0f -}; +static Vec3f D_8097BE94 = { -119.0f, 1056.0f, -147.0f }; -static Vec3f D_8097BE94 = { - -119.0f, 1056.0f, -147.0f -}; +static Vec3f D_8097BEA0 = { -6.0f, 1053.0f, -473.0f }; -static Vec3f D_8097BEA0 = { - -6.0f, 1053.0f, -473.0f -}; - - -static Vec3f D_8097BEAC = { - 0.0f, 0.0f, 0.0f -}; - -static Vec3f D_8097BEB8 = { - 0.0f, 0.0f, 0.0f -}; - -static Vec3f D_8097BEC4 = { - 0.0f, 0.0f, 0.0f -}; +static Vec3f D_8097BEAC = { 0.0f, 0.0f, 0.0f }; +static Vec3f D_8097BEB8 = { 0.0f, 0.0f, 0.0f }; +static Vec3f D_8097BEC4 = { 0.0f, 0.0f, 0.0f }; typedef void (*DemoGjActionFunc)(DemoGj*, GlobalContext*); @@ -165,75 +139,38 @@ void DemoGj_Update19(DemoGj* this, GlobalContext* globalCtx); void DemoGj_Update20(DemoGj* this, GlobalContext* globalCtx); static DemoGjActionFunc sUpdateFuncs[] = { - DemoGj_Update0, - DemoGj_Update1, - DemoGj_Update2, - DemoGj_Update3, - DemoGj_Update4, - DemoGj_Update5, - DemoGj_Update6, - DemoGj_Update7, - DemoGj_Update8, - DemoGj_Update9, - DemoGj_Update10, - DemoGj_Update11, - DemoGj_Update12, - DemoGj_Update13, - DemoGj_Update14, - DemoGj_Update15, - DemoGj_Update16, - DemoGj_Update17, - DemoGj_Update18, - DemoGj_Update19, - DemoGj_Update20, + DemoGj_Update0, DemoGj_Update1, DemoGj_Update2, DemoGj_Update3, DemoGj_Update4, DemoGj_Update5, + DemoGj_Update6, DemoGj_Update7, DemoGj_Update8, DemoGj_Update9, DemoGj_Update10, DemoGj_Update11, + DemoGj_Update12, DemoGj_Update13, DemoGj_Update14, DemoGj_Update15, DemoGj_Update16, DemoGj_Update17, + DemoGj_Update18, DemoGj_Update19, DemoGj_Update20, }; - -void DemoGj_Draw0(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw1(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw2(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw3(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw4(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw5(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw6(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw7(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw8(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw9(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw10(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw11(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw12(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw13(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw14(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw15(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw16(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw17(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw18(DemoGj* this, GlobalContext* globalCtx); - +void DemoGj_Draw0(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw1(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw2(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw3(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw4(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw5(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw6(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw7(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw8(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw9(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw10(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw11(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw12(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw13(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw14(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw15(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw16(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw17(DemoGj* this, GlobalContext* globalCtx); +void DemoGj_Draw18(DemoGj* this, GlobalContext* globalCtx); static DemoGjActionFunc sDrawFuncs[] = { - DemoGj_Draw0, - DemoGj_Draw1, - DemoGj_Draw2, - DemoGj_Draw3, - DemoGj_Draw4, - DemoGj_Draw5, - DemoGj_Draw6, - DemoGj_Draw7, - DemoGj_Draw8, - DemoGj_Draw9, - DemoGj_Draw10, - DemoGj_Draw11, - DemoGj_Draw12, - DemoGj_Draw13, - DemoGj_Draw14, - DemoGj_Draw15, - DemoGj_Draw16, - DemoGj_Draw17, - DemoGj_Draw18, + DemoGj_Draw0, DemoGj_Draw1, DemoGj_Draw2, DemoGj_Draw3, DemoGj_Draw4, DemoGj_Draw5, DemoGj_Draw6, + DemoGj_Draw7, DemoGj_Draw8, DemoGj_Draw9, DemoGj_Draw10, DemoGj_Draw11, DemoGj_Draw12, DemoGj_Draw13, + DemoGj_Draw14, DemoGj_Draw15, DemoGj_Draw16, DemoGj_Draw17, DemoGj_Draw18, }; - - const ActorInit Demo_Gj_InitVars = { ACTOR_DEMO_GJ, ACTORCAT_PROP, @@ -246,26 +183,26 @@ const ActorInit Demo_Gj_InitVars = { (ActorFunc)DemoGj_Draw, }; - // bits 11-15 -s32 DemoGj_GetCollectibleType(DemoGj *this) { +s32 DemoGj_GetCollectibleType(DemoGj* this) { s32 params = this->dyna.actor.params >> 0xB; return params & 0x1F; } // bits 8-10 -s32 DemoGj_GetCollectibleAmount(DemoGj *this) { +s32 DemoGj_GetCollectibleAmount(DemoGj* this) { s32 params = this->dyna.actor.params >> 0x8; return params & 7; } // bits 0-7 -s32 DemoGj_GetType(DemoGj *this) { +s32 DemoGj_GetType(DemoGj* this) { s32 params = this->dyna.actor.params; return params & 0xFF; } -void DemoGj_Cylinder_Init(DemoGj* this, GlobalContext* globalCtx, ColliderCylinder* cylinder, ColliderCylinderInitType1* cylinderInit) { +void DemoGj_Cylinder_Init(DemoGj* this, GlobalContext* globalCtx, ColliderCylinder* cylinder, + ColliderCylinderInitType1* cylinderInit) { Collider_InitCylinder(globalCtx, cylinder); Collider_SetCylinderType1(globalCtx, cylinder, &this->dyna.actor, cylinderInit); } @@ -279,24 +216,24 @@ s32 DemoGj_Cylinder_HasExploded(DemoGj* this, GlobalContext* globalCtx, Collider void DemoGj_Cylinder_Destroy(DemoGj* this, GlobalContext* globalCtx) { switch (DemoGj_GetType(this)) { - case DemoGj_Type_16: - Collider_DestroyCylinder(globalCtx, &this->cylinders[0]); - Collider_DestroyCylinder(globalCtx, &this->cylinders[1]); - Collider_DestroyCylinder(globalCtx, &this->cylinders[2]); - break; + case DemoGj_Type_16: + Collider_DestroyCylinder(globalCtx, &this->cylinders[0]); + Collider_DestroyCylinder(globalCtx, &this->cylinders[1]); + Collider_DestroyCylinder(globalCtx, &this->cylinders[2]); + break; - case DemoGj_Type_17: - Collider_DestroyCylinder(globalCtx, &this->cylinders[0]); - Collider_DestroyCylinder(globalCtx, &this->cylinders[1]); - Collider_DestroyCylinder(globalCtx, &this->cylinders[2]); - return; + case DemoGj_Type_17: + Collider_DestroyCylinder(globalCtx, &this->cylinders[0]); + Collider_DestroyCylinder(globalCtx, &this->cylinders[1]); + Collider_DestroyCylinder(globalCtx, &this->cylinders[2]); + return; - case DemoGj_Type_22: - Collider_DestroyCylinder(globalCtx, &this->cylinders[0]); - return; - - default: - break; + case DemoGj_Type_22: + Collider_DestroyCylinder(globalCtx, &this->cylinders[0]); + return; + + default: + break; } } @@ -310,24 +247,16 @@ void DemoGj_PlayExplosionSfx(DemoGj* this, GlobalContext* globalCtx) { Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 50, NA_SE_EV_GRAVE_EXPLOSION); } -void func_80978AFC(GlobalContext *globalCtx, Vec3f *pos, f32 arg2) { +void func_80978AFC(GlobalContext* globalCtx, Vec3f* pos, f32 arg2) { f32 temp = arg2 * 0.2f; - if (1) - // this function just calls EffectSsDust_Spawn() with drawflags=1 and updateMode=0 - func_800283D4( - globalCtx, - pos, - &sVelocity, - &sAccel, - &sPrimColor, - &sEnvColor, - temp * Rand_ZeroOne() + arg2, - 0xF, - 0x5A - ); + if (1) { + // this function just calls EffectSsDust_Spawn() with drawflags=1 and updateMode=0 + func_800283D4(globalCtx, pos, &sVelocity, &sAccel, &sPrimColor, &sEnvColor, temp * Rand_ZeroOne() + arg2, 0xF, + 0x5A); + } } -void DemoGj_DropCollectible(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_DropCollectible(DemoGj* this, GlobalContext* globalCtx) { Vec3f* pos = &this->dyna.actor.world.pos; s16 collectible; @@ -343,7 +272,7 @@ void DemoGj_DropCollectible(DemoGj *this, GlobalContext *globalCtx) { } } -void func_80978C20(DemoGj *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *arg3) { +void func_80978C20(DemoGj* this, GlobalContext* globalCtx, Vec3f* arg2, Vec3f* arg3) { Vec3f pos; Vec3f velocity; @@ -372,28 +301,13 @@ void func_80978C20(DemoGj *this, GlobalContext *globalCtx, Vec3f *arg2, Vec3f *a phi_s0 = 0x61; } else if (aux < 0.7f) { phi_s0 = 0x41; - } - else { + } else { phi_s0 = 0x21; } - EffectSsKakera_Spawn( - globalCtx, - &pos, - &velocity, - arg2, - -0xC8, - phi_s0, - 0xA, - 0xA, - 0, - Rand_ZeroOne() * 20.0f + 20.0f, - 0x14, - 0x12C, - (s32) (Rand_ZeroOne() * 30.0f) + 0x1E, - -1, - 0x186, - &D_06000EA0); + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, arg2, -0xC8, phi_s0, 0xA, 0xA, 0, + Rand_ZeroOne() * 20.0f + 20.0f, 0x14, 0x12C, (s32)(Rand_ZeroOne() * 30.0f) + 0x1E, -1, + 0x186, &D_06000EA0); theta += 0x2AAA; } @@ -408,7 +322,7 @@ s32 DemoGj_IsSceneInvalid(void) { return 1; // return true; (?) } -s32 DemoGj_FindGanon(DemoGj *this, GlobalContext *globalCtx) { +s32 DemoGj_FindGanon(DemoGj* this, GlobalContext* globalCtx) { Actor* actor; if (this->ganon == NULL) { @@ -416,7 +330,7 @@ s32 DemoGj_FindGanon(DemoGj *this, GlobalContext *globalCtx) { while (actor != NULL) { if (actor->id == ACTOR_BOSS_GANON2) { - this->ganon = (BossGanon2 *) actor; + this->ganon = (BossGanon2*)actor; // Demo_Gj_Search_Boss_Ganon %d: Discover Ganon !!!! osSyncPrintf("Demo_Gj_Search_Boss_Ganon %d:ガノン発見!!!!\n", this->dyna.actor.params); @@ -432,11 +346,11 @@ s32 DemoGj_FindGanon(DemoGj *this, GlobalContext *globalCtx) { //! @bug: Missing return value when `this->ganon` is already set. } -void DemoGj_InitCommon(DemoGj* this, GlobalContext* globalCtx, CollisionHeader *header) { +void DemoGj_InitCommon(DemoGj* this, GlobalContext* globalCtx, CollisionHeader* header) { GlobalContext* globalCtx2 = globalCtx; Actor* actor = &this->dyna.actor; DynaCollisionContext* colCtx_dyna = &globalCtx2->colCtx.dyna; - CollisionHeader *newHeader; + CollisionHeader* newHeader; if (header != NULL) { Actor_ProcessInitChain(actor, sInitChain); @@ -447,7 +361,8 @@ void DemoGj_InitCommon(DemoGj* this, GlobalContext* globalCtx, CollisionHeader * } } -s32 DemoGj_InitSetIndexes(DemoGj* this, GlobalContext* globalCtx, s32 updateIndex, s32 drawIndex, CollisionHeader* header) { +s32 DemoGj_InitSetIndexes(DemoGj* this, GlobalContext* globalCtx, s32 updateIndex, s32 drawIndex, + CollisionHeader* header) { if (!DemoGj_IsSceneInvalid()) { this->updateIndex = updateIndex; this->drawIndex = drawIndex; @@ -465,7 +380,8 @@ void DemoGj_DrawCommon(DemoGj* this, GlobalContext* globalCtx, Gfx* displayList) func_80093D18(gfxCtx); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_demo_gj.c", 1165), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_demo_gj.c", 1165), + G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, displayList); gSPPopMatrix(POLY_OPA_DISP++, G_MTX_MODELVIEW); @@ -506,12 +422,12 @@ void func_8097911C(DemoGj* this, GlobalContext* globalCtx, Gfx* displayList) { } // TODO: find a better name -void DemoGj_Reflect(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Reflect(DemoGj* this, GlobalContext* globalCtx) { f32 yPosition = this->dyna.actor.world.pos.y; - f32 *yVelocity = &this->dyna.actor.velocity.y; - f32 *speedXZ = &this->dyna.actor.speedXZ; - Vec3s *unk_172 = &this->unk_172; + f32* yVelocity = &this->dyna.actor.velocity.y; + f32* speedXZ = &this->dyna.actor.speedXZ; + Vec3s* unk_172 = &this->unk_172; f32 verticalTranslation; Vec3f vec; @@ -519,73 +435,74 @@ void DemoGj_Reflect(DemoGj *this, GlobalContext *globalCtx) { f32 xzPlaneFactor; switch (DemoGj_GetType(this)) { - case DemoGj_Type_08: - verticalTranslation = kREG(23); - vec.x = kREG(24) * 0.01f + 1.0f; - vec.y = kREG(25) * 0.01f + 1.0f; - vec.z = kREG(26) * 0.01f + 1.0f; - verticalFactor = kREG(27) * 0.01f + -1.0f; - xzPlaneFactor = kREG(28) * 0.01f + 1.0f; - break; + case DemoGj_Type_08: + verticalTranslation = kREG(23); + vec.x = kREG(24) * 0.01f + 1.0f; + vec.y = kREG(25) * 0.01f + 1.0f; + vec.z = kREG(26) * 0.01f + 1.0f; + verticalFactor = kREG(27) * 0.01f + -1.0f; + xzPlaneFactor = kREG(28) * 0.01f + 1.0f; + break; - case DemoGj_Type_09: - verticalTranslation = kREG(36); - vec.x = kREG(37) * 0.01f + 1.0f; - vec.y = kREG(38) * 0.01f + 1.0f; - vec.z = kREG(39) * 0.01f + 1.0f; - verticalFactor = kREG(40) * 0.01f + -1.0f; - xzPlaneFactor = kREG(41) * 0.01f + 1.0f; - break; + case DemoGj_Type_09: + verticalTranslation = kREG(36); + vec.x = kREG(37) * 0.01f + 1.0f; + vec.y = kREG(38) * 0.01f + 1.0f; + vec.z = kREG(39) * 0.01f + 1.0f; + verticalFactor = kREG(40) * 0.01f + -1.0f; + xzPlaneFactor = kREG(41) * 0.01f + 1.0f; + break; - case DemoGj_Type_10: - verticalTranslation = kREG(49); - vec.x = kREG(50) * 0.01f + 1.0f; - vec.y = kREG(51) * 0.01f + 1.0f; - vec.z = kREG(52) * 0.01f + 1.0f; - verticalFactor = kREG(53) * 0.01f + -1.0f; - xzPlaneFactor = kREG(54) * 0.01f + 1.0f; - break; + case DemoGj_Type_10: + verticalTranslation = kREG(49); + vec.x = kREG(50) * 0.01f + 1.0f; + vec.y = kREG(51) * 0.01f + 1.0f; + vec.z = kREG(52) * 0.01f + 1.0f; + verticalFactor = kREG(53) * 0.01f + -1.0f; + xzPlaneFactor = kREG(54) * 0.01f + 1.0f; + break; - case DemoGj_Type_11: - verticalTranslation = kREG(62); - vec.x = kREG(63) * 0.01f + 1.0f; - vec.y = kREG(64) * 0.01f + 1.0f; - vec.z = kREG(65) * 0.01f + 1.0f; - verticalFactor = kREG(66) * 0.01f + -1.0f; - xzPlaneFactor = kREG(67) * 0.01f + 1.0f; - break; + case DemoGj_Type_11: + verticalTranslation = kREG(62); + vec.x = kREG(63) * 0.01f + 1.0f; + vec.y = kREG(64) * 0.01f + 1.0f; + vec.z = kREG(65) * 0.01f + 1.0f; + verticalFactor = kREG(66) * 0.01f + -1.0f; + xzPlaneFactor = kREG(67) * 0.01f + 1.0f; + break; - case DemoGj_Type_12: - verticalTranslation = kREG(75); - vec.x = kREG(76) * 0.01f + 1.0f; - vec.y = kREG(77) * 0.01f + 1.0f; - vec.z = kREG(78) * 0.01f + 1.0f; - verticalFactor = kREG(79) * 0.01f + -1.0f; - xzPlaneFactor = kREG(80) * 0.01f + 1.0f; - break; + case DemoGj_Type_12: + verticalTranslation = kREG(75); + vec.x = kREG(76) * 0.01f + 1.0f; + vec.y = kREG(77) * 0.01f + 1.0f; + vec.z = kREG(78) * 0.01f + 1.0f; + verticalFactor = kREG(79) * 0.01f + -1.0f; + xzPlaneFactor = kREG(80) * 0.01f + 1.0f; + break; - case DemoGj_Type_13: - verticalTranslation = kREG(88); - vec.x = kREG(89) * 0.01f + 1.0f; - vec.y = kREG(90) * 0.01f + 1.0f; - vec.z = kREG(91) * 0.01f + 1.0f; - verticalFactor = kREG(92) * 0.01f + -1.0f; - xzPlaneFactor = kREG(93) * 0.01f + 1.0f; - break; + case DemoGj_Type_13: + verticalTranslation = kREG(88); + vec.x = kREG(89) * 0.01f + 1.0f; + vec.y = kREG(90) * 0.01f + 1.0f; + vec.z = kREG(91) * 0.01f + 1.0f; + verticalFactor = kREG(92) * 0.01f + -1.0f; + xzPlaneFactor = kREG(93) * 0.01f + 1.0f; + break; - case DemoGj_Type_14: - verticalTranslation = kREG(10) + -190.0f; - vec.x = kREG(9) * 0.01f + 1.0f; - vec.y = kREG(8) * 0.01f + 1.0f; - vec.z = kREG(7) * 0.01f + 1.0f; - verticalFactor = kREG(6) * 0.01f + -1.0f; - xzPlaneFactor = kREG(5) * 0.01f + 1.0f; - break; + case DemoGj_Type_14: + verticalTranslation = kREG(10) + -190.0f; + vec.x = kREG(9) * 0.01f + 1.0f; + vec.y = kREG(8) * 0.01f + 1.0f; + vec.z = kREG(7) * 0.01f + 1.0f; + verticalFactor = kREG(6) * 0.01f + -1.0f; + xzPlaneFactor = kREG(5) * 0.01f + 1.0f; + break; - default: - // Demo_Gj_common_Reflect : This arg_data is not supported = %d - osSyncPrintf(VT_FGCOL(RED) "Demo_Gj_common_Reflect : そんなarg_dataには対応していない = %d\n" VT_RST, this->dyna.actor.params); - return; + default: + // Demo_Gj_common_Reflect : This arg_data is not supported = %d + osSyncPrintf(VT_FGCOL(RED) "Demo_Gj_common_Reflect : そんなarg_dataには対応していない = %d\n" VT_RST, + this->dyna.actor.params); + return; } yPosition += verticalTranslation; @@ -612,8 +529,8 @@ void DemoGj_Reflect(DemoGj *this, GlobalContext *globalCtx) { } } -s32 func_809797E4(DemoGj *this, u8 arg1) { - BossGanon2 *ganon = this->ganon; +s32 func_809797E4(DemoGj* this, u8 arg1) { + BossGanon2* ganon = this->ganon; if ((ganon != NULL) && (ganon->unk_314 == arg1)) { return 1; // return true; (?) @@ -621,21 +538,21 @@ s32 func_809797E4(DemoGj *this, u8 arg1) { return 0; // return false; (?) } -s32 func_80979818(DemoGj *this, GlobalContext* globalCtx) { +s32 func_80979818(DemoGj* this, GlobalContext* globalCtx) { return func_809797E4(this, 1); } -s32 func_8097983C(DemoGj *this, GlobalContext* globalCtx) { +s32 func_8097983C(DemoGj* this, GlobalContext* globalCtx) { return func_809797E4(this, 2); } // TODO: find a better name -void DemoGj_SetupMovement(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_SetupMovement(DemoGj* this, GlobalContext* globalCtx) { Actor* actor = &this->dyna.actor; Player* player; Vec3f* pos = &actor->world.pos; - Vec3s *unk_172; + Vec3s* unk_172; f32 xDistance; f32 zDistance; @@ -647,80 +564,81 @@ void DemoGj_SetupMovement(DemoGj *this, GlobalContext *globalCtx) { unk_172 = &this->unk_172; switch (DemoGj_GetType(this)) { - case DemoGj_Type_08: - actor->speedXZ = (f32) kREG(16) + 10.0f; - actor->velocity.y = (f32) kREG(17) + 40.0f; - unk_172->x = (s16) (kREG(18)); - unk_172->y = (s16) (kREG(19) + 0x3E8); - unk_172->z = (s16) (kREG(20) + 0xBB8); - actor->minVelocityY = ((f32) kREG(21) * 0.01f) + -29.0f; - actor->gravity = ((f32) kREG(22) * 0.01f) + -5.0f; - break; + case DemoGj_Type_08: + actor->speedXZ = (f32)kREG(16) + 10.0f; + actor->velocity.y = (f32)kREG(17) + 40.0f; + unk_172->x = (s16)(kREG(18)); + unk_172->y = (s16)(kREG(19) + 0x3E8); + unk_172->z = (s16)(kREG(20) + 0xBB8); + actor->minVelocityY = ((f32)kREG(21) * 0.01f) + -29.0f; + actor->gravity = ((f32)kREG(22) * 0.01f) + -5.0f; + break; - case DemoGj_Type_09: - actor->speedXZ = (f32) kREG(29) + 10.0f; - actor->velocity.y = (f32) kREG(30) + 40.0f; - unk_172->x = (s16) (kREG(31)); - unk_172->y = (s16) (kREG(32) + 0x3E8); - unk_172->z = (s16) (kREG(33) + 0xBB8); - actor->minVelocityY = ((f32) kREG(34) * 0.01f) + -29.0f; - actor->gravity = ((f32) kREG(35) * 0.01f) + -5.0f; - break; + case DemoGj_Type_09: + actor->speedXZ = (f32)kREG(29) + 10.0f; + actor->velocity.y = (f32)kREG(30) + 40.0f; + unk_172->x = (s16)(kREG(31)); + unk_172->y = (s16)(kREG(32) + 0x3E8); + unk_172->z = (s16)(kREG(33) + 0xBB8); + actor->minVelocityY = ((f32)kREG(34) * 0.01f) + -29.0f; + actor->gravity = ((f32)kREG(35) * 0.01f) + -5.0f; + break; - case DemoGj_Type_10: - actor->speedXZ = (f32) kREG(42) + 10.0f; - actor->velocity.y = (f32) kREG(43) + 40.0f; - unk_172->x = (s16) (kREG(44)); - unk_172->y = (s16) (kREG(45) + 0x3E8); - unk_172->z = (s16) (kREG(46) + 0xBB8); - actor->minVelocityY = ((f32) kREG(47) * 0.01f) + -29.0f; - actor->gravity = ((f32) kREG(48) * 0.01f) + -5.0f; - break; + case DemoGj_Type_10: + actor->speedXZ = (f32)kREG(42) + 10.0f; + actor->velocity.y = (f32)kREG(43) + 40.0f; + unk_172->x = (s16)(kREG(44)); + unk_172->y = (s16)(kREG(45) + 0x3E8); + unk_172->z = (s16)(kREG(46) + 0xBB8); + actor->minVelocityY = ((f32)kREG(47) * 0.01f) + -29.0f; + actor->gravity = ((f32)kREG(48) * 0.01f) + -5.0f; + break; - case DemoGj_Type_11: - actor->speedXZ = (f32) kREG(55) + 10.0f; - actor->velocity.y = (f32) kREG(56) + 40.0f; - unk_172->x = (s16) (kREG(57)); - unk_172->y = (s16) (kREG(58) + 0x3E8); - unk_172->z = (s16) (kREG(59) + 0xBB8); - actor->minVelocityY = ((f32) kREG(60) * 0.01f) + -29.0f; - actor->gravity = ((f32) kREG(61) * 0.01f) + -5.0f; - break; + case DemoGj_Type_11: + actor->speedXZ = (f32)kREG(55) + 10.0f; + actor->velocity.y = (f32)kREG(56) + 40.0f; + unk_172->x = (s16)(kREG(57)); + unk_172->y = (s16)(kREG(58) + 0x3E8); + unk_172->z = (s16)(kREG(59) + 0xBB8); + actor->minVelocityY = ((f32)kREG(60) * 0.01f) + -29.0f; + actor->gravity = ((f32)kREG(61) * 0.01f) + -5.0f; + break; - case DemoGj_Type_12: - actor->speedXZ = (f32) kREG(68) + 10.0f; - actor->velocity.y = (f32) kREG(69) + 40.0f; - unk_172->x = (s16) (kREG(70)); - unk_172->y = (s16) (kREG(71) + 0x3E8); - unk_172->z = (s16) (kREG(72) + 0xBB8); - actor->minVelocityY = ((f32) kREG(73) * 0.01f) + -29.0f; - actor->gravity = ((f32) kREG(74) * 0.01f) + -5.0f; - break; + case DemoGj_Type_12: + actor->speedXZ = (f32)kREG(68) + 10.0f; + actor->velocity.y = (f32)kREG(69) + 40.0f; + unk_172->x = (s16)(kREG(70)); + unk_172->y = (s16)(kREG(71) + 0x3E8); + unk_172->z = (s16)(kREG(72) + 0xBB8); + actor->minVelocityY = ((f32)kREG(73) * 0.01f) + -29.0f; + actor->gravity = ((f32)kREG(74) * 0.01f) + -5.0f; + break; - case DemoGj_Type_13: - actor->speedXZ = (f32) kREG(81) + 10.0f; - actor->velocity.y = (f32) kREG(82) + 40.0f; - unk_172->x = (s16) (kREG(83)); - unk_172->y = (s16) (kREG(84) + 0x3E8); - unk_172->z = (s16) (kREG(85) + 0xBB8); - actor->minVelocityY = ((f32) kREG(86) * 0.01f) + -29.0f; - actor->gravity = ((f32) kREG(87) * 0.01f) + -5.0f; - break; + case DemoGj_Type_13: + actor->speedXZ = (f32)kREG(81) + 10.0f; + actor->velocity.y = (f32)kREG(82) + 40.0f; + unk_172->x = (s16)(kREG(83)); + unk_172->y = (s16)(kREG(84) + 0x3E8); + unk_172->z = (s16)(kREG(85) + 0xBB8); + actor->minVelocityY = ((f32)kREG(86) * 0.01f) + -29.0f; + actor->gravity = ((f32)kREG(87) * 0.01f) + -5.0f; + break; - case DemoGj_Type_14: - actor->speedXZ = (f32) kREG(94) + 10.0f; - actor->velocity.y = (f32) kREG(95) + 70.0f; - unk_172->x = (s16) (kREG(15)); - unk_172->y = (s16) (kREG(14) + 0x3E8); - unk_172->z = (s16) (kREG(13) + 0xBB8); - actor->minVelocityY = ((f32) kREG(12) * 0.01f) + -29.0f; - actor->gravity = ((f32) kREG(11) * 0.01f) + -5.0f; - break; + case DemoGj_Type_14: + actor->speedXZ = (f32)kREG(94) + 10.0f; + actor->velocity.y = (f32)kREG(95) + 70.0f; + unk_172->x = (s16)(kREG(15)); + unk_172->y = (s16)(kREG(14) + 0x3E8); + unk_172->z = (s16)(kREG(13) + 0xBB8); + actor->minVelocityY = ((f32)kREG(12) * 0.01f) + -29.0f; + actor->gravity = ((f32)kREG(11) * 0.01f) + -5.0f; + break; - default: - // Demo_Gj_Setup_Move_common : This arg_data is not supported = %d - osSyncPrintf(VT_FGCOL(RED) "Demo_Gj_Setup_Move_common : そんなarg_dataには対応していない = %d\n" VT_RST, actor->params); - break; + default: + // Demo_Gj_Setup_Move_common : This arg_data is not supported = %d + osSyncPrintf(VT_FGCOL(RED) "Demo_Gj_Setup_Move_common : そんなarg_dataには対応していない = %d\n" VT_RST, + actor->params); + break; } if ((xDistance == 0.0f) && (zDistance == 0.0f)) { @@ -730,16 +648,16 @@ void DemoGj_SetupMovement(DemoGj *this, GlobalContext *globalCtx) { zDistance = player->actor.world.pos.z - pos->z; if (xDistance != 0.0f || zDistance != 0.0f) { - actor->world.rot.y = (Math_FAtan2F(xDistance, zDistance) * (0x8000/M_PI)); + actor->world.rot.y = (Math_FAtan2F(xDistance, zDistance) * (0x8000 / M_PI)); return; } } else { - actor->world.rot.y = (Math_FAtan2F(xDistance, zDistance) * (0x8000/M_PI)); + actor->world.rot.y = (Math_FAtan2F(xDistance, zDistance) * (0x8000 / M_PI)); } } } -void func_80979F9C(DemoGj* this){ +void func_80979F9C(DemoGj* this) { if (func_809797E4(this, 3)) { this->flag1 = 1; // this->flag1 = true; (?) } @@ -749,25 +667,25 @@ void func_80979FD0(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 1, 2, &D_06001F70); } -void func_8097A000(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A000(DemoGj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - this->rotationVec.x += (s16) (kREG(18)); - this->rotationVec.y += (s16) (kREG(19) + 0x3E8); - this->rotationVec.z += (s16) (kREG(20) + 0xBB8); + this->rotationVec.x += (s16)(kREG(18)); + this->rotationVec.y += (s16)(kREG(19) + 0x3E8); + this->rotationVec.z += (s16)(kREG(20) + 0xBB8); DemoGj_Reflect(this, globalCtx); } -void func_8097A07C(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A07C(DemoGj* this, GlobalContext* globalCtx) { u32 gameplayFrames; if (!this->flag1) { gameplayFrames = globalCtx->gameplayFrames % 3; - if (1) { } + if (1) {} if (gameplayFrames == 0) { - if (!globalCtx->gameplayFrames) { } + if (!globalCtx->gameplayFrames) {} func_80978AFC(globalCtx, &D_8097BE88, 300.0f); } @@ -775,7 +693,7 @@ void func_8097A07C(DemoGj *this, GlobalContext *globalCtx) { } } -void func_8097A0E4(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A0E4(DemoGj* this, GlobalContext* globalCtx) { if (func_80979818(this, globalCtx)) { DemoGj_SetupMovement(this, globalCtx); this->updateIndex = 8; @@ -783,7 +701,7 @@ void func_8097A0E4(DemoGj *this, GlobalContext *globalCtx) { } } -void func_8097A130(DemoGj *this, GlobalContext* globalCtx) { +void func_8097A130(DemoGj* this, GlobalContext* globalCtx) { if (func_8097983C(this, globalCtx)) { Actor_Kill(&this->dyna.actor); } @@ -811,25 +729,25 @@ void func_8097A208(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 2, 3, &D_06002448); } -void func_8097A238(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A238(DemoGj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - this->rotationVec.x += (s16) (kREG(31)); - this->rotationVec.y += (s16) (kREG(32) + 0x3E8); - this->rotationVec.z += (s16) (kREG(33) + 0xBB8); + this->rotationVec.x += (s16)(kREG(31)); + this->rotationVec.y += (s16)(kREG(32) + 0x3E8); + this->rotationVec.z += (s16)(kREG(33) + 0xBB8); DemoGj_Reflect(this, globalCtx); } -void func_8097A2B4(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A2B4(DemoGj* this, GlobalContext* globalCtx) { u32 gameplayFrames; if (!this->flag1) { gameplayFrames = globalCtx->gameplayFrames % 3; - if (1) { } + if (1) {} if (gameplayFrames == 1) { - if (!globalCtx->gameplayFrames) { } + if (!globalCtx->gameplayFrames) {} func_80978AFC(globalCtx, &D_8097BE94, 300.0f); } @@ -873,19 +791,19 @@ void func_8097A444(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 3, 4, &D_06002850); } -void func_8097A474(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A474(DemoGj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - this->rotationVec.x += (s16) (kREG(44)); - this->rotationVec.y += (s16) (kREG(45) + 0x3E8); - this->rotationVec.z += (s16) (kREG(46) + 0xBB8); + this->rotationVec.x += (s16)(kREG(44)); + this->rotationVec.y += (s16)(kREG(45) + 0x3E8); + this->rotationVec.z += (s16)(kREG(46) + 0xBB8); DemoGj_Reflect(this, globalCtx); } void func_8097A4F0(DemoGj* this, GlobalContext* globalCtx) { if (func_80979818(this, globalCtx)) { - DemoGj_SetupMovement(this, globalCtx); + DemoGj_SetupMovement(this, globalCtx); this->updateIndex = 10; this->drawIndex = 11; } @@ -919,12 +837,12 @@ void func_8097A614(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 4, 5, &D_06002D28); } -void func_8097A644(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A644(DemoGj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - this->rotationVec.x += (s16) (kREG(57)); - this->rotationVec.y += (s16) (kREG(58) + 0x3E8); - this->rotationVec.z += (s16) (kREG(59) + 0xBB8); + this->rotationVec.x += (s16)(kREG(57)); + this->rotationVec.y += (s16)(kREG(58) + 0x3E8); + this->rotationVec.z += (s16)(kREG(59) + 0xBB8); DemoGj_Reflect(this, globalCtx); } @@ -965,17 +883,17 @@ void func_8097A7E4(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 5, 6, &D_06002FE4); } -void func_8097A814(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A814(DemoGj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - this->rotationVec.x += (s16) (kREG(70)); - this->rotationVec.y += (s16) (kREG(71) + 0x3E8); - this->rotationVec.z += (s16) (kREG(72) + 0xBB8); + this->rotationVec.x += (s16)(kREG(70)); + this->rotationVec.y += (s16)(kREG(71) + 0x3E8); + this->rotationVec.z += (s16)(kREG(72) + 0xBB8); DemoGj_Reflect(this, globalCtx); } -void func_8097A890(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A890(DemoGj* this, GlobalContext* globalCtx) { if (func_80979818(this, globalCtx)) { DemoGj_SetupMovement(this, globalCtx); this->updateIndex = 12; @@ -983,45 +901,45 @@ void func_8097A890(DemoGj *this, GlobalContext *globalCtx) { } } -void func_8097A8DC(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A8DC(DemoGj* this, GlobalContext* globalCtx) { if (func_8097983C(this, globalCtx)) { Actor_Kill(&this->dyna.actor); } } -void DemoGj_Update5(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update5(DemoGj* this, GlobalContext* globalCtx) { DemoGj_FindGanon(this, globalCtx); func_8097A890(this, globalCtx); } -void DemoGj_Update12(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update12(DemoGj* this, GlobalContext* globalCtx) { func_8097A814(this, globalCtx); func_8097A8DC(this, globalCtx); } -void DemoGj_Draw6(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw6(DemoGj* this, GlobalContext* globalCtx) { DemoGj_DrawCommon(this, globalCtx, &D_06002E80); } -void DemoGj_Draw13(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw13(DemoGj* this, GlobalContext* globalCtx) { func_8097911C(this, globalCtx, &D_06002E80); } -void func_8097A9B4(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A9B4(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 6, 7, &D_060033E0); } -void func_8097A9E4(DemoGj *this, GlobalContext *globalCtx) { +void func_8097A9E4(DemoGj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - this->rotationVec.x += (s16) (kREG(83)); - this->rotationVec.y += (s16) (kREG(84) + 0x3E8); - this->rotationVec.z += (s16) (kREG(85) + 0xBB8); + this->rotationVec.x += (s16)(kREG(83)); + this->rotationVec.y += (s16)(kREG(84) + 0x3E8); + this->rotationVec.z += (s16)(kREG(85) + 0xBB8); DemoGj_Reflect(this, globalCtx); } -void func_8097AA60(DemoGj *this, GlobalContext *globalCtx) { +void func_8097AA60(DemoGj* this, GlobalContext* globalCtx) { if (func_80979818(this, globalCtx)) { DemoGj_SetupMovement(this, globalCtx); this->updateIndex = 13; @@ -1029,53 +947,53 @@ void func_8097AA60(DemoGj *this, GlobalContext *globalCtx) { } } -void func_8097AAAC(DemoGj *this, GlobalContext *globalCtx) { +void func_8097AAAC(DemoGj* this, GlobalContext* globalCtx) { if (func_8097983C(this, globalCtx)) { Actor_Kill(&this->dyna.actor); } } -void DemoGj_Update6(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update6(DemoGj* this, GlobalContext* globalCtx) { DemoGj_FindGanon(this, globalCtx); func_8097AA60(this, globalCtx); } -void DemoGj_Update13(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update13(DemoGj* this, GlobalContext* globalCtx) { func_8097A9E4(this, globalCtx); func_8097AAAC(this, globalCtx); } -void DemoGj_Draw7(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw7(DemoGj* this, GlobalContext* globalCtx) { DemoGj_DrawCommon(this, globalCtx, &D_06003190); } -void DemoGj_Draw14(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw14(DemoGj* this, GlobalContext* globalCtx) { func_8097911C(this, globalCtx, &D_06003190); } -void func_8097AB84(DemoGj *this, GlobalContext *globalCtx) { +void func_8097AB84(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 7, 8, &D_06003AF0); } -void func_8097ABB4(DemoGj *this, GlobalContext *globalCtx) { +void func_8097ABB4(DemoGj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - this->rotationVec.x += (s16) (kREG(15)); - this->rotationVec.y += (s16) (kREG(14) + 0x3E8); - this->rotationVec.z += (s16) (kREG(13) + 0xBB8); + this->rotationVec.x += (s16)(kREG(15)); + this->rotationVec.y += (s16)(kREG(14) + 0x3E8); + this->rotationVec.z += (s16)(kREG(13) + 0xBB8); DemoGj_Reflect(this, globalCtx); } -void func_8097AC30(DemoGj *this, GlobalContext *globalCtx) { +void func_8097AC30(DemoGj* this, GlobalContext* globalCtx) { u32 gameplayFrames; if (!this->flag1) { gameplayFrames = globalCtx->gameplayFrames % 3; - if (1) { } + if (1) {} if (gameplayFrames == 2) { - if (!globalCtx->gameplayFrames) { } + if (!globalCtx->gameplayFrames) {} func_80978AFC(globalCtx, &D_8097BEA0, 300.0f); } @@ -1083,7 +1001,7 @@ void func_8097AC30(DemoGj *this, GlobalContext *globalCtx) { } } -void func_8097AC9C(DemoGj *this, GlobalContext *globalCtx) { +void func_8097AC9C(DemoGj* this, GlobalContext* globalCtx) { if (func_80979818(this, globalCtx)) { DemoGj_SetupMovement(this, globalCtx); this->updateIndex = 14; @@ -1091,60 +1009,60 @@ void func_8097AC9C(DemoGj *this, GlobalContext *globalCtx) { } } -void func_8097ACE8(DemoGj *this, GlobalContext *globalCtx) { +void func_8097ACE8(DemoGj* this, GlobalContext* globalCtx) { if (func_8097983C(this, globalCtx)) { Actor_Kill(&this->dyna.actor); } } -void DemoGj_Update7(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update7(DemoGj* this, GlobalContext* globalCtx) { DemoGj_FindGanon(this, globalCtx); func_8097AC9C(this, globalCtx); } -void DemoGj_Update14(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update14(DemoGj* this, GlobalContext* globalCtx) { func_8097ABB4(this, globalCtx); func_8097ACE8(this, globalCtx); } -void DemoGj_Draw8(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw8(DemoGj* this, GlobalContext* globalCtx) { DemoGj_DrawCommon(this, globalCtx, &D_06003710); } -void DemoGj_Draw15(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw15(DemoGj* this, GlobalContext* globalCtx) { func_8097911C(this, globalCtx, &D_06003710); } -void func_8097ADC0(DemoGj *this, GlobalContext *globalCtx) { +void func_8097ADC0(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 0, 1, &D_06001B70); } -void DemoGj_Update0(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update0(DemoGj* this, GlobalContext* globalCtx) { DemoGj_FindGanon(this, globalCtx); func_8097A07C(this, globalCtx); func_8097A2B4(this, globalCtx); func_8097AC30(this, globalCtx); } -void DemoGj_Draw1(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw1(DemoGj* this, GlobalContext* globalCtx) { DemoGj_DrawCommon(this, globalCtx, &D_06000DC0); } -void func_8097AE5C(DemoGj *this, GlobalContext *globalCtx) { +void func_8097AE5C(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 15, 0, NULL); DemoGj_Cylinder_Init(this, globalCtx, &this->cylinders[0], &sCylinderInit1); DemoGj_Cylinder_Init(this, globalCtx, &this->cylinders[1], &sCylinderInit1); DemoGj_Cylinder_Init(this, globalCtx, &this->cylinders[2], &sCylinderInit1); } -void func_8097AEDC(DemoGj *this, GlobalContext *globalCtx) { +void func_8097AEDC(DemoGj* this, GlobalContext* globalCtx) { } -void func_8097AEE8(DemoGj *this, GlobalContext *globalCtx) { - ColliderCylinder *cylinders_0 = &this->cylinders[0]; - ColliderCylinder *cylinders_1 = &this->cylinders[1]; - ColliderCylinder *cylinders_2 = &this->cylinders[2]; - PosRot *actorPosRot = &this->dyna.actor.world; +void func_8097AEE8(DemoGj* this, GlobalContext* globalCtx) { + ColliderCylinder* cylinders_0 = &this->cylinders[0]; + ColliderCylinder* cylinders_1 = &this->cylinders[1]; + ColliderCylinder* cylinders_2 = &this->cylinders[2]; + PosRot* actorPosRot = &this->dyna.actor.world; s32 pad; @@ -1166,8 +1084,8 @@ void func_8097AEE8(DemoGj *this, GlobalContext *globalCtx) { cylinders_2->dim.pos.y = actorPosRot->pos.y; } -void func_8097B080(DemoGj *this, GlobalContext *globalCtx) { - CollisionCheckContext *colChkCtx; +void func_8097B080(DemoGj* this, GlobalContext* globalCtx) { + CollisionCheckContext* colChkCtx; GlobalContext* globalCtx2 = globalCtx; Collider* cylinders_0 = &this->cylinders[0].base; Collider* cylinders_1 = &this->cylinders[1].base; @@ -1181,7 +1099,7 @@ void func_8097B080(DemoGj *this, GlobalContext *globalCtx) { CollisionCheck_SetAC(globalCtx2, colChkCtx, cylinders_2); } -void func_8097B0EC(DemoGj *this, GlobalContext *globalCtx, Vec3f *arg2) { +void func_8097B0EC(DemoGj* this, GlobalContext* globalCtx, Vec3f* arg2) { Vec3f pos; pos.x = this->dyna.actor.world.pos.x; @@ -1191,8 +1109,8 @@ void func_8097B0EC(DemoGj *this, GlobalContext *globalCtx, Vec3f *arg2) { func_80978C20(this, globalCtx, &pos, arg2); } -void func_8097B128(DemoGj *this, GlobalContext *globalCtx) { - Vec3f *scale = &this->dyna.actor.scale; +void func_8097B128(DemoGj* this, GlobalContext* globalCtx) { + Vec3f* scale = &this->dyna.actor.scale; if (func_8097983C(this, globalCtx)) { DemoGj_InitCommon(this, globalCtx, &D_06001F70); @@ -1204,7 +1122,7 @@ void func_8097B128(DemoGj *this, GlobalContext *globalCtx) { } } -s32 DemoGj_Cylinder_AnyHasExploded(DemoGj *this, GlobalContext *globalCtx) { +s32 DemoGj_Cylinder_AnyHasExploded(DemoGj* this, GlobalContext* globalCtx) { if (DemoGj_Cylinder_HasExploded(this, globalCtx, &this->cylinders[0])) { return 1; // return true; (?) } @@ -1217,7 +1135,7 @@ s32 DemoGj_Cylinder_AnyHasExploded(DemoGj *this, GlobalContext *globalCtx) { return 0; // return false; (?) } -void func_8097B22C(DemoGj *this, GlobalContext *globalCtx) { +void func_8097B22C(DemoGj* this, GlobalContext* globalCtx) { s32 pad; Vec3f vec1; @@ -1248,35 +1166,35 @@ void func_8097B22C(DemoGj *this, GlobalContext *globalCtx) { func_8097B080(this, globalCtx); } -void DemoGj_Update15(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update15(DemoGj* this, GlobalContext* globalCtx) { DemoGj_FindGanon(this, globalCtx); func_8097B128(this, globalCtx); } -void DemoGj_Update18(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update18(DemoGj* this, GlobalContext* globalCtx) { func_8097B22C(this, globalCtx); func_8097AEDC(this, globalCtx); } -void DemoGj_Draw16(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw16(DemoGj* this, GlobalContext* globalCtx) { DemoGj_DrawCommon(this, globalCtx, &D_06001D20); } -void func_8097B3C4(DemoGj *this, GlobalContext *globalCtx) { +void func_8097B3C4(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 16, 0, NULL); DemoGj_Cylinder_Init(this, globalCtx, &this->cylinders[0], &sCylinderInit2); DemoGj_Cylinder_Init(this, globalCtx, &this->cylinders[1], &sCylinderInit2); DemoGj_Cylinder_Init(this, globalCtx, &this->cylinders[2], &sCylinderInit2); } -void func_8097B444(DemoGj *this, GlobalContext *globalCtx) { +void func_8097B444(DemoGj* this, GlobalContext* globalCtx) { } -void func_8097B450(DemoGj *this, GlobalContext *globalCtx) { - ColliderCylinder *cylinder0 = &this->cylinders[0]; - ColliderCylinder *cylinder1 = &this->cylinders[1]; - ColliderCylinder *cylinder2 = &this->cylinders[2]; - PosRot *actorPosRot = &this->dyna.actor.world; +void func_8097B450(DemoGj* this, GlobalContext* globalCtx) { + ColliderCylinder* cylinder0 = &this->cylinders[0]; + ColliderCylinder* cylinder1 = &this->cylinders[1]; + ColliderCylinder* cylinder2 = &this->cylinders[2]; + PosRot* actorPosRot = &this->dyna.actor.world; s32 pad; @@ -1285,8 +1203,8 @@ void func_8097B450(DemoGj *this, GlobalContext *globalCtx) { f32 cos_theta = Math_CosS(theta); f32 sin_theta = Math_SinS(theta); - cylinder0->dim.pos.z = actorPosRot->pos.z - ( 35.0f * sin_theta); - cylinder0->dim.pos.x = actorPosRot->pos.x + ( 35.0f * cos_theta); + cylinder0->dim.pos.z = actorPosRot->pos.z - (35.0f * sin_theta); + cylinder0->dim.pos.x = actorPosRot->pos.x + (35.0f * cos_theta); cylinder0->dim.pos.y = actorPosRot->pos.y; cylinder1->dim.pos.z = actorPosRot->pos.z - (-10.0f * sin_theta); @@ -1298,7 +1216,7 @@ void func_8097B450(DemoGj *this, GlobalContext *globalCtx) { cylinder2->dim.pos.y = actorPosRot->pos.y; } -void func_8097B5A4(DemoGj *this, GlobalContext *globalCtx) { +void func_8097B5A4(DemoGj* this, GlobalContext* globalCtx) { GlobalContext* globalCtx2 = globalCtx; CollisionCheckContext* colChkCtx = &globalCtx2->colChkCtx; @@ -1314,7 +1232,7 @@ void func_8097B5A4(DemoGj *this, GlobalContext *globalCtx) { } // Does the same as `DemoGj_Cylinder_AnyHasExploded` -s32 DemoGj_Cylinder_AnyHasExploded2(DemoGj *this, GlobalContext *globalCtx) { +s32 DemoGj_Cylinder_AnyHasExploded2(DemoGj* this, GlobalContext* globalCtx) { if (DemoGj_Cylinder_HasExploded(this, globalCtx, &this->cylinders[0])) { return 1; // return true; (?) } @@ -1327,7 +1245,7 @@ s32 DemoGj_Cylinder_AnyHasExploded2(DemoGj *this, GlobalContext *globalCtx) { return 0; // return false; (?) } -void func_8097B688(DemoGj *this, GlobalContext *globalCtx, Vec3f *arg2) { +void func_8097B688(DemoGj* this, GlobalContext* globalCtx, Vec3f* arg2) { Vec3f pos; pos.x = this->dyna.actor.world.pos.x; @@ -1337,8 +1255,8 @@ void func_8097B688(DemoGj *this, GlobalContext *globalCtx, Vec3f *arg2) { func_80978C20(this, globalCtx, &pos, arg2); } -void func_8097B6C4(DemoGj *this, GlobalContext *globalCtx) { - Vec3f *scale = &this->dyna.actor.scale; +void func_8097B6C4(DemoGj* this, GlobalContext* globalCtx) { + Vec3f* scale = &this->dyna.actor.scale; if (func_8097983C(this, globalCtx)) { DemoGj_InitCommon(this, globalCtx, &D_06002448); @@ -1350,8 +1268,8 @@ void func_8097B6C4(DemoGj *this, GlobalContext *globalCtx) { } } -void func_8097B750(DemoGj *this, GlobalContext *globalCtx) { - GlobalContext *globalCtx2 = globalCtx; +void func_8097B750(DemoGj* this, GlobalContext* globalCtx) { + GlobalContext* globalCtx2 = globalCtx; Vec3f vec1; Vec3f vec2; @@ -1381,29 +1299,29 @@ void func_8097B750(DemoGj *this, GlobalContext *globalCtx) { func_8097B5A4(this, globalCtx2); } -void DemoGj_Update16(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update16(DemoGj* this, GlobalContext* globalCtx) { DemoGj_FindGanon(this, globalCtx); func_8097B6C4(this, globalCtx); } -void DemoGj_Update19(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update19(DemoGj* this, GlobalContext* globalCtx) { func_8097B750(this, globalCtx); func_8097B444(this, globalCtx); } -void DemoGj_Draw17(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw17(DemoGj* this, GlobalContext* globalCtx) { DemoGj_DrawCommon(this, globalCtx, &D_06002160); } -void func_8097B8E8(DemoGj *this, GlobalContext *globalCtx) { +void func_8097B8E8(DemoGj* this, GlobalContext* globalCtx) { DemoGj_InitSetIndexes(this, globalCtx, 17, 0, NULL); DemoGj_Cylinder_Init(this, globalCtx, &this->cylinders[0], &sCylinderInit3); } -void func_8097B930(DemoGj *this, GlobalContext *globalCtx) { +void func_8097B930(DemoGj* this, GlobalContext* globalCtx) { } -void func_8097B93C(DemoGj *this, GlobalContext *globalCtx, Vec3f *arg2) { +void func_8097B93C(DemoGj* this, GlobalContext* globalCtx, Vec3f* arg2) { Vec3f pos; pos.x = this->dyna.actor.world.pos.x; @@ -1417,8 +1335,8 @@ void func_8097B93C(DemoGj *this, GlobalContext *globalCtx, Vec3f *arg2) { func_80978C20(this, globalCtx, &pos, arg2); } -void func_8097B9BC(DemoGj *this, GlobalContext *globalCtx) { - Vec3f *scale = &this->dyna.actor.scale; +void func_8097B9BC(DemoGj* this, GlobalContext* globalCtx) { + Vec3f* scale = &this->dyna.actor.scale; if (func_8097983C(this, globalCtx)) { DemoGj_InitCommon(this, globalCtx, &D_06003AF0); @@ -1430,10 +1348,10 @@ void func_8097B9BC(DemoGj *this, GlobalContext *globalCtx) { } } -void func_8097BA48(DemoGj *this, GlobalContext *globalCtx) { +void func_8097BA48(DemoGj* this, GlobalContext* globalCtx) { Actor* actor = &this->dyna.actor; - ColliderCylinder *cylinder = &this->cylinders[0]; - Collider *collider = &cylinder->base; + ColliderCylinder* cylinder = &this->cylinders[0]; + Collider* collider = &cylinder->base; CollisionCheckContext* colChkCtx = &globalCtx->colChkCtx; Vec3f vec1; @@ -1462,22 +1380,22 @@ void func_8097BA48(DemoGj *this, GlobalContext *globalCtx) { CollisionCheck_SetAC(globalCtx, colChkCtx, collider); } -void DemoGj_Update17(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update17(DemoGj* this, GlobalContext* globalCtx) { DemoGj_FindGanon(this, globalCtx); func_8097B9BC(this, globalCtx); } -void DemoGj_Update20(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Update20(DemoGj* this, GlobalContext* globalCtx) { func_8097BA48(this, globalCtx); func_8097B930(this, globalCtx); } -void DemoGj_Draw18(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw18(DemoGj* this, GlobalContext* globalCtx) { DemoGj_DrawCommon(this, globalCtx, &D_06003710); } void DemoGj_Update(Actor* thisx, GlobalContext* globalCtx) { - DemoGj *this = THIS; + DemoGj* this = THIS; DemoGjActionFunc func; if (this->updateIndex < 0 || this->updateIndex >= 21 || (func = sUpdateFuncs[this->updateIndex]) == NULL) { @@ -1489,66 +1407,67 @@ void DemoGj_Update(Actor* thisx, GlobalContext* globalCtx) { func(this, globalCtx); } -void DemoGj_Init(Actor *thisx, GlobalContext *globalCtx) { - DemoGj *this = THIS; +void DemoGj_Init(Actor* thisx, GlobalContext* globalCtx) { + DemoGj* this = THIS; switch (DemoGj_GetType(this)) { - case DemoGj_Type_04: - func_8097ADC0(this, globalCtx); - return; + case DemoGj_Type_04: + func_8097ADC0(this, globalCtx); + return; - case DemoGj_Type_08: - func_80979FD0(this, globalCtx); - return; + case DemoGj_Type_08: + func_80979FD0(this, globalCtx); + return; - case DemoGj_Type_09: - func_8097A208(this, globalCtx); - return; + case DemoGj_Type_09: + func_8097A208(this, globalCtx); + return; - case DemoGj_Type_10: - func_8097A444(this, globalCtx); - return; + case DemoGj_Type_10: + func_8097A444(this, globalCtx); + return; - case DemoGj_Type_11: - func_8097A614(this, globalCtx); - return; + case DemoGj_Type_11: + func_8097A614(this, globalCtx); + return; - case DemoGj_Type_12: - func_8097A7E4(this, globalCtx); - return; + case DemoGj_Type_12: + func_8097A7E4(this, globalCtx); + return; - case DemoGj_Type_13: - func_8097A9B4(this, globalCtx); - return; + case DemoGj_Type_13: + func_8097A9B4(this, globalCtx); + return; - case DemoGj_Type_14: - func_8097AB84(this, globalCtx); - return; + case DemoGj_Type_14: + func_8097AB84(this, globalCtx); + return; - case DemoGj_Type_16: - func_8097AE5C(this, globalCtx); - return; + case DemoGj_Type_16: + func_8097AE5C(this, globalCtx); + return; - case DemoGj_Type_17: - func_8097B3C4(this, globalCtx); - return; + case DemoGj_Type_17: + func_8097B3C4(this, globalCtx); + return; - case DemoGj_Type_22: - func_8097B8E8(this, globalCtx); - return; + case DemoGj_Type_22: + func_8097B8E8(this, globalCtx); + return; - default: - // Demo_Gj_Actor_ct There is no such argument!!!!!!!!!!!!!!!!!!!!!! - osSyncPrintf(VT_FGCOL(RED) "Demo_Gj_Actor_ct そんな引数は無い!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST, globalCtx, this); - Actor_Kill(&this->dyna.actor); + default: + // Demo_Gj_Actor_ct There is no such argument!!!!!!!!!!!!!!!!!!!!!! + osSyncPrintf(VT_FGCOL(RED) "Demo_Gj_Actor_ct そんな引数は無い!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST, globalCtx, + this); + Actor_Kill(&this->dyna.actor); } } -void DemoGj_Draw0(DemoGj *this, GlobalContext *globalCtx) { +void DemoGj_Draw0(DemoGj* this, GlobalContext* globalCtx) { } -void DemoGj_Draw(Actor *thisx, GlobalContext *globalCtx) { - DemoGj *this = THIS; +void DemoGj_Draw(Actor* thisx, GlobalContext* globalCtx) { + DemoGj* this = THIS; DemoGjActionFunc func; if (this->drawIndex < 0 || this->drawIndex >= 19 || (func = sDrawFuncs[this->drawIndex]) == NULL) {