From 5b2cafdc894823d57beee8f3947a391d881d91de Mon Sep 17 00:00:00 2001 From: Henny022p Date: Sun, 9 Mar 2025 19:12:36 +0000 Subject: [PATCH] formatting --- include/affine.h | 2 +- include/enemy/armos.h | 2 +- include/fade.h | 5 ++++- include/gfx.h | 2 +- include/itemDefinitions.h | 2 +- include/npc/bigGoron.h | 2 +- include/object.h | 2 -- include/object/cutsceneMiscObject.h | 2 +- include/object/lockedDoor.h | 2 +- include/object/pot.h | 2 +- include/vram.h | 2 +- src/beanstalkSubtask.c | 7 ++++--- src/enemy/mazaalHead.c | 8 ++------ src/enemy/vaatiArm.c | 4 +--- src/manager/diggingCaveEntranceManager.c | 2 +- src/manager/minishPortalManager.c | 2 +- src/message.c | 4 ++-- src/object/lilypadLarge.c | 2 +- src/scroll.c | 3 +-- 19 files changed, 26 insertions(+), 31 deletions(-) diff --git a/include/affine.h b/include/affine.h index 1ea56c66..ae8d2ddb 100644 --- a/include/affine.h +++ b/include/affine.h @@ -18,4 +18,4 @@ extern void DrawEntities(void); extern void sub_080ADA04(OAMCommand*, void*); extern void DrawDirect(u32 spriteIndex, u32 frameIndex); -#endif //AFFINE_H +#endif // AFFINE_H diff --git a/include/enemy/armos.h b/include/enemy/armos.h index 03f5cceb..277f80ca 100644 --- a/include/enemy/armos.h +++ b/include/enemy/armos.h @@ -5,4 +5,4 @@ void Armos_SetFlagFromTransition(u32 armosId); -#endif //ARMOS_H +#endif // ARMOS_H diff --git a/include/fade.h b/include/fade.h index e623df25..aa7c86e1 100644 --- a/include/fade.h +++ b/include/fade.h @@ -101,6 +101,9 @@ void FadeVBlank(void); void ResetFadeMask(void); extern u32 gUsedPalettes; -#define USE_PALETTE(i) do { gUsedPalettes |= 1 << (i); } while(0) +#define USE_PALETTE(i) \ + do { \ + gUsedPalettes |= 1 << (i); \ + } while (0) #endif // FADE_H diff --git a/include/gfx.h b/include/gfx.h index b0ecd2a4..2620debc 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -5,4 +5,4 @@ extern const u8 gGlobalGfxAndPalettes[]; -#endif //GFX_H +#endif // GFX_H diff --git a/include/itemDefinitions.h b/include/itemDefinitions.h index f48fa18a..e5816dd5 100644 --- a/include/itemDefinitions.h +++ b/include/itemDefinitions.h @@ -17,4 +17,4 @@ typedef struct { static_assert(sizeof(ItemDefinition) == 0xc); -#endif //ITEMDEFINITIONS_H +#endif // ITEMDEFINITIONS_H diff --git a/include/npc/bigGoron.h b/include/npc/bigGoron.h index b7279733..568c420b 100644 --- a/include/npc/bigGoron.h +++ b/include/npc/bigGoron.h @@ -5,4 +5,4 @@ extern void sub_0806D0B0(struct Entity_*); -#endif //BIGGORON_H +#endif // BIGGORON_H diff --git a/include/object.h b/include/object.h index 34a85ea5..231f7239 100644 --- a/include/object.h +++ b/include/object.h @@ -201,7 +201,6 @@ typedef enum { LINK_ANIMATION, } Object; - Entity* CreateLinkAnimation(Entity* parent, u32 type, u32 type2); void ObjectInit(Entity* this); u32 LoadObjectSprite(Entity* this, s32 type, const ObjectDefinition* definition); @@ -221,7 +220,6 @@ void sub_0808C650(Entity*, u32); u32 sub_0808C67C(void); void sub_0808C688(void); - void ItemOnGround(); void DeathFx(); void ItemForSale(); diff --git a/include/object/cutsceneMiscObject.h b/include/object/cutsceneMiscObject.h index da8ee3e1..49772846 100644 --- a/include/object/cutsceneMiscObject.h +++ b/include/object/cutsceneMiscObject.h @@ -5,4 +5,4 @@ extern void sub_08095C48(struct Entity_*); -#endif //CUTSCENEMISCOBJECT_H +#endif // CUTSCENEMISCOBJECT_H diff --git a/include/object/lockedDoor.h b/include/object/lockedDoor.h index 90a6c7cb..8bbca19c 100644 --- a/include/object/lockedDoor.h +++ b/include/object/lockedDoor.h @@ -5,4 +5,4 @@ extern bool32 sub_08083734(struct Entity_*, u32); -#endif //LOCKEDDOOR_H +#endif // LOCKEDDOOR_H diff --git a/include/object/pot.h b/include/object/pot.h index 4867586a..65429388 100644 --- a/include/object/pot.h +++ b/include/object/pot.h @@ -5,4 +5,4 @@ extern u32 sub_0808288C(struct Entity_*, u32, u32, u32); -#endif //POT_H +#endif // POT_H diff --git a/include/vram.h b/include/vram.h index eae470e5..26fa4412 100644 --- a/include/vram.h +++ b/include/vram.h @@ -78,4 +78,4 @@ typedef struct { } OAMControls; extern OAMControls gOAMControls; -#endif //VRAM_H +#endif // VRAM_H diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index 3188b2e8..c18bd945 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -212,7 +212,7 @@ u32 UpdatePlayerCollision(void) { if ((((gPlayerState.flags & (PL_FLAGS10000 | PL_FLAGS2)) != 0) || ((gPlayerState.sword_state & 0x10) != 0)) || ((DoApplicableTransition(gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x, - gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y, index, 5) == 0 && + gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y, index, 5) == 0 && (((gPlayerState.heldObject != 0 || ((gPlayerState.gustJarState & 0xf) != 0)) || (sub_0807BD14(&gPlayerEntity.base, index) == 0)))))) { return 3; @@ -274,8 +274,9 @@ u32 UpdatePlayerCollision(void) { } ptr1 = &gUnk_080B4478[gPlayerEntity.base.animationState & 6]; - transition = FindApplicableAreaTransition((gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x) + ptr1[0], - (gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y) + ptr1[1]); + transition = + FindApplicableAreaTransition((gPlayerEntity.base.x.HALF.HI - gRoomControls.origin_x) + ptr1[0], + (gPlayerEntity.base.y.HALF.HI - gRoomControls.origin_y) + ptr1[1]); if (transition == NULL) { return 0; } diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index 1cec5baa..ffb4d420 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -124,12 +124,8 @@ void (*const gUnk_080CED74[])(MazaalHeadEntity*) = { sub_08034BA0, }; const s8 gUnk_080CED84[] = { 0x0d, 0x10, -0xd, 0x10 }; -const Transition gUnk_080CED88 = { - 1, 0, 0, 0x88, 0xf8, 0, AREA_INNER_MAZAAL, ROOM_INNER_MAZAAL_PHASE_1, 1, 0, 0, 0 -}; -const Transition gUnk_080CED9C = { - 1, 0, 0, 0x88, 0xf8, 0, AREA_INNER_MAZAAL, ROOM_INNER_MAZAAL_MAIN, 1, 0, 0, 0 -}; +const Transition gUnk_080CED88 = { 1, 0, 0, 0x88, 0xf8, 0, AREA_INNER_MAZAAL, ROOM_INNER_MAZAAL_PHASE_1, 1, 0, 0, 0 }; +const Transition gUnk_080CED9C = { 1, 0, 0, 0x88, 0xf8, 0, AREA_INNER_MAZAAL, ROOM_INNER_MAZAAL_MAIN, 1, 0, 0, 0 }; void MazaalHead(MazaalHeadEntity* this) { MazaalHead_Functions[GetNextFunction(super)](this); diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index b53ca35e..8ee71d2e 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -192,9 +192,7 @@ const Coords gUnk_080D13D8[] = { { .HALF = { -0x60, 0x80 } }, { .HALF = { 0x60, const u8 gUnk_080D13E0[] = { 0xc, 0xe, 0x10 }; const u8 gUnk_080D13E3[] = { 8, 9, 10, 4, 4, 5 }; const s8 gUnk_080D13E9[] = { -8, 8 }; -const Transition gUnk_080D13EC = { - 1, 0, 0, 0x98, 0xb8, 0, AREA_VAATIS_ARMS, ROOM_VAATIS_ARMS_FIRST, 1, 0, 0, 0 -}; +const Transition gUnk_080D13EC = { 1, 0, 0, 0x98, 0xb8, 0, AREA_VAATIS_ARMS, ROOM_VAATIS_ARMS_FIRST, 1, 0, 0, 0 }; const u16 gUnk_080D1400[][5] = { { 0x8000, 0x7000, 0x6000, 0x5000, 0x4000 }, { 0x8000, -0x7000, -0x6000, -0x5000, -0x4000 }, diff --git a/src/manager/diggingCaveEntranceManager.c b/src/manager/diggingCaveEntranceManager.c index 18e7a74c..49104baf 100644 --- a/src/manager/diggingCaveEntranceManager.c +++ b/src/manager/diggingCaveEntranceManager.c @@ -11,7 +11,7 @@ #include "room.h" #include "scroll.h" #include "tiles.h" -#ifndef EU +#ifndef EU #endif void DiggingCaveEntranceManager_Main(DiggingCaveEntranceManager*); diff --git a/src/manager/minishPortalManager.c b/src/manager/minishPortalManager.c index 74276e46..66171581 100644 --- a/src/manager/minishPortalManager.c +++ b/src/manager/minishPortalManager.c @@ -45,7 +45,7 @@ void MinishPortalManager_Main(MinishPortalManager* this) { } if (GetActTileAtRoomCoords(this->unk_38, this->unk_3a, super->timer) == ACT_TILE_61) { CreateMagicSparklesFxAt(this->unk_38 + gRoomControls.origin_x, this->unk_3a + gRoomControls.origin_y, - super->timer); + super->timer); if (super->subtimer == 0) { super->subtimer = 1; SoundReq(SFX_NEAR_PORTAL); diff --git a/src/message.c b/src/message.c index 64e26581..54ab722f 100644 --- a/src/message.c +++ b/src/message.c @@ -841,13 +841,13 @@ static void sub_08056FBC(TextRender* ctb) { * @param number number to convert * @param string output string buffer (at least 8 bytes in size) * @return number of character written (NOT including null terminator) -*/ + */ u32 NumberToAscii(u32 number, String8* string) { int j; int i; int length; u8 buffer[8]; - char * const output = string->s; + char* const output = string->s; number = EncodeBCD(number) & 0xfffffff; length = 0; diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index 6da49a41..fceb7d0c 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -506,7 +506,7 @@ void sub_08085D60(LilypadLargeEntity* this) { if (GetCollisionDataRelativeTo(super, tmpX, tmpY) == COLLISION_DATA_255) { if (DoApplicableTransition((super->x.HALF.HI - gRoomControls.origin_x) + tmpX, - (super->y.HALF.HI - gRoomControls.origin_y) + tmpY, r4, 5) == 0) { + (super->y.HALF.HI - gRoomControls.origin_y) + tmpY, r4, 5) == 0) { if (sub_0807BD14(&gPlayerEntity.base, r4 >> 3) != 0) { super->direction = r4; sub_08085E74(this); diff --git a/src/scroll.c b/src/scroll.c index 0137e344..47ba7688 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -619,8 +619,7 @@ const Transition* FindApplicableAreaTransition(u32 pos_x, u32 pos_y) { const Transition* transition = gArea.pCurrentRoomInfo->exits; u32 warp_types = 0xa; while (transition->warp_type != WARP_TYPE_END_OF_LIST) { - if (((1 << transition->warp_type) & warp_types) != 0 && - IsPosInTransitionRect(transition, pos_x, pos_y, 0)) { + if (((1 << transition->warp_type) & warp_types) != 0 && IsPosInTransitionRect(transition, pos_x, pos_y, 0)) { return transition; } transition++;