diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2021-07-07 09:11:52 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2021-07-07 09:11:52 -0400 |
commit | 810ca5f8ff79aeec6ffe8e982f4786aade616b4d (patch) | |
tree | 7732fc02ff8ced046cedcbd9643122aba7c7706a /src/field_player_avatar.c | |
parent | 3964820a84e4819bb807d601d2c3c7b196f764e8 (diff) |
Flatten pos fields in struct Sprite
Diffstat (limited to 'src/field_player_avatar.c')
-rw-r--r-- | src/field_player_avatar.c | 42 |
1 files changed, 21 insertions, 21 deletions
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++; } |