diff options
author | aaaaaa123456789 <aaaaaa123456789@acidch.at> | 2020-09-13 04:22:50 -0300 |
---|---|---|
committer | aaaaaa123456789 <aaaaaa123456789@acidch.at> | 2020-09-13 06:30:55 -0300 |
commit | 7dc95a0103af08c95c9093b6efa6c77af77a2538 (patch) | |
tree | 663537916626ab264bbdef4ea3606415457c36a3 /src/decoration.c | |
parent | 58a2b62bae1406d2c768698ed13efcd6a5ffbeec (diff) |
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
Diffstat (limited to 'src/decoration.c')
-rw-r--r-- | src/decoration.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/decoration.c b/src/decoration.c index 22ae327f9..40cccbe5e 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1147,7 +1147,7 @@ static void DontTossDecoration(u8 taskId) static void ReturnToDecorationItemsAfterInvalidSelection(u8 taskId) { - if (JOY_NEW(A_BUTTON | B_BUTTON)) + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { ClearDialogWindowAndFrame(0, 0); AddDecorationWindow(WINDOW_DECORATION_CATEGORIES); @@ -1803,7 +1803,7 @@ static bool8 ApplyCursorMovement_IsInvalid(u8 taskId) static bool8 IsHoldingDirection(void) { - u16 heldKeys = JOY_HELD(DPAD_ANY); + u16 heldKeys = gMain.heldKeys & DPAD_ANY; if (heldKeys != DPAD_UP && heldKeys != DPAD_DOWN && heldKeys != DPAD_LEFT && heldKeys != DPAD_RIGHT) return FALSE; @@ -1827,14 +1827,13 @@ static void Task_SelectLocation(u8 taskId) sPlacePutAwayYesNoFunctions[tDecorationItemsMenuCommand].yesFunc(taskId); return; } - - if (tButton == B_BUTTON) + else if (tButton == B_BUTTON) { sPlacePutAwayYesNoFunctions[tDecorationItemsMenuCommand].noFunc(taskId); return; } - if ((JOY_HELD(DPAD_ANY)) == DPAD_UP) + if ((gMain.heldKeys & DPAD_ANY) == DPAD_UP) { sDecorationLastDirectionMoved = DIR_SOUTH; gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 0; @@ -1842,7 +1841,7 @@ static void Task_SelectLocation(u8 taskId) tCursorY--; } - if ((JOY_HELD(DPAD_ANY)) == DPAD_DOWN) + if ((gMain.heldKeys & DPAD_ANY) == DPAD_DOWN) { sDecorationLastDirectionMoved = DIR_NORTH; gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 0; @@ -1850,7 +1849,7 @@ static void Task_SelectLocation(u8 taskId) tCursorY++; } - if ((JOY_HELD(DPAD_ANY)) == DPAD_LEFT) + if ((gMain.heldKeys & DPAD_ANY) == DPAD_LEFT) { sDecorationLastDirectionMoved = DIR_WEST; gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = -2; @@ -1858,7 +1857,7 @@ static void Task_SelectLocation(u8 taskId) tCursorX--; } - if ((JOY_HELD(DPAD_ANY)) == DPAD_RIGHT) + if ((gMain.heldKeys & DPAD_ANY) == DPAD_RIGHT) { sDecorationLastDirectionMoved = DIR_EAST; gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 2; @@ -1878,10 +1877,10 @@ static void Task_SelectLocation(u8 taskId) if (!tButton) { - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) tButton = A_BUTTON; - if (JOY_NEW(B_BUTTON)) + if (gMain.newKeys & B_BUTTON) tButton = B_BUTTON; } } @@ -1896,7 +1895,7 @@ static void ContinueDecorating(u8 taskId) static void CantPlaceDecorationPrompt(u8 taskId) { - if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON)) + if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON) ContinueDecorating(taskId); } @@ -1929,7 +1928,7 @@ static void CopyTile(u8 *dest, u16 tile) case BG_TILE_H_FLIP(0) >> 10: for (i = 0; i < 8; i++) { - dest[4 * i + 0] = (buffer[4 * (i + 1) - 1] >> 4) + ((buffer[4 * (i + 1) - 1] & 0x0F) << 4); + dest[4 * i] = (buffer[4 * (i + 1) - 1] >> 4) + ((buffer[4 * (i + 1) - 1] & 0x0F) << 4); dest[4 * i + 1] = (buffer[4 * (i + 1) - 2] >> 4) + ((buffer[4 * (i + 1) - 2] & 0x0F) << 4); dest[4 * i + 2] = (buffer[4 * (i + 1) - 3] >> 4) + ((buffer[4 * (i + 1) - 3] & 0x0F) << 4); dest[4 * i + 3] = (buffer[4 * (i + 1) - 4] >> 4) + ((buffer[4 * (i + 1) - 4] & 0x0F) << 4); @@ -1938,7 +1937,7 @@ static void CopyTile(u8 *dest, u16 tile) case BG_TILE_V_FLIP(0) >> 10: for (i = 0; i < 8; i++) { - dest[4 * i + 0] = buffer[4 * (7 - i) + 0]; + dest[4 * i] = buffer[4 * (7 - i)]; dest[4 * i + 1] = buffer[4 * (7 - i) + 1]; dest[4 * i + 2] = buffer[4 * (7 - i) + 2]; dest[4 * i + 3] = buffer[4 * (7 - i) + 3]; @@ -2387,7 +2386,7 @@ static void AttemptPutAwayDecoration_(u8 taskId) static void ContinuePuttingAwayDecorationsPrompt(u8 taskId) { - if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON)) + if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON) ContinuePuttingAwayDecorations(taskId); } |