Flatten pos fields in struct Sprite
This commit is contained in:
@@ -3632,8 +3632,8 @@ static void ShowHideGridBalls(bool8 hideAll, u8 hideBallId)
|
||||
else
|
||||
{
|
||||
gSprites[sRoulette->spriteIds[i + SPR_GRID_BALLS]].invisible = FALSE;
|
||||
gSprites[sRoulette->spriteIds[i + SPR_GRID_BALLS]].pos1.x = (sGridSelections[sRoulette->hitSquares[i]].x + 1) * 8 + 4;
|
||||
gSprites[sRoulette->spriteIds[i + SPR_GRID_BALLS]].pos1.y = (sGridSelections[sRoulette->hitSquares[i]].y + 1) * 8 + 3;
|
||||
gSprites[sRoulette->spriteIds[i + SPR_GRID_BALLS]].x = (sGridSelections[sRoulette->hitSquares[i]].x + 1) * 8 + 4;
|
||||
gSprites[sRoulette->spriteIds[i + SPR_GRID_BALLS]].y = (sGridSelections[sRoulette->hitSquares[i]].y + 1) * 8 + 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3648,8 +3648,8 @@ static void ShowHideWinSlotCursor(u8 selectionId)
|
||||
else
|
||||
{
|
||||
gSprites[sRoulette->spriteIds[SPR_WIN_SLOT_CURSOR]].invisible = FALSE;
|
||||
gSprites[sRoulette->spriteIds[SPR_WIN_SLOT_CURSOR]].pos1.x = (sGridSelections[selectionId].x + 2) * 8;
|
||||
gSprites[sRoulette->spriteIds[SPR_WIN_SLOT_CURSOR]].pos1.y = (sGridSelections[selectionId].y + 2) * 8;
|
||||
gSprites[sRoulette->spriteIds[SPR_WIN_SLOT_CURSOR]].x = (sGridSelections[selectionId].x + 2) * 8;
|
||||
gSprites[sRoulette->spriteIds[SPR_WIN_SLOT_CURSOR]].y = (sGridSelections[selectionId].y + 2) * 8;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3688,8 +3688,8 @@ static void SpriteCB_WheelIcon(struct Sprite *sprite)
|
||||
angle -= 360;
|
||||
sin = Sin2(angle);
|
||||
cos = Cos2(angle);
|
||||
sprite->pos2.x = sin * sprite->data[1] >> 12;
|
||||
sprite->pos2.y = -cos * sprite->data[1] >> 12;
|
||||
sprite->x2 = sin * sprite->data[1] >> 12;
|
||||
sprite->y2 = -cos * sprite->data[1] >> 12;
|
||||
matrixNum = sprite->oam.matrixNum;
|
||||
sin /= 16;
|
||||
gOamMatrices[matrixNum].d = cos /= 16;
|
||||
@@ -3845,7 +3845,7 @@ static void SetBallCounterNumLeft(u8 numBalls)
|
||||
|
||||
static void SpriteCB_GridSquare(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos2.x = sRoulette->gridX;
|
||||
sprite->x2 = sRoulette->gridX;
|
||||
}
|
||||
|
||||
static void CreateWheelCenterSprite(void)
|
||||
@@ -3995,12 +3995,12 @@ static void UpdateBallPos(struct Sprite *sprite)
|
||||
sprite->sBallDistToCenter = sRoulette->ballDistToCenter;
|
||||
sin = Sin2(sprite->sBallAngle);
|
||||
cos = Cos2(sprite->sBallAngle);
|
||||
sprite->pos2.x = sin * sprite->sBallDistToCenter >> 12;
|
||||
sprite->pos2.y = -cos * sprite->sBallDistToCenter >> 12;
|
||||
sprite->x2 = sin * sprite->sBallDistToCenter >> 12;
|
||||
sprite->y2 = -cos * sprite->sBallDistToCenter >> 12;
|
||||
if (IsSEPlaying())
|
||||
{
|
||||
m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, sprite->pos2.x);
|
||||
m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, sprite->pos2.x);
|
||||
m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, sprite->x2);
|
||||
m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, sprite->x2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4013,9 +4013,9 @@ static void SpriteCB_BallLandInSlot(struct Sprite *sprite)
|
||||
sprite->sBallAngle -= 360;
|
||||
sin = Sin2(sprite->sBallAngle);
|
||||
cos = Cos2(sprite->sBallAngle);
|
||||
sprite->pos2.x = sin * sprite->sBallDistToCenter >> 12;
|
||||
sprite->pos2.y = -cos * sprite->sBallDistToCenter >> 12;
|
||||
sprite->pos2.y += gSpriteCoordOffsetY;
|
||||
sprite->x2 = sin * sprite->sBallDistToCenter >> 12;
|
||||
sprite->y2 = -cos * sprite->sBallDistToCenter >> 12;
|
||||
sprite->y2 += gSpriteCoordOffsetY;
|
||||
}
|
||||
|
||||
static void SpriteCB_UnstickBall_ShroomishBallFall(struct Sprite *sprite)
|
||||
@@ -4098,9 +4098,9 @@ static void SpriteCB_UnstickBall_Shroomish(struct Sprite *sprite)
|
||||
|
||||
static void SpriteCB_UnstickBall_TaillowDrop(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos2.y = (s16)(sprite->data[2] * 0.05f * sprite->data[2]) - 45;
|
||||
sprite->y2 = (s16)(sprite->data[2] * 0.05f * sprite->data[2]) - 45;
|
||||
sprite->data[2]++;
|
||||
if (sprite->data[2] >= DEGREES_PER_SLOT && sprite->pos2.y >= 0)
|
||||
if (sprite->data[2] >= DEGREES_PER_SLOT && sprite->y2 >= 0)
|
||||
{
|
||||
LandBall()
|
||||
sRoulette->ballUnstuck = TRUE;
|
||||
@@ -4111,11 +4111,11 @@ static void SpriteCB_UnstickBall_TaillowPickUp(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[2]++ < 45)
|
||||
{
|
||||
sprite->pos2.y--;
|
||||
sprite->y2--;
|
||||
if (sprite->data[2] == 45)
|
||||
{
|
||||
if (gSprites[sRoulette->spriteIds[SPR_CLEAR_MON]].animCmdIndex == 1)
|
||||
sprite->pos2.y++;
|
||||
sprite->y2++;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4125,9 +4125,9 @@ static void SpriteCB_UnstickBall_TaillowPickUp(struct Sprite *sprite)
|
||||
if (gSprites[sRoulette->spriteIds[SPR_CLEAR_MON]].animDelayCounter == 0)
|
||||
{
|
||||
if (gSprites[sRoulette->spriteIds[SPR_CLEAR_MON]].animCmdIndex == 1)
|
||||
sprite->pos2.y++;
|
||||
sprite->y2++;
|
||||
else
|
||||
sprite->pos2.y--;
|
||||
sprite->y2--;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4516,8 +4516,8 @@ static void SpriteCB_ShroomishExit(struct Sprite *sprite)
|
||||
// Delay for screen shaking, then exit left
|
||||
if (sprite->data[1]++ >= sprite->data[3])
|
||||
{
|
||||
sprite->pos1.x -= 2;
|
||||
if (sprite->pos1.x < -16)
|
||||
sprite->x -= 2;
|
||||
if (sprite->x < -16)
|
||||
{
|
||||
if (!sRoulette->ballUnstuck)
|
||||
sRoulette->ballUnstuck = TRUE;
|
||||
@@ -4563,7 +4563,7 @@ static void SpriteCB_ShroomishFall(struct Sprite *sprite)
|
||||
f32 timer;
|
||||
sprite->data[1]++;
|
||||
timer = sprite->data[1];
|
||||
sprite->pos2.y = timer * 0.039f * timer;
|
||||
sprite->y2 = timer * 0.039f * timer;
|
||||
sRoulette->shroomishShadowAlpha = sShroomishShadowAlphas[(sRoulette->shroomishShadowTimer - 1) / 2];
|
||||
if (sRoulette->shroomishShadowTimer < ARRAY_COUNT(sShroomishShadowAlphas) * 2 - 1)
|
||||
sRoulette->shroomishShadowTimer++;
|
||||
@@ -4636,9 +4636,9 @@ static void SpriteCB_TaillowShadow_Flash(struct Sprite *sprite)
|
||||
|
||||
static void SpriteCB_Taillow_FlyAway(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->pos1.y > -16)
|
||||
if (sprite->y > -16)
|
||||
{
|
||||
sprite->pos1.y--;
|
||||
sprite->y--;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4657,9 +4657,9 @@ static void SpriteCB_Taillow_PickUpBall(struct Sprite *sprite)
|
||||
if (sprite->data[1] >= 0)
|
||||
{
|
||||
sprite->data[1]--;
|
||||
sprite->pos1.y--;
|
||||
sprite->y--;
|
||||
if (sprite->data[1] == 0 && sprite->animCmdIndex == 1)
|
||||
sprite->pos2.y++;
|
||||
sprite->y2++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4669,9 +4669,9 @@ static void SpriteCB_Taillow_PickUpBall(struct Sprite *sprite)
|
||||
if (sprite->animDelayCounter == 0)
|
||||
{
|
||||
if (sprite->animCmdIndex == 1)
|
||||
sprite->pos2.y++;
|
||||
sprite->y2++;
|
||||
else
|
||||
sprite->pos2.y--;
|
||||
sprite->y2--;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4700,10 +4700,10 @@ static void SpriteCB_Taillow_FlyIn(struct Sprite *sprite)
|
||||
|
||||
if (sprite->data[1]-- > 7)
|
||||
{
|
||||
sprite->pos1.x += xMoveOffsets[sRoulette->ball->sStuckOnWheelLeft] * 2;
|
||||
sprite->x += xMoveOffsets[sRoulette->ball->sStuckOnWheelLeft] * 2;
|
||||
if (IsSEPlaying())
|
||||
{
|
||||
s8 pan = -((116 - sprite->pos1.x) / 2);
|
||||
s8 pan = -((116 - sprite->x) / 2);
|
||||
m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan);
|
||||
m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan);
|
||||
}
|
||||
@@ -4712,8 +4712,8 @@ static void SpriteCB_Taillow_FlyIn(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[1] >= 0)
|
||||
{
|
||||
sprite->pos1.x += xMoveOffsets[sRoulette->ball->sStuckOnWheelLeft] * yMoveOffsets[7 - sprite->data[1]][0];
|
||||
sprite->pos1.y += yMoveOffsets[7 - sprite->data[1]][1];
|
||||
sprite->x += xMoveOffsets[sRoulette->ball->sStuckOnWheelLeft] * yMoveOffsets[7 - sprite->data[1]][0];
|
||||
sprite->y += yMoveOffsets[7 - sprite->data[1]][1];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4735,7 +4735,7 @@ static void SpriteCB_TaillowShadow_FlyIn(struct Sprite *sprite)
|
||||
|
||||
if (sprite->data[1]-- >= 0)
|
||||
{
|
||||
sprite->pos1.x += moveDir[sRoulette->ball->sStuckOnWheelLeft] * 2;
|
||||
sprite->x += moveDir[sRoulette->ball->sStuckOnWheelLeft] * 2;
|
||||
gSprites[sprite->sMonShadowSpriteId].invisible ^= 1;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user