From 18b86e484aea3c3b913709259f71c1a516a34db1 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Sat, 6 May 2023 00:36:48 +0200 Subject: [PATCH] Formatting --- include/structures.h | 8 +++++--- src/beanstalkSubtask.c | 3 ++- src/code_08049DF4.c | 4 ++-- src/common.c | 12 +++++++----- src/npc/npc4E.c | 5 ++--- src/object/cameraTarget.c | 7 ++++--- src/object/itemForSale.c | 6 +++--- src/object/lockedDoor.c | 3 ++- src/playerUtils.c | 3 ++- 9 files changed, 29 insertions(+), 22 deletions(-) diff --git a/include/structures.h b/include/structures.h index 9c8864db..0cbe9c71 100644 --- a/include/structures.h +++ b/include/structures.h @@ -268,7 +268,8 @@ typedef struct { typedef struct { /*0x00*/ u8 ignoreLayer; /* if bit 0 set, skip layer check for collision */ /*0x01*/ u8 type; - /*0x02*/ u8 interactDirections; /* lower 4 bits determine Link's allowed facing directions to interact, 0 to allow (0000WSEN) */ + /*0x02*/ u8 interactDirections; /* lower 4 bits determine Link's allowed facing directions to interact, 0 to allow + (0000WSEN) */ /*0x03*/ u8 kinstoneId; /*0x04*/ const Rect* customHitbox; /* optional custom rectangle */ /*0x08*/ Entity* entity; @@ -278,9 +279,10 @@ typedef struct { /*0x00*/ u8 isUpdated; /*0x01*/ u8 unused; /*0x02*/ u8 kinstoneId; - /*0x03*/ u8 currentIndex; /* index of currentObject in canditate list, or 0xFF */ + /*0x03*/ u8 currentIndex; /* index of currentObject in candidate list, or 0xFF */ /*0x04*/ InteractableObject* currentObject; - /*0x08*/ InteractableObject candidates[0x20]; /* contains the loaded NPCs, key doors, windcrests and other objects */ + /*0x08*/ InteractableObject + candidates[0x20]; /* contains the loaded NPCs, key doors, windcrests and other objects */ } PossibleInteraction; static_assert(sizeof(PossibleInteraction) == 0x188); diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index 3009a41c..f1f85a4a 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -204,7 +204,8 @@ u32 UpdatePlayerCollision(void) { ptr1 = &gUnk_080B4490[index * 2]; if (sub_080B1B44(COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr1[0], -ptr1[1]), gPlayerEntity.collisionLayer) == 0xff) { - if ((((gPlayerState.flags & (PL_FLAGS10000 | PL_FLAGS2)) != 0) || ((gPlayerState.sword_state & 0x10) != 0)) || + if ((((gPlayerState.flags & (PL_FLAGS10000 | PL_FLAGS2)) != 0) || + ((gPlayerState.sword_state & 0x10) != 0)) || ((sub_080806BC(gPlayerEntity.x.HALF.HI - gRoomControls.origin_x, gPlayerEntity.y.HALF.HI - gRoomControls.origin_y, index, 5) == 0 && (((gPlayerState.heldObject != 0 || ((gPlayerState.field_0x1c & 0xf) != 0)) || diff --git a/src/code_08049DF4.c b/src/code_08049DF4.c index e6d53f99..a4af4474 100644 --- a/src/code_08049DF4.c +++ b/src/code_08049DF4.c @@ -51,8 +51,8 @@ Entity* sub_08049E80(void) { } Entity* sub_08049EB0(void) { - if ((gPlayerState.field_0x3c == 0) && !(gPlayerState.flags & - (PL_MOLDWORM_CAPTURED | PL_DISABLE_ITEMS | PL_MINISH | PL_CAPTURED))) { + if ((gPlayerState.field_0x3c == 0) && + !(gPlayerState.flags & (PL_MOLDWORM_CAPTURED | PL_DISABLE_ITEMS | PL_MINISH | PL_CAPTURED))) { gUnk_020000B0 = &gPlayerEntity; return &gPlayerEntity; } diff --git a/src/common.c b/src/common.c index 064082a9..1aa305df 100644 --- a/src/common.c +++ b/src/common.c @@ -468,7 +468,8 @@ void DrawDungeonMap(u32 floor, DungeonMapObject* specialData, u32 size) { tileEntity++; } } - if ((HasDungeonCompass() && ((floorMapData->unk_2 & 2) != 0)) && (!CheckGlobalFlag(gArea.dungeon_idx + 1))) { + if ((HasDungeonCompass() && ((floorMapData->unk_2 & 2) != 0)) && + (!CheckGlobalFlag(gArea.dungeon_idx + 1))) { roomHeader = gAreaRoomHeaders[floorMapData->area] + floorMapData->room; specialData->type = DMO_TYPE_BOSS; tmp1 = ((roomHeader->pixel_width / 2) + roomHeader->map_x) / 16; @@ -1073,9 +1074,10 @@ KinstoneId GetFusionToOffer(Entity* entity) { while (TRUE) { // loop through fusions for this fuser switch (offeredFusion) { case KINSTONE_NEEDS_REPLACEMENT: // offered fusion completed with someone else - case KINSTONE_NONE: // no fusion offered yet + case KINSTONE_NONE: // no fusion offered yet offeredFusion = fuserFusionData[5]; - if (offeredFusion == KINSTONE_NONE || offeredFusion == KINSTONE_RANDOM || CheckKinstoneFused(offeredFusion) == 0) { + if (offeredFusion == KINSTONE_NONE || offeredFusion == KINSTONE_RANDOM || + CheckKinstoneFused(offeredFusion) == 0) { break; } case KINSTONE_JUST_FUSED: // previous fusion completed @@ -1086,8 +1088,8 @@ KinstoneId GetFusionToOffer(Entity* entity) { if (offeredFusion == KINSTONE_RANDOM) { // random shared fusion offeredFusion = GetRandomSharedFusion(fuserData); } - if (offeredFusion == KINSTONE_NONE) { // end of fusion list - offeredFusion = KINSTONE_FUSER_DONE; // mark this fuser as done + if (offeredFusion == KINSTONE_NONE) { // end of fusion list + offeredFusion = KINSTONE_FUSER_DONE; // mark this fuser as done break; } if (offeredFusion == KINSTONE_JUST_FUSED) { // previous fusion completed diff --git a/src/npc/npc4E.c b/src/npc/npc4E.c index 1ec89710..cdfd7abe 100644 --- a/src/npc/npc4E.c +++ b/src/npc/npc4E.c @@ -232,9 +232,8 @@ void NPC4E_Fusion(Entity* this) { const Hitbox gUnk_08114154 = { 0, -8, 0, 0, 0, 0, 24, 8 }; const InteractCollisionData gNpc4ECollisionData[] = { // - { 0, 0, 8, 8, 0x0E, 0, 0, 0 }, { 0, 0, 26, 8, 0x0E, 0, 0, 0 }, - { 0, 0, 16, 4, 0x0E, 0, 0, 0 }, { 0, 0, 10, 10, 0x00, 0, 0, 0 }, - { 0, 0, 10, 10, 0x00, 0, 0, 0 }, { 0, 0, 6, 4, 0x0E, 0, 0, 0 }, + { 0, 0, 8, 8, 0x0E, 0, 0, 0 }, { 0, 0, 26, 8, 0x0E, 0, 0, 0 }, { 0, 0, 16, 4, 0x0E, 0, 0, 0 }, + { 0, 0, 10, 10, 0x00, 0, 0, 0 }, { 0, 0, 10, 10, 0x00, 0, 0, 0 }, { 0, 0, 6, 4, 0x0E, 0, 0, 0 }, { 0, 8, 16, 4, 0x0E, 0, 0, 0 }, { 0, -8, 24, 8, 0x0E, 0, 0, 0 }, #ifndef EU { 0, 0, 88, 8, 0x0E, 0, 0, 0 } diff --git a/src/object/cameraTarget.c b/src/object/cameraTarget.c index 88831f94..57a5623a 100644 --- a/src/object/cameraTarget.c +++ b/src/object/cameraTarget.c @@ -103,7 +103,8 @@ void CameraTarget_Action1(Entity* this) { if (this->timer) { this->timer--; } else { - if ((gPossibleInteraction.currentObject->entity != NULL) && ((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) { + if ((gPossibleInteraction.currentObject->entity != NULL) && + ((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) { this->child = gPossibleInteraction.currentObject->entity; this->interactType = gPossibleInteraction.currentIndex; sub_08083A40(this); @@ -119,8 +120,8 @@ void CameraTarget_Action2(Entity* this) { u32 temp2; const KinstoneWorldEvent* ptr; - if ((this->type != 1) && - (((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) >= 100 || (this->child != gPossibleInteraction.currentObject->entity)))) { + if ((this->type != 1) && (((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) >= 100 || + (this->child != gPossibleInteraction.currentObject->entity)))) { sub_080838DC(this); } else { this->x = this->child->x; diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c index 3327f2c6..916f71d0 100644 --- a/src/object/itemForSale.c +++ b/src/object/itemForSale.c @@ -118,9 +118,9 @@ void ItemForSale_Action2(ItemForSaleEntity* this) { sub_080819B4(this); } else { ptr = sub_080784E4(); - if (((*(int*)(ptr + 8) == 0) || - ((*(u8*)(ptr + 1) != 1 || (gUnk_0200AF00.rActionPlayerState = R_ACTION_SPEAK, (gPlayerState.playerInput.newInput & - (PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0)))) && + if (((*(int*)(ptr + 8) == 0) || ((*(u8*)(ptr + 1) != 1 || (gUnk_0200AF00.rActionPlayerState = R_ACTION_SPEAK, + (gPlayerState.playerInput.newInput & + (PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0)))) && ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_10 | PLAYER_INPUT_8)) != 0)) { sub_080819B4(this); } diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index c4d3d8bf..6cc6c1a6 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -134,7 +134,8 @@ void LockedDoor_Init(Entity* this) { } else { this->action = 8; AddInteractableSmallKeyLock(this); - SetInteractableObjectCollision(this, 0, gLockedDoorInteractDirections[this->field_0x7c.BYTES.byte2], NULL); + SetInteractableObjectCollision(this, 0, gLockedDoorInteractDirections[this->field_0x7c.BYTES.byte2], + NULL); } } else { DeleteThisEntity(); diff --git a/src/playerUtils.c b/src/playerUtils.c index 8147a443..3515748c 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -1090,7 +1090,8 @@ bool32 sub_080782C0(void) { return FALSE; } } - if (((gPlayerState.playerInput.newInput & PLAYER_INPUT_1000) != 0) && ((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) { + if (((gPlayerState.playerInput.newInput & PLAYER_INPUT_1000) != 0) && + ((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) { AddKinstoneToBag(KINSTONE_NONE); if (gSave.kinstoneAmounts[0] != 0) { gPossibleInteraction.kinstoneId = gPossibleInteraction.currentObject->kinstoneId;