From 810ca5f8ff79aeec6ffe8e982f4786aade616b4d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 7 Jul 2021 09:11:52 -0400 Subject: Flatten pos fields in struct Sprite --- src/field_player_avatar.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/field_player_avatar.c') diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 9b1f4ceb6..e5f6007b5 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1933,8 +1933,8 @@ static bool8 Fishing_StartEncounter(struct Task *task) ObjectEventTurn(playerObjEvent, playerObjEvent->movementDirection); if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) SetSurfBlob_PlayerOffset(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, FALSE, 0); - gSprites[gPlayerAvatar.spriteId].pos2.x = 0; - gSprites[gPlayerAvatar.spriteId].pos2.y = 0; + gSprites[gPlayerAvatar.spriteId].x2 = 0; + gSprites[gPlayerAvatar.spriteId].y2 = 0; ClearDialogWindowAndFrame(0, TRUE); task->tFrameCounter++; return FALSE; @@ -1990,8 +1990,8 @@ static bool8 Fishing_PutRodAway(struct Task *task) ObjectEventTurn(playerObjEvent, playerObjEvent->movementDirection); if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) SetSurfBlob_PlayerOffset(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, FALSE, 0); - gSprites[gPlayerAvatar.spriteId].pos2.x = 0; - gSprites[gPlayerAvatar.spriteId].pos2.y = 0; + gSprites[gPlayerAvatar.spriteId].x2 = 0; + gSprites[gPlayerAvatar.spriteId].y2 = 0; task->tStep++; } return FALSE; @@ -2023,8 +2023,8 @@ static void AlignFishingAnimationFrames(void) u8 animType; AnimateSprite(playerSprite); - playerSprite->pos2.x = 0; - playerSprite->pos2.y = 0; + playerSprite->x2 = 0; + playerSprite->y2 = 0; animCmdIndex = playerSprite->animCmdIndex; if (playerSprite->anims[playerSprite->animNum][animCmdIndex].type == -1) { @@ -2039,16 +2039,16 @@ static void AlignFishingAnimationFrames(void) animType = playerSprite->anims[playerSprite->animNum][animCmdIndex].type; if (animType == 1 || animType == 2 || animType == 3) { - playerSprite->pos2.x = 8; + playerSprite->x2 = 8; if (GetPlayerFacingDirection() == 3) - playerSprite->pos2.x = -8; + playerSprite->x2 = -8; } if (animType == 5) - playerSprite->pos2.y = -8; + playerSprite->y2 = -8; if (animType == 10 || animType == 11) - playerSprite->pos2.y = 8; + playerSprite->y2 = 8; if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) - SetSurfBlob_PlayerOffset(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, TRUE, playerSprite->pos2.y); + SetSurfBlob_PlayerOffset(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, TRUE, playerSprite->y2); } void SetSpinStartFacingDir(u8 direction) @@ -2090,8 +2090,8 @@ static void Task_DoPlayerSpinExit(u8 taskId) SetSpinStartFacingDir(object->facingDirection); tSpinDelayTimer = 0; tSpeed = 1; - tCurY = (u16)(sprite->pos1.y + sprite->pos2.y) << 4; - sprite->pos2.y = 0; + tCurY = (u16)(sprite->y + sprite->y2) << 4; + sprite->y2 = 0; CameraObjectReset2(); object->fixedPriority = TRUE; sprite->oam.priority = 0; @@ -2104,10 +2104,10 @@ static void Task_DoPlayerSpinExit(u8 taskId) // Rise and accelerate tCurY -= tSpeed; tSpeed += 3; - sprite->pos1.y = tCurY >> 4; + sprite->y = tCurY >> 4; // Check if offscreen - if (sprite->pos1.y + (s16)gTotalCameraPixelOffsetY < -32) + if (sprite->y + (s16)gTotalCameraPixelOffsetY < -32) tState++; break; case 2: @@ -2156,11 +2156,11 @@ static void Task_DoPlayerSpinEntrance(u8 taskId) ObjectEventForceSetHeldMovement(object, GetFaceDirectionMovementAction(sSpinDirections[tStartDir])); tSpinDelayTimer = 0; tSpeed = 116; - tDestY = sprite->pos1.y; + tDestY = sprite->y; tPriority = sprite->oam.priority; tSubpriority = sprite->subpriority; - tCurY = -((u16)sprite->pos2.y + 32) * 16; - sprite->pos2.y = 0; + tCurY = -((u16)sprite->y2 + 32) * 16; + sprite->y2 = 0; CameraObjectReset2(); object->fixedPriority = TRUE; sprite->oam.priority = 1; @@ -2175,12 +2175,12 @@ static void Task_DoPlayerSpinEntrance(u8 taskId) tSpeed -= 3; if (tSpeed < 4) tSpeed = 4; - sprite->pos1.y = tCurY >> 4; + sprite->y = tCurY >> 4; // Check if reached dest - if (sprite->pos1.y >= tDestY) + if (sprite->y >= tDestY) { - sprite->pos1.y = tDestY; + sprite->y = tDestY; tGroundTimer = 0; tState++; } -- cgit v1.2.3 From 554210c5e315e786ddc6eef888e9ff6065ad73f8 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 24 Aug 2021 19:59:32 -0300 Subject: Removed trailing spaces in the most relevant files Command used for the job: egrep -rl ' $' --include *.c --include *.h --include *.s --include *.inc --include *.txt * | xargs sed -i 's/\s\+$//g' Credits to Grant Murphy from Stack Overflow. --- src/field_player_avatar.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/field_player_avatar.c') diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index e5f6007b5..617dd8ea3 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1687,7 +1687,7 @@ static bool8 (*const sFishingStateFuncs[])(struct Task *) = { Fishing_Init, Fishing_GetRodOut, - Fishing_WaitBeforeDots, + Fishing_WaitBeforeDots, Fishing_InitDots, // FISHING_START_ROUND Fishing_ShowDots, Fishing_CheckForBite, @@ -1729,13 +1729,13 @@ static bool8 Fishing_GetRodOut(struct Task *task) { struct ObjectEvent *playerObjEvent; const s16 minRounds1[] = { - [OLD_ROD] = 1, - [GOOD_ROD] = 1, + [OLD_ROD] = 1, + [GOOD_ROD] = 1, [SUPER_ROD] = 1 }; const s16 minRounds2[] = { - [OLD_ROD] = 1, - [GOOD_ROD] = 3, + [OLD_ROD] = 1, + [GOOD_ROD] = 3, [SUPER_ROD] = 6 }; @@ -1865,8 +1865,8 @@ static bool8 Fishing_GotBite(struct Task *task) static bool8 Fishing_WaitForA(struct Task *task) { const s16 reelTimeouts[3] = { - [OLD_ROD] = 36, - [GOOD_ROD] = 33, + [OLD_ROD] = 36, + [GOOD_ROD] = 33, [SUPER_ROD] = 30 }; @@ -2100,7 +2100,7 @@ static void Task_DoPlayerSpinExit(u8 taskId) tState++; case 1: // Spin while rising TrySpinPlayerForWarp(object, &tSpinDelayTimer); - + // Rise and accelerate tCurY -= tSpeed; tSpeed += 3; -- cgit v1.2.3